25 static const char name_cat[MAXCAT][13] =
75 fprintf(
ioQQQ,
" trace, optimize_func variables" );
78 fprintf(
ioQQQ,
"%.2e", param[i] );
80 fprintf(
ioQQQ,
"\n" );
109 fprintf(
ioQQQ,
" Iteration %ld not within range.\n",
123 fprintf(
ioQQQ,
" PROBLEM Cloudy returned error condition - what happened?\n" );
136 for( i=0; i < MAXCAT; i++ )
145 " Normalization line array index is bad. What has gone wrong?\n" );
151 fprintf(
ioQQQ,
"\n\n PROBLEM Normalization line has zero intensity. What has gone wrong?\n" );
152 fprintf(
ioQQQ,
" Is spectrum normalized to a species that does not exist?\n" );
161 fprintf(
ioQQQ,
" ID Model Observed error chi**2 Type\n" );
187 fprintf(
ioQQQ,
"\n" );
199 fprintf(
ioQQQ,
"\n\n Optimizer could not find one or more lines.\n" );
200 fprintf(
ioQQQ,
" Sorry.\n");
205 for( i=0; i < 10; i++ )
220 chi2_cat[cat] += chi1;
226 fprintf(
ioQQQ,
"%12.5f%12.5f%12.5f%12.2e Relative intensity",
232 fprintf(
ioQQQ,
"\n" );
248 fprintf(
ioQQQ,
" optimizer did not find column density %s %li \n",
257 chi2_cat[cat] += chi1;
259 fprintf(
ioQQQ,
" %4.4s%7ld%12.4e%12.4e%12.5f%12.2e Temperature\n",
270 fprintf(
ioQQQ,
" optimizer did not find column density %s %li \n",
279 chi2_cat[cat] += chi1;
281 fprintf(
ioQQQ,
" %4.4s%7ld%12.4e%12.4e%12.5f%12.2e Column density\n",
304 chi2_cat[cat] += chi1;
306 fprintf(
ioQQQ,
" %4.4s ",
311 fprintf(
ioQQQ,
"%12.5f%12.5f%12.5f%12.2e Line intensity\n",
328 nFnu_model = pow(10.,nFnu_model);
339 catstr =
"Photometry";
344 catstr =
"Radio intensity";
347 chi2_cat[cat] += chi1;
352 fprintf(
ioQQQ,
"%12.4g%12.4g%12.5f%12.2e %s [%s]\n",
356 catstr, unit.c_str() );
376 chi2_cat[cat] += chi1;
378 fprintf(
ioQQQ,
" %12.4g%12.4g%12.5f%12.2e Angular diameter\n",
385 fprintf(
ioQQQ,
" WARNING; no line matches found\n" );
390 fprintf(
ioQQQ,
"\n" );
391 for( i=0; i < MAXCAT; i++ )
393 if( nobs_cat[i] > 0 )
395 chisq += chi2_cat[i]/nobs_cat[i];
396 fprintf(
ioQQQ,
" Category %s #obs.%3ld Total Chi**2%11.3e Average Chi**2%11.3e\n",
397 name_cat[i],nobs_cat[i],chi2_cat[i],chi2_cat[i]/nobs_cat[i] );
412 fprintf(
ioQQQ,
"\n" );
457 fprintf(
ioQQQ,
"The number of variable options on this line makes no sense to me4\n");
461 fprintf(
ioQQQ,
" Varied command: %s\n",
485 fprintf(
ioQQQ,
"chi2_func: non-positive observed quantity, this should not happen\n" );
493 temp =
pow2((ymodl-ymeas)/(
min(ymodl,ymeas)*yerr));
506 temp =
pow2((ymodl-ymeas)/(ymeas*yerr));
514 fprintf(
ioQQQ,
"chi2_func: relative error is zero, this should not happen\n" );
void cap4(char *chCAP, const char *chLab)
#define DEBUG_ENTRY(funcname)
int cdColm(const char *chLabel, long int ion, double *theocl)
void cdWarnings(FILE *ioPNT)
long int cdLine(const char *chLabel, realnum wavelength, double *relint, double *absint)
int cdTemp(const char *chLabel, long int IonStage, double *TeMean, const char *chWeight)
static t_PredCont & Inst()
static realnum * wavelength
void vary_input(bool *lgLimOK, int grid_index)
STATIC double chi2_func(double, double, double)
chi2_type optimize_func(const realnum param[], int grid_index)
UNUSED const double AS1RAD
void prt_wl(FILE *ioOUT, realnum wl)
vector< string > chColDen_label
vector< realnum > xLineInt_Obs
vector< realnum > ColDen_Obs
vector< realnum > temp_error
realnum vparm[LIMEXT][LIMPAR]
vector< realnum > temp_obs
char chVarFmt[LIMPAR][FILENAME_PATH_LENGTH_2]
vector< string > chLineLabel
vector< chi2_type > ContNFnuErr
vector< realnum > xLineInt_error
vector< string > chTempLab
vector< realnum > ColDen_error
vector< Energy > ContEner
realnum varang[LIMPAR][2]
vector< realnum > wavelength
vector< string > chTempWeight
double SavGenericData[10]
vector< long > ion_ColDen