1 #include <boost/bind.hpp> 7 #include <boost/lexical_cast.hpp> 14 .def(luabind::constructor<
const blitz::Array<bool, 1>&,
bool,
15 const blitz::Array<double, 1>&,
27 (
const blitz::Array<bool, 1>& Flag_temp,
28 bool Flag_offset,
const blitz::Array<double, 1>& Temp,
32 : press_level(Press_level)
34 if(Flag_temp.rows() != Temp.rows())
35 throw Exception(
"Flag_temp and Temp need to be the same size");
36 Range trange(1, Flag_temp.rows());
37 Array<bool, 1> flag(Flag_temp.rows() + 1);
38 Array<double, 1> val(flag.shape());
39 flag(0) = Flag_offset;
41 flag(trange) = Flag_temp;
45 init(val, flag, Press,
true, 1);
62 std::vector<AutoDerivative<double> > plist;
63 std::vector<AutoDerivative<double> > tlist;
64 for(
int i = 0; i < press->pressure_grid().rows() - 1; ++i) {
65 plist.push_back(press->pressure_grid()(i).
value);
66 tlist.push_back(temperature_levels()(i));
68 int i = press->pressure_grid().rows() - 1;
69 double p1 = log(press_level->pressure_level()(i - 1));
71 t1 = temperature_levels()(i - 1);
72 double p2 = log(press_level->pressure_level()(i));
73 t2 = temperature_levels()(i);
75 plist.push_back(press->surface_pressure().value);
80 (
new lin_type(plist.begin(), plist.end(), tlist.begin()));
81 tgrid = boost::bind(&lin_type::operator(), lin, _1);
92 coefficient()(temperature_range()).
value(),
93 coefficient()(0).
value(), Press, press_level));
102 return "Temperature Offset (Kelvin)";
103 return "Temperature (Kelvin) for Pressure Level " +
104 boost::lexical_cast<std::string>(i);
116 res(coefficient()(temperature_range()).copy());
117 for(
int i = 0; i < res.
rows(); ++i)
118 res(i) = res(i) + coefficient()(0);
128 if(!used_flag_value()(0) ||
132 return sqrt(cov(0,0));
138 Os <<
"TemperatureFixedLevel:\n" 139 <<
" Temperature offset: " << temperature_offset() <<
"\n" 140 <<
" Retrieval flag offset: " << (used_flag_value()(0) ?
141 "True\n" :
"False\n")
142 <<
" Temperature:\n";
144 temp(coefficient()(temperature_range()));
145 opad << temp.
value() <<
"\n";
147 Os <<
" Temperature flag:\n";
148 opad << used_flag_value()(temperature_range()) <<
"\n";
ArrayAd< double, 1 > temperature_levels() const
Return the temperature on the fixed levels (which may include values from below the surface)...
This is a filtering stream that adds a pad to the front of every line written out.
This class takes a set of points and values, and linearly interpolates between those values...
virtual boost::shared_ptr< Temperature > clone() const
Clone a Temperature object.
double temperature_offset_uncertainty() const
Uncertainty of temperature offset.
This is the base of the exception hierarchy for Full Physics code.
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
TemperatureFixedLevel(const blitz::Array< bool, 1 > &Flag_temp, bool Flag_offset, const blitz::Array< double, 1 > &Temp, double T_offset, const boost::shared_ptr< Pressure > &Press, const boost::shared_ptr< PressureLevelInput > &Press_level)
Create an Temperature.
This class maintains the temperature portion of the state.
Apply value function to a blitz array.
const blitz::Array< T, D > & value() const
Contains classes to abstract away details in various Spurr Radiative Transfer software.
#define REGISTER_LUA_END()
virtual std::string state_vector_name_i(int i) const
Return state vector name for ith entry in coeff.
This class maintains the temperature portion of the state.
void calc_temperature_grid() const
This calculates temperature grid to use for layer retrieval.
double value(const FullPhysics::AutoDerivative< double > &Ad)
virtual void print(std::ostream &Os) const
Print to stream.