Commit 8e61542c authored by Andrew Strong's avatar Andrew Strong

gen_source_population.cc: output summary and statistics for all three catalogues

parent d96088d3
......@@ -443,7 +443,7 @@ int Galplot::gen_source_population()
*/
//---------------------------------------------------------
txt_stream<<endl<<"Comparison source synthesis : Fermi catalogue"<<endl; //AWS20081216
txt_stream<<endl<<"Comparison source synthesis : Fermi catalogue 1"<<endl; //AWS20081216
//sourcepop1 replaced by sourcepop5 AWS20111011
txt_stream<<"source counts for region "<<sourcepop5.long_min1 <<" < l < "<<sourcepop5.long_max1 <<", "<<sourcepop5.long_min2 <<" < l < "<<sourcepop5.long_max2<<" / "
......@@ -476,8 +476,208 @@ int Galplot::gen_source_population()
<<endl;
}
// one-line summary statistics
txt_stream << " galdef_ID = " << galplotdef.galdef_ID;
txt_stream << " psfile_tag = " << galplotdef.psfile_tag;
txt_stream << " sourcepop4 vs sourcepop5: cat 1 versus model: ";
txt_stream << " density = " << sourcepop5.density0;
txt_stream << " L_min = " << sourcepop5.L_min;
txt_stream << " L_max = " << sourcepop5.L_max;
txt_stream << " alpha_L = " << sourcepop5.alpha_L;
txt_stream << " long_min1=" << galplotdef.long_min1;
txt_stream << " long_max1=" << galplotdef.long_max1;
txt_stream << " long_min2=" << galplotdef.long_min2;
txt_stream << " long_max2=" << galplotdef.long_max2;
txt_stream << " lat_min1=" << galplotdef.lat_min1;
txt_stream << " lat_max1=" << galplotdef.lat_max1;
txt_stream << " lat_min2=" << galplotdef.lat_min2;
txt_stream << " lat_max2=" << galplotdef.lat_max2;
txt_stream <<" log likelihood "<< logL<<endl;
// short form
txt_stream << " " << sourcepop5.density0;
txt_stream << " " << sourcepop5.L_min;
txt_stream << " " << sourcepop5.L_max;
txt_stream << " " << sourcepop5.alpha_L;
txt_stream << " " << galplotdef.long_min1;
txt_stream << " " << galplotdef.long_max1;
txt_stream << " " << galplotdef.long_min2;
txt_stream << " " << galplotdef.long_max2;
txt_stream << " " << galplotdef.lat_min1;
txt_stream << " " << galplotdef.lat_max1;
txt_stream << " " << galplotdef.lat_min2;
txt_stream << " " << galplotdef.lat_max2;
txt_stream <<" " << logL;
txt_stream <<" logL statistics" <<endl;
//---------------------------------------------------------
txt_stream<<endl<<"Comparison source synthesis : Fermi catalogue 2"<<endl;
txt_stream<<"source counts for region "<<sourcepop5.long_min1 <<" < l < "<<sourcepop5.long_max1 <<", "<<sourcepop5.long_min2 <<" < l < "<<sourcepop5.long_max2<<" / "
<<sourcepop5. lat_min1 <<" < b < "<<sourcepop5.lat_max1 <<", "<< sourcepop5. lat_min2 <<" < b < "<<sourcepop5. lat_max2<<endl; // AWS20111011
sourcepop5.print(); sourcepop6.print();// AWS20111011
logL=0.0;
for (ii=0;ii< sourcepop5.n_dlnN_dlnS;ii++) // AWS20111011
{
if(pow(10, sourcepop5.lnS_min+ii*sourcepop5.dlnS)>=sourcepop5.flux_detection_limit
&&sourcepop5.dlnN_dlnS[ii]>0.0) // AWS20111011
logL+= - sourcepop5.dlnN_dlnS [ii] + sourcepop6.dlnN_dlnS [ii] * log(sourcepop5.dlnN_dlnS[ii]);// AWS20111011
}
txt_stream << "sourcepop5.n_dlnN_dlnS="<< sourcepop5.n_dlnN_dlnS<<endl;//AWS20111011
txt_stream << "sourcepop6.n_dlnN_dlnS="<< sourcepop6.n_dlnN_dlnS<<endl;//AWS20111011
for (ii=0;ii< sourcepop5.n_dlnN_dlnS;ii++)
{
if( sourcepop5.dlnN_dlnS[ii]>0 || sourcepop6.dlnN_dlnS[ii]>0 )
txt_stream <<"ii="<<ii
<<" lnS="<< sourcepop5.lnS_min+ii*sourcepop5.dlnS <<"/"<< sourcepop5.lnS_min+(ii+1)*sourcepop5.dlnS
<<" S=" <<pow(10, sourcepop5.lnS_min+ii*sourcepop5.dlnS) <<"/"<<pow(10, sourcepop5.lnS_min+(ii+1)*sourcepop5.dlnS)
<<" N(S)= "<< sourcepop5.dlnN_dlnS [ii]<<":" << sourcepop6.dlnN_dlnS [ii]
<<" N(>S)= "<< sourcepop5.dlnN_dlnS_int[ii]<<":" << sourcepop6.dlnN_dlnS_int[ii]
<<" F(S)= "<< sourcepop5.FS [ii]<<":" << sourcepop6.FS [ii]
<<" F(>S)= "<< sourcepop5.FS_int [ii]<<":" << sourcepop6.FS_int [ii]
<<endl;
}
// one-line summary statistics
txt_stream << " galdef_ID = " << galplotdef.galdef_ID;
txt_stream << " psfile_tag = " << galplotdef.psfile_tag;
txt_stream << " sourcepop6 vs sourcepop5: cat 2 versus model: ";
txt_stream << " density = " << sourcepop5.density0;
txt_stream << " L_min = " << sourcepop5.L_min;
txt_stream << " L_max = " << sourcepop5.L_max;
txt_stream << " alpha_L = " << sourcepop5.alpha_L;
txt_stream << " long_min1=" << galplotdef.long_min1;
txt_stream << " long_max1=" << galplotdef.long_max1;
txt_stream << " long_min2=" << galplotdef.long_min2;
txt_stream << " long_max2=" << galplotdef.long_max2;
txt_stream << " lat_min1=" << galplotdef.lat_min1;
txt_stream << " lat_max1=" << galplotdef.lat_max1;
txt_stream << " lat_min2=" << galplotdef.lat_min2;
txt_stream << " lat_max2=" << galplotdef.lat_max2;
txt_stream <<" log likelihood "<< logL<<endl;
// short form
txt_stream << " " << sourcepop5.density0;
txt_stream << " " << sourcepop5.L_min;
txt_stream << " " << sourcepop5.L_max;
txt_stream << " " << sourcepop5.alpha_L;
txt_stream << " " << galplotdef.long_min1;
txt_stream << " " << galplotdef.long_max1;
txt_stream << " " << galplotdef.long_min2;
txt_stream << " " << galplotdef.long_max2;
txt_stream << " " << galplotdef.lat_min1;
txt_stream << " " << galplotdef.lat_max1;
txt_stream << " " << galplotdef.lat_min2;
txt_stream << " " << galplotdef.lat_max2;
txt_stream <<" " << logL;
txt_stream <<" logL statistics" <<endl;
//---------------------------------------------------------
txt_stream<<endl<<"Comparison source synthesis : Fermi catalogue 3"<<endl;
txt_stream<<"source counts for region "<<sourcepop5.long_min1 <<" < l < "<<sourcepop5.long_max1 <<", "<<sourcepop5.long_min2 <<" < l < "<<sourcepop5.long_max2<<" / "
<<sourcepop5. lat_min1 <<" < b < "<<sourcepop5.lat_max1 <<", "<< sourcepop5. lat_min2 <<" < b < "<<sourcepop5. lat_max2<<endl; // AWS20111011
sourcepop5.print(); sourcepop7.print();// AWS20111011
logL=0.0;
for (ii=0;ii< sourcepop5.n_dlnN_dlnS;ii++) // AWS20111011
{
if(pow(10, sourcepop5.lnS_min+ii*sourcepop5.dlnS)>=sourcepop5.flux_detection_limit
&&sourcepop5.dlnN_dlnS[ii]>0.0) // AWS20111011
logL+= - sourcepop5.dlnN_dlnS [ii] + sourcepop7.dlnN_dlnS [ii] * log(sourcepop5.dlnN_dlnS[ii]);// AWS20111011
}
txt_stream << "sourcepop5.n_dlnN_dlnS="<< sourcepop5.n_dlnN_dlnS<<endl;//AWS20111011
txt_stream << "sourcepop7.n_dlnN_dlnS="<< sourcepop7.n_dlnN_dlnS<<endl;//AWS20111011
for (ii=0;ii< sourcepop5.n_dlnN_dlnS;ii++)
{
if( sourcepop5.dlnN_dlnS[ii]>0 || sourcepop7.dlnN_dlnS[ii]>0 )
txt_stream <<"ii="<<ii
<<" lnS="<< sourcepop5.lnS_min+ii*sourcepop5.dlnS <<"/"<< sourcepop5.lnS_min+(ii+1)*sourcepop5.dlnS
<<" S=" <<pow(10, sourcepop5.lnS_min+ii*sourcepop5.dlnS) <<"/"<<pow(10, sourcepop5.lnS_min+(ii+1)*sourcepop5.dlnS)
<<" N(S)= "<< sourcepop5.dlnN_dlnS [ii]<<":" << sourcepop7.dlnN_dlnS [ii]
<<" N(>S)= "<< sourcepop5.dlnN_dlnS_int[ii]<<":" << sourcepop7.dlnN_dlnS_int[ii]
<<" F(S)= "<< sourcepop5.FS [ii]<<":" << sourcepop7.FS [ii]
<<" F(>S)= "<< sourcepop5.FS_int [ii]<<":" << sourcepop7.FS_int [ii]
<<endl;
}
// one-line summary statistics
txt_stream << " galdef_ID = " << galplotdef.galdef_ID;
txt_stream << " psfile_tag = " << galplotdef.psfile_tag;
txt_stream << " sourcepop7 vs sourcepop5: cat 3 versus model: ";
txt_stream << " density = " << sourcepop5.density0;
txt_stream << " L_min = " << sourcepop5.L_min;
txt_stream << " L_max = " << sourcepop5.L_max;
txt_stream << " alpha_L = " << sourcepop5.alpha_L;
txt_stream << " long_min1=" << galplotdef.long_min1;
txt_stream << " long_max1=" << galplotdef.long_max1;
txt_stream << " long_min2=" << galplotdef.long_min2;
txt_stream << " long_max2=" << galplotdef.long_max2;
txt_stream << " lat_min1=" << galplotdef.lat_min1;
txt_stream << " lat_max1=" << galplotdef.lat_max1;
txt_stream << " lat_min2=" << galplotdef.lat_min2;
txt_stream << " lat_max2=" << galplotdef.lat_max2;
txt_stream <<" log likelihood "<< logL<<endl;
// short form
txt_stream << " " << sourcepop5.density0;
txt_stream << " " << sourcepop5.L_min;
txt_stream << " " << sourcepop5.L_max;
txt_stream << " " << sourcepop5.alpha_L;
txt_stream << " " << galplotdef.long_min1;
txt_stream << " " << galplotdef.long_max1;
txt_stream << " " << galplotdef.long_min2;
txt_stream << " " << galplotdef.long_max2;
txt_stream << " " << galplotdef.lat_min1;
txt_stream << " " << galplotdef.lat_max1;
txt_stream << " " << galplotdef.lat_min2;
txt_stream << " " << galplotdef.lat_max2;
txt_stream <<" " << logL;
txt_stream <<" logL statistics" <<endl;
txt_stream <<"log likelihood "<< logL<<endl;
//---------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment