# Import modules
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import linregress
60 Calibration neutron probe
Neutron probes are instruments used in agricultural and hydrological research for measuring rootzone soil moisture. Neutron probes work by emitting fast neutrons (typically using a combination of Americum-241 and Beryllium) into the soil, which then collide with hydrogen atoms predominantly found in water molecules and lose much of their energy through these collisions. Thus, the intensity of fast neutrons is inversely correlated to the soil’s moisture content. Neutron probes consist of a sealed probe that contains the radioactive source, and a neutron detector for reading the neutron flux. For field operation, neutron probes require the installation of access tubes for the probe to be dropped into the soil at various depths.
Neutron probes are highly accurate, but they need to be calibrated for specific soil types. This calibration consists of comparing neutron counts with known measurements of volumetric water content. This exercise will demosntrate how to fit a linear model to a neutron probe calibration dataset.
# Read dataset
= pd.read_csv("../datasets/neutron_probe_calibration.csv")
df 3) df.head(
calibration | core | top_depth | bottom_depth | vwc | count_ratio | |
---|---|---|---|---|---|---|
0 | Dry | 1 | 30 | 60 | 0.279 | 1.63 |
1 | Dry | 1 | 60 | 90 | 0.259 | 1.54 |
2 | Dry | 1 | 90 | 120 | 0.265 | 1.46 |
# Extract columns into variables for easier notation
= df['vwc']
vwc_obs = df['count_ratio'] count_ratio_obs
# Inspect data
=(5,4))
plt.figure(figsize='w', edgecolor='k')
plt.scatter(count_ratio_obs, vwc_obs, facecolor"Count ratio")
plt.xlabel("Volumetric water content (cm$^3$/cm$^3$)")
plt.ylabel( plt.show()
# Fit linear model and get optimized slope and intercept
= linregress(count_ratio_obs, vwc_obs)
slope, intercept, rvalue, pvalue, sterr = rvalue**2
r_squared print(f"R-squared: {r_squared:.3f}")
R-squared: 0.915
# Use optimized model to create line
= np.linspace(1.2, 2.2)
count_ratio_line = intercept + slope * count_ratio_line vwc_line
# Compute root mean squared error (RMSE)
= intercept + slope * count_ratio_obs
vwc_pred = np.sqrt(np.nanmean((vwc_pred - vwc_obs)**2))
RMSE print(round(RMSE,3), "cm^3/cm^3")
0.019 cm^3/cm^3
# Create figure with regression line
=(5,4))
plt.figure(figsize=50, facecolor='w', alpha=0.5, edgecolor='k')
plt.scatter(count_ratio_obs, vwc_obs, s'-k')
plt.plot(count_ratio_line, vwc_line, "Count ratio")
plt.xlabel("Volumetric water content (cm$^3$/cm$^3$)")
plt.ylabel(1.2, 0.47, f"y = {intercept:.3f} + {slope:.3f}x", )
plt.text(1.2, 0.44, f"r-squared = {r_squared:.3f}",)
plt.text(1.2, 0.41, f"RMSE = {RMSE:.3f} cm$^3$/cm$^3$", )
plt.text( plt.show()
References
Evett, S.R., Tolk, J.A. and Howell, T.A., 2003. A depth control stand for improved accuracy with the neutron probe. Vadose Zone Journal, 2(4), pp.642-649.
Patrignani, A., Godsey, C.B., Ochsner, T.E. and Edwards, J.T., 2012. Soil water dynamics of conventional and no-till wheat in the Southern Great Plains. Soil Science Society of America Journal, 76(5), pp.1768-1775.
Patrignani, A., Godsey, C.B. and Ochsner, T.E., 2019. No-Till Diversified Cropping Systems for Efficient Allocation of Precipitation in the Southern Great Plains. Agrosystems, Geosciences & Environment, 2(1).