ReFRACtor
ground_coxmunk.cc
Go to the documentation of this file.
1 #include "ground_coxmunk.h"
2 #include "polynomial_eval.h"
3 #include "ostream_pad.h"
4 
5 using namespace FullPhysics;
6 using namespace blitz;
7 
8 #ifdef HAVE_LUA
9 #include "register_lua.h"
11 .def(luabind::constructor<const double,
12  const bool&,
13  const blitz::Array<double, 1>&>())
15 #endif
16 
17 GroundCoxmunk::GroundCoxmunk(const double Windspeed,
18  const bool& Ws_flag,
19  const blitz::Array<double, 1>& Refr_index)
20  : SubStateVectorArray<Ground>(Windspeed, Ws_flag),
21  refractive_index_(Refr_index)
22 {
23 }
24 
25 ArrayAd<double, 1> GroundCoxmunk::surface_parameter(const double wn, const int spec_index) const
26 {
27  ArrayAd<double, 1> spars;
28  spars.resize(4, windspeed().number_variable());
29  spars(0) = windspeed();
30  spars(1) = refractive_index(spec_index);
31  spars(2) = 0;
32  // 0 = no shadowing, 1 = include shadowing
33  spars(3) = 0;
34  return spars;
35 }
36 
38 {
39  return coefficient()(0);
40 }
41 
42 const double GroundCoxmunk::refractive_index(const int Spec_idx) const
43 {
44  return refractive_index_(Spec_idx);
45 }
46 
48  return boost::shared_ptr<GroundCoxmunk>(new GroundCoxmunk(coefficient().value()(0), used_flag_value()(0), refractive_index_));
49 }
50 
51 std::string GroundCoxmunk::state_vector_name_i(int i) const {
52  return "Ground Coxmunk Windspeed";
53 }
54 
55 void GroundCoxmunk::print(std::ostream& Os) const
56 {
57  OstreamPad opad(Os, " ");
58  Os << "GroundCoxmunk:\n";
59  opad << "Windspeed: " << windspeed().value() << '\n'
60  << "Refractive Index: " << refractive_index_ << '\n';
61  opad.strict_sync();
62 }
63 
65 {
66  // Check that windspeed isn't negative.
67  if(windspeed().value() < 0)
68  throw Exception("Windspeed has gone negative");
69 }
GroundCoxmunk(const double Windspeed, const bool &Ws_flag, const blitz::Array< double, 1 > &Refr_index)
virtual const double refractive_index(const int Spec_idx) const
This is a filtering stream that adds a pad to the front of every line written out.
Definition: ostream_pad.h:32
virtual void print(std::ostream &Os) const
This is the base of the exception hierarchy for Full Physics code.
Definition: fp_exception.h:16
const blitz::Array< bool, 1 > & used_flag_value() const
virtual const AutoDerivative< double > windspeed() const
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Definition: register_lua.h:136
This class maintains the ground portion of the state.
Definition: ground.h:22
Apply value function to a blitz array.
void resize(const blitz::TinyVector< int, D > &Shape, int nvar)
Definition: array_ad.h:177
virtual void update_sub_state_hook()
Hook for anything a derived class needs to do after coefficient is updated and before notify_update...
const ArrayAd< double, 1 > & coefficient() const
It is common to have a class that is an Observable with a set of coefficients, a subset of which are ...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
const T & value() const
Convert to type T.
#define REGISTER_LUA_END()
Definition: register_lua.h:134
This class implements a Coxmunk ground type.
virtual ArrayAd< double, 1 > surface_parameter(const double wn, const int spec_index) const
Surface parmeters.
virtual boost::shared_ptr< Ground > clone() const
Clone a Ground object.
double value(const FullPhysics::AutoDerivative< double > &Ad)
virtual std::string state_vector_name_i(int i) const
Return state vector name for ith entry in coeff.

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