betaFeedback

WorksPhysics and Astronomy

Are arXiv submissions on Wednesday better cited? Introducing Big Data methods in undergraduate courses on scientific computing

Abstract

Extracting information from big data sets, both real and simulated, is a modern hallmark of the physical sciences. In practice, students face barriers to learning ``Big Data'' methods in undergraduate physics and astronomy curricula. As an attempt to alleviate some of these challenges, we present a simple, farm-to-table data analysis pipeline that can collect, process, and plot data from the 800k entries common to the arXiv preprint repository and the bibliographical database inSpireHEP. The pipeline employs contemporary research practices and can be implemented using open-sourced Python libraries common to undergraduate courses on Scientific Computing. To support the use such pipelines in classroom contexts, we make public an example implementation, authored by two undergraduate physics students, that runs on off-the-shelf laptops. For advanced students, we discuss applications of the pipeline, including for online DAQ monitoring and commercialization.

Introduction

Plotting data and establishing (or falsifying) correlations with statistical confidence are among the most basic skills of a physical scientist. So core to physics & astronomy, the topics are introduced as early as high school, often in labs aimed at extracting the gravitational constant on Earth’s surface. In practice, many students carry out these first analyses with spreadsheet software (e.g., Excel), non-graphing calculators, or just pen and paper.

While the core principles are the same, contemporary analyses in physics & astronomy research are obviously much more sophisticated. For many disciplines, such as astrophysics, nuclear physics and particle physics, analyses of real data and simulated data fall into the realm of “Big Data.” Datasets are too big and/or too complex to be assessed with multipurpose tools like Excel.

For example: Despite historically being a standard tool in industries that employ former STEM students (e.g., finance), Excel is limited to 220∼O(106)2^{20} \sim O(10^{6}) data entries (rows) and 214∼O(104)2^{14} \sim O(10^{4}) data attributes (columns). In comparison, experiments at CERN’s Large Hadron Collider detect more than 101610^{16} proton collisions, or about 101010^{10} Excel spreadsheets, per year [1, 2]. Similarly, Data Release 1 of the Dark Energy Spectroscopic Instrument contains 18.7 million objects, or about 18 spreadsheets [3]. Even a voter registry for a large city can exceed 10610^{6} entries. In other words, the skills and tools needed for data-heavy sectors inside and outside academia now exceed those taught in introductory laboratories.

Efficiently analyzing big data sets in a timely manner requires training, typically at the PhD level, in fast compiled languages, like C++C++, and high-level scripting languages, like Python. It requires constructing and interfacing analysis pipelines. It requires managing memory in loops over entries. It requires knowledge of software libraries (e.g., matplotlib, scipy, pandas) in addition to physics and statistics. So on and so forth. However, to carry out undergraduate research projects and to be competitive for graduate programs, prospective physicists and astronomers are increasingly expected to already have such skills at the bachelor’s level [4, 5, 6].

Certainly, where available, Big Data practices are being introduced in undergraduate courses on scientific computing and undergraduate research opportunities. In practice though, students face barriers to learning these skills [7]. Practical challenges include: a lack of example scripts that are scalable to large datasets and comprehensible to students outside of computer science; limited access to computing resources (e.g., many-processor computing clusters); and limited access to large datasets themselves. Simply put, the jump from using Excel in first-year laboratories to using research-level analysis frameworks, like Astropy [8] or ROOT/pyROOT [9, 10], in third- and fourth-year studies is difficult.

To help bridge the growing gap [7] between the computational skills that undergraduate students are explicitly taught and those they are expected to just know1, we explored whether a light-weight, analysis framework could be developed that is also suitable for undergraduate physics & astronomy courses. Furthermore, we explored whether this was possible without requiring specialized or advanced physics knowledge. The outcome was positive.

As part of a four-week summer research program2, two mid-level undergraduate physics students successfully built a “farm-to-table” analysis pipeline employing methods from Big Data. As illustrated in Figure 1, the pipeline collects/harvests, processes, and plots bibliometric data for entries common to the arXiv preprint repository and the inSPIREHEP bibliographical database, which are both publicly accessible. (The pipeline itself mirrors those used in high energy physics and other fields.)

Farm-to-table data analysis pipeline

Figure 1. Illustration of a “farm-to-table” data analysis pipeline, including pipeline initialization (Phase 0), data queries to the arXiv (Phase 1), data queries to inSPIREHEP (Phase 2), processing/filtering data (Phase 3), plotting/analyzing data (Phase 4), exporting output (Phase 5).

The key to the pipeline’s design, and therefore usefulness in overcoming practical challenges, is the use of Application Program Interfaces3 (APIs). APIs are prevalent in data- and web-based industries, especially social media (e.g., “click to share” buttons). They also have critical uses in experiments, such as real-time online data acquisition monitoring and telescope alert systems.

Starting from the APIs for the arXiv and inSPIREHEP, the students implemented the pipeline into a set of Python scripts using popular, open-sourced libraries (numpy, matplotlib, etc.). The precise choice of these databases is somewhat arbitrary and due to familiarity, but is nevertheless illustrative, as discussed in Sec. II. Remarkably, each phase of the pipeline required only O(100)O(100) lines of code and ran on personal, off-the-shelf laptops.

Due to the granularity of the data and the largeness of the databases, students were able to explore rather creative correlations with statistical confidence. For example: using around 330k manuscripts from particle and nuclear physics over a 34-year period, students found no correlation between citation count and arXiv submission date, contrary to popular lore. To support the use of the pipeline in coursework, an example implementation by the students is freely available at the repository

https://gitlab.cern.ch/riruiz/public-projects/-/tree/master/BibAPI

Throughout the text, we refer to this template as BibAPI. In Sec. II we give an overview of our “farm-to-table” analysis pipeline. In Sec. III, we discuss its implementation by the undergraduates into BibAPI. Example findings are presented in Sec. IV, while pipeline extensions and applications are discussed in § 1.4. We conclude in Sec. VI. Our computational setup and some supplemental results are given in the appendices.

Overview of analysis pipelines

In physics & astronomy research, the general objective of data-analysis pipelines is to carry out the following operations: (i) access data from one or more databases, (ii)

organize and tabulate a subset of the bulk data, (iii) analyze the subset(s), and (iv) plot and record the results. Data may be real or simulated, signal-like or background-like. Subsets are built by filtering according to data attributes. Analyzing and plotting may occur iteratively.

When introducing such pipelines into undergraduate physics & astronomy courses, we propose relaxing the expectation that students analyze data from real experiments or simulations. Even if large data sets are available, students may not have sufficient training to comprehend their complexity, particularly first- and second-year students. An adverse consequence is that some students obtain erroneous or no results because they have not yet taken upper-level courses, e.g., special or general relativity. Learning challenges are compounded if pipelines are simultaneously being used to introduce error analysis.

In lieu of a physics data set, we advocate using public socioeconomic and bibliometric data. While broad interpretation of such data requires care, individual data attributes (columns) can be straightforward to comprehend. In addition to demonstrating how physics skills are applicable outside the field, it retains an interest factor as such public data4 steers public policy and discourse.

As a proof-of-principle, we focus on analyzing bibliometric data of manuscripts in particle and nuclear physics submitted to the arXiv from 1991 to March 2025. This constitutes about 330k entries out of the arXiv’s 2.8M+ entries across all disciplines. For each manuscript, its bibliometric record was extracted from inSPIREHEP.

The workflow of our “farm-to-table” pipeline is illustrated in Figure 1. We start by querying the arXiv through its API (Phase 1). The query returns a list of manuscripts matching our search criteria (i.e., specific subject categories over a particular date range). Each manuscript entry contains identifying data and submission metadata. For each entry in the list, a query is made to InSPIREHEP via its own API [12] (Phase 2). Each secondary query returns bibliometric data, such as authorship, citation count, etc. Data are then filtered and composite quantities (averages and ratios) are calculated (Phase 3). Finally, results are plotted (Phase 4) and possibly exported to online platforms (Phase 5).

Pipeline Implementation

We now describe in fuller detail the pipeline of Figure 1 as implemented into BibAPI. For exporting results to online platforms via APIs (Phase 5), see § 1.4 A.

We note that the students’ bibAPI.py template has been modularized by the senior authors to allow each Phase to run independently. By embedding each Phase into a function (an example of “functional programming”) students and instructors can study, modify, and extend individual sequences without repeating calls to online databases. Information is shared between Phases by passing an instance of the APIQueryInputs() class, which retains “state” information (an example of “object oriented programming”). While modularization can improve readability (about 100-250 lines per phase) and facilitate lesson planning, it also leads to “code bloat.” In total, the script is about 1000 lines, including comments, checks and error handling, and Phase 5.

Students’ Experiences and Backgrounds

The students started work on the pipeline in Summer 2024 as part of a 4-week Research Experience for Undergraduate program (see footnote 2). Guided by a postdoctoral researcher, they developed the pipeline at a pace of roughly one phase per week. As a cross check, each student implemented their own version of the pipeline.

At the conclusion of the program, students successfully present preliminary versions of results shown in Sec. IV. Due breaks and term-time obligations, work was paused until Spring 2025. The students’ works were then merged and patched for bugs by Student 2 and Faculty 1.

Prior to Summer 2024 Student 1 had just completed their second year in a physics bachelor program. Student 1 briefly majored in computer science in their first year of studies. At the start of the project Student 2 had similarly just completed their second year in another physics bachelor program. Student 2 was introduced to plotting with Python in a course on basics of programming languages used in modern physics but had not been introduced to more advanced applications of Python.

Postdoc 1 already had prior experience with Python and other programing languages, obtained during their PhD work and first postdoctoral appointment. The usage of APIs was however completely new and had to be learned. Faculty 1 is a theoretical and computational high energy physicist and develops simulation software.

Implementation into BibAPI

