15 #include <athena/mesh/mesh.hpp>
21 #include <application/application.hpp>
30 Real
const *par, Real *val,
32 Application::Logger app(
"inversion");
40 app->Log(
"Calculate LogPosteriorProbability");
41 app->Log(
"I am walker = " + std::to_string(k - ks));
45 std::fill(*XpSample, *XpSample + (1 + NVAPOR) *
plevel_.size(), 0.);
53 for (
int i = 1; i <=
plevel_.size() - 2; ++i)
54 XpSample[m][i] = par[ip * (
plevel_.size() - 2) + i - 1];
55 XpSample[m][
plevel_.size() - 1] = 0.;
64 app->Log(
"run RT for model = " + std::to_string(
j));
72 Eigen::VectorXd misfit(nvalue);
79 for (
int m = 0; m < nvalue; ++m) misfit(m) = val[m] -
target_(m);
80 lnpost = -0.5 * misfit.transpose() *
icov_ * misfit;
85 app->Log(
"log posterir probability = " + std::to_string(lnpost));
89 return lnprior + lnpost;
virtual void CalculateFitTarget(Radiation const *prad, Real *val, int nvalue, int k, int j) const
MeshBlock const * pmy_block_
pointer to parent MeshBlock
virtual Real LogPriorProbability(Real **XpSample) const
Real LogPosteriorProbability(Radiation *prad, Hydro *phydro, Real const *par, Real *val, int k) const override
std::vector< Real > plevel_
void UpdateProfiles(Hydro *phydro, Real **XpSample, int k, int jl, int ju) const
void CalRadiance(MeshBlock const *pmb, int k, int j)
Calculate the radiance.
void NewCArray(T **&a, int n1, int n2)