18 #include <athena/athena.hpp>
19 #include <athena/mesh/mesh.hpp>
22 #include <application/application.hpp>
23 #include <application/exceptions.hpp>
33 int nvalue,
int k,
int j)
const {
34 std::stringstream msg;
35 Application::Logger app(
"inversioon");
37 app->Log(
"JunoProfileInversion::CalculateFitTarget");
38 app->Log(
"model = " + std::to_string(
j));
41 throw ValueError(
"CalculateFitTarget",
"nvalue", prad->
GetNumBands(),
46 std::vector<Real> mus, tbs;
52 int ndir = pband->GetNumOutgoingRays();
56 for (
int n = 0; n < ndir; ++n) mus[n] = pband->GetCosinePolarAngle(n);
59 val[
b * 2] = pband->btoa(0, k,
j);
62 for (
int n = 0; n < ndir; ++n) tbs[n] = pband->btoa(n, k,
j);
64 Real tb45 =
interp1(cos(45. / 180. * M_PI), tbs.data(), mus.data(), ndir);
65 val[
b * 2 + 1] = (tbs[0] - tb45) / tbs[0] * 100.;
69 val[
b * 2] -= pband->btoa(0, k,
pmy_block_->js - 1);
72 for (
int n = 0; n < ndir; ++n)
73 tbs[n] = pband->btoa(n, k,
pmy_block_->js - 1);
75 tb45 =
interp1(cos(45. / 180. * M_PI), tbs.data(), mus.data(), ndir);
76 val[
b * 2 + 1] -= (tbs[0] - tb45) / tbs[0] * 100.;
MeshBlock const * pmy_block_
pointer to parent MeshBlock
void CalculateFitTarget(Radiation const *prad, Real *val, int nvalue, int k, int j) const override
std::shared_ptr< RadiationBand > GetBand(int i) const
Get band by index.
size_t GetNumBands() const
Get number of bands.
double interp1(double x, double const *data, double const *axis, size_t len)