Phase 0 (Initialization) occurs when the script is run from the terminal or command prompt. During this phase arXiv query parameters are set either to their default values (apiInputs = APIQueryInputs()), or those specified in the terminal (e.g., apiInputs.cats = sys.argv[3]). Allowed inputs are the start/end dates of the arXiv query (YYYY-MM-DD format) and subject categories (hep-th, nucl-ex, etc.). Paths for files written to disk are also set here. (These must be modified manually in __main__). In the __main__ sequence, Phase tasks are carried out by the functions doPhaseN(...), whose inputs are an instance of APIQueryInputs.

Phase 1 (ArXiv Query) fetches data from the URL export.arxiv.org/api. This is the arXiv’s subdomain that hosts its API and functions as a portal to its database. A list of manuscripts and submission records can be obtained by appending the URL by query parameters in a prescribed format (/query?search_query=...). A query returns an xml packet in the atom format.

Inputs passed to doPhase1(...) are used to build a set of “micro queries,” where the specific date range of the full query is divided into three-month windows (generate_date_ranges(...)). Each “micro URL” is then opened (urllib.request.urlopen(...)). Returned xml packets are parsed and saved to a text file (APIQueryInputs.idPath[0]) with tab-separated values. To prevent denial-of-service attacks, a short break (time.sleep(2)) after multiple queries.

Phase 2 (InSpireHEP Query) fetches data from the URL inspirehep.net/api. This is InSPIREHEP’s subdomain hosting its own API. Appending this base URL by /arxiv/ and a manuscript’s arXiv identifier5 will return the manuscript’s bibliometric record in json format.

The function doPhase2(...) starts by loading the list of manuscript identifiers (APIQueryInputs.idPath[0]) generated by doPhase1(...). For each manuscript in the list, a query URL is constructed, called, and read (json.loads(urllib.request.urlopen(...).read())). Records are parsed and saved to a text file with tab-separated values (APIQueryInputs.dataPath[0]). As in Phase 1, the code pauses after multiple queries.

Sometimes information is not known by InSPIREHEP (e.g., publication details of an unpublished paper). In these instances, “Not-Given” is recorded as blank spaces can result in data misattribution. Some arXiv papers, e.g., those withdrawn, do not have an InSPIREHEP record. For such manuscripts, identifiers are recorded to an alternative file (APIQueryInputs.lostData[0]).

Phase 3 (Reprocessing Data) serves as a bridge between fetching data from online databases and creating plots. In doPhase3(...), the file containing bibliometric records (APIQueryInputs.dataPath[0]) is loaded (pd.read csv(...)) and data are re-record in new files (APIQueryInputs.plotData[N]), each retaining only the data necessary for specific plots.

Phase 4 (Plotting) is the final phase of the script’s default configuration. In doPhase4(...), the data files prepared in Phase 3 (APIQueryInputs.plotData[N]) are loaded (pd.read csv(...)) and plotted as histograms. Composite quantities (ratios and averages) are also computed and plotted. Axes and labels are populated using input information (Phase 0). Finally, plots are saved as png files (APIQueryInputs.imgPaths[N]).

Pipeline Output

We now show some results of the students’ analysis. Their investigation covers manuscripts submitted to the arXiv over the period 1991 Jan. 01 – 2025 Mar. 31 (34 years) for six subject categories: four in high energy physics and two in nuclear. A manuscript’s “primary” category must be one of these six. Query inputs are summarized in Table I and generated a raw dataset of NarXiv=329,035N_{\mathrm{arXiv}} = 329{,}035 manuscripts. Of these, Ntot=328,936N_{\mathrm{tot}} = 328{,}936 records were collected from INSPIREHEP. The “missing” ΔN=99\Delta N = 99 records largely correspond to entries withdrawn6 from the arXiv and are not considered further. In App. § 1.3.3, results for a one-year run (2022 Jan. 01–Dec. 31, with Ntot=12,099N_{\mathrm{tot}} = 12{,}099 and ΔN=2\Delta N = 2) are available.

Date Range: 1991 Jan. 01 – 2025 Mar. 31
HEP categories: experiment (hep-ex), theory (hep-th), phenomenology (hep-ph), lattice (hep-lat)
Nucl categories: experiment (nucl-ex), theory (nucl-th)

Table I. Parameters for arXiv query in Sec. IV.

Regarding computing resources, collecting, processing, and plotting 34 years worth of papers required about 3 days of runtime. While Phase 1 took approximately half a day, the bottleneck is Phase 2. Roughly, our call rate to INSPIREHEP is about rcall≈2r_{\mathrm{call}} \approx2 calls (1 call) per second when connected to the internet by cable (Wi-Fi). This translates to ΔtPhase 2≈Ntot/rcall∼45\Delta t_{\mathrm{Phase\ 2}} \approx N_{\mathrm{tot}}/r_{\mathrm{call}} \sim45 (90) hours. We note that a poor internet connection can reduce the number of found in Phase 1. Phases 3-4 took seconds.

