40static double tnurbn[
NRUBIN] = {1.05E-08,1.05E-07,1.05E-06,1.04E-05,1.00E-04,1.00E-03,1.00E-02,3.01E-02,1.00E-01,
41 1.50E-01,2.50E-01,4.01E-01,6.01E-01,9.8E-01,9.96E-01,1.00E+00,1.02445,1.07266,1.12563,1.18411,1.23881,
42 1.29328,1.35881,1.42463,1.48981,1.55326,1.6166,1.68845,1.76698,1.8019,1.808,1.84567,1.9317,2.04891,2.14533,
43 2.19702,2.27941,2.37438,2.43137,2.49798,2.56113,2.59762,2.66597,2.80543,2.95069,3.02911,3.11182,3.22178,
44 3.3155,3.42768,3.50678,3.56157,3.61811,3.75211,3.89643,4.},
45 fnurbn[
NRUBIN] = {1.56E-20,1.55E-17,1.54E-14,1.53E-11,1.35E-08,1.34E-05,1.35E-02,3.62E-01,1.27E+01,
46 3.90E+01,1.48E+02,4.52E+02,1.02E+03,2.27E+03,8.69E+02,8.04E+02,6.58E+02,6.13E+02,6.49E+02,6.06E+02,
47 6.30E+02,5.53E+02,5.55E+02,5.24E+02,4.86E+02,4.49E+02,4.42E+02,3.82E+02,3.91E+02,2.91E+02,2.61E+02,
48 1.32E+02,1.20E+02,1.16E+02,9.56E+01,9.94E+01,9.10E+01,4.85E+01,7.53E+01,9.53E+01,8.52E+01,5.76E+01,
49 6.72E+01,5.20E+01,8.09E+00,3.75E+00,5.57E+00,3.80E+00,2.73E+00,2.22E+00,3.16E-01,1.26E-01,1.39E-01,
50 6.15E-02,3.22E-02,7.98E-03};
72static const double tnuHM96[
NHM96]={-8,-1.722735683,-0.351545683,-0.222905683,-0.133385683,
74-0.127655683,-0.004575683,0.297544317,0.476753,0.476756,0.588704317,
750.661374317,1.500814317,2.245164317};
78static const double fnuHM96[
NHM96]={-32.53342863,-19.9789,-20.4204,-20.4443,-20.5756,-20.7546,
79-21.2796,-21.6256,-21.8404,-21.4823,-22.2102,-22.9263,-23.32,-24.2865};
102 const double RESETFACTOR = 0.98;
111 power = (fluxlog[1] - fluxlog[0] ) / log10( tnu[1]/tnu[0] );
113 tnu[0] =
rfield.emm*RESETFACTOR;
114 fluxlog[0] = fluxlog[1] + power * log10( tnu[0] /tnu[1] );
120 power = log10( fluxlog[1]/fluxlog[0]) / log10( tnu[1]/tnu[0] );
122 tnu[0] =
rfield.emm*RESETFACTOR;
123 fluxlog[0] = log10(fluxlog[1]) + power * log10( tnu[0] /tnu[1] );
125 fluxlog[0] = pow(10. , fluxlog[0]);
134 long int *nhm ,
double redshift )
138 double *table_redshifts = NULL,
143 long int nRedshift , i , n , nz , ipLo , ipHi;
155 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioFILE ) != NULL )
159 if( chLine[0] !=
'#')
168 mag_read = (long)
FFmtRead(chLine,&i,(
int)
sizeof(chLine),&lgEOL);
169 if( mag_read != 50808 )
172 " Magic number in Haardt & Madau file is not correct, I expected 50808 and found %li\n",
187 a =
FFmtRead(chLine,&i,(
int)
sizeof(chLine),&lgEOL);
196 table_redshifts = (
double*)
MALLOC( (
size_t)nRedshift*
sizeof(
double) );
199 for( n=0; n<nRedshift; ++n )
201 table_redshifts[n] =
FFmtRead(chLine,&i,(
int)
sizeof(chLine),&lgEOL);
211 table_wl = (
double*)
MALLOC( (
size_t)*nhm*
sizeof(
double) );
213 table_fn = (
double**)
MALLOC( (
size_t)nRedshift*
sizeof(
double*) );
214 for(n=0; n<nRedshift; ++n )
216 table_fn[n] = (
double*)
MALLOC( (
size_t)(*nhm)*
sizeof(
double) );
220 if( fseek( ioFILE , 0 , SEEK_SET ) != 0 )
222 fprintf(
ioQQQ,
" read_hm05 could not rewind HM05 date file.\n");
227 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioFILE ) != NULL )
231 if( chLine[0] !=
'#')
239 table_wl[*nhm] =
FFmtRead(chLine,&i,(
int)
sizeof(chLine),&lgEOL);
242 for( nz=0; nz<nRedshift; ++nz )
245 table_fn[nz][*nhm] =
FFmtRead(chLine,&i,(
int)
sizeof(chLine),&lgEOL);
256 enum {DEBUG_LOC=
false};
259 fprintf(
ioQQQ,
"wavelength/z");
260 for(nz=0; nz<nRedshift; ++nz )
261 fprintf(
ioQQQ,
"\t%.3f", table_redshifts[nz] );
263 for( i=0; i<*nhm; ++i )
265 fprintf(
ioQQQ,
"%.3e", table_wl[i] );
266 for( nz=0; nz<nRedshift; ++nz )
267 fprintf(
ioQQQ,
"\t%.3e", table_fn[nz][i] );
274 assert( table_redshifts!=NULL );
277 if( redshift < table_redshifts[0] ||
278 redshift > table_redshifts[nRedshift-1] )
280 fprintf(
ioQQQ,
" The redshift requested on table HM05 is %g but is not within the range of the table, which goes from %g to %g.\n",
281 redshift, table_redshifts[0] , table_redshifts[nRedshift-1] );
282 fprintf(
ioQQQ,
" Sorry.\n");
289 for( nz=0; nz<nRedshift-1; ++nz )
291 if( redshift >= table_redshifts[nz] &&
292 redshift <= table_redshifts[nz+1] )
299 ASSERT( ipLo>=0 && ipHi >=0 );
303 for( i=0; i<*nhm-1; ++i )
305 if( table_wl[i]>=table_wl[i+1] )
307 fprintf(
ioQQQ,
" The wavelengths in the table HM05 data table are not in increasing order. This is required.\n");
308 fprintf(
ioQQQ,
" Sorry.\n");
314 *fnuHM = (
double *)
MALLOC( (
size_t)(*nhm)*
sizeof(
double ) );
315 *tnuHM = (
double *)
MALLOC( (
size_t)(*nhm)*
sizeof(
double ) );
320 frac_hi = (redshift-table_redshifts[ipLo]) / (table_redshifts[ipHi]-table_redshifts[ipLo]);
321 for( i=0; i<*nhm; ++i )
326 (*tnuHM)[*nhm-1-i] =
RYDLAM / table_wl[i];
328 (*fnuHM)[*nhm-1-i] = table_fn[ipLo][i]*(1.-frac_hi) + table_fn[ipHi][i]*frac_hi;
332 for( n=0; n<nRedshift; ++n )
336 free( table_redshifts );
363 bool lgNoContinuum =
false,
377 fprintf(
ioQQQ,
" %ld is too many spectra entered. Increase LIMSPC\n Sorry.\n",
387 lgQuoteFound =
false;
406 for( i=0; i <
NAGN; i++ )
423 ConBreak =
rfield.emm*1.01f;
427 fprintf(
ioQQQ,
" There must be a number for the break.\n Sorry.\n" );
434 fprintf(
ioQQQ,
" The break must be greater than 0.2 Ryd.\n Sorry.\n" );
441 ConBreak = 0.0912/ConBreak;
447 ConBreak = pow(10.,ConBreak);
450 else if( ConBreak == 0. )
452 fprintf(
ioQQQ,
" An energy of 0 is not allowed.\n Sorry.\n" );
458 fprintf(
ioQQQ,
" The energy of the break cannot be greater than%10.2e Ryd.\n Sorry.\n",
463 else if( ConBreak <=
rfield.tNu[
rfield.nShape][0].Ryd() )
465 fprintf(
ioQQQ,
" The energy of the break cannot be less than%10.2e Ryd.\n Sorry.\n",
486 for( i=0; i <
NKN120; i++ )
494 else if( p.
nMatch(
"CRAB") )
496 if( p.
nMatch(
"DAVIDSON") )
500 for( i=0; i <
NCRAB; i++ )
512 const int NCRAB08 = 14;
514 static const double tnucrbHz08[NCRAB08] = {
529 static const double crbnuLnu08[NCRAB08] = {
544 static double tnu[NCRAB08] , tflux[NCRAB08];
545 for( i=0; i < NCRAB08; i++ )
548 tnu[i] = pow(10. , tnucrbHz08[i] ) /
FR1RYD;
550 tflux[i] = crbnuLnu08[i] - tnucrbHz08[i];
553 for( i=0; i < NCRAB08; i++ )
563 else if( p.
nMatch(
"COOL") )
567 for( i=0; i <
NCFL; i++ )
586 for( j=0; j <
NHM96; j++ )
598 scale = log10(scale);
603 fprintf(
ioQQQ,
" %ld is too many continua entered. Increase LIMSPC\n Sorry.\n",
613 fprintf(
ioQQQ,
" This command has come between a previous ordered pair of continuum shape and luminosity commands.\n Reorder the commands to complete each continuum specification before starting another.\n" );
614 fprintf(
ioQQQ,
" Sorry.\n" );
635 if( !
radius.lgRadiusKnown )
643 if( !
radius.lgRadiusKnown )
651 double *tnuHM , *fnuHM;
663 strcpy( chFile ,
"haardt_madau_quasar.dat" );
668 strcpy( chFile ,
"haardt_madau_galaxy.dat" );
676 fprintf(
ioQQQ,
" The redshift MUST be specified on the table HM05 command. I did not find one.\n Sorry.\n");
682 read_hm05( chFile , &tnuHM , &fnuHM , &nhm , redshift );
685 for( j=0; j < nhm-1; j++ )
689 if( tnuHM[j]<=1. && 1. <= tnuHM[j+1] )
702 scale = log10(scale);
709 rfield.totpow[p.
m_nqh] = log10(fnuHM[ipNORM]) + log10(
PI4) + scale;
714 fprintf(
ioQQQ,
" %ld is too many continua entered. Increase LIMSPC\n Sorry.\n",
724 fprintf(
ioQQQ,
" This command has come between a previous ordered pair of continuum shape and luminosity commands.\n Reorder the commands to complete each continuum specification before starting another.\n" );
725 fprintf(
ioQQQ,
" Sorry.\n" );
738 scale =
SDIV( fnuHM[ipNORM] );
745 (
realnum)log10(fnuHM[0]*pow((
double)(
rfield.emm/tnuHM[0]),2.)/scale);
749 for( j=0; j < nhm; j++ )
762 for( j=0; j < nhm-1; j++ )
767 if( !
radius.lgRadiusKnown )
775 if( !
radius.lgRadiusKnown )
783 else if( p.
nMatch(
" ISM") )
791 for( i=6; i <
NISM; i++ )
805 if( scale > 0. && !p.
nMatch(
" LOG") )
806 scale = log10(scale);
811 fprintf(
ioQQQ,
" %4ld is too many continua entered. Increase LIMSPC\n Sorry.\n",
821 fprintf(
ioQQQ,
" This command has come between a previous ordered pair of continuum shape and luminosity commands.\n Reorder the commands to complete each continuum specification before starting another.\n" );
822 fprintf(
ioQQQ,
" Sorry.\n" );
843 if( !
radius.lgRadiusKnown )
861 else if( p.
nMatch(
"DRAI") )
864 rfield.lgMustBlockHIon =
true;
879 if( scale > 0. && !p.
nMatch(
" LOG") )
880 scale = log10(scale);
885 fprintf(
ioQQQ,
" %4ld is too many continua entered. Increase LIMSPC\n Sorry.\n",
895 fprintf(
ioQQQ,
" This command has come between a previous ordered pair of continuum shape and luminosity commands.\n Reorder the commands to complete each continuum specification before starting another.\n" );
896 fprintf(
ioQQQ,
" Sorry.\n" );
929 if( !
radius.lgRadiusKnown )
936 else if( p.
nMatch(
"LINE") )
943 lgNoContinuum =
true;
947 fprintf(
ioQQQ,
" sorry, only one table line per input stream\n");
953 if( lgQuoteFound && strlen(chFile) > 0 )
967 fprintf(
ioQQQ,
"\n DISASTER PROBLEM ParseTable could not find "
969 fprintf(
ioQQQ,
" Please check the spelling of the file name and that it "
970 "is in either the local or data directory.\n\n");
980 else if( p.
nMatch(
"POWE") )
1007 else if( brakmm == 0. )
1016 else if( brakmm < 0. )
1020 brakmm = pow(10.,brakmm);
1025 brakmm =
RYDLAM / (1e4*brakmm);
1032 " Check the order of parameters on this table power law command - the low-energy break of %f Ryd seems high to me.\n",
1060 else if( brakxr == 0. )
1068 brakxr = pow(10.,brakxr);
1076 if( brakmm >= brakxr )
1078 fprintf(
ioQQQ,
" HELP!! The lower energy for the power law, %f, is greater than the upper energy, %f. This is not possible.\n Sorry.\n",
1099 else if( p.
nMatch(
"READ") )
1106 fprintf(
ioQQQ,
" Name of file must appear on TABLE READ.\n");
1127 fprintf(
ioQQQ,
" The TABLE TLUSTY command is no longer supported.\n" );
1128 fprintf(
ioQQQ,
" Please use TABLE STAR TLUSTY instead. See Hazy for details.\n" );
1132 else if( p.
nMatch(
"RUBI") )
1135 for( i=0; i <
NRUBIN; i++ )
1145 else if( p.
nMatch(
"STAR") )
1147 char chMetalicity[5] =
"", chODFNew[8], chVaryFlag[7] =
"";
1148 bool lgHCa =
false, lgHNi =
false;
1150 double Tlow = -1., Thigh = -1.;
1166 sprintf(chVaryFlag,
"%1ld-DIM",ndim);
1172 static const char table[][2][10] = {
1204 strncpy( chMetalicity,
"p00",
sizeof(chMetalicity) );
1205 for (i=0; i < (long)(
sizeof(table)/
sizeof(*table)); ++i)
1209 strncpy( chVaryFlag, table[i][0],
sizeof(chVaryFlag) );
1210 strncpy( chMetalicity, table[i][1],
sizeof(chMetalicity) );
1218 bool lgHalo = p.
nMatch(
"HALO");
1219 bool lgSolar = ( !lgHalo && strcmp( chMetalicity,
"p00" ) == 0 );
1224 bool lgList = p.
nMatch(
"LIST");
1233 for( nval=0; nval <
MDIM; nval++ )
1240 if( nval == 0 && !lgList )
1242 fprintf(
ioQQQ,
" The stellar temperature MUST be entered.\n" );
1252 if( ( val[0] <= 10. && !p.
nMatch(
"LINE") ) || p.
nMatch(
"LOG ") )
1255 val[0] = pow(10.,val[0]);
1258 fprintf(
ioQQQ,
" DISASTER the log of the temperature was specified, "
1259 "but the numerical value is too large.\n Sorry.\n\n");
1269 else if( p.
nMatch(
"ATLA") )
1276 strncpy( chODFNew,
"_odfnew",
sizeof(chODFNew) );
1278 strncpy( chODFNew,
"",
sizeof(chODFNew) );
1281 nstar =
AtlasInterpolate(val,&nval,&ndim,chMetalicity,chODFNew,lgList,&Tlow,&Thigh);
1284 else if( p.
nMatch(
"COST") )
1301 if( val[1] < 1. || val[1] > 7. )
1303 fprintf(
ioQQQ,
" The second number must be the id sequence number, 1 to 7.\n" );
1304 fprintf(
ioQQQ,
" reset to 1.\n" );
1308 else if( p.
nMatch(
"ZAMS") )
1313 fprintf(
ioQQQ,
" A second number, the age of the star, must be present.\n" );
1317 else if( p.
nMatch(
" AGE") )
1322 fprintf(
ioQQQ,
" A second number, the ZAMS mass of the star, must be present.\n" );
1344 if( ! ( lgSolar || lgHalo ) )
1346 fprintf(
ioQQQ,
" Please choose SOLAR or HALO abundances.\n" );
1353 else if( p.
nMatch(
"KURU") )
1358 else if( p.
nMatch(
"MIHA") )
1363 else if( p.
nMatch(
"RAUC") )
1365 if( ! ( lgSolar || lgHalo ) )
1367 fprintf(
ioQQQ,
" Please choose SOLAR or HALO abundances.\n" );
1379 else if( p.
nMatch(
"HYDR") )
1383 else if( p.
nMatch(
"HELI") )
1387 else if( p.
nMatch(
"H+HE") )
1395 else if( p.
nMatch(
"CO W") )
1406 else if( p.
nMatch(
"TLUS") )
1414 else if( p.
nMatch(
"BSTA") )
1420 else if( p.
nMatch(
"OSTA") )
1428 fprintf(
ioQQQ,
" There must be a third key on TABLE STAR TLUSTY;" );
1429 fprintf(
ioQQQ,
" the options are OBSTAR, BSTAR, OSTAR.\n" );
1434 else if( p.
nMatch(
"WERN") )
1441 else if( p.
nMatch(
"WMBA") )
1450 fprintf(
ioQQQ,
" There must be a second key on TABLE STAR;" );
1451 fprintf(
ioQQQ,
" the options are ATLAS, KURUCZ, MIHALAS, RAUCH, WERNER, and WMBASIC.\n" );
1471 for( i=1; i < nval; i++ )
1491 else if( p.
nMatch(
"COST") )
1519 else if( p.
nMatch(
"KURU") )
1524 "TABLE STAR KURUCZ %f LOG" );
1527 else if( p.
nMatch(
"MIHA") )
1532 "TABLE STAR MIHALAS %f LOG" );
1535 else if( p.
nMatch(
"RAUC") )
1544 else if( p.
nMatch(
"HELI") )
1546 else if( p.
nMatch(
"H+HE") )
1550 else if( p.
nMatch(
"CO W") )
1555 if( ( lgHCa || lgHNi ) && ndim == 2 )
1581 else if( p.
nMatch(
"BSTA") )
1583 else if( p.
nMatch(
"OSTA") )
1594 else if( p.
nMatch(
"WERN") )
1599 "TABLE STAR WERNER %f LOG %f" );
1602 else if( p.
nMatch(
"WMBA") )
1607 "TABLE STAR WMBASIC %f LOG %f %f" );
1620 for( i=1; i < nval; i++ )
1632 else if( p.
nMatch(
" XDR") )
1664 fprintf(
ioQQQ,
" There MUST be a keyword on this line. The keys are:"
1665 "AGN, AKN120, CRAB, COOL, DRAINE, HM96, HM05, _ISM, LINE, POWERlaw, "
1666 "READ, RUBIN, STAR, and XDR.\n Sorry.\n" );
1673 if( strcmp(
rfield.chSpType[
rfield.nShape],
"VOLK ") == 0 )
1693 pow(10.,
rfield.tNu[
rfield.nShape][i].Ryd() - 15.51718));
1733 fprintf(
ioQQQ,
" Table for this continuum; TNU, TFAC, TSLOP\n" );
1749 for( i=0; i <
rfield.ncont[
rfield.nShape] && !lgHit; i++ )
1808 ++i;
tsldrn[i] = -17.7575;
1809 ++i;
tsldrn[i] = -17.7268;
1810 ++i;
tsldrn[i] = -17.7036;
1811 ++i;
tsldrn[i] = -17.6953;
1812 ++i;
tsldrn[i] = -17.7182;
1813 ++i;
tsldrn[i] = -17.7524;
1814 ++i;
tsldrn[i] = -17.8154;
1815 ++i;
tsldrn[i] = -17.9176;
1816 ++i;
tsldrn[i] = -18.1675;
1817 ++i;
tsldrn[i] = -18.1690;
1818 ++i;
tsldrn[i] = -18.2477;
1819 ++i;
tsldrn[i] = -18.4075;
1820 ++i;
tsldrn[i] = -18.5624;
1821 ++i;
tsldrn[i] = -18.7722;
1877 cfle[0] = 0.0000100;
1878 cflf[0] = -0.8046910;
1879 cfle[1] = 0.7354023;
1880 cflf[1] = -0.8046910;
1881 cfle[2] = 1.4708046;
1882 cflf[2] = -0.7436830;
1883 cfle[3] = 2.2062068;
1884 cflf[3] = -0.6818757;
1885 cfle[4] = 2.9416091;
1886 cflf[4] = -0.7168990;
1887 cfle[5] = 3.6770115;
1888 cflf[5] = -0.8068384;
1889 cfle[6] = 4.4124136;
1890 cflf[6] = -0.6722584;
1891 cfle[7] = 5.1478162;
1892 cflf[7] = -0.7626385;
1893 cfle[8] = 5.8832183;
1894 cflf[8] = -1.0396487;
1895 cfle[9] = 6.6186204;
1896 cflf[9] = -0.7972314;
1897 cfle[10] = 7.3540230;
1898 cflf[10] = -0.9883416;
1899 cfle[11] = 14.7080460;
1900 cflf[11] = -1.1675659;
1901 cfle[12] = 22.0620689;
1902 cflf[12] = -1.1985949;
1903 cfle[13] = 29.4160919;
1904 cflf[13] = -1.2263466;
1905 cfle[14] = 36.7701149;
1906 cflf[14] = -1.2918345;
1907 cfle[15] = 44.1241379;
1908 cflf[15] = -1.3510833;
1909 cfle[16] = 51.4781609;
1910 cflf[16] = -1.2715496;
1911 cfle[17] = 58.8321838;
1912 cflf[17] = -1.1098027;
1913 cfle[18] = 66.1862030;
1914 cflf[18] = -1.4315782;
1915 cfle[19] = 73.5402298;
1916 cflf[19] = -1.1327956;
1917 cfle[20] = 147.080459;
1918 cflf[20] = -1.6869649;
1919 cfle[21] = 220.620681;
1920 cflf[21] = -2.0239367;
1921 cfle[22] = 294.160919;
1922 cflf[22] = -2.2130392;
1923 cfle[23] = 367.701141;
1924 cflf[23] = -2.3773901;
1925 cfle[24] = 441.241363;
1926 cflf[24] = -2.5326197;
1927 cfle[25] = 514.7816162;
1928 cflf[25] = -2.5292389;
1929 cfle[26] = 588.3218384;
1930 cflf[26] = -2.8230250;
1931 cfle[27] = 661.8620605;
1932 cflf[27] = -2.9502323;
1933 cfle[28] = 735.4022827;
1934 cflf[28] = -3.0774822;
1935 cfle[29] = 1470.8045654;
1936 cflf[29] = -4.2239799;
1937 cfle[30] = 2206.2067871;
1938 cflf[30] = -5.2547927;
1939 cfle[31] = 2941.6091309;
1940 cflf[31] = -6.2353640;
1941 cfle[32] = 3677.0114746;
1942 cflf[32] = -7.1898708;
1943 cfle[33] = 4412.4135742;
1944 cflf[33] = -8.1292381;
1945 cfle[34] = 5147.8159180;
1946 cflf[34] = -9.0594845;
1947 cfle[35] = 5883.2182617;
1948 cflf[35] = -9.9830370;
1949 cfle[36] = 6618.6206055;
1950 cflf[36] = -10.9028034;
1951 cfle[37] = 7354.0229492;
1952 cflf[37] = -11.8188877;
1953 cfle[38] = 7400.0000000;
1954 cflf[38] = -30.0000000;
1955 cfle[39] = 10000000.0000000;
1956 cflf[39] = -30.0000000;
2049 vector<char*> chLabel;
2055 if( nLINE_TABLE == 0 )
2058 fprintf(
ioQQQ ,
"lines_table checking lines within data table %s\n",
chLINE_LIST.c_str() );
2062 for(
long n=0; n < nLINE_TABLE; ++n )
2064 double relative , absolute;
2065 if( (
cdLine( chLabel[n], wl[n] , &relative , &absolute )) <= 0 )
2068 fprintf(
ioQQQ,
"lines_table in parse_table.cpp did not find line %4s ",chLabel[n]);
2070 fprintf(
ioQQQ,
"\n");
2076 fprintf(
ioQQQ ,
" BOTCHED MONITORS!!! Botched Monitors!!! lines_table could not find a total of %li lines\n\n", miss );
2080 fprintf(
ioQQQ ,
"lines_table found all lines\n\n" );
2084 for(
unsigned j=0; j < chLabel.size(); ++j )
2085 delete[] chLabel[j];
2101 for( i=0; i <
NCELL; i++ )
2114 fprintf(
ioQQQ,
" the input continuum file has been truncated.\n" );
2123 char *first = strrchr(chLine,
'/');
2126 unit = string(first+1);
2134 fprintf(
ioQQQ,
" the input continuum file has been truncated.\n" );
2142 sscanf( chLine,
"%ld", &version );
2146 " the input continuum file has the wrong version number, I expected %li and found %li.\n",
2153 fprintf(
ioQQQ,
" the input continuum file has been truncated.\n" );
2159 double mesh_lo, mesh_hi;
2168 strncpy( md5sum, chLine,
NMD5 );
2172 fprintf(
ioQQQ,
" the input continuum file has been truncated.\n" );
2179 if(
cpu.i().big_endian() )
2180 sscanf( chLine,
"%x %x", &u.i[0], &u.i[1] );
2182 sscanf( chLine,
"%x %x", &u.i[1], &u.i[0] );
2187 fprintf(
ioQQQ,
" the input continuum file has been truncated.\n" );
2194 if(
cpu.i().big_endian() )
2195 sscanf( chLine,
"%x %x", &u.i[0], &u.i[1] );
2197 sscanf( chLine,
"%x %x", &u.i[1], &u.i[0] );
2202 fprintf(
ioQQQ,
" the input continuum file has been truncated.\n" );
2206 if( strncmp( md5sum,
continuum.mesh_md5sum.c_str(),
NMD5 ) != 0 ||
2210 fprintf(
ioQQQ,
" the input continuum file has an incompatible energy grid.\n" );
2217 if(
cpu.i().big_endian() )
2218 sscanf( chLine,
"%x %x", &u.i[0], &u.i[1] );
2220 sscanf( chLine,
"%x %x", &u.i[1], &u.i[0] );
2225 fprintf(
ioQQQ,
" the input continuum file has been truncated.\n" );
2232 sscanf( chLine,
"%ld", &nflux );
2236 fprintf(
ioQQQ,
" the input continuum file has been truncated.\n" );
2243 fprintf(
ioQQQ,
" the input continuum file has been truncated.\n" );
2253 sscanf( chLine,
"%lf%lf ", &help[0], &help[1] );
2254 rfield.tNu[
rfield.nShape][i].set(help[0],unit.c_str());
2269 fprintf(
ioQQQ,
" the input continuum file has the wrong number of points: %ld\n",
2278 fprintf(
ioQQQ,
" please recreate this file using the SAVE TRANSMITTED CONTINUUM command.\n" );
2282#if defined(__HP_aCC)
const int FILENAME_PATH_LENGTH_2
const int INPUT_LINE_LENGTH
double FFmtRead(const char *chCard, long int *ipnt, long int last, bool *lgEOL)
const char * strchr_s(const char *s, int c)
bool fp_equal(sys_float x, sys_float y, int n=3)
char * read_whole_line(char *chLine, int nChar, FILE *ioIN)
NORETURN void TotalInsanity(void)
sys_float SDIV(sys_float x)
#define DEBUG_ENTRY(funcname)
long int cdLine(const char *chLabel, realnum wavelength, double *relint, double *absint)
long int cdGetLineList(const char chFile[], vector< char * > &chLabels, vector< realnum > &wl)
bool nMatch(const char *chKey) const
bool nMatchErase(const char *chKey)
int GetQuote(char *chLabel, bool lgABORT)
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
UNUSED const realnum BIGFLOAT
static const double tnuHM96[NHM96]
static double tnurbn[NRUBIN]
STATIC void resetBltin(double *tnu, double *fluxlog, bool lgLog)
static double fnuism[NISM]
static double tnuagn[NAGN]
static double tnuism[NISM]
static double fnuakn[NKN120]
static string chLINE_LIST
static const double fnuHM96[NHM96]
static double tsldrn[NDRAINE]
STATIC void ReadTable(const char *fnam)
static double tslagn[NAGN]
static double tnuakn[NKN120]
void ParseTable(Parser &p)
STATIC void ZeroContin(void)
STATIC void read_hm05(const char chFile[], double **tnuHM, double **fnuHM, long int *nhm, double redshift)
static double tnudrn[NDRAINE]
static double fnucrb[NCRAB]
static double tnucrb[NCRAB]
static double fnurbn[NRUBIN]
UNUSED const double FR1RYD
UNUSED const double HIONPOT
UNUSED const double EVRYD
UNUSED const double RYDLAM
void prt_wl(FILE *ioOUT, realnum wl)
static const long VERSION_TRNCON
long RauchInterpolateHydr(double val[], long *nval, long *ndim, bool lgList, double *Tlow, double *Thigh)
long Kurucz79Interpolate(double val[], long *nval, long *ndim, bool lgList, double *Tlow, double *Thigh)
long WMBASICInterpolate(double val[], long *nval, long *ndim, bool lgList, double *Tlow, double *Thigh)
long AtlasInterpolate(double val[], long *nval, long *ndim, const char *chMetalicity, const char *chODFNew, bool lgList, double *Tlow, double *Thigh)
long WernerInterpolate(double val[], long *nval, long *ndim, bool lgList, double *Tlow, double *Thigh)
long RauchInterpolateHNi(double val[], long *nval, long *ndim, bool lgHalo, bool lgList, double *Tlow, double *Thigh)
long CoStarInterpolate(double val[], long *nval, long *ndim, IntMode imode, bool lgHalo, bool lgList, double *val0_lo, double *val0_hi)
long GridInterpolate(double val[], long *nval, long *ndim, const char *FileName, bool lgList, double *Tlow, double *Thigh)
long RauchInterpolateHpHe(double val[], long *nval, long *ndim, bool lgList, double *Tlow, double *Thigh)
long RauchInterpolateHelium(double val[], long *nval, long *ndim, bool lgList, double *Tlow, double *Thigh)
long TlustyInterpolate(double val[], long *nval, long *ndim, tl_grid tlg, const char *chMetalicity, bool lgList, double *Tlow, double *Thigh)
long RauchInterpolateHCa(double val[], long *nval, long *ndim, bool lgHalo, bool lgList, double *Tlow, double *Thigh)
void AtmospheresAvail(void)
long RauchInterpolateCOWD(double val[], long *nval, long *ndim, bool lgList, double *Tlow, double *Thigh)
long MihalasInterpolate(double val[], long *nval, long *ndim, bool lgList, double *Tlow, double *Thigh)
long RauchInterpolatePG1159(double val[], long *nval, long *ndim, bool lgList, double *Tlow, double *Thigh)
static const unsigned int NMD5