icedb  version 0.5.1
Snow particle scattering database API
Functions | Variables
icedb::refract::implementations Namespace Reference

The raw dielectric providers implementations. More...

Functions

void _init ()
 
void mWaterLiebe (double f, double t, std::complex< double > &m)
 
void mWaterFreshMeissnerWentz (double f, double t, std::complex< double > &m)
 
void mIceMatzler (double f, double t, std::complex< double > &m)
 
void mIceWarren (double f, double t, std::complex< double > &m)
 Ice complex refractive index for microwave/uv. More...
 
void mWaterHanel (double lambda, std::complex< double > &m)
 Water complex refractive index for ir/vis. More...
 
void mIceHanel (double lambda, std::complex< double > &m)
 Ice complex refractive index for ir/vis. More...
 
void mNaClHanel (double lambda, std::complex< double > &m)
 Sodium chloride refractive index for ir/vis. More...
 
void mSeaSaltHanel (double lambda, std::complex< double > &m)
 Sea salt refractive index for ir/vis. More...
 
void mDustHanel (double lambda, std::complex< double > &m)
 Dust-like particle refractive index for ir/vis. More...
 
void mSandOHanel (double lambda, std::complex< double > &m)
 Sand O-ray refractvie index for ir/vis (birefringent) More...
 
void mSandEHanel (double lambda, std::complex< double > &m)
 Sand E-ray refractive index for ir/vis (birefringent) More...
 

Variables

std::mutex m_refracts
 
all_providers_mp allProvidersSet
 
std::map< std::string, all_providers_mpprovidersSet
 
std::map< std::string, provider_mpprovidersByName
 
std::set< std::string > substs
 

Detailed Description

The raw dielectric providers implementations.

Function Documentation

◆ _init()

void icedb::refract::implementations::_init ( )

Definition at line 21 of file refract.cpp.

References icedb::refract::provider_s::FREQ, icedb::refract::provider_s::FREQTEMP, icedb::refract::provider_s::generate(), mDustHanel(), mIceHanel(), mIceMatzler(), mIceWarren(), mNaClHanel(), mSandEHanel(), mSandOHanel(), mSeaSaltHanel(), mWaterFreshMeissnerWentz(), mWaterHanel(), and mWaterLiebe().

Referenced by icedb::refract::findProvider(), icedb::refract::findProviderByName(), icedb::refract::findProviders(), and icedb::refract::listAllProviders().

