import datetime
import os
import astropy.coordinates as coord
import astropy.table as at
import astropy.units as u
import matplotlib as mpl
import matplotlib.pyplot as plt
plt.style.use('nbs.mplstyle')
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
os.makedirs('../plots/', exist_ok=True)
astropy_df = pd.read_csv('../cache/astropy-citations.csv',
index_col='pubdate', parse_dates=True)
N = len(astropy_df['authors'].str.split(';').explode().unique())
print(f"Total number of unique authors that cite Astropy: {N}")
Total number of unique authors that cite Astropy: 40009
unq_journals, counts = np.unique(astropy_df.pub.values.astype(str),
return_counts=True)
print(f"Number of journals that cite astropy: {len(unq_journals)}")
Number of journals that cite astropy: 110
astropy_df['pub'].astype(str).value_counts()[:20]
The Astrophysical Journal 2763 Monthly Notices of the Royal Astronomical Society 2039 Astronomy and Astrophysics 1099 The Astronomical Journal 713 The Astrophysical Journal Supplement Series 274 Publications of the Astronomical Society of the Pacific 89 Physical Review D 67 Publications of the Astronomical Society of Australia 55 The Journal of Open Source Software 54 Astronomy and Computing 53 The Planetary Science Journal 45 Publications of the Astronomical Society of Japan 35 Journal of Cosmology and Astroparticle Physics 34 Nature Astronomy 22 Journal of Astronomical Telescopes, Instruments, and Systems 21 Icarus 19 Research in Astronomy and Astrophysics 16 Frontiers in Astronomy and Space Sciences 16 Physical Review Letters 15 Nature 15 Name: pub, dtype: int64
astropy_df['authors'].str.split(';').apply(lambda x: x[0]).value_counts()[:10]
Morris, Brett M. 16 Price-Whelan, Adrian M. 14 MacLeod, Morgan 14 Ginsburg, Adam 12 Jayasinghe, T. 10 Sahlmann, J. 9 Simpson, Jeffrey D. 9 López-Sanjuan, C. 9 Lopez-Rodriguez, Enrique 9 Chiti, Anirudh 9 Name: authors, dtype: int64
astropy_df['authors'].str.split(';').explode().value_counts()[:20]
Latham, David W. 88 Winn, Joshua N. 79 Jenkins, Jon M. 75 Stassun, Keivan G. 68 James, D. J. 64 Collins, Karen A. 63 Smith, M. 61 Carretero, J. 60 Miquel, R. 58 Brooks, D. 57 Rosolowsky, Erik 56 Wilner, David J. 56 Kuehn, K. 56 Sanchez, E. 55 Gruendl, R. A. 55 Suchyta, E. 55 Tarle, G. 55 Röttgering, H. J. A. 54 García-Bellido, J. 54 Mann, Andrew W. 54 Name: authors, dtype: int64
g = astropy_df.groupby(by=[astropy_df.index.year, astropy_df.index.month]).count()
group_dates = [datetime.date(x[0], x[1], 1) for x in g.index]
group_dates_dec = [x[0] + x[1]/12 for x in g.index]
for add_lines in [True, False]:
fig, ax = plt.subplots(figsize=(8, 6), constrained_layout=True)
ax.plot(group_dates, g['pubdate.1'].values,
marker='', drawstyle='steps-mid',
lw=2, color='tab:orange')
ax.set_xlim(datetime.date(2013, 8, 1),
datetime.datetime.now())
ax.set_xlabel('time')
ax.set_ylabel('Astropy papers\nrefereed citations per month')
if add_lines:
ylim = ax.get_ylim()
yptp = ylim[1] - ylim[0]
ax.axvline(datetime.date(2013, 10, 1),
zorder=-1, linestyle='--')
ax.axvline(datetime.date(2018, 9, 1),
zorder=-1, linestyle='--')
ax.text(datetime.date(2018, 10-2, 1),
ylim[1] - 0.05 * yptp,
'Astropy paper 2',
ha='right', va='top', fontsize=16)
ax.text(datetime.date(2013, 10+1, 1),
ylim[1] - 0.05 * yptp,
'Astropy paper 1',
ha='left', va='top', fontsize=16)
extra = '-lines' if add_lines else ''
fig.text(1, 0, 'Source: NASA/ADS', fontsize=16, ha='right')
fig.savefig(f'../plots/astropy-citations{extra}.png', dpi=300)
all_pubs = np.unique(astropy_df['pub'].values.astype(str))
g = astropy_df.groupby(by=[astropy_df.index.year,
astropy_df.pub]).count()
group_dates = np.array([datetime.date(x[0], 1, 1) for x in g.index])
group_dates_dec = [x[0] for x in g.index]
pubs = [str(x[1]) for x in g.index]
# fig, ax = plt.subplots(figsize=(8, 6), constrained_layout=True)
# ax.plot(group_dates, g['pubdate.1'].values,
# marker='', drawstyle='steps-mid',
# lw=2, color='tab:orange')
# ax.set_xlim(datetime.date(2013, 8, 1),
# datetime.datetime.now())
# ax.set_xlabel('time')
# ax.set_ylabel('Astropy papers\nrefereed citations per month')
# fig.text(1, 0, 'Source: NASA/ADS', fontsize=16, ha='right')
# # fig.savefig(f'../plots/astropy-citations{extra}.png', dpi=300)
fig, ax = plt.subplots(figsize=(8, 6), constrained_layout=True)
for pub in all_pubs:
mask = pubs == np.array(pub)
gg = g[mask]
dates = group_dates[mask]
if gg['year'].values.sum() < 50:
continue
ax.plot(dates, gg['year'].values,
marker='', #drawstyle='steps-mid',
lw=2, label=pub)
ax.set_xlim(datetime.date(2013, 8, 1),
datetime.datetime.now())
ax.set_xlabel('time')
ax.set_ylabel('Astropy papers\nrefereed citations per year')
ax.set_yscale('log')
ax.legend()
fig.text(1, 0, 'Source: NASA/ADS', fontsize=16, ha='right')
fig.savefig(f'../plots/astropy-citations-per-journal.png', dpi=300)
fig, ax = plt.subplots(figsize=(8, 6), constrained_layout=True)
for pub in all_pubs:
mask = pubs == np.array(pub)
gg = g[mask]
dates = group_dates[mask]
if gg['year'].values.sum() >= 50 or gg['year'].values.sum() < 10:
continue
ax.plot(dates, gg['year'].values,
marker='', #drawstyle='steps-mid',
lw=2, label=pub)
ax.set_xlim(datetime.date(2013, 8, 1),
datetime.datetime.now())
ax.set_xlabel('time')
ax.set_ylabel('Astropy papers\nrefereed citations per year')
ax.set_yscale('log')
ax.legend()
fig.text(1, 0, 'Source: NASA/ADS', fontsize=16, ha='right')
fig.savefig(f'../plots/astropy-citations-per-journal-few.png', dpi=300)
Journals without many citations to Astropy:
for pub in all_pubs:
mask = pubs == np.array(pub)
gg = g[mask]
dates = group_dates[mask]
if gg['year'].values.sum() >= 10:
continue
print(pub)
ACS Earth and Space Chemistry AGU Advances Acta Astronautica Acta Astronomica Acta Materialia Advances in Radio Science Advances in Space Research Aerospace Annual Review of Astronomy and Astrophysics Applied Optics Astronomical School's Report Astronomical and Astrophysical Transactions Astronomy Letters Astronomy Reports Astroparticle Physics Astrophysical Bulletin Astrophysics and Space Science Atmosphere Atmospheric Measurement Techniques Atoms Boletin de la Asociacion Argentina de Astronomia La Plata Argentina Bulgarian Astronomical Journal Chinese Physics B Classical and Quantum Gravity Communications Earth and Environment Computational Science and Discovery Computers and Geosciences Earth Moon and Planets Earth and Planetary Science Letters Earth and Space Science Earth's Future European Physical Journal C Experimental Astronomy Experiments in Fluids Frontiers in Physics Galaxies Geoscientific Model Development International Journal of Astrobiology International Journal of Remote Sensing Inverse Problems Journal of Astronomical Instrumentation Journal of Astrophysics and Astronomy Journal of Geodesy Journal of Geophysical Research (Atmospheres) Journal of Geophysical Research (Biogeosciences) Journal of Geophysical Research (Planets) Journal of Geophysical Research (Space Physics) Journal of High Energy Astrophysics Journal of Instrumentation Journal of Korean Astronomical Society Journal of Korean Physical Society Journal of Physical Chemistry A Journal of Physics G Nuclear Physics Journal of Quantitative Spectroscopy and Radiative Transfer Journal of Space Weather and Space Climate Journal of the American Association of Variable Star Observers (JAAVSO) Journal of the Astronautical Sciences Journal of the Optical Society of America B Optical Physics Machine Learning: Science and Technology Meteoritics and Planetary Science Microscopy and Microanalysis Monthly Weather Review Nature Communications New Astronomy New Astronomy Reviews Optics Express Physical Review X Physics of the Dark Universe Planetary and Space Science RAS Techniques and Instruments Radio Science Remote Sensing Remote Sensing of Environment Review of Scientific Instruments Revista Mexicana de Astronomia y Astrofisica Science Science Advances Science China Physics, Mechanics, and Astronomy Scientia Sinica Physica, Mechanica & Astronomica Sensors Serbian Astronomical Journal SoftwareX Space Science Reviews Space Weather The Open Journal of Astrophysics The Physics Teacher Universe