By the end of Phase 1, about 240 MB of memory was needed. Phase 4 is the biggest memory consumer, requiring about 465 MB to generate histograms. (Due to the modular structure of the program, memory allocated for earlier phases is reused for later phases.) Output files, including png files, required about 10 MB of storage.

Submissions vs Day of Week

We start with Figure 2(a), where we show as a baseline the total number of articles (NsubN_{\mathrm{sub}}) submitted on each day of the week (DD), as defined by New York local time. For each day, including weekends, O(104)O(10^{4}) manuscripts were submitted to the arXiv. This translates to an analyzing power (assuming counting statistics) of about

Number of articles submitted by day of week and average citations per article by submission day

Figure 2. (a) The total number of articles submitted to the arXiv as a function of day. (b) Upper: the average number of citations per article CDC_D as a function of day. Lower: Same as upper but normalized to the seven-day average ⟨C7⟩\langle C_7\rangle.

δN=1/N∼0.4%−0.8%\delta N = 1/\sqrt{N} \sim0.4\% - 0.8\%. Interestingly, while timezones can account for many Sunday submissions (Asia and Europe are ahead of New York), the volume of Saturday submissions suggests many weekend submissions. Summing over the week recovers the full dataset:

∑D∈{days of the week}Nsub(D)=Ntot=328,936.(1)\sum_{D \in\{\text{days of the week}\}} N_{\mathrm{sub}}(D) = N_{\mathrm{tot}} = 328{,}936 . \tag*{(1)}

In Figure 2(b) the upper panel shows the average number of citations per article (CC) as a function of submission day. The average CC is defined as the sum of all citations (cic_i) over all articles (ii) submitted on a given day of the week divided by the total number of submitted manuscripts on the same day. Symbolically, this ratio is given by

C(D)=∑i∈{articles}ci(D)Nsub(D).(2)C(D)=\frac{\sum_{i\in\{\mathrm{articles}\}}c_i(D)}{N_{\mathrm{sub}}(D)}. \tag*{(2)}

At this level of granularity the average CC appears uniform over the workday submissions but drops for weekend submissions. We find the means and standard deviations for M-F (⟨C5⟩\langle C_5\rangle, σ5\sigma_5) and the full week (⟨C7⟩\langle C_7\rangle, σ7\sigma_7) are:

⟨C5⟩=∑D=MFC(D)/5≈40.4,(3)\langle C_5\rangle=\sum_{D=\mathrm{M}}^{\mathrm{F}}C(D)/5\approx40.4, \tag*{(3)}
σ5⟨C5⟩=1⟨C5⟩15∑D=M−F(C(D)−⟨C5⟩)2≈1%,(4)\frac{\sigma_5}{\langle C_5\rangle}=\frac{1}{\langle C_5\rangle}\sqrt{\frac{1}{5}\sum_{D=\mathrm{M-F}}\left(C(D)-\langle C_5\rangle\right)^2}\approx1\%, \tag*{(4)}
⟨C7⟩≈38.5,σ7⟨C7⟩≈8%.(5)\langle C_7\rangle\approx38.5,\qquad\frac{\sigma_7}{\langle C_7\rangle}\approx8\%. \tag*{(5)}

In words, the average arXiv submission in HEP and nuclear physics has about 38.5±8%38.5\pm8\% citations regardless of the day it is submitted to the database, but about 40.4±1%40.4\pm1\% citations if submitted during the weekday. We further illustrate the (non)uniformity of citation averages in the lower panel of Figure 2(b), which shows the upper panel normalized by the 7-day mean, i.e., the ratio C(D)/⟨C7⟩C(D)/\langle C_7\rangle.

Figure 2(b) reveals an interesting finding. When a manuscript is submitted to the arXiv, its appearance is delayed by moderators who screen for plagiarism, etc. Wednesday submissions, for example, usually appear Friday. Since there are no arXiv updates over the weekend, there is a myth in the HEP theory community that articles submitted on Wednesdays are better cited because they have more exposure over the weekend. Our analysis does not support this claim: Wednesday submissions (Friday appearance) generate an average number of citations. However, data do suggest that weekend submissions garner about 6 − 7 fewer citations, which is over 10×σ510\times\sigma_5 below from the weekday submission ⟨C5⟩\langle C_5\rangle.

Citations vs Authorship

In Figure 3, the upper plot shows as a function of a manuscript’s authorship size (nauthn_{\mathrm{auth}}) the average number of citations per author C(nauth)C(n_{\mathrm{auth}}). Using the relationship

Citations per Number of Authors (≤ 15)

Figure 3. Upper: The average number of citations per author C(nauth)C(n_{\mathrm{auth}}) as a function of a manuscript’s authorship size. Lower: Same as upper but normalized to the mean ⟨A15⟩\langle A_{15}\rangle.

C(n)=∑i∈{articles}ci(n)/nNsub(n)=∑i∈{articles}ci(n)n Nsub(n),(6)C(n)=\frac{\sum_{i\in\{\mathrm{articles}\}}c_i(n)/n}{N_{\mathrm{sub}}(n)}=\frac{\sum_{i\in\{\mathrm{articles}\}}c_i(n)}{n\,N_{\mathrm{sub}}(n)}, \tag*{(6)}

the average C(n)C(n) is equal to the sum of all citations (cic_i) over all articles (ii) with a given authorship size (nn), divided by the authorship size and the number of submitted articles (NsubN_{\mathrm{sub}}) with the same number of authors. To further illustrate overall trends, we show in the lower plot

the same data as in the upper plot normalized by the mean over all submitted papers ⟨A15⟩\langle A_{15}\rangle with nauth≤15n_{\mathrm{auth}}\leq15,

⟨A15⟩=∑i∈{articles}ci(n)/nNtot(7)\langle A_{15}\rangle=\frac{\sum_{i\in\{\mathrm{articles}\}}c_i(n)/n}{N_{\mathrm{tot}}} \tag*{(7)}
=1Ntot∑n=115C(n) Nsub(n)≈17.0.(8)=\frac{1}{N_{\mathrm{tot}}}\sum_{n=1}^{15}C(n)\,N_{\mathrm{sub}}(n)\approx17.0. \tag*{(8)}

We find that the average number of citations per author decreases almost uniformly with increasing collaboration size. The exception is for nauth=10−11n_{\mathrm{auth}}=10-11 authors. Here, the distribution reaches a local maximum with C(nauth=10−11)≈6.6−5.8C(n_{\mathrm{auth}}=10-11)\approx6.6-5.8 citations per author, which translates to about 64-66 total paper citations. For reference, C(nauth=5,9,12)≈9.0, 4.8, 3.8C(n_{\mathrm{auth}}=5,9,12)\approx9.0,\,4.8,\,3.8, and translate to about 45-46 total paper citations on average. However, we caution making too strong an inference. For manuscripts with n=1−3n=1-3, there are about Nsub(n=1−3)≈7.1−8.4×104N_{\mathrm{sub}}(n=1-3)\approx7.1-8.4\times10^4 entries. For manuscripts with n≥10n\geq10 authors, there are fewer than 3100 entries.

Citations vs Subject Category

Finally, in Figure 4 we show the dependence on individual subject categories. As a baseline we show in Figure 4(a) the total number of papers submitted by category. The differences in paper count highlight the different norms and expectations within particle and nuclear physics.

Submissions and citations by subject category

Figure 4. (a) Total papers submitted by subject category. (b) Upper: Total number of citations of all manuscripts by subject, including (light) and excluding (dark shading) self-citations. Lower: Self-citations as a fraction of total.

In the upper panel of Figure 4(b) we show as a function of subject category the total number of citations of all papers within that category (light shading). Here, total citations ctot(sub)c_{\mathrm{tot}}(\mathrm{sub}) within a category is given by the sum of individual paper citations ci(sub)c_i(\mathrm{sub}); this includes self-citations7 ciself(sub)c_i^{\mathrm{self}}(\mathrm{sub}) and citations by other authors ciothers(sub)c_i^{\mathrm{others}}(\mathrm{sub}). Symbolically, these counts are related by

ctot(sub)=ctotself(sub)+ctotothers(sub),(9)c_{\mathrm{tot}}(\mathrm{sub}) = c_{\mathrm{tot}}^{\mathrm{self}}(\mathrm{sub}) + c_{\mathrm{tot}}^{\mathrm{others}}(\mathrm{sub}), \tag*{(9)}
ctotself(others)(sub)=∑i∈{articles}ciself(others)(sub).(10)c_{\mathrm{tot}}^{\mathrm{self(others)}}(\mathrm{sub}) = \sum_{i\in\{\mathrm{articles}\}} c_i^{\mathrm{self(others)}}(\mathrm{sub}). \tag*{(10)}

Also shown in Figure 4(b) as a function of subject are the total number of citations excluding self-citations (dark shading). In the lower panel, we show the fraction of self-citations (SS), which can be written as the ratio

S(sub)=ctot(sub)−ctotothers(sub)ctot.(11)S(\mathrm{sub}) = \frac{c_{\mathrm{tot}}(\mathrm{sub}) - c_{\mathrm{tot}}^{\mathrm{others}}(\mathrm{sub})}{c_{\mathrm{tot}}}. \tag*{(11)}

We observe that experimental papers self-cite at a slightly higher rate than theoretical works, with self-citations constituting S∼33%S \sim33\% of all citations in experimental works and about S∼20%S \sim20\% of all citations in theoretical works. We avoid commentary on practice of self-citing but note that our dataset includes conference proceedings submitted to the arXiv. Experimental collaborations frequently produce conference proceedings that often reference multiple experimental papers.

Applications and Extensions

For students with more advanced computing skills, the “farm-to-table” data analysis pipeline of Figure 1 can be applied and extended in several ways. For instance: during Phase 4, one can assume a statistical model (such as those available in scipy) and fit the data. One can train a machine learning algorithm (e.g., regression models or neural networks as available in sklearn) to explore more sophisticated correlations. Beyond statistical modeling, one can also explore computational security protocols.