21  {
22  std::lock_guard<std::mutex> lock(m_refracts);
23  static bool inited = false;
24  if (inited) return;
26 
27  std::shared_ptr<std::map<std::string, provider_p> > data(
28  new std::map<std::string, provider_p>);
29 
30  auto pmWaterLiebe = provider_s::generate(
31  "mWaterLiebe", "water",
32  "Liebe, H.J., Hufford, G.A. & Manabe, T. Int J Infrared Milli Waves (1991) 12: 659. doi:10.1007/BF01008897",
33  "",
34  provider_s::spt::FREQTEMP, (void*)mWaterLiebe)
35  ->addReq("spec", "GHz", 0, 1000)->addReq("temp", "K", 273.15, 373.15)->registerFunc();
36  auto pmWaterFreshMeissnerWentz = provider_s::generate(
37  "mWaterFreshMeissnerWentz", "water",
38  "T. Meissner and F. J. Wentz, \"The complex dielectric constant of pure and sea water from microwave satellite observations\", IEEE Trans. Geosci. Remote Sensing, vol. 42, no.9, pp. 1836-1849, September 2004.",
39  "For pure water (no salt)",
40  provider_s::spt::FREQTEMP, (void*)mWaterFreshMeissnerWentz)
41  ->addReq("spec", "GHz", 0, 500)->addReq("temp", "K", 253.15, 313.15)->registerFunc();
42  auto pmIceMatzler = provider_s::generate(
43  "mIceMatzler", "ice",
44  "Thermal Microwave Radiation: Applications for Remote Sensing, "
45  "Chapter 5, Microwave dielectric properties of ice, "
46  "By Christian Matzler(2006)",
47  "",
48  provider_s::spt::FREQTEMP, (void*)mIceMatzler)
49  ->addReq("spec", "GHz", 0, 1000)->addReq("temp", "K", 0, 273.15)->registerFunc();
50  auto pmIceWarren = provider_s::generate(
51  "mIceWarren", "ice",
52  "Stephen G. Warren, \"Optical constants of ice from the ultraviolet to the microwave, \" Appl. Opt. 23, 1206-1225 (1984)",
53  "",
54  provider_s::spt::FREQTEMP, (void*)mIceWarren)
55  ->addReq("spec", "GHz", 0.167, 8600)->addReq("temp", "degC", -60, -1)->registerFunc();
56  auto pmWaterHanel = provider_s::generate(
57  "mWaterHanel", "water",
58  "Tables from Thomas Hanel. Not sure which paper.", "",
59  provider_s::spt::FREQ, (void*)mWaterHanel)
60  ->addReq("spec", "um", 0.2, 30000)->registerFunc(100);
61  auto pmIceHanel = provider_s::generate(
62  "mIceHanel", "ice",
63  "Tables from Thomas Hanel. Not sure which paper.", "",
64  provider_s::spt::FREQ, (void*)mIceHanel)
65  ->addReq("spec", "um", 0.2, 30000)->registerFunc(100);
66 
67  auto pmNaClHanel = provider_s::generate(
68  "mNaClHanel", "NaCl",
69  "Tables from Thomas Hanel. Not sure which paper.", "",
70  provider_s::spt::FREQ, (void*)mNaClHanel)
71  ->addReq("spec", "um", 0.2, 30000)->registerFunc(100);
72  auto pmSeaSaltHanel = provider_s::generate(
73  "mSeaSaltHanel", "SeaSalt",
74  "Tables from Thomas Hanel. Not sure which paper.", "",
75  provider_s::spt::FREQ, (void*)mSeaSaltHanel)
76  ->addReq("spec", "um", 0.2, 30000)->registerFunc(100);
77  auto pmDustHanel = provider_s::generate(
78  "mDustHanel", "Dust",
79  "Tables from Thomas Hanel. Not sure which paper.", "",
80  provider_s::spt::FREQ, (void*)mDustHanel)
81  ->addReq("spec", "um", 0.2, 300)->registerFunc(100);
82  auto pmSandOHanel = provider_s::generate(
83  "mSandOHanel", "Sand_O",
84  "Tables from Thomas Hanel. Not sure which paper.", "",
85  provider_s::spt::FREQ, (void*)mSandOHanel)
86  ->addReq("spec", "um", 0.2, 300)->registerFunc(100);
87  auto pmSandEHanel = provider_s::generate(
88  "mSandEHanel", "Sand_E",
89  "Tables from Thomas Hanel. Not sure which paper.", "",
90  provider_s::spt::FREQ, (void*)mSandEHanel)
91  ->addReq("spec", "um", 0.2, 300)->registerFunc(100);
92 
93  inited = true;
94  }
void mIceWarren(double f, double t, std::complex< double > &m)
Ice complex refractive index for microwave/uv.
void mWaterHanel(double lambda, std::complex< double > &m)
Water complex refractive index for ir/vis.
void mIceMatzler(double f, double t, std::complex< double > &m)
void mNaClHanel(double lambda, std::complex< double > &m)
Sodium chloride refractive index for ir/vis.
void mSandEHanel(double lambda, std::complex< double > &m)
Sand E-ray refractive index for ir/vis (birefringent)
void mSandOHanel(double lambda, std::complex< double > &m)
Sand O-ray refractvie index for ir/vis (birefringent)
void mDustHanel(double lambda, std::complex< double > &m)
Dust-like particle refractive index for ir/vis.
std::multimap< int, provider_p > provider_collection_type
Definition: refract.hpp:55
void mWaterLiebe(double f, double t, std::complex< double > &m)
void mWaterFreshMeissnerWentz(double f, double t, std::complex< double > &m)
std::shared_ptr< provider_collection_type > all_providers_mp
Definition: refract.hpp:57
all_providers_mp allProvidersSet
Definition: refract.cpp:17
void mIceHanel(double lambda, std::complex< double > &m)
Ice complex refractive index for ir/vis.
void mSeaSaltHanel(double lambda, std::complex< double > &m)
Sea salt refractive index for ir/vis.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mDustHanel()

void icedb::refract::implementations::mDustHanel ( double  lambda,
std::complex< double > &  m 
)

Dust-like particle refractive index for ir/vis.

Definition at line 569 of file refractImpl.cpp.

References ICEDB_log, icedb::logging::ICEDB_LOG_DEBUG_2, ICEDB_throw, anonymous_namespace{refractImpl.cpp}::setupHanelB(), and icedb::error::xModelOutOfRange.

Referenced by _init().

570 {
571  if (lambda < 0.2 || lambda > 300)
573  .add<double>("Wavelength (um)", lambda)
574  .add<std::string>("Reason", "Allowed wavelength range (um) is (0.2,300).");
575  //double wvlen = icedb::units::conv_spec("GHz", "mm").convert(f);
576  array<double, 1> args = { lambda };
577  m = std::complex<double>(setupHanelB(hanelBmedium::DUST_LIKE_RE)->interp(args),
578  -1.0 * setupHanelB(hanelBmedium::DUST_LIKE_IM)->interp(args));
579  ICEDB_log("refract", icedb::logging::ICEDB_LOG_DEBUG_2, "mDustHanel result for lambda: " << lambda << " is " << m);
580 }
#define ICEDB_throw(x)
Definition: error.hpp:88
std::shared_ptr< InterpMultilinear< 1, double > > setupHanelB(hanelBmedium m)
#define ICEDB_log(c, p, x)
Definition: logging.hpp:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mIceHanel()

