1 #include <boost/algorithm/string.hpp> 2 #include <boost/lexical_cast.hpp> 20 : aerosol(Aerosol), all_aer_names(All_aer_names) { initialize(); }
24 double minv = std::numeric_limits<double>::min();
25 double maxv = std::numeric_limits<double>::max();
27 Array<double, 2> aer_aod_matrix_(all_aer_names.size(), 4);
28 aer_aod_matrix_ = fill_value<double>();
30 for(
int out_aer_idx = 0; out_aer_idx < all_aer_names.size(); out_aer_idx++) {
31 auto match_iter = std::find(ret_aer_names.begin(), ret_aer_names.end(), all_aer_names[out_aer_idx]);
33 if(match_iter != ret_aer_names.end()) {
34 int in_aer_idx = std::distance(ret_aer_names.begin(), match_iter);
37 aer_aod_matrix_(out_aer_idx, 0) = aerosol->aerosol_optical_depth(in_aer_idx, minv, maxv);
40 aer_aod_matrix_(out_aer_idx, 1) = aerosol->aerosol_optical_depth(in_aer_idx, low_boundary, maxv);
43 aer_aod_matrix_(out_aer_idx, 2) = aerosol->aerosol_optical_depth(in_aer_idx, high_boundary, low_boundary);
46 aer_aod_matrix_(out_aer_idx, 3) = aerosol->aerosol_optical_depth(in_aer_idx, minv, high_boundary);
49 return aer_aod_matrix_;
53 Array<double, 2> aer_param_matrix_(all_aer_names.size(), max_num_param);
54 aer_param_matrix_ = fill_value<double>();
56 for(
int out_aer_idx = 0; out_aer_idx < all_aer_names.size(); out_aer_idx++) {
57 auto match_iter = std::find(ret_aer_names.begin(), ret_aer_names.end(), all_aer_names[out_aer_idx]);
59 if(match_iter != ret_aer_names.end()) {
60 int in_aer_idx = std::distance(ret_aer_names.begin(), match_iter);
64 throw Exception(
"Could not ast aerosol extinction into AerosolExctinctionImpBase");
66 Range param_r = Range(0, aer_ext->aerosol_parameter().rows()-1);
67 aer_param_matrix_(out_aer_idx, param_r) = aer_ext->aerosol_parameter();
70 return aer_param_matrix_;
74 Array<double, 2> aer_param_uncert_matrix_(all_aer_names.size(), max_num_param);
75 aer_param_uncert_matrix_ = fill_value<double>();
77 for(
int out_aer_idx = 0; out_aer_idx < all_aer_names.size(); out_aer_idx++) {
78 auto match_iter = std::find(ret_aer_names.begin(), ret_aer_names.end(), all_aer_names[out_aer_idx]);
80 if(match_iter != ret_aer_names.end()) {
81 int in_aer_idx = std::distance(ret_aer_names.begin(), match_iter);
85 throw Exception(
"Could not ast aerosol extinction into AerosolExctinctionImpBase");
87 Range param_r = Range(0, aer_ext->aerosol_parameter().rows()-1);
88 aer_param_uncert_matrix_(out_aer_idx, param_r) = aer_ext->aerosol_parameter_uncertainty();
91 return aer_param_uncert_matrix_;
99 blitz::Array<std::string, 1> out_aer_names(all_aer_names.size());
100 for(
int i; i < all_aer_names.size(); i++)
101 out_aer_names(i) = all_aer_names[i];
102 return out_aer_names;
109 ret_aer_names = aerosol->aerosol_name();
111 aer_model_types_.resize(all_aer_names.size());
112 aer_model_types_ =
"";
114 type_retrieved_.resize(all_aer_names.size());
119 for(
int out_aer_idx = 0; out_aer_idx < all_aer_names.size(); out_aer_idx++) {
120 auto match_iter = std::find(ret_aer_names.begin(), ret_aer_names.end(), all_aer_names[out_aer_idx]);
122 if(match_iter != ret_aer_names.end()) {
123 int in_aer_idx = std::distance(ret_aer_names.begin(), match_iter);
127 throw Exception(
"Could not ast aerosol extinction into AerosolExctinctionImpBase");
128 max_num_param = max(max_num_param, aer_ext->aerosol_parameter().rows());
130 aer_model_types_(out_aer_idx) = aer_ext->model_short_name();
131 type_retrieved_(out_aer_idx) = 1;
138 const double low_boundary = 800e2;
141 const double high_boundary = 500e2;
144 std::vector<std::string> all_aer_names;
145 std::vector<std::string> ret_aer_names;
148 Array<std::string, 1> aer_model_types_;
149 Array<int, 1> type_retrieved_;
154 : all_aer_names(All_aer_names)
163 throw Exception(
"Currently only support AerosolOptical");
198 double minv = std::numeric_limits<double>::min();
199 double maxv = std::numeric_limits<double>::max();
200 boost::function<double ()> func_tot_all =
203 out->register_data_source(
"/RetrievalResults/aerosol_total_aod", func_tot_all);
Array< double, 2 > aerosol_param_uncert_matrix() const
virtual void register_output_apriori(const boost::shared_ptr< Output > &out) const
Register apriori portions of class.
This is the base of the exception hierarchy for Full Physics code.
Array< double, 2 > aerosol_aod_matrix() const
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
double aerosol_optical_depth_total(double pmin=std::numeric_limits< double >::min(), double pmax=std::numeric_limits< double >::max()) const
This gives the total optical depth for each particle, plus adds the total optical depth for all parti...
Apply value function to a blitz array.
Array< double, 2 > aerosol_param_matrix() const
This class maintains the aerosol portion of the state.
blitz::Array< int, 1 > aerosol_type_retrieved() const
Implementation of Aerosol.
This registers the portions of the Aerosol class that should be written as output.
As described in the Output class, we have a decentralized model of producing output for L2 Full Physi...
AerosolConsolidatedOutput(const boost::shared_ptr< Aerosol > &Aerosol, const std::vector< std::string > &All_aer_names)
Constructor.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
#define REGISTER_LUA_END()
As a design principle, we have each base class with the absolutely minimum interface needed for use f...
AerosolOutputHelper(const boost::shared_ptr< AerosolOptical > &Aerosol, const std::vector< std::string > &All_aer_names)
virtual void register_output(const boost::shared_ptr< Output > &out) const
Register portions of class that will be written to output.
blitz::Array< std::string, 1 > aerosol_model_types() const
blitz::Array< std::string, 1 > all_aerosol_names() const