In large-scale science experiments, security is an important but seldom-discussed topic. Datasets need to be securely stored but also accessible by credible users. To access non-public datasets of experiments and observatories, one generally uses login credentials. A well-known instance of an analysis pipeline employing login credentials is the online monitoring system of an experiment.

The Large Hadron Collider and its experiments, for example, share an automated data acquisition (DAQ) monitoring system that gives online status reports in real time8. The monitor’s pipeline follows Figure 1: For each system, diagnostic data are collected (Phases 1–2), processed (Phase 3), and plotted (Phase 4) on a local server. Plots are then copied to a web server (Phase 5).

Another example is the SuperNova Early Warning System9, where a supernova candidate in one telescope/observatory transmits an alert to others through a credentialed, one-way “query” (Phases 5). For such interfacing between known servers, scp/ssh commands with RSA keys are used. For interfacing between unknown servers (via APIs), “access tokens” are a popular alternative.

To this end, we further explored whether API security protocols could be added to Figure 1, and therefore also into coursework. Again, the outcome was positive. In this case, an early career postdoc built an “export pipe” that posts the plots from Phase 4 to social media accounts. We now describe Phase 5 of the BibAPI template.

Phase 5: Exporting to Social Media

Phase 5 (Exporting) of BibAPI exports plots from Phase 4 to social media accounts via their APIs. We focus on the platforms Bluesky and Twitter/X to highlight the similar procedures among media platforms, including Facebook and LinkedIn. Credentialed APIs operate like public APIs (e.g., InSpireHEP). The main difference is that a “client” calls URLs/URIs on behalf of a user.

In practice, instead of directly calling a URL in a script (e.g., with urlopen(...)), a client must first be initialized, typically with calls of the form10 client = ClientClass(...) and client.login(...). The client then calls a URI, i.e., an elongated URL containing encrypted credentials and content (markup text), through a “post” command11 of the form client.post(...). The platform interprets the URI and carries out the embedded instructions. To post media (e.g., png files), one may need to first upload the file via an upload call of the form client.upload(...). This type of call returns the URL of the file, which can be passed to client.post(...).

In doPhase5(...), the above procedure is carried out. API clients for Bluesky (atproto.Client(...)) and Twitter/X (tweepy.Client(...)) are first initialized. Figures from Phase 4 (APIQueryInputs.imgPaths[N]) are then uploaded and published on the platforms (send_images(...) and create_tweet(...)).

In the client calls above, “tokens” are passed as arguments. These are pseudo-login credentials that anonymize real credentials. In principle, only the platforms can map “tokens” to real credentials. Tokens can be fed into URIs, given a fixed lifetime, and granted restricted account permissions, e.g., only read. Unlike real credentials, a single set of login tokens can be shared.

To generate API tokens, a developer’s account on the platform must be created and tied to an existing social media account. Importantly, free developer accounts can be obtained for academic/educational use. Under such licensing agreements, API calls from pipelines-turned-web-apps cannot be commercialized. Under alternative licenses, implementations of Figure 1 can be commercialized. This exemplifies how Big Data methods used in physics & astronomy research are applicable in industry.

An Automated Online DAQ Monitor

With Phase 5, the pipeline depicted in Figure 1 mirrors the Large Hadron Collider’s online DAQ monitor. However, unlike BibAPI, real online DAQ monitors are automated and run continuously. Turning BibAPI into

a “bot” is actually straightforward. One simply needs a job scheduler, such as cron on Linux systems.

As depicted in Figure 5, a two-to-three-line crontab operating daily (for ARXiv queries) or every minute (for DAQ monitoring) on an online server can call a two-to-three line shell script (driver.sh) that subsequently calls an API script (API.py). The script can then make the appropriate queries and posts to online platforms. In the context of science communication and outreach, we also report the successful launch of a bot that checks the ARXiv daily for new research papers by certain research networks and advertises the work on social media12.

Illustration of an automated API/social media bot

Figure 5. Illustration of an automated API/social media bot.

Discussion and Conclusions

Many disciplines in the physical sciences, including astrophysics, nuclear physics, and particle physics have become synonymous with Big Data. Among other traits, Big Data is characterized by the fast handling of large datasets (in excess of O(106)O(10^{6}) entries), strict memory and storage management, and interfacing directly with databases, possibly with security protocols. In other words: advanced computing skills. It is likely that these skills will be increasingly integrated into physics & astronomy curricula, particularly at the undergraduate level [11]. However, the fact is that physics & astronomy students face barriers to learning these skills [7].

In this work, we have presented a “farm-to-table” analysis pipeline that collects, processes, and plots (bibliometric) data from two public databases that are well-known in the physics community. The pipeline (Sec. II) was inspired by those used in contemporary physics & astronomy research and can be implemented (Sec. III) using Python libraries typically introduced in undergraduate computing courses. Our overarching motivation is to demonstrate that advanced data analysis skills can successfully be introduced at the undergraduate level. These are skills that are typically taught at the PhD level but often are needed by students earlier in their training.