void icedb::refract::implementations::mIceHanel ( double  lambda,
std::complex< double > &  m 
)

Ice complex refractive index for ir/vis.

Definition at line 529 of file refractImpl.cpp.

References ICEDB_log, icedb::logging::ICEDB_LOG_DEBUG_2, ICEDB_throw, anonymous_namespace{refractImpl.cpp}::setupHanelA(), and icedb::error::xModelOutOfRange.

Referenced by _init().

530 {
531  if (lambda < 0.2 || lambda > 30000)
533  .add<double>("Wavelength (um)", lambda)
534  .add<std::string>("Reason", "Allowed wavelength range (um) is (0.2,30000).");
535 
536  array<double, 1> args = { lambda };
537  m = std::complex<double>(setupHanelA(hanelAmedium::ICE_RE)->interp(args),
538  -1.0 * setupHanelA(hanelAmedium::ICE_IM)->interp(args));
539  ICEDB_log("refract", icedb::logging::ICEDB_LOG_DEBUG_2, "mIceHanel result for lambda: " << lambda << " is " << m);
540 }
std::shared_ptr< InterpMultilinear< 1, double > > setupHanelA(hanelAmedium m)
Definition: refractImpl.cpp:20
#define ICEDB_throw(x)
Definition: error.hpp:88
#define ICEDB_log(c, p, x)
Definition: logging.hpp:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mIceMatzler()

void icedb::refract::implementations::mIceMatzler ( double  f,
double  t,
std::complex< double > &  m 
)

Ice complex refractive index Christian Matzler (2006)

Definition at line 360 of file refractImpl.cpp.

References ICEDB_log, icedb::logging::ICEDB_LOG_DEBUG_2, ICEDB_throw, and icedb::error::xModelOutOfRange.

Referenced by _init().

361 {
362  if (f < 0 || f > 1000 || t > 273.15)
364  .add<double>("Frequency (GHz)", f)
365  .add<double>("Temperature (K)", t)
366  .add<std::string>("Reason", "Allowed freq. range (GHz) is (0,1000), and allowed temp. range is <= 273.15 K.");
367 
368  double er = 0;
369  if (t>243.0)
370  er = 3.1884 + 9.1e-4*(t - 273.0);
371  else
372  er = 3.1611 + 4.3e-4*(t - 243.0);
373  // Imaginary part
374  double theta = 300.0 / (t)-1.0;
375  double alpha = (0.00504 + 0.0062*theta)*exp(-22.1*theta);
376  double dbeta = exp(-9.963 + 0.0372*(t - 273.16));
377  const double B1 = 0.0207;
378  const double B2 = 1.16e-11;
379  const double b = 335;
380  double betam = B1 / t*exp(b / t) / pow((exp(b / t) - 1.0), 2) + B2*pow(f, 2.0);
381  double beta = betam + dbeta;
382  double ei = alpha / f + beta*f;
383  std::complex<double> e(er, -ei);
384  m = sqrt(e);
386  "mIceMatzler result for freq: " << f << " GHz and temp " << t << " K is " << m);
387 }
#define ICEDB_throw(x)
Definition: error.hpp:88
#define ICEDB_log(c, p, x)
Definition: logging.hpp:45
Here is the caller graph for this function:

◆ mIceWarren()

void icedb::refract::implementations::mIceWarren ( double  f,
double  t,
std::complex< double > &  m 
)

Ice complex refractive index for microwave/uv.

Definition at line 389 of file refractImpl.cpp.

References icedb::units::converter::convert(), ICEDB_log, icedb::logging::ICEDB_LOG_DEBUG_2, ICEDB_throw, anonymous_namespace{refractImpl.cpp}::m_setup, and icedb::error::xModelOutOfRange.

Referenced by _init().

