Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in continuum.c and cdf.c to allow the code to deal with continuum models #286

Merged
merged 9 commits into from
Aug 7, 2017
14 changes: 11 additions & 3 deletions source/bb.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ check_fmax(fmin,fmax,temp) This is a little helper routine written by NSH in Au
12nov ksl Removed some of the old Notes assocaited with this routine.
See version earlier than 74 for these old notes.
17jul nsh - changed references to PDFs to CDFs
17jul nsh - also changed how the BB cdf is generated - low alpha jumps were not really doing anything!
**************************************************************/

#define ALPHAMIN 0.4 // Region below which we will use a low frequency approximation
Expand Down Expand Up @@ -607,7 +608,7 @@ planck_d (alpha)
// Calculate the emittance of a bb between freqmin and freqmax
// Should integrate to sigma

//NSH - 17Jul - made change to if/else statement so that qromb used whenever bounds are not completely withing the tabulated bands.
//NSH - 17Jul - made change to if/else statement so that qromb used whenever bounds are not completely within the tabulated bands.
double
emittance_bb (freqmin, freqmax, t)
double freqmin, freqmax, t;
Expand All @@ -625,11 +626,18 @@ emittance_bb (freqmin, freqmax, t)



if (alphamin > ALPHAMIN && alphamax < ALPHAMAX)
if (alphamin > ALPHAMIN && alphamax < ALPHAMAX) //We are within the tabulated range
{
return (q1 * t * t * t * t * integ_planck_d (alphamin, alphamax));
}
else
else if (alphamax > ALPHABIG)
{
if (alphamin > ALPHABIG) //The whole band is above the point where we can sensibly integrate the BB function
return(0);
else //only the upper part of the band is above ALPHABIG
return (q1 * t * t * t * t * qromb (planck_d, alphamin, ALPHABIG, 1e-7));
}
else //We are outside the tabulated range and must integrate
{
return (q1 * t * t * t * t * qromb (planck_d, alphamin, alphamax, 1e-7));
}
Expand Down
Loading