The key to the pipeline’s operation and success, is the use of Application Program Interfaces, which are prevalent in industry, the public sector, and Big Science.

To illustrate the classroom potential of the pipeline, we showed in Sec. IV a simplified analysis of bibliometric data from about 330k manuscripts in high energy and nuclear physics submitted to the arXiv over a 34-year period. The analysis itself was authored by two undergraduate students during a 4-week internship and is publicly available. In § 1.4, potential applications and extensions of the pipeline are discussed, including security protocols and pathways commercialization. With suitable tailoring, we believe that some or all parts of the pipeline can be incorporated into undergraduate curricula, including at the first- and second-year level.

Acknowledgments

The authors thank Hal Haggard and Alexis Knaub for discussions. The authors also thank the arXiv and InSpireHEP for the use of its open access interoperability. This work was partially funded by the Polish Academy of Sciences under the ‘Funding for the dissemination and promotion of scientific activities’ program (PAN.BFB.S.BUN.442.022.2024). SD and RR acknowledge the support of Narodowe Centrum Nauki under Grants 2019/34/E/ST2/00186 and 2023/49/B/ST2/04330 (SNAIL). The authors acknowledge support from the COMETA COST Action CA22130.

References

Computational Setup

The BibAPI template was developed and tested on Linux and MacOS operating systems, but not Windows. However the use of these template on Windows is not expected to be problematic. The script does not require significant computing power, as such any basic, single-core, off-the-shell personal laptop or desktop computer with a stable internet connection should have sufficient memory and disk resources to run it.

Python3 was used (more specifically Python3.12 and Python3.13) with several libraries and modules. To make requests to the databases APIs, urllib was used alongside feedparser to parse the data obtained from the queries. The raw data saved and stored in external txt files are loaded using the pandas library, which is widely used in Data Science. Pandas facilitates easy manipulation of data frames / data sets. Plots were produced using the commonly used matplotlib library.

The social media APIs from § 1.4 require the tweepy (Twitter/X) and atproto (Bluesky) modules. It is possible to extend Phase 5 to Facebook using the facebook-sdk module. Listing 1 present a snippet of the code used to authenticate a client on Twitter/X and post to social media. Posting to other social media platforms follows a similar procedure. By default, Phase 5 is skipped in the BibAPI template and associated modules are not needed to run Phases 1-4.

A summary of specialized libraries used, and the phases in which they are used, alongside the command lines to install them locally can be found in Table II.

PY3 Module nameVersionsPhaseLocal installation
urllib32.3.0/2.4.01,2,3,4$ pip3 urllib
feedparser6.0.111,2,3,4$ pip3 feedparser
pandas2.2.32.2.3$ pip3 pandas
matplotlib3.8.3/3.10.34$ pip3 matplotlib
tweepy4.15.05$ pip3 tweepy
atproto0.0.615$ pip3 atproto
facebook3.1.05$ pip3 facebook-sdk

Table II. Specialized Python libraries used in the project

import tweepy

# define OAuth1.0 client (for making post)
client = tweepy.Client(
    consumer_key=CONSUMER_KEY,
    consumer_secret=CONSUMER_SECRET,
    access_token=ACCESS_TOKEN,
    access_token_secret=ACCESS_TOKEN_SECRET
)
# define OAuth2.0 client (for uploading media)
apiKeys=tweepy.OAuthHandler(
kingdom.CONSUMER_KEY,
kingdom.CONSUMER_SECRET)

apiKeys.set_access_token(
kingdom.ACCESS_TOKEN,
kingdom.ACCESS_TOKEN_SECRET)

# upload media to platform
clientAPI=tweepy.API(apiKeys)
media = clientAPI.media_upload(pathtomedia)
meID = media.media_id_string

# simple test tweet
tweet="twitter API media test!"

# push post to platform
client.create_tweet(text=tweet,media_ids=meID)

Listing 1. Creation of the OAuth1.0 and 2.0 clients and tweet publication with media

Usage and Options

After the libraries listed in Table II been installed, bibAPI.py can run from a terminal with the command

$ python ./bibAPI.py START END CAT1 CAT2 ...

Here, START and END are the start and end dates in YYYY-MM-DD format of the arXiv query. CATN are subject categories as abbreviated by the arXiv. For systems where python refers to python2, one should call python3.

Running the BibAPI script without any arguments,

$ python ./bibAPI.py

will invoke the default date range (2023-12-04 to 2024-12-05) and default subject category (hep-ex and nucl-ex). To modify the date range but not default categories, use

$ python ./bibAPI.py YYYY-MM-DD YYYY-MM-DD

The list of categories cannot be modified from the terminal without also stipulating the date range. However, one can modify the default value of the category attribute in the script’s APIQueryInputs class. This object is located near the top of the bibAPI.py file.

To reproduce the output in Sec. IV, use the command

$ python ./bibAPI.py 1991-01-01 2025-03-31
        hep-ex hep-th hep-ph hep-lat
        nucl-ex nucl-th

