6 #include <athena/mesh/mesh.hpp>
12 #include <application/application.hpp>
13 #include <application/exceptions.hpp>
20 int j,
int il,
int iu) {
21 throw NotImplementedError(
"RTSolverLambert::CalBandFlux");
29 auto &toa = pband->
toa_;
30 auto &tau = pband->
tau_;
31 auto &temf = pband->
temf_;
32 auto &spec = pband->
pgrid_->spec;
36 Real alpha = pband->
HasPar(
"alpha") ? pband->
GetPar<Real>(
"alpha") : 0.;
39 Real iu = pmb->ie + 1;
41 std::vector<Real> taut(iu + 1);
49 for (
int i = iu - 1; i >= il; --i) {
50 taut[i] = taut[i + 1] + tau(n, i) / rayOutput[m].mu;
52 0.5 * (temf[i + 1] * exp(-taut[i + 1]) + temf[i] * exp(-taut[i])) *
53 tau(n, i) / rayOutput[m].mu;
55 toa(n, m) += temf[il] * exp(-taut[il]);
57 if ((alpha > 0) && (taut[il] < 1000.)) {
58 toa(n, m) += temf[il] * alpha *
gammq(alpha, taut[il]) *
59 pow(taut[il], -alpha) * tgamma(alpha);
61 btoa(m, k,
j) += spec[n].wght * toa(n, m);
T GetPar(std::string const &name) const
Get parameter.
bool HasPar(std::string const &name) const
Check if a parameter exists.
void CalBandFlux(MeshBlock const *pmb, int k, int j, int il, int iu) override
void CalBandRadiance(MeshBlock const *pmb, int k, int j) override
std::vector< Real > temf_
temperature at cell boundary (face)
size_t GetNumOutgoingRays()
Get number of outgoing rays.
std::shared_ptr< SpectralGridBase > pgrid_
spectral grid
AthenaArray< Real > toa_
spectral bin top-of-the-atmosphere radiance
AthenaArray< Real > btoa
band top-of-the-atmosphere radiance
AthenaArray< Real > tau_
spectral bin optical depth
size_t GetNumSpecGrids() const
Get number of spectral grids.
std::vector< Direction > rayOutput_
outgoing rays
double gammq(double a, double x)