1 #ifndef SCATTER_MOMENT_INTERPOLATOR_H 2 #define SCATTER_MOMENT_INTERPOLATOR_H 3 #include <blitz/array.h> 4 #include <boost/shared_ptr.hpp> 25 const blitz::Array<double, 2>& Pf_mom1,
27 const blitz::Array<double, 2>& Pf_mom2)
28 : wn0(Wn1), pf0(Pf_mom1), delta_pf0((Pf_mom2 - Pf_mom1)/(Wn2 - Wn1))
41 blitz::Array<double, 2>
44 using namespace blitz;
46 Range ra(Range::all());
48 if(nummom == -1 || nummom - 1> pf0.rows())
49 r1 = Range(0, pf0.rows() - 1);
51 r1 = Range(0, nummom);
52 if(numscat == -1 || numscat > pf0.cols()) {
56 r2 = Range(0, numscat - 1);
59 int s1 = (nummom == -1 ? pf0.rows() : nummom + 1);
60 Array<double, 2> res(s1, s2);
61 if(nummom - 1 > pf0.rows())
63 res(r1, ra) = pf0(r1, r2) + delta_pf0(r1, r2) * (wn - wn0);
68 blitz::Array<double, 2> pf0;
69 blitz::Array<double, 2> delta_pf0;
77 while(xstart != xend) {
78 double x0 = *xstart++;
79 const blitz::Array<double, 2>& y0 = *ystart++;
83 const blitz::Array<double, 2>& y1 = *ystart;
90 blitz::Array<double, 2>
91 operator()(
double x,
int nummom = -1,
int nscatt = -1)
const 94 std::map<double, boost::shared_ptr<ScatteringMomentInterpolate2Point> >::const_iterator Itype;
95 Itype i = inter.lower_bound(x);
98 return (*inter.rbegin()->second)(x, nummom, nscatt);
100 return (*i->second)(x, nummom, nscatt);
103 std::map<double, boost::shared_ptr<ScatteringMomentInterpolate2Point> > inter;
#define range_max_check(V, Max)
Range check.
blitz::Array< double, 2 > operator()(double wn, int nummom=-1, int numscat=-1) const
Interpolate the data to give the phase function scattering moments for the given wave number...
ScatteringMomentInterpolate2Point(double Wn1, const blitz::Array< double, 2 > &Pf_mom1, double Wn2, const blitz::Array< double, 2 > &Pf_mom2)
Constructor, this takes the two wave numbers and scattering matrices to interpolate.
This is the base of the exception hierarchy for Full Physics code.
Apply value function to a blitz array.
The calculation of the phase function scattering matrix moments is fairly expensive.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
blitz::Array< double, 2 > operator()(double x, int nummom=-1, int nscatt=-1) const
ScatteringMomentInterpolate(I1 xstart, I1 xend, I2 ystart)