For the results in App. § 1.3.3, use instead

$ python ./bibAPI.py 2022-01-01 2022-12-31
        hep-ex hep-th hep-ph hep-lat
        nucl-ex nucl-th

Collecting and processing data for the entire 34-year period takes approximately 36 hours on a personal laptop. The seemingly long runtime is due to brief but intentional pauses during Phase1 and Phase2 (see Sec. III). The pauses are needed to avoid (accidental) denial-of-service attacks on databases (a security protocol). For about 330k records, Phase 1 will write to file a list of arXiv identifiers (APIQueryInputs.idPath[0]) that is about 8 MB. The corresponding inSPIREHEP record (APIQueryInputs.dataPath[0]) generated by Phase2 is about 15 MBs. In total, about 30 MBs of records and image files are written to file. For the year 2023, under 2 MBs of records and image files are written to file. Copies of our datasets are available at

gitlab.cern.ch/riruiz/public-projects/-/tree/master/BibAPI/ResultsFromPaper

For further help, execute either of the following

$ python ./bibAPI.py --help
$ python
>>> import bibAPI
>>> bibAPI.queryHelp()

Both set of commands will print (hopefully) helpful tips. The command dir(bibAPI) will list all “methods” and “attributes” available in the script (technically a Python “module”). Likewise, help(bibAPI.xxx) for method/attribute xxx will print any available documentation.

Additional Results: 1-year run

In Figure 6, Figure 7, and Figure 8 we show the same results as in Sec. IV but for the smaller data range 2022 Jan. 01–Dec. 31. A total of Ntot=12,099N_{\mathrm{tot}} = 12{,}099 records were obtained from inSPIREHEP, with δN=2\delta N = 2 additional manuscripts excluded. For one year of papers, full runtime took about 5 hours on a Wi-Fi connection. By the end of Phase 1, about 135 MB of memory was needed. By the end of Phase 2, memory needs grew to about 160 MB. Phase 4 required about 405 MB to generate histograms. Output files required under 4 MB of storage.

Number of articles submitted and average number of citations by submission day

Figure 6. (a,b) same as Figure 2(a) and Figure 2(b) but for the date range 2022 Jan. 01 – 2022 Dec. 31.

Citations by number of authors

Figure 7. Same as Figure 3 but for the date range 2022 Jan. 01 – 2022 Dec. 31.

Submissions per subject category, total citations and total citations excluding self-citations by subject, and ratio of self-citations to total citations

Figure 8. (a,b) same as Figure 4(a) and Figure 4(b) but for the date range 2022 Jan. 01 – 2022 Dec. 31.

References

  1. [1]Letter of Intent for the Phase-II Upgrade of the ATLAS Experiment, (2012).
  2. [2]Technical Proposal for the Phase-II Upgrade of the CMS Experiment 10.17181/CERN.VU8I.D59J (2015).
  3. [3]M. Abdul Karim et al. (DESI), Data Release 1 of the Dark Energy Spectroscopic Instrument, (2025), arXiv:2503.14745 [astro-ph.CO].arxiv.org/abs/2503.14745
  4. [4]P. Mulvey and J. Pold, Physics Bachelors Initial Employment Booklet - Academic Years 2020-21 and 2021-22 (2025).DOI
  5. [5]P. Mulvey and J. Pold, Physics Trends: Knowledge and Skills Used - New Physics Bachelors Employed in STEM Fields (2025).
  6. [6]P. Mulvey and J. Pold, AI Use Among Physics Degree Recipients (2025).DOI
  7. [7]K. Shah, J. Butler, A. V. Knaub, A. Zenginoğlu, W. Ratcliff, and M. Soltanieh-ha, Data science education in undergraduate physics: Lessons learned from a community of practice, American Journal of Physics 92, 655 (2024).arxiv.org/abs/2403.00961
  8. [8]T. P. Robitaille et al. (Astropy), Astropy: A Community Python Package for Astronomy, Astron. Astrophys. 558, A33 (2013), arXiv:1307.6212 [astro-ph.IM].DOI
  9. [9]R. Brun and F. Rademakers, ROOT: An object oriented data analysis framework, Nucl. Instrum. Meth. A 389, 81 (1997).
  10. [10]I. Antcheva et al., ROOT: A C++ framework for petabyte data storage, statistical analysis and visualization, Comput. Phys. Commun. 180, 2499 (2009), arXiv:1508.07749 [physics.data-an].
  11. [11]E. Behringer and L. Engelhardt, Guest editorial: Aapt recommendations for computational physics in the undergraduate physics curriculum, and the partnership for integrating computation into undergraduate physics, American Journal of Physics 85, 325 (2017), https://pubs.aip.org/aapt/ajp/article-pdf/85/5/325/13077528/325_1_online.pdf.DOI
  12. [12]M. Moskovic, The INSPIRE REST API 10.5281/zenodo.5788550 (2021).DOI

Paper details

vlnc:W_shdeqedh
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents