Skip to content

Commit

Permalink
Paper corrections and DOIs
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquinperaza committed Jan 24, 2024
1 parent f37289b commit e257e79
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 29 deletions.
81 changes: 68 additions & 13 deletions paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ @article{zreda2012cosmos
number={11},
pages={4079--4099},
year={2012},
publisher={Copernicus GmbH}
publisher={Copernicus GmbH},
doi={10.5194/hess-16-4079-2012}
}

@article {rosolem2013,
Expand All @@ -31,7 +32,8 @@ @article{andreasen2017status
number={8},
pages={1--11},
year={2017},
publisher={Wiley Online Library}
publisher={Wiley Online Library},
doi={10.2136/vzj2017.04.0086}
}

@INPROCEEDINGS{2009NMDB,
Expand Down Expand Up @@ -61,7 +63,8 @@ @article{desilets2010nature
volume={46},
number={11},
year={2010},
publisher={Wiley Online Library}
publisher={Wiley Online Library},
doi={10.1029/2009WR008726}
}

@article{baatz2015empirical,
Expand All @@ -72,7 +75,8 @@ @article{baatz2015empirical
number={4},
pages={2030--2046},
year={2015},
publisher={Wiley Online Library}
publisher={Wiley Online Library},
doi={10.1002/2014WR016443}
}

@article{wahbi2018situ,
Expand All @@ -81,7 +85,8 @@ @article{wahbi2018situ
journal={Cosmic Ray Neutron Sensing: Estimation of Agricultural Crop Biomass Water Equivalent},
pages={5--9},
year={2018},
publisher={Springer International Publishing}
publisher={Springer International Publishing},
doi={10.1007/978-3-319-69539-6_2}
}

@article{schron2018cosmic,
Expand All @@ -92,7 +97,8 @@ @article{schron2018cosmic
number={9},
pages={6441--6459},
year={2018},
publisher={Wiley Online Library}
publisher={Wiley Online Library},
doi={10.1029/2017WR021719}
}

@article{smart2001geomagnetic,
Expand All @@ -119,6 +125,7 @@ @article{dong2018soil
pages={2199--2211},
year={2018},
publisher={Wiley Online Library}
doi={10.1002/2017WR021692}
}

@article{zreda2008measuring,
Expand All @@ -128,7 +135,8 @@ @article{zreda2008measuring
volume={35},
number={21},
year={2008},
publisher={Wiley Online Library}
publisher={Wiley Online Library},
doi={10.1029/2008GL035655}
}

@article{franz2012measurement,
Expand All @@ -138,7 +146,8 @@ @article{franz2012measurement
volume={48},
number={8},
year={2012},
publisher={Wiley Online Library}
publisher={Wiley Online Library},
doi={10.1029/2012WR011871}
}

@article{kohli2015footprint,
Expand All @@ -149,7 +158,8 @@ @article{kohli2015footprint
number={7},
pages={5772--5790},
year={2015},
publisher={Wiley Online Library}
publisher={Wiley Online Library},
doi={10.1002/2015WR017169}
}


Expand All @@ -160,7 +170,8 @@ @article{franz2020practical
volume={2},
pages={9},
year={2020},
publisher={Frontiers Media SA}
publisher={Frontiers Media SA},
doi={10.3389/frwa.2020.00009}
}


Expand All @@ -172,7 +183,8 @@ @article{albergel2008near
number={6},
pages={1323--1337},
year={2008},
publisher={Copernicus Publications G{\"o}ttingen, Germany}
publisher={Copernicus Publications G{\"o}ttingen, Germany},
doi={10.5194/hess-12-1323-2008}
}

@article{rossini2021predicting,
Expand All @@ -183,7 +195,8 @@ @article{rossini2021predicting
number={6},
pages={1894--1902},
year={2021},
publisher={Wiley Online Library}
publisher={Wiley Online Library},
doi={10.1002/saj2.20319}
}

@article{jakobi2020error,
Expand All @@ -193,7 +206,8 @@ @article{jakobi2020error
volume={2},
pages={10},
year={2020},
publisher={Frontiers Media SA}
publisher={Frontiers Media SA},
doi={10.3389/frwa.2020.00010}
}

@article{schron2017improving,
Expand Down Expand Up @@ -252,3 +266,44 @@ @misc{cornish_pasdy
note = {Processing and Analysis of Sensor Data in pYthon}
}

@article{harris2020array,
title={Array programming with NumPy},
author={Harris, Charles R and Millman, K Jarrod and Van Der Walt, St{\'e}fan J and Gommers, Ralf and Virtanen, Pauli and Cournapeau, David and Wieser, Eric and Taylor, Julian and Berg, Sebastian and Smith, Nathaniel J and others},
journal={Nature},
volume={585},
number={7825},
pages={357--362},
year={2020},
publisher={Nature Publishing Group UK London},
doi={10.1038/s41586-020-2649-2}
}

@article{mckinney2011pandas,
title={pandas: a foundational Python library for data analysis and statistics},
author={McKinney, Wes and others},
journal={Python for high performance and scientific computing},
volume={14},
number={9},
pages={1--9},
year={2011},
publisher={Seattle}
}

@article{virtanen2020scipy,
title={SciPy 1.0: fundamental algorithms for scientific computing in Python},
author={Virtanen, Pauli and Gommers, Ralf and Oliphant, Travis E and Haberland, Matt and Reddy, Tyler and Cournapeau, David and Burovski, Evgeni and Peterson, Pearu and Weckesser, Warren and Bright, Jonathan and others},
journal={Nature methods},
volume={17},
number={3},
pages={261--272},
year={2020},
publisher={Nature Publishing Group},
doi={10.1038/s41592-019-0686-2}
}

@article{hunter2007matplotlib,
title={The matplotlib user’s guide},
author={Hunter, John and Dale, Darren},
journal={Matplotlib 0.90. 0 user’s guide},
year={2007}
}
34 changes: 18 additions & 16 deletions paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,30 @@ editor_options:

# Summary

CRNPy is a Python library developed for processing and analyzing cosmic-ray neutron counts recorded by stationary and roving moderated neutron probes (CRNP) for soil moisture sensing. The CRNPy library includes common routines for implementing atmospheric corrections, biomass corrections, road corrections, one- and two-dimensional filtering, horizontal and vertical footprint analysis, uncertainty estimation, depth extrapolation operators, device calibration, and conversion of neutron counts into volumetric soil water content. The library is designed to be user-friendly, versatile, and instrument agnostic to enable users the integration of the CRNPy library in a wide range of agricultural and hydrological applications.
CRNPy is a Python library that facilitates the processing, analysis, and conversion of raw cosmic-ray neutron counts obtained with stationary and roving cosmic-ray neutron probes (CRNP) into volumetric soil water content. The CRNPy library includes routines for atmospheric, biomass, and road corrections, along with one-dimensional and two-dimensional filtering. The library extends its utility by offering horizontal and vertical footprint determination, uncertainty estimation, depth extrapolation operators, and routines to assist users with field calibration. The design of the CRNPy library prioritizes reproducibility, ease of use, and compatibility across instruments, facilitating its adoption by manufacturers, end users, and researchers working to integrate non-invasive soil moisture sensing in agricultural and hydrological applications.

# Statement of Need

Cosmic ray neutron probes (CRNP) are crucial for non-invasive soil moisture sensing at the hectometer scale, bridging the gap between point-level sensors and large-scale satellite remote sensors. While processing CRNP data involves multiple corrections and filtering steps described in various peer-reviewed articles, CRNPy offers a comprehensive, user-friendly library with minimal dependencies. Unlike existing tools such as `crspy` [@power2021cosmic] which is an open-source tool for processing cosmic-ray neutron and soil moisture data, CRNPy does not necessitate specific naming conventions for input data or the download of large external data sources. Differentiating from existing tools like `corny` [@cornish_pasdy], which target CRNP data processing workflows, CRNPy introduces versatility and modularity. It not only reaches diverse research needs but also facilitates seamless integration into deployed cloud solutions or CRNP coupled with Systems-on-Chip (SoC), offering a broader range of applicability and customization.
Cosmic ray neutron probes (CRNP) are non-invasive soil moisture sensors that fill the niche between point-level and satellite sensors. However, the conversion of raw CRNP data into soil moisture requires multiple corrections and filtering steps that are described across various peer-reviewed articles. To circumvent this limitation and enhance reproducibility, the CRNPy library offers a simple, instrument-agnostic, and integrated solution with minimal dependencies. Compared to the existing `crspy`[@power2021cosmic] library, CRNPy avoids stringent data naming conventions and external data requirements. A flexible data naming convention enables a seamless integration with output files from different instrument manufacturers and the non-requirement of external data sources makes the library more compact (only ~65 KB) and straight forward to install. Compared to the `corny` [@cornish_pasdy] toolbox's GUI-based workflow, CRNPy's modular design based on Python functions promotes integration and reproducibility within data analysis pipelines and interactive development environments like Jupyter Lab notebooks. In addition, its straightforward installation using the Python Package Index, the minimal dependencies—most included with the Anaconda open-source ecosystem—and the comprehensive datasets with included examples in the form of Jupyter notebooks, provide an accessible start for CRNP data processing. The CRNPy library emphasizes easy maintenance and community-driven improvements since users can expand its capabilities by adding regular Python functions to the core module. The compact size and simple structure of the CRNPy library can also enable future integration into cloud-based services, IoT sensors, and system-on-chip technologies, broadening its use and customization potential.

# Library features

The CRNPy library includes common routines for creating workflows to process raw data from both stationary (\autoref{fig:workflow_stationary}) and roving (\autoref{fig:workflow_rover}) devices. Some of the notable features of the CRNPy library include:

- The entire CRNPy library is implemented on Python programming language using, Numpy, Pandas, SciPy, and Matplotlib libraries, which are included in common Python data science bundles like the Anaconda open source ecosystem.
- Utility functions for determining site-specific information required before processing raw neutron counts, including the determination of lattice water (i.e., bounded water to clay particles), geomagnetic cutoff rigidity [@smart2001geomagnetic], and searching for a reference neutron monitor [@2009NMDB].
- Delimited-text files can be used without the need to change column names, which increases reproducibility and minimizes human error. Each function of the CRNPy library accepts either a Numpy array or a Pandas Series, enabling a more versatile, modular, and customizable workflow that adapts to instrument outputs from different manufacturers. The CRNPy examples using multiple devices provide guidelines and a starting point for users getting started with CRNP devices.
- Outliers can be caused by hardware malfunction, vibrations, or external neutron sources (e.g., use of nearby neutron probe soil moisture meters like the 503 Hydroprobe by Instrotek, Inc.). The CRNPy library offers several methods for outliers detection using the `is_outlier()` method, which includes a simple range detection based on user-provided lower and upper boundaries, interquartile range, z-scores, and a scaled mean absolute difference [@iglewicz1993volume].
- The ability to compute the total raw neutron counts for CRNP devices with multiple neutron detectors.
- Implement corrections for atmospheric pressure using the `correction_pressure()` method as described by [@zreda2012cosmos], for air humidity using the `correction_humidity()` method following [@rosolem2013], and for incoming neutron flux using the `correction_incoming_flux()` method based on the guidelines from [@zreda2012cosmos; @hawdon2014calibration; @mcjannet2023incoming]. @andreasen2017status provide an overall description of these correction methods included in CRNPy. This step is essential to account for the effects of atmospheric conditions on neutron attenuation. \autoref{fig:output_stationary}a and \autoref{fig:output_stationary}b illustrate the impact of each correction on the raw neutron count observed with a stationary CRNP.
- Additional corrections may be necessary to account for the effects of other surrounding hydrogen pools, such as above- and below-ground plant biomass and road conditions, on the neutron counts. `biomass_to_bwe()` and `correction_bwe()` functions are used for biomass correction [@baatz2015empirical; @wahbi2018situ], while the road_correction() function is used for correcting for differences in road moisture and surrounding field soil moisture when doing mobile surveys [@schron2018cosmic]. These steps are optional and depend on the specific research needs and data conditions.
- The conversion of corrected counts into volumetric soil water content follows the approach suggested by [@desilets2010nature] using the `counts_to_vwc()` function.
- Neutron count uncertainty can estimated with the `uncertainty_counts()` function and propagated into the resulting volumetric water content using the `uncertainty_vwc()` function by following the method detailed in @jakobi2020error. \autoref{fig:output_stationary}c shows the neutron count uncertainty propagated to the volumetric water content.
- The `sensing_depth()` method allows the sensing depth estimation of the measured soil volumetric water content, following the approach of previous studies finding the volume that accounts for 86% (2 e-folds assuming an exponential decay) of the origin of the counted neutrons [@franz2012measurement; @schron2017improving].
- Because observations with CRNP devices typically represent the soil moisture conditions in the top 10-20 cm, an exponential filter operator [@albergel2008near] is provided to extrapolate soil moisture conditions at greater soil depths using the function `exp_filter()`, which can be used to extend soil moisture conditions in the rootzone [@rossini2021predicting; @franz2020practical]. \autoref{fig:output_stationary}d shows the variation of the sensing depth over time for a stationary CRNP.
- For roving devices, CRNPy includes a few utility functions for spatial filtering and basic interpolation routines with cubic, linear, nearest neighbor, and inverse distance weighting interpolation methods. \autoref{fig:output_rover} represents the output of CRNP rover transect, after being processed and interpolated using CRNPy.
The CRNPy library integrates standard routines for processing CRNP data, with features including:


- Utilization of core scientific Python libraries like Numpy [@harris2020array], Pandas [@mckinney2011pandas], SciPy [@virtanen2020scipy], and Matplotlib [@hunter2007matplotlib], that are readily available within the Anaconda environment. All CRNPy functions are compatible with Numpy arrays or Pandas series for robust data science functionality.
- Utility functions for obtaining site-specific lattice water, geomagnetic cutoff rigidity [@smart2001geomagnetic], and neutron monitor references [@2009NMDB], which are required for pre-processing raw neutron counts.
- Flexible input data handling from delimited text files without stringent naming conventions for columns, which keeps scripts simpler, increases reproducibility, and minimizes human error. This aspect also enables a more versatile, modular, and customizable workflow (\autoref{fig:workflow_stationary} and \autoref{fig:workflow_rover}) that adapts to instrument outputs from different manufacturers.
- Detection of possible outliers using range detection based on user-provided lower and upper boundaries, interquartile range, z-scores, and a scaled mean absolute difference [@iglewicz1993volume].
- Corrections for atmospheric pressure as described by @zreda2012cosmos, air humidity [@rosolem2013], and incoming neutron flux following the guidelines from @zreda2012cosmos; @hawdon2014calibration; @mcjannet2023incoming. The article by @andreasen2017status provides an overall description of these correction methods included in CRNPy (\autoref{fig:output_stationary}a and \autoref{fig:output_stationary}b).
- Corrections to account for additional hydrogen pools in above- and below-ground plant biomass [@baatz2015empirical; @wahbi2018situ].
- Corrections to account for the impact of road soil moisture conditions during roving surveys [@schron2018cosmic].
- Conversion of corrected counts into volumetric soil water content following the approach suggested by @desilets2010nature.
- Determination of neutron count uncertainty following the method detailed in @jakobi2020error (see \autoref{fig:output_stationary}c).
- Estimation of sensing depth by determining the volume that accounts for 86% of the origin of the counted neutrons [@franz2012measurement; @schron2017improving].
- An exponential filter operator [@albergel2008near] to extend near-surface soil moisture conditions to the rootzone [@rossini2021predicting; @franz2020practical], see \autoref{fig:output_stationary}d.
- Utility functions for spatial filtering and basic interpolation routines required to process CRNP rover surveys (see \autoref{fig:output_rover})


![Example workflow for stationary CRNP, dashed lines represent optional steps.\label{fig:workflow_stationary}](figures/workflow_rdt.png)

Expand Down

0 comments on commit e257e79

Please sign in to comment.