1 #ifndef L2_FP_CONFIGURATION_LUA_H 2 #define L2_FP_CONFIGURATION_LUA_H 53 const std::string& Out_file =
"out.h5")
54 : ls(
LuaState::load_file(Fname)), output_name_(Out_file) {}
63 const std::string& Out_file =
"out.h5")
64 : ls(Ls), output_name_(Out_file) {}
72 : ls(
LuaState::load_file(Argc > 0 ? Argv[0] :
"config.lua")),
73 output_name_(Argc > 1 ? Argv[1] :
"out.h5")
79 return ls->globals()[
"logger"].value_ptr<
LogImp>();
83 return ls->globals()[
"forward_model"].value_ptr<
ForwardModel>();
87 return ls->globals()[
"state_vector"].value_ptr<
StateVector>();
91 if (not ls->globals()[
"solver"].is_nil())
92 return ls->globals()[
"solver"].value_ptr<
ConnorSolver>();
98 return ls->globals()[
"initial_guess"].value_ptr<
InitialGuess>();
102 virtual void print(std::ostream& Os)
const { Os <<
"L2FpConfigurationLua"; }
107 if (not ls->globals()[
"iterative_solver"].is_nil())
114 if(not ls->globals()[
"stat_method_map"].is_nil())
115 return ls->globals()[
"stat_method_map"].value_ptr<
MaxAPosteriori>();
127 std::string output_name_;
L2FpConfigurationLua(const boost::shared_ptr< LuaState > &Ls, const std::string &Out_file="out.h5")
Take a LuaState that we've already generated the configuration stuff (e.g., this was created in pytho...
virtual boost::shared_ptr< MaxAPosteriori > max_a_posteriori() const
Maximum a posteriori.
void output_name(const std::string &F)
virtual boost::shared_ptr< StateVector > state_vector() const
Before running L2 full physics, we need to create the solver that we will be using, along with registering whatever output we will be generating.
The actual implementation of the Logger.
virtual boost::shared_ptr< IterativeSolver > iterative_solver() const
Iterative solver.
The base class for maximum a posteriori estimation.
The forward model represents the encapsulation of modeling spectra from an atmospheric state then app...
This handles informing a set of interested objects when the state vector has updated.
virtual ~L2FpConfigurationLua()
virtual boost::shared_ptr< LogImp > logger() const
Logger to use.
const std::string & output_name() const
Output file name.
L2FpConfigurationLua(const std::string &Fname, const std::string &Out_file="out.h5")
Read the given Lua configuration file.
virtual boost::shared_ptr< ForwardModel > forward_model() const
Forward model. Everything should be initialized to the initial guess.
L2FpConfigurationLua(int Argc, char **Argv)
Parse the arguments passed to the executable to set up configuration.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
virtual boost::shared_ptr< ConnorSolver > solver() const
Solver.
This is a light wrapper around the lua_state object.
The base class for all iterative optimizers.
This is an implementation of L2FpConfiguration that uses Lua.
This gets the initial guess and the apriori state vector values.
virtual void print(std::ostream &Os) const
virtual void output(boost::shared_ptr< Output > &Regular_output, boost::shared_ptr< Output > &Error_output) const
Create output, for both a normal run and for an error run (either or both can be null if we don't wan...
virtual boost::shared_ptr< InitialGuess > initial_guess() const
Initial guess.