From d642dc8b8e154d80a7b8e029d989ae9a3115df31 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 17 Sep 2018 15:32:27 -0500 Subject: add absorption length data from SNOMAN This commit updates get_absorption_length_snoman_d2o() and get_absorption_length_h2o() to use absorption lengths from SNOMAN. Currently I'm just using the values from prod/media.dat but there are other media files in that directory that have values that seem to be actually measured using in-situ measurements (for example media_qoca_*.dat). I'm not 100% sure which ones to use so I am adding the default ones for now. --- src/optics.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/optics.c') diff --git a/src/optics.c b/src/optics.c index 9569865..af89802 100644 --- a/src/optics.c +++ b/src/optics.c @@ -1,5 +1,18 @@ #include #include "optics.h" +#include "misc.h" + +/* Absorption coefficients for H2O and D2O as a function of wavelength from + * SNOMAN. + * + * Note: These numbers come from prod/media.dat. + * + * FIXME: Should I be using the values from media_2_09.dat or media_qoca_*.cmd? */ +static double absorption_coefficient_h2o_wavelengths[7] = {250.0, 350.0, 400.0, 450.0, 500.0, 548.0, 578.0}; +static double absorption_coefficient_h2o[7] = {1e-5, 1e-5, 1.3e-5, 6.0e-5, 2.0e-4, 5.8e-4, 9.2e-4}; + +static double absorption_coefficient_d2o_wavelengths[7] = {254.0, 313.0, 366.0, 406.0, 436.0, 548.0, 578.0}; +static double absorption_coefficient_d2o[7] = {1e-5, 1e-5, 1e-5, 1e-5, 1e-5, 1e-5, 1e-5}; /* From Table 4 in the paper. */ static double A0 = 0.243905091; @@ -29,13 +42,13 @@ static double HC = 1.239841973976e3; double get_absorption_length_snoman_h2o(double wavelength) { /* Returns the absorption length in H2O in cm. */ - return 1e4; + return 1.0/interp1d(wavelength, absorption_coefficient_h2o_wavelengths, absorption_coefficient_h2o, sizeof(absorption_coefficient_h2o_wavelengths)/sizeof(absorption_coefficient_h2o_wavelengths[0])); } double get_absorption_length_snoman_d2o(double wavelength) { /* Returns the absorption length in D2O in cm. */ - return 1e4; + return 1.0/interp1d(wavelength, absorption_coefficient_d2o_wavelengths, absorption_coefficient_d2o, sizeof(absorption_coefficient_d2o_wavelengths)/sizeof(absorption_coefficient_d2o_wavelengths[0])); } double get_index(double p, double wavelength, double T) -- cgit