Commit 195d33e1 authored by Andrew Strong's avatar Andrew Strong

SourcePopulation.cc: python output

parent d3d2b6e6
......@@ -1541,6 +1541,9 @@ int SourcePopulation::analyse_sample()
// output for external plotting routines //AWS20200622
*txt_stream<<"format for external plotting routines"<<endl; //AWS20200622
// idl
*txt_stream<<"S = [";
for (ii=0;ii< n_dlnN_dlnS;ii++)
{ *txt_stream<<pow(10, (lnS_min+ii*dlnS + lnS_min+(ii+1)*dlnS)/2. );
......@@ -1573,6 +1576,35 @@ int SourcePopulation::analyse_sample()
*txt_stream<<"start_plot =0; idl";
*txt_stream<<"oplot,S,NS ; idl"<<endl;
// python format
*txt_stream<<"title='" <<title<< "' # python format"<<endl;
*txt_stream<<"S = [";
for (ii=0;ii< n_dlnN_dlnS;ii++)
{ *txt_stream<<pow(10, (lnS_min+ii*dlnS + lnS_min+(ii+1)*dlnS)/2. );
if(ii<n_dlnN_dlnS-1) *txt_stream<<",";
}
*txt_stream<<"]";
*txt_stream<<" # python format";
*txt_stream<<endl;
*txt_stream<<"NS = [";
for (ii=0;ii< n_dlnN_dlnS;ii++)
{ *txt_stream<<dlnN_dlnS[ii];
if(ii<n_dlnN_dlnS-1) *txt_stream<<",";
}
*txt_stream<<"]";
*txt_stream<<" # python format";
*txt_stream<<endl;
// end of format for external plotting routines
*txt_stream<<"(oversampling corrected) dlnN_dlnS: total N ="<< dlnN_dlnS_total_N <<" total S ="<< dlnN_dlnS_total_S<< endl;
*txt_stream<<" sample region corrected for oversampling factor ="<<oversample <<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