390 {
391  if (f < 0.167 || f > 8600 || t > -1 || t < -60)
393  .add<double>("Frequency (GHz)", f)
394  .add<double>("Temperature (degC)", t)
395  .add<std::string>("Reason", "Allowed freq. range (GHz) is (0.167,8600), and allowed temp. range is -60 - -1 deg C.");
396 
397  // Warren table 2 is used for interpolation
398  static bool setup = false;
399  static std::vector<double> tempCs, wavelengths;
400  static std::vector<double > vals_re, vals_im;
401  static std::shared_ptr<InterpMultilinear<2, double > > interp_ML_warren_re, interp_ML_warren_im;
402  auto setupWarren = [&]()
403  {
404  std::lock_guard<std::mutex> lock(m_setup);
405  if (setup) return;
406 
407  tempCs.push_back(-1); tempCs.push_back(-5); tempCs.push_back(-20); tempCs.push_back(-60);
408  wavelengths.reserve(62);
409  vals_re.reserve(600); vals_im.reserve(600);
410 
411  // First wavelength is at tbl[0], last is at tbl[549]
412  static const double tbl[] = {
413  .1670, 1.8296, 8.30e-2, 1.8296, 8.30e-2, 1.8296, 8.30e-2, 1.8296, 8.30e-2,
414  .1778, 1.8236, 6.90e-2, 1.8236, 6.90e-2, 1.8236, 6.90e-2, 1.8236, 6.90e-2,
415  .1884, 1.8315, 5.70e-2, 1.8315, 5.70e-2, 1.8315, 5.70e-2, 1.8315, 5.70e-2,
416  .1995, 1.8275, 4.56e-2, 1.8275, 4.56e-2, 1.8275, 4.56e-2, 1.8275, 4.45e-2,
417  .2113, 1.8222, 3.79e-2, 1.8222, 3.79e-2, 1.8222, 3.79e-2, 1.8222, 3.55e-2,
418  .2239, 1.8172, 3.14e-2, 1.8172, 3.14e-2, 1.8172, 3.14e-2, 1.8172, 2.91e-2,
419  .2371, 1.8120, 2.62e-2, 1.8120, 2.62e-2, 1.8120, 2.62e-2, 1.8120, 2.44e-2,
420  .2512, 1.8070, 2.24e-2, 1.8070, 2.24e-2, 1.8070, 2.19e-2, 1.8070, 1.97e-2,
421  .2661, 1.8025, 1.96e-2, 1.8025, 1.96e-2, 1.8025, 1.88e-2, 1.8025, 1.67e-2,
422  .2818, 1.7983, 1.76e-2, 1.7983, 1.76e-2, 1.7983, 1.66e-2, 1.7983, 1.40e-2,
423  .2985, 1.7948, 1.67e-2, 1.7948, 1.67e-2, 1.7948, 1.54e-2, 1.7948, 1.26e-2,
424  .3162, 1.7921, 1.62e-2, 1.7921, 1.60e-2, 1.7921, 1.47e-2, 1.7921, 1.08e-2,
425  .3548, 1.7884, 1.55e-2, 1.7884, 1.50e-2, 1.7884, 1.35e-2, 1.7884, 8.90e-3,
426  .3981, 1.7860, 1.47e-2, 1.7860, 1.40e-2, 1.7860, 1.25e-2, 1.7860, 7.34e-3,
427  .4467, 1.7843, 1.39e-2, 1.7843, 1.31e-2, 1.7843, 1.15e-2, 1.7843, 6.40e-3,
428  .5012, 1.7832, 1.32e-2, 1.7832, 1.23e-2, 1.7832, 1.06e-2, 1.7832, 5.60e-3,
429  .5623, 1.7825, 1.25e-2, 1.7825, 1.15e-2, 1.7825, 9.77e-3, 1.7825, 5.00e-3,
430  .6310, 1.7820, 1.18e-2, 1.7820, 1.08e-2, 1.7820, 9.01e-3, 1.7820, 4.52e-3,
431  .7943, 1.7817, 1.06e-2, 1.7817, 9.46e-3, 1.7816, 7.66e-3, 1.7815, 3.68e-3,
432  1.000, 1.7816, 9.54e-3, 1.7816, 8.29e-3, 1.7814, 6.52e-3, 1.7807, 2.99e-3,
433  1.259, 1.7819, 8.56e-3, 1.7819, 7.27e-3, 1.7816, 5.54e-3, 1.7801, 2.49e-3,
434  2.500, 1.7830, 6.21e-3, 1.7830, 4.91e-3, 1.7822, 3.42e-3, 1.7789, 1.55e-3,
435  5.000, 1.7843, 4.49e-3, 1.7843, 3.30e-3, 1.7831, 2.10e-3, 1.7779, 9.61e-4,
436  10.00, 1.7852, 3.24e-3, 1.7852, 2.22e-3, 1.7838, 1.29e-3, 1.7773, 5.95e-4,
437  20.00, 1.7862, 2.34e-3, 1.7861, 1.49e-3, 1.7839, 7.93e-4, 1.7772, 3.69e-4,
438  32.00, 1.7866, 1.88e-3, 1.7863, 1.14e-3, 1.7840, 5.70e-4, 1.7772, 2.67e-4,
439  35.00, 1.7868, 1.74e-3, 1.7864, 1.06e-3, 1.7840, 5.35e-4, 1.7772, 2.51e-4,
440  40.00, 1.7869, 1.50e-3, 1.7865, 9.48e-4, 1.7840, 4.82e-4, 1.7772, 2.29e-4,
441  45.00, 1.7870, 1.32e-3, 1.7865, 8.50e-4, 1.7840, 4.38e-4, 1.7772, 2.11e-4,
442  50.00, 1.7870, 1.16e-3, 1.7865, 7.66e-4, 1.7840, 4.08e-4, 1.7772, 1.96e-4,
443  60.00, 1.7871, 8.80e-4, 1.7865, 6.30e-4, 1.7839, 3.50e-4, 1.7772, 1.73e-4,
444  70.00, 1.7871, 6.95e-4, 1.7865, 5.20e-4, 1.7838, 3.20e-4, 1.7772, 1.55e-4,
445  90.00, 1.7872, 4.64e-4, 1.7865, 3.84e-4, 1.7837, 2.55e-4, 1.7772, 1.31e-4,
446  111.0, 1.7872, 3.40e-4, 1.7865, 2.96e-4, 1.7837, 2.12e-4, 1.7772, 1.13e-4,
447  120.0, 1.7872, 3.11e-4, 1.7865, 2.70e-4, 1.7837, 2.00e-4, 1.7772, 1.06e-4,
448  130.0, 1.7872, 2.94e-4, 1.7865, 2.52e-4, 1.7837, 1.86e-4, 1.7772, 9.90e-5,
449  140.0, 1.7872, 2.79e-4, 1.7865, 2.44e-4, 1.7837, 1.75e-4, 1.7772, 9.30e-5,
450  150.0, 1.7872, 2.70e-4, 1.7865, 2.36e-4, 1.7837, 1.66e-4, 1.7772, 8.73e-5,
451  160.0, 1.7872, 2.64e-4, 1.7865, 2.30e-4, 1.7837, 1.56e-4, 1.7772, 8.30e-5,
452  170.0, 1.7872, 2.58e-4, 1.7865, 2.28e-4, 1.7837, 1.49e-4, 1.7772, 7.87e-5,
453  180.0, 1.7872, 2.52e-4, 1.7865, 2.25e-4, 1.7837, 1.44e-4, 1.7772, 7.50e-5,
454  200.0, 1.7872, 2.49e-4, 1.7865, 2.20e-4, 1.7837, 1.35e-4, 1.7772, 6.83e-5,
455  250.0, 1.7872, 2.54e-4, 1.7865, 2.16e-4, 1.7837, 1.21e-4, 1.7772, 5.60e-5,
456  290.0, 1.7872, 2.64e-4, 1.7865, 2.17e-4, 1.7837, 1.16e-4, 1.7772, 4.96e-5,
457  320.0, 1.7872, 2.74e-4, 1.7865, 2.20e-4, 1.7837, 1.16e-4, 1.7772, 4.55e-5,
458  350.0, 1.7872, 2.89e-4, 1.7665, 2.25e-4, 1.7837, 1.17e-4, 1.7772, 4.21e-5,
459  380.0, 1.7872, 3.05e-4, 1.7865, 2.32e-4, 1.7837, 1.20e-4, 1.7772, 3.91e-5,
460  400.0, 1.7872, 3.15e-4, 1.7865, 2.39e-4, 1.7837, 1.23e-4, 1.7772, 3.76e-5,
461  450.0, 1.7872, 3.46e-4, 1.7865, 2.60e-4, 1.7837, 1.32e-4, 1.7772, 3.40e-5,
462  500.0, 1.7872, 3.82e-4, 1.7865, 2.86e-4, 1.7837, 1.44e-4, 1.7772, 3.10e-5,
463  600.0, 1.7872, 4.62e-4, 1.7865, 3.56e-4, 1.7837, 1.68e-4, 1.7772, 2.64e-5,
464  640.0, 1.7872, 5.00e-4, 1.7865, 3.83e-4, 1.7837, 1.80e-4, 1.7772, 2.51e-5,
465  680.0, 1.7872, 5.50e-4, 1.7865, 4.15e-4, 1.7837, 1.90e-4, 1.7772, 2.43e-5,
466  720.0, 1.7872, 5.95e-4, 1.7865, 4.45e-4, 1.7837, 2.09e-4, 1.7772, 2.39e-5,
467  760.0, 1.7872, 6.47e-4, 1.7865, 4.76e-4, 1.7837, 2.16e-4, 1.7772, 2.37e-5,
468  800.0, 1.7872, 6.92e-4, 1.7865, 5.08e-4, 1.7837, 2.29e-4, 1.7772, 2.38e-5,
469  840.0, 1.7872, 7.42e-4, 1.7865, 5.40e-4, 1.7837, 2.40e-4, 1.7772, 2.40e-5,
470  900.0, 1.7872, 8.20e-4, 1.7865, 5.86e-4, 1.7837, 2.60e-4, 1.7772, 2.46e-5,
471  1000., 1.7872, 9.70e-4, 1.7865, 6.78e-4, 1.7837, 2.92e-4, 1.7772, 2.66e-5,
472  2000., 1.7872, 1.95e-3, 1.7865, 1.28e-3, 1.7837, 6.10e-4, 1.7772, 4.45e-5,
473  5000., 1.7872, 5.78e-3, 1.7865, 3.55e-3, 1.7840, 1.02e-3, 1.7772, 8.70e-5,
474  8600., 1.7880, 9.70e-3, 1.7872, 5.60e-3, 1.7845, 1.81e-3, 1.7780, 1.32e-4
475  };
476 
477  for (size_t i = 0; i < 558; ++i)
478  {
479  if (i % 9 == 0) wavelengths.push_back(tbl[i]);
480  else if (i % 9 == 1 || i % 9 == 3 || i % 9 == 5 || i % 9 == 7) vals_re.push_back(tbl[i]);
481  else vals_im.push_back(tbl[i]);
482  }
483 
484  static std::vector< std::vector<double>::iterator > grid_iter_list;
485  grid_iter_list.push_back(tempCs.begin());
486  grid_iter_list.push_back(wavelengths.begin());
487 
488  // the size of the grid in each dimension
489  static std::array<size_t, 2> grid_sizes;
490  grid_sizes[0] = tempCs.size();
491  grid_sizes[1] = wavelengths.size();
492  // total number of elements
493  static size_t num_elements = grid_sizes[0] * grid_sizes[1];
494 
495  // construct the interpolator. the last two arguments are pointers to the underlying data
496  interp_ML_warren_re = std::shared_ptr<InterpMultilinear<2, double > >(new InterpMultilinear<2, double >
497  (grid_iter_list.begin(), grid_sizes.begin(), vals_re.data(), vals_re.data() + num_elements));
498  interp_ML_warren_im = std::shared_ptr<InterpMultilinear<2, double > >(new InterpMultilinear<2, double >
499  (grid_iter_list.begin(), grid_sizes.begin(), vals_im.data(), vals_im.data() + num_elements));
500 
501  setup = true;
502  };
503 
504 
505  setupWarren();
506 
507  // interpolate one value
508  double wvlen = icedb::units::conv_spec("GHz", "mm").convert(f);
509  std::array<double, 2> args = { wvlen, t - 273.15 };
510  m = std::complex<double>(interp_ML_warren_re->interp(args.begin()),
511  -1.0 * interp_ML_warren_im->interp(args.begin()));
512  ICEDB_log("refract", icedb::logging::ICEDB_LOG_DEBUG_2, "mIceWarren result for freq: " << f << " GHz, temp " << t << " K is " << m);
513 }
#define ICEDB_throw(x)
Definition: error.hpp:88
Perform interconversions between frequency, wavelength and wavenumber (GHz, Hz, m, cm, um, cm^-1, m^-1)
Definition: units.hpp:56
virtual double convert(double inVal) const
Definition: units.cpp:52
#define ICEDB_log(c, p, x)
Definition: logging.hpp:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mNaClHanel()

void icedb::refract::implementations::mNaClHanel ( double  lambda,
std::complex< double > &  m 
)

Sodium chloride refractive index for ir/vis.

Definition at line 542 of file refractImpl.cpp.

References ICEDB_log, icedb::logging::ICEDB_LOG_DEBUG_2, ICEDB_throw, anonymous_namespace{refractImpl.cpp}::setupHanelA(), and icedb::error::xModelOutOfRange.

Referenced by _init().

543 {
544  if (lambda < 0.2 || lambda > 30000)
546  .add<double>("Wavelength (um)", lambda)
547  .add<std::string>("Reason", "Allowed wavelength range (um) is (0.2,30000).");
548 
549  //double wvlen = icedb::units::conv_spec("GHz", "mm").convert(f);
550  array<double, 1> args = { lambda };
551  m = std::complex<double>(setupHanelA(hanelAmedium::NACL_RE)->interp(args),
552  -1.0 * setupHanelA(hanelAmedium::NACL_IM)->interp(args));
553  ICEDB_log("refract", icedb::logging::ICEDB_LOG_DEBUG_2, "mNaClHanel result for lambda: " << lambda << " is " << m);
554 }
std::shared_ptr< InterpMultilinear< 1, double > > setupHanelA(hanelAmedium m)
Definition: refractImpl.cpp:20
#define ICEDB_throw(x)
Definition: error.hpp:88
#define ICEDB_log(c, p, x)
Definition: logging.hpp:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mSandEHanel()

void icedb::refract::implementations::mSandEHanel ( double  lambda,
std::complex< double > &  m 
)

Sand E-ray refractive index for ir/vis (birefringent)

Definition at line 595 of file refractImpl.cpp.

References ICEDB_log, icedb::logging::ICEDB_LOG_DEBUG_2, ICEDB_throw, anonymous_namespace{refractImpl.cpp}::setupHanelB(), and icedb::error::xModelOutOfRange.

Referenced by _init().

596 {
597  if (lambda < 0.2 || lambda > 300)
599  .add<double>("Wavelength (um)", lambda)
600  .add<std::string>("Reason", "Allowed wavelength range (um) is (0.2,300).");
601  //double wvlen = icedb::units::conv_spec("GHz", "mm").convert(f);
602  array<double, 1> args = { lambda };
603  m = std::complex<double>(setupHanelB(hanelBmedium::SAND_E_RE)->interp(args),
604  -1.0 * setupHanelB(hanelBmedium::SAND_E_IM)->interp(args));
605  ICEDB_log("refract", icedb::logging::ICEDB_LOG_DEBUG_2, "mSandEHanel result for lambda: " << lambda << " is " << m);
606 }
#define ICEDB_throw(x)
Definition: error.hpp:88
std::shared_ptr< InterpMultilinear< 1, double > > setupHanelB(hanelBmedium m)
#define ICEDB_log(c, p, x)
Definition: logging.hpp:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mSandOHanel()

void icedb::refract::implementations::mSandOHanel ( double  lambda,
std::complex< double > &  m 
)

Sand O-ray refractvie index for ir/vis (birefringent)

Definition at line 582 of file refractImpl.cpp.

References ICEDB_log, icedb::logging::ICEDB_LOG_DEBUG_2, ICEDB_throw, anonymous_namespace{refractImpl.cpp}::setupHanelB(), and icedb::error::xModelOutOfRange.

Referenced by _init().

583 {
584  if (lambda < 0.2 || lambda > 300)
586  .add<double>("Wavelength (um)", lambda)
587  .add<std::string>("Reason", "Allowed wavelength range (um) is (0.2,300).");
588  //double wvlen = icedb::units::conv_spec("GHz", "mm").convert(f);
589  array<double, 1> args = { lambda };
590  m = std::complex<double>(setupHanelB(hanelBmedium::SAND_O_RE)->interp(args),
591  -1.0 * setupHanelB(hanelBmedium::SAND_O_IM)->interp(args));
592  ICEDB_log("refract", icedb::logging::ICEDB_LOG_DEBUG_2, "mSandOHanel result for lambda: " << lambda << " is " << m);
593 }
#define ICEDB_throw(x)
Definition: error.hpp:88
std::shared_ptr< InterpMultilinear< 1, double > > setupHanelB(hanelBmedium m)
#define ICEDB_log(c, p, x)
Definition: logging.hpp:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mSeaSaltHanel()

void icedb::refract::implementations::mSeaSaltHanel ( double  lambda,
std::complex< double > &  m 
)

Sea salt refractive index for ir/vis.

Definition at line 556 of file refractImpl.cpp.

References ICEDB_log, icedb::logging::ICEDB_LOG_DEBUG_2, ICEDB_throw, anonymous_namespace{refractImpl.cpp}::setupHanelA(), and icedb::error::xModelOutOfRange.

Referenced by _init().

557 {
558  if (lambda < 0.2 || lambda > 30000)
560  .add<double>("Wavelength (um)", lambda)
561  .add<std::string>("Reason", "Allowed wavelength range (um) is (0.2,30000).");
562  //double wvlen = icedb::units::conv_spec("GHz", "mm").convert(f);
563  array<double, 1> args = { lambda };
564  m = std::complex<double>(setupHanelA(hanelAmedium::SEASALT_RE)->interp(args),
565  -1.0 * setupHanelA(hanelAmedium::SEASALT_IM)->interp(args));
566  ICEDB_log("refract", icedb::logging::ICEDB_LOG_DEBUG_2, "mSeaSaltHanel result for lambda: " << lambda << " is " << m);
567 }
std::shared_ptr< InterpMultilinear< 1, double > > setupHanelA(hanelAmedium m)
Definition: refractImpl.cpp:20
#define ICEDB_throw(x)
Definition: error.hpp:88
#define ICEDB_log(c, p, x)
Definition: logging.hpp:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mWaterFreshMeissnerWentz()

void icedb::refract::implementations::mWaterFreshMeissnerWentz ( double  f,
double  t,
std::complex< double > &  m 
)

Water complex refractive index for microwave for 0 to 500 GHz, temps from -20 to 40 C. This one is for pure water (salinity = 0). There is also a model with salinity (TBI). Meissner and Wentz (2004)

Definition at line 316 of file refractImpl.cpp.

References ICEDB_log, icedb::logging::ICEDB_LOG_DEBUG_2, ICEDB_throw, and icedb::error::xModelOutOfRange.

Referenced by _init().

