Commit cd129a14 authored by Andrew Strong's avatar Andrew Strong
Browse files

SourcePopulation.cc: replace flux_detection_limit by...

SourcePopulation.cc: replace flux_detection_limit by flux_detection_limit_sensitivity_file in selections, flux_detection_limit is user-defined and constant, used in gen_source_population.cc
parent 4ade79ae
...@@ -121,7 +121,7 @@ int SourcePopulation::print(int options) // default options=1 in header ...@@ -121,7 +121,7 @@ int SourcePopulation::print(int options) // default options=1 in header
*txt_stream<<"spectrum_br1_sigma="<<spectrum_br1_sigma<<endl; *txt_stream<<"spectrum_br1_sigma="<<spectrum_br1_sigma<<endl;
*txt_stream<<"spectrum_g_2_sigma="<<spectrum_g_2_sigma<<endl; *txt_stream<<"spectrum_g_2_sigma="<<spectrum_g_2_sigma<<endl;
*txt_stream<<"source flux detection limit="<<flux_detection_limit<<endl; *txt_stream<<"user-defined source flux detection limit="<<flux_detection_limit<<endl;
*txt_stream<<"longitude range 1 "<<long_min1<<" to "<<long_max1<<endl; *txt_stream<<"longitude range 1 "<<long_min1<<" to "<<long_max1<<endl;
*txt_stream<<"longitude range 2 "<<long_min2<<" to "<<long_max2<<endl; *txt_stream<<"longitude range 2 "<<long_min2<<" to "<<long_max2<<endl;
...@@ -791,20 +791,20 @@ int SourcePopulation::analyse_sample() ...@@ -791,20 +791,20 @@ int SourcePopulation::analyse_sample()
cout<<"source statistics sample i="<<i<<" Fermi sensitivity l="<<sample_l[i] <<" b="<<sample_b[i] cout<<"source statistics sample i="<<i<<" Fermi sensitivity l="<<sample_l[i] <<" b="<<sample_b[i]
<<" theta="<<theta<<" phi="<<phi; <<" theta="<<theta<<" phi="<<phi;
// cout<<" interpolated value="<<healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_)<<endl; // cout<<" interpolated value="<<healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_)<<endl;
flux_detection_limit = healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_); flux_detection_limit_sensitivity_file = healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_); //AWS20200713 was flux_detection_limit
cout<<" flux detection limit="<<flux_detection_limit<<" sample flux="<<sample_flux[i]<<endl; cout<<" flux detection limit_sensitivity_file="<<flux_detection_limit_sensitivity_file<<" sample flux="<<sample_flux[i]<<endl;
} }
dlnN_dlnS [ii]++; dlnN_dlnS [ii]++;
FS [ii]+= sample_flux[i]; FS [ii]+= sample_flux[i];
if(sample_flux[i]<flux_detection_limit) //AWS20170123 if(sample_flux[i]<flux_detection_limit_sensitivity_file) //AWS20200713
{ //AWS20170123 { //AWS20170123
dlnN_dlnS_sublimit[ii]++; //AWS20170123 dlnN_dlnS_sublimit[ii]++; //AWS20170123
FS_sublimit[ii]+= sample_flux[i]; //AWS20170123 FS_sublimit[ii]+= sample_flux[i]; //AWS20170123
} //AWS20170123 } //AWS20170123
if(sample_flux[i]>flux_detection_limit) //AWS20170123 if(sample_flux[i]>flux_detection_limit_sensitivity_file) //AWS20200713
{ //AWS20170123 { //AWS20170123
dlnN_dlnS_soplimit[ii]++; //AWS20170123 dlnN_dlnS_soplimit[ii]++; //AWS20170123
FS_soplimit[ii]+= sample_flux[i]; //AWS20170123 FS_soplimit[ii]+= sample_flux[i]; //AWS20170123
...@@ -829,7 +829,7 @@ int SourcePopulation::analyse_sample() ...@@ -829,7 +829,7 @@ int SourcePopulation::analyse_sample()
if(sample_flux[i]<flux_detection_limit) if(sample_flux[i]<flux_detection_limit_sensitivity_file) //AWS20200713
{ {
sample_selected_sourcecnt_sublimit++; sample_selected_sourcecnt_sublimit++;
sample_selected_total_flux_sublimit+=sample_flux[i]; sample_selected_total_flux_sublimit+=sample_flux[i];
...@@ -839,7 +839,7 @@ int SourcePopulation::analyse_sample() ...@@ -839,7 +839,7 @@ int SourcePopulation::analyse_sample()
if (sample_d[i] > sample_selected_d_max_sublimit) sample_selected_d_max_sublimit= sample_d[i]; if (sample_d[i] > sample_selected_d_max_sublimit) sample_selected_d_max_sublimit= sample_d[i];
} }
if(sample_flux[i]>flux_detection_limit) if(sample_flux[i]>flux_detection_limit_sensitivity_file) //AWS20200713
{ {
sample_selected_sourcecnt_soplimit++; sample_selected_sourcecnt_soplimit++;
sample_selected_total_flux_soplimit+=sample_flux[i]; sample_selected_total_flux_soplimit+=sample_flux[i];
...@@ -867,12 +867,12 @@ int SourcePopulation::analyse_sample() ...@@ -867,12 +867,12 @@ int SourcePopulation::analyse_sample()
{ {
longprof_intensity [ii] += sample_flux[i]; longprof_intensity [ii] += sample_flux[i];
if(sample_flux[i]<flux_detection_limit) if(sample_flux[i]<flux_detection_limit_sensitivity_file) //AWS20200713
longprof_intensity_sublimit[ii] += sample_flux[i]; longprof_intensity_sublimit[ii] += sample_flux[i];
longprof_sourcecnt [ii] ++ ; longprof_sourcecnt [ii] ++ ;
if(sample_flux[i]<flux_detection_limit) if(sample_flux[i]<flux_detection_limit_sensitivity_file) //AWS20200713
longprof_sourcecnt_sublimit[ii] ++ ; longprof_sourcecnt_sublimit[ii] ++ ;
}//if ii }//if ii
...@@ -891,12 +891,12 @@ int SourcePopulation::analyse_sample() ...@@ -891,12 +891,12 @@ int SourcePopulation::analyse_sample()
{ {
latprof_intensity [ii] += sample_flux[i]; latprof_intensity [ii] += sample_flux[i];
if(sample_flux[i]<flux_detection_limit) if(sample_flux[i]<flux_detection_limit_sensitivity_file) //AWS20200713
latprof_intensity_sublimit[ii] += sample_flux[i]; latprof_intensity_sublimit[ii] += sample_flux[i];
latprof_sourcecnt [ii] ++ ; latprof_sourcecnt [ii] ++ ;
if(sample_flux[i]<flux_detection_limit) if(sample_flux[i]<flux_detection_limit_sensitivity_file) //AWS20200713
latprof_sourcecnt_sublimit[ii] ++ ; latprof_sourcecnt_sublimit[ii] ++ ;
}//if ii }//if ii
...@@ -1064,8 +1064,8 @@ int SourcePopulation::analyse_sample() ...@@ -1064,8 +1064,8 @@ int SourcePopulation::analyse_sample()
cout<<"skymap generation source sample i="<<i<<" Fermi sensitivity l="<<sample_l[i] <<" b="<<sample_b[i] cout<<"skymap generation source sample i="<<i<<" Fermi sensitivity l="<<sample_l[i] <<" b="<<sample_b[i]
<<" theta="<<theta<<" phi="<<phi; <<" theta="<<theta<<" phi="<<phi;
// cout<<" interpolated value="<<healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_)<<endl; // cout<<" interpolated value="<<healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_)<<endl;
flux_detection_limit = healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_); flux_detection_limit_sensitivity_file = healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_); //AWS20200713
cout<<" flux detection limit="<<flux_detection_limit<<" sample flux="<<sample_flux[i]<<endl; cout<<" flux detection limit_sensitivity_file="<<flux_detection_limit_sensitivity_file<<" sample flux="<<sample_flux[i]<<endl;
} }
ii=int( (log10(sample_flux[i])-lnS_min)/dlnS ); ii=int( (log10(sample_flux[i])-lnS_min)/dlnS );
...@@ -1085,18 +1085,18 @@ int SourcePopulation::analyse_sample() ...@@ -1085,18 +1085,18 @@ int SourcePopulation::analyse_sample()
{ {
skymap_intensity.d2[il][ib].s[0] += sample_flux[i]; skymap_intensity.d2[il][ib].s[0] += sample_flux[i];
if(sample_flux[i]<flux_detection_limit) if(sample_flux[i]<flux_detection_limit_sensitivity_file) //AWS20200713
skymap_intensity_sublimit.d2[il][ib].s[0] += sample_flux[i]; skymap_intensity_sublimit.d2[il][ib].s[0] += sample_flux[i];
if(sample_flux[i]>flux_detection_limit) if(sample_flux[i]>flux_detection_limit_sensitivity_file) //AWS20200713
skymap_intensity_soplimit.d2[il][ib].s[0] += sample_flux[i]; skymap_intensity_soplimit.d2[il][ib].s[0] += sample_flux[i];
skymap_sourcecnt.d2[il][ib].s[0] ++ ; skymap_sourcecnt.d2[il][ib].s[0] ++ ;
if(sample_flux[i]<flux_detection_limit) if(sample_flux[i]<flux_detection_limit_sensitivity_file) //AWS20200713
skymap_sourcecnt_sublimit.d2[il][ib].s[0] ++ ; skymap_sourcecnt_sublimit.d2[il][ib].s[0] ++ ;
if(sample_flux[i]>flux_detection_limit) if(sample_flux[i]>flux_detection_limit_sensitivity_file) //AWS20200713
skymap_sourcecnt_soplimit.d2[il][ib].s[0] ++ ; skymap_sourcecnt_soplimit.d2[il][ib].s[0] ++ ;
...@@ -1110,15 +1110,15 @@ int SourcePopulation::analyse_sample() ...@@ -1110,15 +1110,15 @@ int SourcePopulation::analyse_sample()
// cout<<"SourcePopulation healpix maps: l="<<sample_l[i]<<" b="<<sample_b[i]<<" ipix="<<ipix<<endl; // cout<<"SourcePopulation healpix maps: l="<<sample_l[i]<<" b="<<sample_b[i]<<" ipix="<<ipix<<endl;
healpix_skymap_sourcecnt [ipix][0]++; healpix_skymap_sourcecnt [ipix][0]++;
if(sample_flux[i]<flux_detection_limit) healpix_skymap_sourcecnt_sublimit[ipix][0]++; if(sample_flux[i]<flux_detection_limit_sensitivity_file) healpix_skymap_sourcecnt_sublimit[ipix][0]++;
if(sample_flux[i]>flux_detection_limit) healpix_skymap_sourcecnt_soplimit[ipix][0]++; if(sample_flux[i]>flux_detection_limit_sensitivity_file) healpix_skymap_sourcecnt_soplimit[ipix][0]++;
if(skymap_method==1)//AWS20100820 if(skymap_method==1)//AWS20100820
{ {
healpix_skymap_intensity [ipix][0]+= sample_flux[i]; healpix_skymap_intensity [ipix][0]+= sample_flux[i];
if(sample_flux[i]<flux_detection_limit) healpix_skymap_intensity_sublimit[ipix][0]+= sample_flux[i]; if(sample_flux[i]<flux_detection_limit_sensitivity_file) healpix_skymap_intensity_sublimit[ipix][0]+= sample_flux[i];
if(sample_flux[i]>flux_detection_limit) healpix_skymap_intensity_soplimit[ipix][0]+= sample_flux[i]; if(sample_flux[i]>flux_detection_limit_sensitivity_file) healpix_skymap_intensity_soplimit[ipix][0]+= sample_flux[i];
} }
// using source spectra directly // using source spectra directly
...@@ -1127,15 +1127,15 @@ int SourcePopulation::analyse_sample() ...@@ -1127,15 +1127,15 @@ int SourcePopulation::analyse_sample()
for(int iE=0;iE<n_E;iE++) for(int iE=0;iE<n_E;iE++)
{ {
healpix_skymap_intensity_spectrum [ipix][iE]+= sample_flux_spectra[i][iE]; healpix_skymap_intensity_spectrum [ipix][iE]+= sample_flux_spectra[i][iE];
if(sample_flux[i]<flux_detection_limit) healpix_skymap_intensity_spectrum_sublimit[ipix][iE]+= sample_flux_spectra[i][iE]; if(sample_flux[i]<flux_detection_limit_sensitivity_file) healpix_skymap_intensity_spectrum_sublimit[ipix][iE]+= sample_flux_spectra[i][iE];
if(sample_flux[i]>flux_detection_limit) healpix_skymap_intensity_spectrum_soplimit[ipix][iE]+= sample_flux_spectra[i][iE]; if(sample_flux[i]>flux_detection_limit_sensitivity_file) healpix_skymap_intensity_spectrum_soplimit[ipix][iE]+= sample_flux_spectra[i][iE];
} }
for(int iE=0;iE<n_E_bin;iE++) for(int iE=0;iE<n_E_bin;iE++)
{ {
healpix_skymap_intensity [ipix][iE]+= sample_binned_flux_spectra[i][iE]; healpix_skymap_intensity [ipix][iE]+= sample_binned_flux_spectra[i][iE];
if(sample_flux[i]<flux_detection_limit) healpix_skymap_intensity_sublimit [ipix][iE]+= sample_binned_flux_spectra[i][iE]; if(sample_flux[i]<flux_detection_limit_sensitivity_file) healpix_skymap_intensity_sublimit [ipix][iE]+= sample_binned_flux_spectra[i][iE];
if(sample_flux[i]>flux_detection_limit) healpix_skymap_intensity_soplimit [ipix][iE]+= sample_binned_flux_spectra[i][iE]; if(sample_flux[i]>flux_detection_limit_sensitivity_file) healpix_skymap_intensity_soplimit [ipix][iE]+= sample_binned_flux_spectra[i][iE];
} }
} }
......
...@@ -94,6 +94,8 @@ class SourcePopulation ...@@ -94,6 +94,8 @@ class SourcePopulation
int latprof_nlat; int latprof_nlat;
double flux_detection_limit; double flux_detection_limit;
double flux_detection_limit_sensitivity_file; //AWS20200713
long i_flux_min,i_flux_max; long i_flux_min,i_flux_max;
......
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