7 static const char* stoke_names[] = {
"I",
"Q",
"U",
"V"};
8 static const int max_num_stokes = 4;
12 (
const SpectralDomain& Spec_domain,
int Spec_index,
bool Skip_jacobian)
const 14 firstIndex i1; secondIndex i2; thirdIndex i3;
20 stk.
reference(stokes_and_jacobian(Spec_domain, Spec_index));
26 if (olist.size() > 0) {
27 std::vector<boost::shared_ptr<NamedSpectrum> > stoke_spectrums;
28 for(
int stokes_idx = 0; stokes_idx < min(stk.
value().cols(), max_num_stokes); stokes_idx++) {
29 Array<double, 1> stoke_val(stk.
value()(Range::all(), stokes_idx));
30 Array<double, 2> stoke_jac(stk.
jacobian()(Range::all(), stokes_idx, Range::all()));
33 stoke_spectrums.push_back(stoke_ptr);
39 Array<double, 1> stokes_coef_sub(stokes_coef->stokes_coefficient().value()(Spec_index, Range(0, number_stokes() - 1)));
40 res.value() = sum(stk.
value()(i1, i2) * stokes_coef_sub(i2), i2);
41 if(!res.is_constant()) {
42 if(!stokes_coef->stokes_coefficient().is_constant()) {
43 Array<double, 2> stokes_coef_jac_sub(stokes_coef->stokes_coefficient().jacobian()(Spec_index, Range(0, number_stokes() - 1), Range::all()));
45 sum(stk.
jacobian()(i1, i3, i2) * stokes_coef_sub(i3), i3) +
46 sum(stk.
value()(i1, i3) * stokes_coef_jac_sub(i3, i2), i3);
49 sum(stk.
jacobian()(i1, i3, i2) * stokes_coef_sub(i3), i3);
50 }
else if(!stokes_coef->stokes_coefficient().is_constant()) {
51 Array<double, 2> stokes_coef_jac_sub(stokes_coef->stokes_coefficient().jacobian()(Spec_index, Range(0, number_stokes() - 1), Range::all()));
53 sum(stk.
value()(i1, i3) * stokes_coef_jac_sub(i3, i2), i3);
#define range_check(V, Min, Max)
Range check.
virtual Spectrum reflectance(const SpectralDomain &Spec_domain, int Spec_index, bool Skip_jacobian=false) const
Calculate reflectance for the given set of wavenumbers/wavelengths.
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO).
const blitz::Array< T, D+1 > jacobian() const
Adds name and spec index fields to a Spectrum.
Apply value function to a blitz array.
const blitz::Array< T, D > & value() const
This is a full spectrum, which contains a SpectralRange and SpectralDomain.
const Unit inv_sr("sr^-1", pow(sr, -1))
int number_variable() const
We have a number of different spectrums that appear in different parts of the code.
void reference(const ArrayAd< T, D > &V)
Contains classes to abstract away details in various Spurr Radiative Transfer software.
For GOSAT and OCO, we have a set of stokes coefficients to go from Stokes vector to radiation...