ReFRACtor
|
As described in the Output class, we have a decentralized model of producing output for L2 Full Physics. More...
#include <register_output_base.h>
Public Member Functions | |
virtual | ~RegisterOutputBase () |
virtual std::string | desc () const |
Description of object, to be printed to stream. More... | |
virtual void | print (std::ostream &Os) const |
Print to stream. More... | |
std::string | print_to_string () const |
Print to string. More... | |
virtual void | register_output (const boost::shared_ptr< Output > &out) const =0 |
Register portions of class that will be written to output. More... | |
virtual void | register_output_apriori (const boost::shared_ptr< Output > &out) const |
Register apriori portions of class. More... | |
As described in the Output class, we have a decentralized model of producing output for L2 Full Physics.
Rather than directly writing a value to a file, we register functions that can supply the values when requested. This has the advantage of keeping everything in sync
There isn't anything particularly special to register a function, just a call to Output::register_data_source. However as a matter of convention we collect all the functions that register data into classes found in the RegisterOutput directory, and derived from this RegisterOutputBase class. This class doesn't really give any special functionality, rather deriving from this class is a statement of intent that derived classes what to register output.
A reasonable implementation would be to have classes that supply output data register there intent themselves, so for example Atmosphere could have register_output function. However this would then couple these classes with our particular output model. You could imagine reusing Atmosphere class in other contexts which do not want to use this particular output model. So again as a matter of convention we use a separate class to register output, in this case AtmosphereOutput. We may decide at some point that these extra classes are unnecessarily complicated design, but for now we'll keep this division.
For many classes, we output different information for apriori state vector value vs. the final state vector value. So the registration is separated as two functions. Alternatively, we could have just had two different registration classes, but this is the way we've chosen.
Note that by convention that we "freeze" the state of the class when we register the apriori_output. This allows for things like the StateVector to be changed after wards without changing the apriori state.
Definition at line 45 of file register_output_base.h.
|
inlinevirtual |
Definition at line 47 of file register_output_base.h.
|
inlinevirtual |
Description of object, to be printed to stream.
This gives a cleaner interface for deriving from python.
Reimplemented in FullPhysics::HighResSpectrumOutput.
Definition at line 83 of file register_output_base.h.
|
inlinevirtual |
Print to stream.
The default calls the function "desc" that returns a string. This gives cleaner interface for deriving from this class in python, but most C++ classes will want to override this function rather than using desc.
Definition at line 76 of file register_output_base.h.
|
inlineinherited |
Print to string.
This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.
Definition at line 31 of file printable.h.
|
pure virtual |
Register portions of class that will be written to output.
This is for the final statevector, for classes where apriori and final are written out different.
Implemented in FullPhysics::AerosolConsolidatedOutput, FullPhysics::HighResSpectrumOutput, FullPhysics::ConnorSolverOutput, FullPhysics::MaxAPosterioriOutput, FullPhysics::StateVectorOutput, FullPhysics::AerosolAodOutput, FullPhysics::ErrorAnalysisOutput, FullPhysics::GroundBrdfOutput, FullPhysics::AltitudeOutput, FullPhysics::EmpiricalOrthogonalFunctionOutput, FullPhysics::AbsorberVmrFixedLevelOutput, FullPhysics::PressureFixedLevelOutput, FullPhysics::AbsorberAbscoOutput, FullPhysics::AerosolParamOutput, FullPhysics::DispersionPolynomialOutput, FullPhysics::GroundCoxmunkPlusLambertianOutput, FullPhysics::PressureOutput, FullPhysics::SpectralParametersOutput, FullPhysics::AbsorberVmrFixedLevelScaledOutput, FullPhysics::AbsorberVmrLevelOutput, FullPhysics::AbsorberVmrLevelScaledOutput, FullPhysics::AbsorberVmrMetOutput, FullPhysics::StandardForwardModelOutput, FullPhysics::TemperatureFixedLevelOutput, FullPhysics::ConnorConvergenceOutput, FullPhysics::DispersionFitOutput, FullPhysics::GroundCoxmunkOutput, FullPhysics::GroundLambertianOutput, FullPhysics::StokesCoefficientFractionOutput, FullPhysics::TemperatureLevelOffsetOutput, FullPhysics::TemperatureMetOutput, FullPhysics::RadianceScalingOutput, FullPhysics::GasVmrAprioriOutput, FullPhysics::SourceFilesOutput, FullPhysics::FluorescenceEffectOutput, and FullPhysics::MetPassThroughOutput.
|
inlinevirtual |
Register apriori portions of class.
The default is not to have anything written out, but derived classes can override this.
Note that by convention that we "freeze" the state of the class when we register the apriori_output. This allows for things like the StateVector to be changed after wards without changing the apriori state.
Reimplemented in FullPhysics::AerosolConsolidatedOutput, FullPhysics::HighResSpectrumOutput, FullPhysics::StateVectorOutput, FullPhysics::AltitudeOutput, FullPhysics::EmpiricalOrthogonalFunctionOutput, FullPhysics::AbsorberVmrFixedLevelOutput, FullPhysics::PressureFixedLevelOutput, FullPhysics::AbsorberAbscoOutput, FullPhysics::DispersionPolynomialOutput, FullPhysics::GroundBrdfOutput, FullPhysics::GroundCoxmunkPlusLambertianOutput, FullPhysics::PressureOutput, FullPhysics::AbsorberVmrFixedLevelScaledOutput, FullPhysics::AbsorberVmrLevelOutput, FullPhysics::AbsorberVmrLevelScaledOutput, FullPhysics::AbsorberVmrMetOutput, FullPhysics::TemperatureFixedLevelOutput, FullPhysics::AerosolParamOutput, FullPhysics::DispersionFitOutput, FullPhysics::GroundCoxmunkOutput, FullPhysics::GroundLambertianOutput, FullPhysics::StokesCoefficientFractionOutput, FullPhysics::TemperatureLevelOffsetOutput, FullPhysics::TemperatureMetOutput, FullPhysics::RadianceScalingOutput, FullPhysics::GasVmrAprioriOutput, and FullPhysics::FluorescenceEffectOutput.
Definition at line 67 of file register_output_base.h.