Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

TDDOforSnow

Code and data associated with the paper "Measurement of snowpack density, grain size, and black carbon concentration using timedomain diffuse optics" by Henley et al. 2025"

Code

(see comments for more detailed description)

Curve Fitting

estimateParamsXPwithNestedGridSearch.m Main script that reads measurement data and fits parametric photon diffusion model to measurements. Implements grid search algorithm described in Sec. 2.3 of text.

lossTableFn.m Performs a grid search for fit parameters (alpha, beta, gamma, delta) that minimize a Poisson Log-Likelihood loss function.

lossDerivatives.m Compute poisson log-likelihood loss that quanitifies goodness of fit of photon diffusion model to measured histogram. Also computes gradients and Hessians of loss with respect to fit parameters.

reflectanceDerivates.m Computes diffusion model output as a function of input parameters. Parametric model provided in Eq. 13 of text. Also computes first and second derivatives of diffusion curve with respect to model parameters.

dLfromdRwithAlpha.m Computes poisson loss (Eq. 16) of diffusion curve fit as well as it's derivative and Hessian using input measurements as well as model output and its derivatives.

llr_goodness_test.m Computes reduced deviance score to evaluate goodness of fit of parametric diffusion model fits. This script should be run immediately after the curve fit script (estimateParamsXPwithNestedGridSearch.m or estimateParamsMCwithNestedGridSearchRevised.m) without clearing the workspace. Goodness of fit evaluation is referenced in section 4.1.1 of the text.

Estimate Snow Properties

estimateSnowPropertiesB.m Script that estimates snow properties (ice volume fraction, grain size, and black carbon concentration) from fitted photon diffusion model parameters. Snow properties computed using equations provided in Sec. 2.3.3 of text.

estimateSnowPropertiesB_Cbc_0307.m Script that estimates snow properties (ice volume fraction, grain size, and black carbon concentration) from fitted photon diffusion model parameters. Snow properties computed using equations provided in Sec. 2.3.3 of text. This script was used to process data from the first of two soot addition experiments described in Section 4.2 of the text.

estimateSnowPropertiesB_Cbc_0310.m Script that estimates snow properties (ice volume fraction, grain size, and black carbon concentration) from fitted photon diffusion model parameters. Snow properties computed using equations provided in Sec. 2.3.3 of text. This script was used to process data from the first of two soot addition experiments described in Section 4.2 of the text.

computeVolFracAndCbcB.m Compute ice volume fraction and black carbon mass mixing ratio from fitted diffusion model parameters at two measurement wavelengths. Implements Eqs. 17 and 18 from text.

computeGrainRadiusB.m Compute snow grain radius from fitted diffusion model parameters at two measurement wavelengths. Implements Eq. 19 from text.

computeVolFracAndRadiusB.m Compute ice volume fraction and grain radius from fitted diffusion model parameters at one measurement wavelength. Assumes that absorption due to black carbon and other impurities is negligible. Implements Eqs. 20 and 21 from text.

Miscellaneous

estimateParamsMCwithNestedGridSearchRevised.m Script that reads measurement data and fits parametric photon diffusion model to simulated measurements generated with a monte-carlo photon transport simulation. Grid search algorithm is described in Sec. 2.3 of text. Primary difference with respect to the XP driver script concerns structure of input data--the fitting algorithm is the same. After curve fit parameters are obtained, snow properties (ice volume fraction, grain size, and black carbon mixing ratio) are computed for all combinations of 640 / 905 nm curve fits.

Data

Clean Snow Experiments

Data from experiments described in Section 4.1 of the text.

Experiments_011723/ Raw histogram measurements saved in "data640_011723.txt" (640 nm) and "data905_011723.txt" (905 nm). Curve fit results saved in "SRange_300x300nested_redone_usethisone.mat". Estimated snow properties saved in "Bmodel_results_rev.mat".

Experiments_012423/ Raw histogram measurements saved in "data640_012423.txt" (640 nm) and "data905_012423.txt" (905 nm). Curve fit results saved in "SRange_300x300nestedB.mat". Estimated snow properties saved in "Bmodel_results_rev.mat".

Experiments_012623/ Raw histogram measurements saved in "data640_012623.txt" (640 nm) and "data905_012623.txt" (905 nm). Curve fit results saved in "SRange_300x300nested.mat". Estimated snow properties saved in "Bmodel_results_rev.mat".

Experiments_021523/ Raw histogram measurements saved in "data640_021523.txt" (640 nm) and "data905_021523.txt" (905 nm). Curve fit results saved in "SRange_300x300nested.mat". Estimated snow properties saved in "Bmodel_results_rev.mat".

Experiments_021623/ Raw histogram measurements saved in "data640_021623.txt" (640 nm) and "data905_021623.txt" (905 nm). Curve fit results saved in "SRange_300x300nested.mat". Estimated snow properties saved in "Bmodel_results_rev.mat".

Soot Addition Experiments

Data from experiments described in Section 4.2 of the text, when varying amounts of black carbon were added to snow samples.

Experiments_030723/ Measurements corresponding to first set of soot addition experiments. Raw histogram measurements are saved in files with title format "dataXXX_YYYYYY_ZZZppbw.txt", where XXX is the measurement wavelength, YYYYYY is the date that the measurements were taken, and ZZZ was the expected concentration of soot added to the snow (this expected value turned out to be incorrect). Curve fit results for each soot concentration can be found in "SRange_300x300_ZZZppbw_nested.mat", where ZZZ again corresponds to expected concentration of added soot. Estimated snow properties saved in "Bmodel_results_rev.mat".

Experiments_031023/ Measurements corresponding to second set of soot addition experiments, when the amount of soot added to each sample was approximately doubled. Relevant files follow same naming convention as the first set of experiments.

Monte-carlo Simulations

Data from simulated measurements used to verify algorithms. Simulations are described in Section 2.3.4 of the text and results are shown in Figure 7.

mcForSanityPlotsRevised/ Raw MC data not included due to large file size (contact Connor Henley if you want it). Raw data was converted to time-of-flight histograms with added background. These histograms can be found in files "sim_w_BG_run_X.mat". The results plotted in Figure 7 were derived from "fitresults02.mat" and "fitresults03.mat".

About

Code and data associated with the paper "Measurement of snowpack density, grain size, and black carbon concentration using timedomain diffuse optics" by Henley et al. 2025"

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages