ReFRACtor
spectral_range.cc
Go to the documentation of this file.
1 #include "spectral_range.h"
2 
3 using namespace FullPhysics;
4 using namespace blitz;
5 
6 #ifdef HAVE_LUA
7 #include "register_lua.h"
8 typedef const blitz::Array<double, 1>& (SpectralRange::*ftype)() const;
10 .def("data", (ftype) &SpectralRange::data)
11 .def("units", &SpectralRange::units)
13 #endif
14 
15 //-----------------------------------------------------------------------
17 //-----------------------------------------------------------------------
18 
20 {
21  double conv = FullPhysics::conversion(units_, R);
22  Array<double, 1> dv(data_.value().shape()), uncer(uncertainty_.shape());
23  Array<double, 2> djac(data_.jacobian().shape());
24  dv = data_.value() * conv;
25  if(djac.cols() > 0)
26  djac = data_.jacobian() * conv;
27  if(uncer.rows() > 0)
28  uncer = uncertainty_ * conv;
29  return SpectralRange(ArrayAd<double, 1>(dv, djac), R, uncer);
30 }
double conversion(const Unit &Dunit_from, const Unit &Dunit_to)
Return conversion factor to go from one unit to another.
Definition: unit.cc:180
#define REGISTER_LUA_CLASS(X)
Definition: register_lua.h:116
Apply value function to a blitz array.
const Unit & units() const
Units of data.
We have a number of different spectrums that appear in different parts of the code.
Libraries such as boost::units allow unit handling where we know the units at compile time...
Definition: unit.h:25
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
SpectralRange convert(const Unit &R) const
Convert to given units.
const blitz::Array< double, 1 > & data() const
Underlying data.

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