31 STATIC double TempInterp2(
double* TempArray ,
double* ValueArray,
long NumElements );
43 long int i, nelem, ipHi, ipLo;
51 photons_3889_plus_7065 = 0.;
56 fprintf(
ioQQQ,
" prt_lines_helium called\n" );
60 " start He-like iso sequence");
71 static bool lgMustMalloc=
true;
83 for( nelem=ipISO; nelem <
LIMELM; nelem++ )
121 ipHi = CaABLines[nelem][i].
ipHi;
122 ipLo = CaABLines[nelem][i].
ipLo;
133 CaABLines[nelem][i].label,
'i',
134 "Case B intensity ");
136 if(
nMatch(
"Ca B",CaABLines[nelem][i].label) )
169 "Case B intensity with collisions included");
178 Pop2_3S*qTotEff[ipHi]*
dense.
xIonDense[nelem][nelem+1-ipISO]*totBranch*
182 "Case B intensity with collisions included");
192 linadd( intens, 4471, CaABLines[nelem][i].label,
'i',
193 "Case B intensity ");
223 " two photon continuum ");
231 " induced two photon emission ");
251 " total emission in He-like intercombination lines from 2p3P to ground ");
318 else if( ipLo==
ipHe2s3S && ipHi == ipHe2p3P0 )
342 fprintf(
ioQQQ,
"DEBUG 2P - 2S multiplet wl %s ",
345 fprintf(
ioQQQ,
"\n" );
349 linadd(sum,av_wl,
"TOTL",
'i',
350 "total emission in He-like lines, use average of three line wavelengths " );
353 linadd(sum,av_wl,chLabel,
'i',
354 "total emission in He-like lines, use average of three line wavelengths " );
410 "total intensity of He-like line");
414 enum {DEBUG_LOC=
false};
417 if( nelem==1 && ipLo==0 && ipHi==1 )
419 fprintf(
ioQQQ,
"he1 626 %.2e %.2e \n",
433 double sumcool , sumheat ,
434 save , savecool , saveheat;
439 for( ipLo=ipHe2p3P0; ipLo <=
ipHe2p3P2; ++ipLo )
486 "predicted line, all processes included");
523 "predicted line, all processes included");
538 photons_3889_plus_7065 =
569 photons_3889_plus_7065 +=
576 linadd( photons_3889_plus_7065, 3889.,
"Pho+",
'i',
577 "photon sum given in Porter et al. 2007 (astro-ph/0611579)");
586 fprintf(
ioQQQ,
" lines_helium returns\n" );
596 long i, i1, i2, j, nelem;
598 # define chLine_LENGTH 1000
604 fprintf(
ioQQQ,
" lines_helium opening he1_case_ab.dat\n");
606 ioDATA =
open_data(
"he1_case_ab.dat",
"r" );
611 fprintf(
ioQQQ,
" lines_helium could not read first line of he1_case_ab.dat.\n");
624 " lines_helium: the version of he1_case_ab.dat is not the current version.\n" );
626 " lines_helium: I expected to find the number %i and got %li instead.\n" ,
628 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
634 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
637 if( chLine[0] !=
'#')
654 fprintf(
ioQQQ,
" lines_helium could not find line of temperatures in he1_case_ab.dat.\n");
680 for( j = 0; j < i2; ++j )
684 CaABLines[nelem][j].
ipHi = -1;
685 CaABLines[nelem][j].
ipLo = -1;
686 strcpy( CaABLines[nelem][j].label ,
" " );
699 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
701 static long line = 0;
705 if( (chLine[0] ==
' ') || (chLine[0]==
'\n') )
707 if( chLine[0] !=
'#')
719 ASSERT( CaABLines[nelem][line].ipLo < CaABLines[nelem][line].ipHi );
727 if( (chTemp = strchr( chTemp,
'\t' )) == NULL )
729 fprintf(
ioQQQ,
" lines_helium no init case A and B\n" );
735 strncpy( CaABLines[nelem][line].label, chTemp , 4 );
736 CaABLines[nelem][line].
label[4] = 0;
741 if( (chTemp = strchr( chTemp,
'\t' )) == NULL )
743 fprintf(
ioQQQ,
" lines_helium could not scan case A and B lines, current indices: %li %li\n",
744 CaABLines[nelem][line].ipHi,
745 CaABLines[nelem][line].ipLo );
749 sscanf( chTemp ,
"%le" , &b );
775 return ValueArray[0];
779 return ValueArray[NumElements-1];
785 ASSERT( (ipTe >=0) && (ipTe < NumElements-1) );
789 i0 =
max(
min(ipTe-ORDER/2,NumElements-ORDER-1),0);