70 fprintf(
ioQQQ,
"%7ld lines printed in main line array\n",
87 eina_v = (gf/gup)*TRANS_PROB_CONST*
POW2(enercm);
101 ASSERT( trans_prob > 0. );
108 GetGF_v = trans_prob*gup/TRANS_PROB_CONST/
POW2(enercm);
121 ASSERT(gl > 0. && enercm > 0. && gf >= 0.0 );
126 abscf_v = 1.4974e-6*(gf/gl)*(1e4/enercm);
141 double RefIndex_v = 1.;
144 double wlVacuum = wlAir;
145 for(
int i=0; i<2; ++i )
148 double WN = 1e4 / wlVacuum;
154 1e-8 * (8060.51 + 2480990.0 / (132.274 - WN2) + 17455.7 / (39.32957 - WN2));
156 wlVacuum = wlAir * RefIndex_v;
160 return( (
realnum)(wlAir * RefIndex_v) );
173 double RefIndex_v = 1.0;
179 double xl = EnergyWN * 1e-4;
184 RefIndex_v += 1e-8 * (8060.51 + 2480990.0 / (132.274 - xl) + 17455.7 / (39.32957 - xl));
187 ASSERT( RefIndex_v >= 1. );
188 return( RefIndex_v );
205 if( wavelength > 0. )
208 a = log10( wavelength+FLT_EPSILON);
218 errorwave = 5.f * (
realnum)
exp10( a - (
double)sig_figs );
233 const char *chComment,
259 if (wavelength > 0 && chInfo ==
't' )
324 const char *chComment )
329 const long int ipnt = LONG_MAX;
331 return lincom( xEmiss, xEmiss, wavelength, chLab, ipnt, chInfo, chComment,
true,
TransitionProxy() );
339 double emissivity_in ,
341 double emissivity_out ,
345 double emergent_in , emergent_out;
346 long int i = ipCont-1;
366 emergent_out = emissivity_out;
393 return( emergent_in + emergent_out );
398 double nonScatteredFraction)
404 static const bool DO_PROFILE =
false;
413 double LineWidth = dampXvel/damp;
414 LineWidth =
MIN2( 0.1 * SPEEDLIGHT, LineWidth );
415 double sigma = (LineWidth/SPEEDLIGHT);
418 ASSERT( ip3SigmaBlue >= ip3SigmaRed );
419 long numBins = ip3SigmaBlue - ip3SigmaRed + 1;
427 valarray<realnum> x(numBins);
428 valarray<realnum> profile(numBins);
430 for(
long ipBin=ip3SigmaRed; ipBin<=ip3SigmaBlue; ipBin++ )
432 fixit(
"Escape from zone will be dominated by line wings at"
433 " finite optical depth, so Voigt profile may be incorrect");
437 for(
long ipBin=ip3SigmaRed; ipBin<=ip3SigmaBlue; ipBin++ )
438 outline_base_bin(lgTransStackLine, ipBin, phots*profile[ipBin-ip3SigmaRed], inwd, nonScatteredFraction);
445 double nonScatteredFraction)
449 if (lgTransStackLine)
494 const char *chComment,
500 ASSERT( !lgOutToo || chInfo!=
'i' );
502 lincom(xEmiss, xEmissIsoBkg, wavelength, chLab, ipnt, chInfo, chComment,
false, tr );
508 if (lgOutToo && xEmiss > 0.)
516 const bool lgTransStackLine =
false;
517 const long int ip = ipnt - 1;
520 const double nonScatteredFraction = 1.;
522 outline_base(dampXvel, damp, lgTransStackLine, ip, phots, inwd, nonScatteredFraction);
542 const char *chComment )
545 lindst(0.0, 0.0, xEmiss, wavelength, chLab, ipnt, chInfo, lgOutToo, chComment);
565 const char *chComment )
568 lindst1(dampXvel,damp,xEmiss,xEmiss,wavelength,chLab,ipnt,chInfo,lgOutToo,chComment,
TransitionProxy());
582 const char *chComment)
590 fprintf(
ioQQQ,
"DEBUG lindst: %ld %4ld %15.8e %15.8e %15.8e %15.8e %15.8e\n",
597 t.
WLAng(), chLab, t.
ipCont(), chInfo, lgOutToo, chComment, t );
616 const int MAXFORLIN = 1000;
617 static long int ipForLin[MAXFORLIN]={0};
620 static long int nForLin;
625 ASSERT( wavelength >= 0. );
627 if( wavelength == 0. )
638 *ipnt = ipForLin[nForLin];
643 if( nForLin >= MAXFORLIN )
645 fprintf(
ioQQQ,
"PROBLEM %5ld lines is too many for PntForLine.\n",
647 fprintf(
ioQQQ,
" Increase the value of maxForLine everywhere in the code.\n" );
653 ipForLin[nForLin] =
ipLineEnergy(EnergyRyd,chLabel , 0);
654 *ipnt = ipForLin[nForLin];
689 double CollisionStrength;
693 if( ! ( CrsSectCM2 >= 0. && gLo >= 0. && E_ProjectileRyd >= 0. && reduced_mass_grams >= 0. ) )
695 fprintf(
ioQQQ,
"invalid parameter for ConvCrossSect2CollStr\n" );
699 CollisionStrength = CrsSectCM2 * gLo * E_ProjectileRyd / (PI*BOHR_RADIUS_CM*BOHR_RADIUS_CM);
703 CollisionStrength *= reduced_mass_grams / ELECTRON_MASS;
706 ASSERT( CollisionStrength >= 0. );
707 return CollisionStrength;
728 if( (chInfo !=
'i' && chInfo !=
'r') && chInfo !=
'c' )
730 fprintf(
ioQQQ,
" TOTLIN does not understand chInfo=%c\n",
764 if(
TauLine2[i].Coll().heat() > Strong )
777 if(
HFLines[i].Coll().heat() > Strong )
781 Strong =
HFLines[i].Coll().heat();
786 for (
int ipSpecies=0; ipSpecies <
nSpecies; ++ipSpecies)
789 em !=
dBaseTrans[ipSpecies].Emis().end(); ++em)
792 if( (*em).Tran().Coll().heat() > Strong )
801 fixit(
"all other line stacks need to be included here.");
823 double nphot = t.
Emis().
Aul() * Pesc * (*t.
Hi()).Pop();
824 nphot =
MAX2(0., nphot);
829 if( 0 && t.
chLabel() ==
"H 1 1215.67A" )
832 "\"%s\"\t %10g\t %10g\t %10g\t %10g\t %10g\t %10g\t %10g\n",
847 * ((*t.
Hi()).Pop() - (*t.
Lo()).Pop() * (*t.
Hi()).g() / (*t.
Lo()).g());
854 nphot =
MAX2(0., nphot);
realnum EnergyErg() const
realnum WavlenErrorGet(realnum wavelength, long sig_figs)
double widflx(size_t i) const
realnum * DiffuseLineEmission
double abscf(double gf, double enercm, double gl)
double eina(double gf, double enercm, double gup)
void set_xIntensity(const TransitionProxy &t)
void lindst(double xEmiss, realnum wavelength, const char *chLab, long int ipnt, char chInfo, bool lgOutToo, const char *chComment)
TransitionList HFLines("HFLines",&AnonStates)
bool lgPrintLineAirWavelengths
double RefIndex(double EnergyWN)
static void lindst1(double dampXvel, double damp, double xEmiss, double xEmissIsoBkg, realnum wavelength, const char *chLab, long int ipnt, char chInfo, bool lgOutToo, const char *chComment, const TransitionProxy &tr)
TransitionList TauLine2("TauLine2",&AnonStates)
double phots(const TransitionProxy &t)
double anu(size_t i) const
void PntForLine(double wavelength, const char *chLabel, long int *ipnt)
long int nflux_with_check
void outline_base_bin(bool lgTransStackLine, long int ip, double phots, realnum inwd, double nonScatteredFraction)
long ipoint(double energy_ryd)
double ConvRate2CS(realnum gHi, realnum rate)
realnum & dampXvel() const
double & xIntensity() const
EmissionList::reference Emis() const
LinSv * linadd(double xEmiss, realnum wavelength, const char *chLab, char chInfo, const char *chComment)
long ipLineEnergy(double energy, const char *chLabel, long ipIonEnergy)
const TransitionProxy FndLineHt(long int *level)
void LineStackCreate(void)
qList::iterator Hi() const
realnum wlAirVac(double wlAir)
double totlin(int chInfo)
qList::iterator Lo() const
realnum Pesc_total() const
double GetGF(double trans_prob, double enercm, double gup)
void VoigtU(realnum a, const realnum v[], realnum y[], int n)
vector< double, allocator_avx< double > > ExpZone
CollisionProxy Coll() const
#define DEBUG_ENTRY(funcname)
void outline_base(double dampXvel, double damp, bool lgTransStackLine, long int ip, double phots, realnum inwd, double nonScatteredFraction)
static vector< realnum > wavelength
double ConvCrossSect2CollStr(double CrsSectCM2, double gLo, double E_ProjectileRyd, double reduced_mass_grams)
int fprintf(const Output &stream, const char *format,...)
double emergent_line(double emissivity_in, double emissivity_out, long int ipCont)
double & xObsIntensity() const
static const long sig_figs_max
void init(long index, char chSumTyp, const char *chComment, const char *label, bool lgAdd, realnum wavelength, const TransitionProxy &tr)
vector< TransitionList > dBaseTrans
STATIC LinSv * lincom(double xEmiss, double xEmissIsoBkg, realnum wavelength, const char *chLab, long int ipnt, char chInfo, const char *chComment, bool lgAdd, const TransitionProxy &tr)