dataesr/scientific-paragraphs-categorization huggingface dataset:
The ML data analysis process, which requires a powerful GPU, can also run on edge computing nodes  (Babu et al. , 2022)  or even in central computing facilities  (Starostin et al. , 2022). For more integrated, routine solutions offered by the facilities themselves, edge computing is an attractive option in this context. Prioritizing the user's requirements, it is advantageous for a facility to offer infrastructure that is exclusively available to the particular user group performing the experiment. Through collaborative efforts in the context of PaNOSC the VISA system based on OpenStack (see https://visa. readthedocs. io/) has been developed which essentially fulfills the needs described above. Modern synchrotron beamlines are an ecosystem of distributed computing resources on their own. Therefore, a simple choice to establish communication between the beamline control software and the user-provided online data analysis resources is to rely on the beamline's SCADA system (at ESRF: TANGO controls) for low-dimensional data (Sections SI-1 and SI-2 of the supporting information).
Streaming options, however, become inevitable for high-rate, multidimensional data sources such as large area detector images. In Fig. 2  we illustrate the layout of two independently tested software configurations evaluated during the experiment presented. Figure  2 (a) shows a fully synchronous acquisition and online analysis scheme relying on TANGO communication to transfer one-dimensional (1D) data [binned region-ofinterest (ROI) intensities extracted from detector images, here done via LIMA  (Petitdemange et al. , 2018) ] to the online data analysis running on a user-controlled virtual machine provisioned via VISA where the ML inference takes place. After processing, ML results are made available in the main beamline control process and 'closed loop action' can be triggered. Once completed, another acquisition starts (see Section SI-2 of the supporting information).
(2023). We have developed a fast, GPU-accelerated module within the PyTorch framework that calculates reflectivity curves in order to train the neural networks utilized in the experiment in real time during the beam time. This module seamlessly integrates into the training process, enabling on-the-fly XRR simulations throughout the training phase. Consequently, we were able to quickly adjust the training settings (even during the beam time), eliminating the requirement for meticulous pre-planning. Note that we rely on preprocessing operations and the rich postprocessing pipeline introduced by  Greco et al. (2021 Greco et al. ( , 2022) )  that features q offset sampling and least-meansquares (LMS) fit. A major addition to the postprocessing step of the previous works is the introduction of a new optional fitted parameter that models a linear change of thickness during the measurement of a single curve as we perform in situ and real-time experiments.
Data handling All data, including the extracted parameters of the online data analysis, have been stored in a fully correlated fashion, i. e. raw data alongside analysis results in NeXus HDF5, and are publicly available through the ESRF data portal  (Pithan et al. , 2023). Using the ESRF file-saving infrastructure (Bliss + NeXus-Writer) enabled the visiting experimentalists to directly insert the online data analysis results into the data files published by the beamline (see supporting information for details). Furthermore, through integrating into the ESRF beamline software ecosystem, the online data analysis results could seamlessly be transferred into the accompanying electronic logbook, allowing a first overview of the experimental results ordered via timestamps.
In the multilayer fits physical knowledge was embedded in the parametrization of the electron density model and rather narrow training ranges of the ML model. In contrast, wide training ranges were used for the single-layer model, but prior information was taken into account by inputting it into the ML model to achieve a certain regularization of the results. Here, in the dataset presented in Fig. 5 , through the use of priors, the expected film thickness was constrained to increase by at most 50 A ˚and decrease by no more than 25 A ˚for the ML-based real-time analysis. This still gives the model sufficient flexibility to predict changes during the film growth, but imposes weak boundaries based on the scan speed and deposition rate.
Further integration potential For the experiment conducted in the context of this work it was possible to store ML analysis results together with the original raw data and to interact with the facility-provided electronic logbook (ELN). However, ingesting machinereadable metadata into the facility data catalog remained difficult. In order to support and contribute to a thriving ecosystem of ML models for X-ray data analysis, i. e. physicsinformed ML models and sample-system-specific ML models, it is of crucial importance that facilities provide -ideally standardized -interfaces and best practice guidelines on how externally developed code should interact with the respective beamline control and data storage systems. Initiatives similar to DAPHNE4NFDI  (Barty et al. , 2023)  are well suited for discussion in this context, since they bring together facilities and the user community, including experienced users, to jointly design research data infrastructure along a process chain all the way from the proposal and experiment to the fully analyzed and archived data.
(a) Thin-film thickness extracted through the ML model in real time during the measurement compared with a quartz crystal microbalance (QCM) reference. For films with thickness above roughly 250 A ˚, i. e. 12 molecular monolayers, ML results are reliable. (b) Selected fits from the real-time dataset. Ambiguity in the thickness predictions for lower thicknesses mainly results from the absence of significant features in the investigated q-range.
g. surface pressure of a Langmuir trough) may also be controlled externally. In a broader picture, we see a bright future to embed ML-based feedback loops also for other types of scattering experiments, e. g. involving electrochemical control over battery charging or control over electrochemical sample environment conditions or catalytic conditions in experiments on nanoparticles. It also extends to other synchrotron-based techniques  (Chen et al. , 2021; Hinderhofer et al. , 2023) , as well as neutron-based techniques, including in particular neutron reflectometry  (Treece et al. , 2019). With the focus on publicly available FAIR datasets hosted in facility data catalogs we see the potential of ML-based online data analysis in helping to make these datasets in catalogs 'more fair and more reusable'.
This is possible through enriching the currently archived raw dataset at least with the preliminary analysis results on-the-fly. Live ML X-ray data analysis has the ability to complete datasets with scientifically relevant machine-readable metadata as well as automated capture of scientific results in ELNs accompanying the dataset in the facility data catalog. We are convinced that the presented approach can contribute significantly to a more efficient use of beam time at large-scale facilities. We envision that integration of live data analysis and feedback loops with ML models will become more established at beamlines along the lines presented here. Then, facility users can use ML to observe live how experiments progress and also perform previously unattainable experiments with direct feedback and contribute to an ever-growing, meaningful X-ray dataset pool.
Data availability statement The specific beamline integration Python scripts as well as the TANGO server embedding the ML model used in this study are available in the supporting information accompanying the published article. Data underlying this publication are available in the ESRF data repository  (Pithan et al. , 2023). Experimental data used to prepare for the beam time are available -see  Pithan et al. (2022). A reference ML model is available -see  Greco (2022)  and  Munteanu et al. (2023).
Acknowledgements We acknowledge the  European Synchrotron Radiation Facility (ESRF)  for providing of synchrotron radiation at the ID10 beamline. Further, we express our gratitude to those offering support with the ESRF computing infrastructure, especially  Jean-Francois Perrin ,  Wout de Nolf ,  Samuel Debionne  and  Valentin Valls. Further we thank the  Machine Learning Cluster of Excellence , funded by the  Deutsche Forschungsgemeinschaft (DFG ,  German Research Foundation)  under Germany's  Excellence Strategy -EXC  number  2064/1 - Project number  390727645  for support and access to compute resources.
Ammonia (NH 3 ) is an important atmospheric constituent. It plays a role in air quality and climate through the formation of ammonium sulfate and ammonium nitrate particles. It has also an impact on ecosystems through deposition processes. About 85 % of NH 3 global anthropogenic emissions are related to food and feed production and, in particular, to the use of mineral fertilizers and manure management. Most global chemistry transport models (CTMs) rely on bottom-up emission inventories, which are subject to significant uncertainties. In this study, we estimate emissions from livestock by developing a new module to calculate ammonia emissions from the whole agricultural sector (from housing and storage to grazing and fertilizer application) within the ORCHIDEE (Organising Carbon and Hydrology In Dynamic Ecosystems) global land surface model.
Even though we found an underestimation in our emissions over Europe (-26 %) and an overestimation in the USA (+56 %) compared with previous work, other hot spot regions are consistent. The calculated emission seasonality is in very good agreement with satellite-based emissions. These encouraging results prove the potential of coupling ORCHIDEE landbased emissions to CTMs, which are currently forced by bottom-up anthropogenic-centered inventories such as the CEDS (Community Emissions Data System).
, 2011; Behera et al. , 2013). Other factors such as the ammonium content of the fertilizer and the timing of N application are also crucial for emission estimates  (Riddick et al. , 2016; Vira et al. , 2020). The first type of approach to the quantification of agricultural ammonia emissions is bottom-up inventories. Most global inventories, such as the CEDS (Community Emissions Data System;  McDuffie et al. , 2020) , EDGAR (Emissions Database for Global Atmospheric Research;  Crippa et al. , 2018) , and HTAP (Hemispheric Transport of Air Pollution;  Janssens-Maenhout et al. , 2015) , are based on activity data associated with corresponding emission factors (EFs). Chemistry transport models (CTMs) are usually forced with these global emission inventories. As examples, the inventory described by  Bouwman et al.
Our methodology is based on the integration of a complete dynamical agricultural module (CAMEO, Calculation of AMmonia Emissions in ORCHIDEE) within ORCHIDEE, which details a feed management module linked to the biomass productivity of the model and animal characteristic information, a manure management representation that combines regional agricultural handling practices, and a complex soil emission component based on key environmental parameters such as the vegetation growth, temperature, and soil humidity. Section 2 describes the agricultural model within OR-CHIDEE and the model setup of the 11 year control simulation  (2005) (2006) (2007) (2008) (2009) (2010) (2011) (2012) (2013) (2014) (2015)  as well as with the sensitivity analysis simulation set. Global and regional results comparing previous works (CEDS and the FAN model from  Vira et al.
Methods This section describes the process-based model for the N flow from agriculture within the ORCHIDEE LSM. The new module implemented here aims at calculating two types of emissions from agriculture: the manure management chain emissions (livestock housing and yard emissions as well as manure storage emissions) and soil emissions (accounting for fertilizer and manure application). The ORCHIDEE model framework is described in Sect. 2. 1. 1 followed by the different interactive components (shown in Fig. 1 ): the feeding of livestock, the whole manure management chain, fertilizer surface application, and the soil-plant-atmosphere continuum processes leading to soil emissions. Section 2. 2 describes the setup of the simulations and the model evaluation protocol.
(2019). At the global scale, the model evaluation shows good agreement between the gross primary production simulated with the carbonnitrogen interaction version and the observational validation set. In this paper, we integrate the following new developments within a new module called CAMEO for the Calculation of AMmonia Emissions in ORCHIDEE: a new grassland and cropland management module dedicated to livestock feeding (Sect. 2. 1); a module computing manure production and the associated emissions from indoor farming livestock activities (housing, yard, manure storage) (Sect. BM ing (a) = D a × SI × W a , (1) where W a is the animal weight (kg), and SI is the specific intake (the intake per animal weight unit, kg C kg -1 yr -1 ). A daily dry matter intake equal to 2. 5 % of the livestock weight  (Paustian et al.
5 • × 1. 3 • resolution (39 vertical levels) over the 2005-2015 period  (Hauglustaine et al. , 2014). The spatial distribution of χ a is presented in Fig. S4  (Supplement) for both  May and December (2005-2015 climatology). R a (z) is computed interactively by the biophysics module of the ORCHIDEE model. R b has been implemented according to  Xu et al. (2019)  as follows: R b = v D NH 3 × c (LAI) 2 × l × µ * v 1/3 , ( 17 ) where D NH 3 is the molecular diffusivity of NH 3 in air (m 2 s -1 ;  Massman, 1998) , c is an empirical constant equal to 3, l is the leaf width (0. 02 m;  Massad et al. , 2010) , v is the kinematic viscosity of air (1. 56 × 10 -5 m 2 s -1 at 25 • C), T is the air temperature (in K), and LAI is the leaf area index (m 2 m -2 ), which is computed by the ORCHIDEE model. The resulting annual mean R b ranges between 0 and 1.
Modeling setup The ORCHIDEE model, including all of the developments described in Sect. 2, was run at a spatial resolution of 2 • (180 × 90). This spatial resolution is relatively low but enables one to perform an ensemble of sensitivity tests at a reasonable computing cost. We also performed a reference simulation at a 0. 5 • resolution to ensure that the model resolution does not affect the results. We performed a 10-year reference simulation over the 2005-2015 period. This simulation starts in January 2005 from a simulation done with an ORCHIDEE version similar to the one presented in this paper but without the developments presented in Sect. 2. 1. 2. In the reference simulation, all annual forcing data are updated every year except those related to BNF and the livestock density, which are constant over time.
Little sensitivity of the emissions to this parameter was found because χ a is much smaller than NH 3 (g). However, this parameter has been tested in our implementation through a sensitivity analysis. The ORCHIDEE model requires the following set of forcing data: meteorological data, including the near-surface air temperature and specific humidity, wind speed, pressure, short-and long-wave incoming radiation, rainfall, and snowfall, from the Climatic Research Unit (CRU) and Japanese reanalysis (JRA) dataset (CRU-JRA V2. 1)  (Harris et al. , 2014)   13 ) and (  14 ) p zact_deep,1. 5 p zact_deep 1. 5 m Eq. (  13 ) 0. 5 • spatial resolution and a monthly temporal resolution; the annual mineral fertilizer rates over croplands and grasslands from an annual dataset developed by  Lu and Tian (2017) , which corresponds to a reconstruction from 1960 to 2014 for the global cropland matched with the HYDE 3.
2 cropland distribution; the biological nitrogen fixation rate, which is provided as climatological data as a function of the evapotranspiration flux (see  Vuichard et al. , 2019 , for more details); the distribution of each livestock category, which is taken from the Gridded Livestock of the World (GLW 2;  Robinson et al. , 2014)  and represents the gridded animal densities (D a ) for the year 2006 at a 1 km resolution. Small-ruminant densities correspond to the sum of the sheep and goat densities. The dairy cattle distribution has been retrieved from the total cattle distribution combined with national dairy cattle densities given by FAOSTAT (2020). The calculation adopted is described in the Supplement.
Model evaluation dataset Our integrated approach allows the computation of different variable levels before the final emission results, such as biomass productivity, animal excretion rate, and manure production. This set of variables offers the advantage of evaluating our emissions at different stages of the N flow against the previous works listed in Table  6. The decadal mean  (2005) (2006) (2007) (2008) (2009) (2010) (2011) (2012) (2013) (2014) (2015)  values of global and regional calculated agricultural emissions, including indoor and soil emissions, are compared to the CEDS inventory  (McDuffie et al. , 2020)  and the emissions simulated by FANv2  (Vira et al. , 2020). From the LMDZ-ORCHIDEE-INCA coupling development perspective, it is interesting to compare our approach with CEDS  (McDuffie et al.
, 2020) , as it is a reference dataset offering a long period of data (1750-2019). FANv2 has been chosen for our evaluation because our work is based on a similar approach. The regional budget accounts for Africa; tropical southern Asia; Europe; China, Korea, and Japan (abbreviated as China-K-J in the figures); Oceania; India; the USA and Canada; and Latin America. The seasonal variations in ammonia emissions are also evaluated against satellite-derived emissions  (Evangeliou et al. , 2020). For that purpose, atmospheric NH 3 columns observed by the Infrared Atmospheric Sounding Interferometer (IASI) satellite have been combined with the NH 3 lifetime calculated by LMDZ-INCA in order to retrieve emissions. The NH 3 retrieval product used to derive emissions in our study comprises the 2011-2015 morning observations (Metop-A and -B) and follows a neural network retrieval approach (ANNI-NH3-v3R), as referred to in  Van Damme et al.
(2017 , 2021). Both the lifetime and atmospheric columns are monthly products and share the exact same grid resolution (LMDZ-INCA grid resolution at 2. 5 • ×1. 3 • ). All three CAMEO, CEDS, and FANv2 seasonal variations are evaluated against IASI-derived emissions (defined as IASI inv ). In order to be consistent with IASI observations (where no source distinction is possible), the CAMEO, CEDS, and FANv2 agricultural emissions need to be complemented by fire emission data taken from van der Werf et al. (2017) (Global Fire Emissions Database, GFED s4) as well as by industrial and waste sources  (McDuffie et al. , 2020). The extended emissions are referred to as CAMEO + , FAN + , and CEDS + , respectively, as described in Table  7. It is important to note that only the ORCHIDEE model can provide natural emissions; this source is not considered in the FAN + nor the CEDS + datasets.
2 ). The spatial distributions of the calculated agricultural NH 3 emissions show good agreement with the FANv2 and CEDS results (Fig. 4, b, c ). In India and China, our emissions are slightly higher than FANv2 and CEDS estimates. Our values are lower than the FANv2 estimate in Latin America and Africa but high compared with CEDS emissions, which are particularly low in these two regions. In some parts of Africa and Latin America, where the use of synthetic fertilizer is low (never exceeding 2500 kg N km -2 yr -1 ), livestock activity appears to be the main contributor to the emissions. In intensive agricultural regions, data used for mineral fertilizer application rates can be a source of discrepancy between models. Vira et al. (2020)  use the LUH2 dataset  (Hurtt et al. , 2020) , which assumes that only croplands are fertilized.
Emission seasonality Seasonality patterns have been first explored by comparing our emissions against the CEDS inventory and the FANv2simulated emissions. As shown in Fig. 11 , we calculate maximum emissions during the spring and summer seasons, whereas the emissions peak almost everywhere only during spring in CEDS and FAN. In the three datasets, the lowest values are calculated during winter, when the meteorological conditions are not favorable for emissions and N application is lowest. The summer peak observed in our emissions and the spring peak in CEDS and FAN in the USA, more specifically in the central and southern central parts of the USA, are also reported by the Magnitude And Seasonality of Agricultural Emissions (MASAGE) bottom-up inventory from  Paulot et al. (2014). In MASAGE, two peaks are highlighted during the year: one in March and the other in June.
The regional monthly signal for leaves to start to grow in ORCHIDEE averaged over the different PFTs is drawn using dotted gray lines (this metric is unitless and can be seen as a qualitative signal for the start of the vegetation growing season). Variables are for 2006. China-K-J accounts for China, Korea, and Japan. eter (TES) instrument  (Shephard et al. , 2011)  and the Atmospheric Infrared Sounder (AIRS) retrievals  (Warner et al. , 2017). Our emissions in India peak in spring but remain high during summer. This pattern is also highlighted in the HTAP emissions and IASI satellite data  (Janssens-Maenhout et al. , 2015; Van Damme et al. , 2017) , where no strong seasonality is shown over the Indo-Gangetic Plain, but higher emissions are noted from April to September. To complete our analysis, monthly emissions derived from the IASI satellite (IASI inv ) averaged over the 2011-2015 period are used as a comparison regarding different hot spot regions defined in Fig.
5. The same operation has been carried out for agricultural emissions from FANv2 and the CEDS inventory, and the details of the CAMEO + , CEDS + , and FAN + dataset constituents are listed in Table  6. First, it is worth noting that the seasonality of CAMEO + , CEDS + , and FAN + is primarily due to their respective agricultural emissions; the other sources have no important role in the seasonality. Indeed industrial and waste sources show very low annual standard deviations (in the ranges of 10 -7 and 10 -8 g N m -2 yr -1 , respectively) compared with the agricultural emissions estimated by CEDS, FANv2, or CAMEO (0-8 g N m -2 yr -1 ). Biomass burning emissions have a standard deviation reaching 0. 6 g N m -2 yr -1 in areas characterized by high fire activity, whereas the deviation is intermediate in agricultural regions (∼ 10 -2 g N m -2 yr -1 ; Fig.
5-0. 8 g N m -2 yr -1 in CEDS + , CAMEO + and FAN +. These differences might be explained by high uncertainties associated with the IASI instrument during this period. Van Damme et al. (2014)  highlighted limitations in the IASI (Metop-A) measurement availability over Europe in winter 2011. The number of cloud-free observations is low, especially in December and January, with only 4 % of the dataset being associated with an error lower than 50 % due to the thermal contrast (defined as the temperature difference between the Earth's surface and the atmosphere at 1. 5 km) and the amount of ammonia present in the atmosphere. In southern Europe (the Spanish region), IASI inv emissions show a weaker seasonal cycle than CAMEO + , peaking in summer. Spain is characterized by a diversity of agricultural production types (e.