12 blitz::Array<double, 1> level_1b_sza(
const Level1b& Lev1)
15 for(
int i = 0; i < res.rows(); ++i)
20 double level_1b_sza_i(
const Level1b& Lev1,
int Spec_index)
25 blitz::Array<double, 1> level_1b_zen(
const Level1b& Lev1)
28 for(
int i = 0; i < res.rows(); ++i)
33 double level_1b_zen_i(
const Level1b& Lev1,
int Spec_index)
38 blitz::Array<double, 1> level_1b_azm(
const Level1b& Lev1)
41 for(
int i = 0; i < res.rows(); ++i) {
47 double level_1b_azm_i(
const Level1b& Lev1,
int Spec_index)
52 blitz::Array<double, 2> level_1b_stokes(
const Level1b& Lev1)
55 for(
int i = 0; i < res.rows(); ++i)
60 blitz::Array<double, 1> level_1b_radiance(
const Level1b& Lev1,
int Spec_index)
65 blitz::Array<double, 1> level_1b_uncertainty(
const Level1b& Lev1,
int Spec_index)
85 double level_1b_relative_velocity(
const Level1b& Lev1,
int i)
90 int level_1b_year(
const Level1b& Lev1,
int i)
92 boost::posix_time::ptime t = Lev1.
time(i);
94 return 1900 + to_tm(t).tm_year;
97 int level_1b_month(
const Level1b& Lev1,
int i)
99 boost::posix_time::ptime t = Lev1.
time(i);
101 return to_tm(t).tm_mon + 1;
104 int level_1b_day(
const Level1b& Lev1,
int i)
106 boost::posix_time::ptime t = Lev1.
time(i);
107 return to_tm(t).tm_mday;
110 int level_1b_hour(
const Level1b& Lev1,
int i)
112 boost::posix_time::ptime t = Lev1.
time(i);
113 return to_tm(t).tm_hour;
116 int level_1b_minute(
const Level1b& Lev1,
int i)
118 boost::posix_time::ptime t = Lev1.
time(i);
119 return to_tm(t).tm_min;
122 int level_1b_second(
const Level1b& Lev1,
int i)
124 boost::posix_time::ptime t = Lev1.
time(i);
125 return to_tm(t).tm_sec;
128 int level_1b_dayofyear(
const Level1b& Lev1,
int i)
130 boost::posix_time::ptime t = Lev1.
time(i);
131 return to_tm(t).tm_yday;
136 return l1b->signal(Spec_index, std::vector<int>());
145 .def(
"sza", &level_1b_sza)
146 .def(
"sza", &level_1b_sza_i)
148 .def(
"azm", &level_1b_azm)
149 .def(
"azm", &level_1b_azm_i)
151 .def(
"zen", &level_1b_zen)
152 .def(
"zen", &level_1b_zen_i)
154 .def(
"stokes_coef", &level_1b_stokes)
155 .def(
"year", &level_1b_year)
156 .def(
"month", &level_1b_month)
157 .def(
"day", &level_1b_day)
158 .def(
"hour", &level_1b_hour)
159 .def(
"minute", &level_1b_minute)
160 .def(
"second", &level_1b_second)
161 .def(
"dayofyear", &level_1b_dayofyear)
162 .def(
"radiance", &level_1b_radiance)
163 .def(
"uncertainty", &level_1b_uncertainty)
164 .def(
"uncertainty_with_unit", &level_1b_uncertainty_with_unit)
165 .def(
"radiance_with_unit", &level_1b_radiance_with_unit)
166 .def(
"radiance_spectral_range", &level_1b_radiance_spectral_range)
168 .def(
"signal", &l1b_signal_no_indexes)
169 .def(
"relative_velocity", &level_1b_relative_velocity)
179 .
def(luabind::constructor<>())
180 .
def("push_back", ((
pbt1) &
std::vector<
boost::shared_ptr<Level1b> >::push_back))
199 Unit orig_unit = sounding_azimuth(Spec_index).units;
200 double res = (180 + sounding_azimuth(Spec_index).convert(
units::deg).value) -
201 solar_azimuth(Spec_index).convert(
units::deg).value;
218 if(
rad.data().rows() ==0) {
224 Array<double, 1> used_rad;
225 if (Sample_indexes.size() == 0) {
226 used_rad.resize(
rad.data().rows());
227 used_rad =
rad.data();
229 used_rad.resize(Sample_indexes.size());
230 for(
int samp_idx = 0; samp_idx < (int) Sample_indexes.size(); samp_idx++) {
231 used_rad(samp_idx) =
rad.data()(Sample_indexes[samp_idx]);
234 std::sort(used_rad.data(), used_rad.data() + used_rad.rows());
235 used_rad.reverseSelf(firstDim);
236 Range avg_range(0, std::min(nrad - 1, used_rad.rows() - 1));
237 return DoubleWithUnit(sum(used_rad(avg_range) / avg_range.length()),
rad.units());
virtual Time time(int Spec_index) const =0
Time of sounding.
virtual DoubleWithUnit altitude(int i) const =0
Altitude.
virtual blitz::Array< double, 1 > stokes_coefficient(int i) const =0
Return stokes coefficients.
virtual SpectralRange radiance(int Spec_index) const =0
Radiance, for given spectral band.
To detect things like divide by zero, we may turn on floating point exceptions.
This is used to read a Level 1B file.
#define REGISTER_LUA_CLASS(X)
Apply value function to a blitz array.
virtual DoubleWithUnit latitude(int i) const =0
Latitude.
#define REGISTER_LUA_CLASS_NAME(X, Y)
const Unit & units() const
Units of data.
const blitz::Array< double, 1 > & uncertainty() const
Uncertainty.
virtual DoubleWithUnit relative_azimuth(int i) const
Realtive azimuth.
We frequently have a double with units associated with it.
virtual DoubleWithUnit longitude(int i) const =0
Longitude.
DoubleWithUnit convert(const Unit &R) const
Convert to the given units.
void(std::vector< std::string >::* pbt1)(const std::vector< std::string >::value_type &)
We have a number of different spectrums that appear in different parts of the code.
Libraries such as boost::units allow unit handling where we know the units at compile time...
virtual DoubleWithUnit sounding_zenith(int i) const =0
Sounding zenith.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
#define REGISTER_LUA_END()
def(luabind::constructor< int >()) .def("rows"
virtual DoubleWithUnit signal(int Spec_index, const std::vector< int > &Sample_indexes=std::vector< int >()) const
Calculate an approximation to the size of the continuum signal where there is no significant atmosphe...
virtual DoubleWithUnit solar_zenith(int i) const =0
Solar zenith.
virtual DoubleWithUnit relative_velocity(int Spec_index) const =0
Relative velocity.
const Unit rad("rad", 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0)
const blitz::Array< double, 1 > & data() const
Underlying data.
const Unit deg("deg", pi/180.0 *rad)
virtual int number_spectrometer() const =0
Number of spectrometers.