ReFRACtor
solar_absorption_gfit_file.cc
Go to the documentation of this file.
2 #include "fp_exception.h"
3 
4 using namespace FullPhysics;
5 using namespace blitz;
6 
7 #ifdef HAVE_LUA
8 #include "register_lua.h"
9 
11 .def(luabind::constructor<const std::string&, double>())
13 #endif
14 
15 extern "C" {
16  void solar_pts(const int *lunr, const char* filename, const int* filename_len, const double *fzero, const double *grid, const double *frac, double *spts, const int *ncp);
17 }
18 
19 //-----------------------------------------------------------------------
25 //-----------------------------------------------------------------------
26 
27 SolarAbsorptionGfitFile::SolarAbsorptionGfitFile(const std::string& Line_list_file,
28  double Fraction_solar_diameter)
29 : line_list_file_(Line_list_file), fraction_solar_diameter_(Fraction_solar_diameter)
30 {
31 }
32 
33 //-----------------------------------------------------------------------
35 //-----------------------------------------------------------------------
36 
37 void SolarAbsorptionGfitFile::print(std::ostream& Os) const
38 {
39  Os << "Solar Absorption GFIT File:\n"
40  << " Fraction solar diameter: " << fraction_solar_diameter_;
41 }
42 
43 // See base class for description.
45 {
46  int lunr = 99;
47  // Set up inputs to match our grid
48  // V(i) = fzero + i * grid i = 1,NCP
49  double grid = spec_domain.data()(1) - spec_domain.data()(0);
50  double fzero = spec_domain.data()(0) - grid;
51  int ncp = spec_domain.data().rows();
52  Array<double, 1> spts(ncp);
53  int file_len = line_list_file_.length();
54  solar_pts(&lunr, line_list_file_.c_str(), &file_len, &fzero, &grid, &fraction_solar_diameter_, spts.dataFirst(), &ncp);
55 
56  return Spectrum(spec_domain, SpectralRange(spts, units::dimensionless));
57 }
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO).
const Unit dimensionless("dimensionless", 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Definition: register_lua.h:136
This class calculates the solar absorption spectrum.
This class calculates the solar absorption spectrum.
Apply value function to a blitz array.
void solar_pts(const int *lunr, const char *filename, const int *filename_len, const double *fzero, const double *grid, const double *frac, double *spts, const int *ncp)
This is a full spectrum, which contains a SpectralRange and SpectralDomain.
Definition: spectrum.h:18
We have a number of different spectrums that appear in different parts of the code.
virtual Spectrum solar_absorption_spectrum(const SpectralDomain &spec_domain) const
This calculates the solar absorption spectrum.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
#define REGISTER_LUA_END()
Definition: register_lua.h:134
const blitz::Array< double, 1 > & data() const
Return data.
SolarAbsorptionGfitFile(const std::string &Line_list_file, double Fraction_solar_diameter=1.0)
Read the given line list file, and use for calculating the solar absorption spectrum.
virtual void print(std::ostream &Os) const
Print description of object.

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:10