ReFRACtor
simple_fixed_spectrum_sampling.cc
Go to the documentation of this file.
2 
3 using namespace FullPhysics;
4 using namespace blitz;
5 
6 //-----------------------------------------------------------------------
10 //-----------------------------------------------------------------------
11 
13  double wn_end, double wn_step)
15 {
16  // 0.05 is a bit arbitrary, it is just "a little more than wn_end"
17  int nspec = (int) floor((wn_end + 0.05 * wn_step - wn_start) / wn_step) + 1;
18  Array<double, 1> wn(nspec);
19  for(int i = 0; i < nspec; ++i)
20  wn(i) = wn_start + i * wn_step;
21  spec_domain.push_back(SpectralDomain(wn));
22 }
23 
24 //-----------------------------------------------------------------------
27 //-----------------------------------------------------------------------
28 
30  double wn_start1, double wn_end1, double wn_step1,
31  double wn_start2, double wn_end2, double wn_step2,
32  double wn_start3, double wn_end3, double wn_step3)
34 {
35  int nspec1 = (int) floor((wn_end1 + 0.05 * wn_step1 - wn_start1) / wn_step1) + 1;
36  int nspec2 = (int) floor((wn_end2 + 0.05 * wn_step2 - wn_start2) / wn_step2) + 1;
37  int nspec3 = (int) floor((wn_end3 + 0.05 * wn_step3 - wn_start3) / wn_step3) + 1;
38  Array<double, 1> wn(nspec1);
39  for(int i = 0; i < nspec1; ++i)
40  wn(i) = wn_start1 + i * wn_step1;
41  spec_domain.push_back(SpectralDomain(wn.copy()));
42  wn.resize(nspec2);
43  for(int i = 0; i < nspec2; ++i)
44  wn(i) = wn_start2 + i * wn_step2;
45  spec_domain.push_back(SpectralDomain(wn.copy()));
46  wn.resize(nspec3);
47  for(int i = 0; i < nspec3; ++i)
48  wn(i) = wn_start3 + i * wn_step3;
49  spec_domain.push_back(SpectralDomain(wn.copy()));
50 }
51 
52 //-----------------------------------------------------------------------
54 //-----------------------------------------------------------------------
55 
56 void SimpleFixedSpectrumSampling::print(std::ostream& Os) const
57 {
58  Os << "SimpleFixedSpectrumSampling";
59  for(int i = 0; i < number_spectrometer(); ++i)
60  Os << " " << i + 1 << ":\n"
61  << " wn_start: " << spec_domain[i].data()(0) << "\n"
62  << " wn_end: " << spec_domain[i].data()(spec_domain[i].data().rows() - 1) << "\n"
63  << " wn_space: " << spec_domain[i].data()(1) - spec_domain[i].data()(0) << "\n";
64 }
SimpleFixedSpectrumSampling(double wn_start, double wn_end, double wn_step)
Constructor.
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO).
int number_spectrometer() const
Number of spectrometers we have.
virtual void print(std::ostream &Os) const
Print to stream.
Apply value function to a blitz array.
This determines the sampling of the spectrum that should be used for each of the spectrum indexes...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1

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