Canoe
Comprehensive Atmosphere N' Ocean Engine
vla_profile_inversion_target.cpp
Go to the documentation of this file.
1 
9 // C/C++ headers
10 #include <iomanip>
11 #include <iostream>
12 
13 // climath
14 #include <climath/interpolation.h>
15 #include <climath/linalg.h>
16 
17 // athena
18 #include <athena/athena.hpp>
19 #include <athena/mesh/mesh.hpp>
20 
21 // harp
22 #include <harp/radiation.hpp>
23 #include <harp/radiation_band.hpp>
24 
25 // application
26 #include <application/application.hpp>
27 #include <application/exceptions.hpp>
28 
29 // inversion
30 #include "profile_inversion.hpp"
31 
33  int nvalue, int k, int j) const {
34  std::stringstream msg;
35  Application::Logger app("inversion");
36 
37  app->Log("VLAProfileInversion::CalculateFitTarget");
38  app->Log("model = " + std::to_string(j));
39 
40  if (nvalue != prad->GetNumBands()) {
41  throw ValueError("CalculateFitTarget", "nvalue", prad->GetNumBands(),
42  nvalue);
43  }
44 
45  // 11. log likelihood
46  std::vector<Real> mus, tbs;
47 
48  for (int b = 0; b < prad->GetNumBands(); ++b) {
49  auto pband = prad->GetBand(b);
50 
51  // emission angles;
52  int ndir = pband->GetNumOutgoingRays();
53  mus.resize(ndir);
54  tbs.resize(ndir);
55 
56  for (int n = 0; n < ndir; ++n) mus[n] = pband->GetCosinePolarAngle(n);
57 
58  // brightness temperature
59  val[b] = prad->radiance(b, k, j);
60 
61  if (fit_differential_) {
62  // brightness temperature differential
63  val[b] -= pband->btoa(0, k, pmy_block_->js - 1);
64  }
65  }
66 
67  // app->Log("foward model results", val, nvalue);
68 }
bool fit_differential_
Definition: inversion.hpp:91
MeshBlock const * pmy_block_
pointer to parent MeshBlock
Definition: inversion.hpp:97
std::shared_ptr< RadiationBand > GetBand(int i) const
Get band by index.
Definition: radiation.hpp:47
size_t GetNumBands() const
Get number of bands.
Definition: radiation.hpp:44
AthenaArray< Real > radiance
radiance of all bands
Definition: radiation.hpp:29
void CalculateFitTarget(Radiation const *prad, Real *val, int nvalue, int k, int j) const override