317 {
318  if (f < 0 || f > 500 || tK < 273.15)
320  .add<double>("Frequency (GHz)", f)
321  .add<double>("Temperature (K)", tK)
322  .add<std::string>("Reason", "Allowed freq. range (GHz) is (0,500), and temp. must be >= 273.15 K.");
323 
324  const double as[11] = {
325  5.7230, 0.022379, -0.00071237, 5.0478,
326  -0.070315, 0.00060059, 3.6143, 0.028841,
327  0.13652, 0.0014825, 0.00024166
328  };
329 
330  double tC = tK - 273.15;
331  if (tC < -20 || tC > 40)
333  .add<double>("Frequency (GHz)", f)
334  .add<double>("Temperature (K)", tK)
335  .add<std::string>("Reason", "Allowed temp. range (C) is (-20,40)");
336 
337 
338  // static dielectric constant for pure water (Stogryn)
339  double es = (37088.6 - (82.168*tC)) / (tC + 421.854);
340 
341  double e1 = as[0] + (as[1] * tC) + (as[2] * tC*tC);
342  double nu1 = (45 + tC) / (as[3] + (tC*as[4]) + (tC*tC*as[5]));
343  double einf = as[6] + (tC*as[7]);
344  double nu2 = (45 + tC) / (as[8] + (tC*as[9]) + (tC*tC*as[10]));
345  double sigma = 0;
346  // vacuum electric permittivity
347  const double oneover2pie0 = 17.97510; // GHz m / S
348 
349  using namespace std;
350  complex<double> eps;
351  eps = std::complex<double>(es - e1, 0) / (complex<double>(1, f / nu1));
352  eps += std::complex<double>(e1 - einf, 0) / (complex<double>(1, f / nu2));
353  eps += std::complex<double>(einf, -sigma * oneover2pie0 / f); // -sigma / (f*2.*pi*e0));
354  m = sqrt(eps);
356  "mWaterFreshMeissnerWentz result for freq: " << f << " GHz temp " << tK << " K is " << m);
357 }
STL namespace.
#define ICEDB_throw(x)
Definition: error.hpp:88
#define ICEDB_log(c, p, x)
Definition: logging.hpp:45
Here is the caller graph for this function:

◆ mWaterHanel()

void icedb::refract::implementations::mWaterHanel ( double  lambda,
std::complex< double > &  m 
)

Water complex refractive index for ir/vis.

Definition at line 516 of file refractImpl.cpp.

References ICEDB_log, icedb::logging::ICEDB_LOG_DEBUG_2, ICEDB_throw, anonymous_namespace{refractImpl.cpp}::setupHanelA(), and icedb::error::xModelOutOfRange.

Referenced by _init().

517 {
518  if (lambda < 0.2 || lambda > 30000)
520  .add<double>("Wavelength (um)", lambda)
521  .add<std::string>("Reason", "Allowed wavelength range (um) is (0.2,30000).");
522 
523  array<double, 1> args = { lambda };
524  m = std::complex<double>(setupHanelA(hanelAmedium::WATER_RE)->interp(args),
525  -1.0 * setupHanelA(hanelAmedium::WATER_IM)->interp(args));
526  ICEDB_log("refract", icedb::logging::ICEDB_LOG_DEBUG_2, "mWaterHanel result for lambda: " << lambda << " is " << m);
527 }
std::shared_ptr< InterpMultilinear< 1, double > > setupHanelA(hanelAmedium m)
Definition: refractImpl.cpp:20
#define ICEDB_throw(x)
Definition: error.hpp:88
#define ICEDB_log(c, p, x)
Definition: logging.hpp:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mWaterLiebe()

void icedb::refract::implementations::mWaterLiebe ( double  f,
double  t,
std::complex< double > &  m 
)

Water complex refractive index for microwave for 0 to 1000 GHz Liebe, Hufford and Manabe (1991)

Definition at line 292 of file refractImpl.cpp.

References ICEDB_log, icedb::logging::ICEDB_LOG_DEBUG_2, ICEDB_throw, and icedb::error::xModelOutOfRange.

Referenced by _init().

293 {
294  if (f < 0 || f > 1000 || t > 273.15)
296  .add<double>("Frequency (GHz)", f)
297  .add<double>("Temperature (K)", t)
298  .add<std::string>("Reason", "Allowed freq. range (GHz) is (0,1000), and allowed temp. range is <= 273.15 K.");
299 
300  double theta1 = 1.0 - (300.0 / t);
301  double eps0 = 77.66 - (103.3*theta1);
302  double eps1 = .0671*eps0;
303  double eps2 = 3.52;
304  double fp = (316.*theta1 + 146.4)*theta1 + 20.20;
305  double fs = 39.8*fp;
306  using namespace std;
307  complex<double> eps;
308  eps = std::complex<double>(eps0 - eps1, 0) / std::complex<double>(1.0, f / fp)
309  + std::complex<double>(eps1 - eps2, 0) / std::complex<double>(1.0, f / fs)
310  + std::complex<double>(eps2, 0);
311  m = sqrt(eps);
313  "mWaterLiebe result for freq: " << f << " temp " << t << " is " << m);
314 }
STL namespace.
#define ICEDB_throw(x)
Definition: error.hpp:88
#define ICEDB_log(c, p, x)
Definition: logging.hpp:45
Here is the caller graph for this function:

Variable Documentation

◆ allProvidersSet

all_providers_mp icedb::refract::implementations::allProvidersSet

◆ m_refracts

std::mutex icedb::refract::implementations::m_refracts

Definition at line 16 of file refract.cpp.

◆ providersByName

std::map<std::string, provider_mp> icedb::refract::implementations::providersByName

◆ providersSet

std::map<std::string, all_providers_mp> icedb::refract::implementations::providersSet

◆ substs

std::set<std::string> icedb::refract::implementations::substs