Commit cd129a14 authored by Andrew Strong's avatar Andrew Strong

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
*txt_stream<<"spectrum_br1_sigma="<<spectrum_br1_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 2 "<<long_min2<<" to "<<long_max2<<endl;
......@@ -791,20 +791,20 @@ int SourcePopulation::analyse_sample()
cout<<"source statistics sample i="<<i<<" Fermi sensitivity l="<<sample_l[i] <<" b="<<sample_b[i]
<<" theta="<<theta<<" phi="<<phi;
// cout<<" interpolated value="<<healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_)<<endl;
flux_detection_limit = healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_);
cout<<" flux detection limit="<<flux_detection_limit<<" sample flux="<<sample_flux[i]<<endl;
flux_detection_limit_sensitivity_file = healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_); //AWS20200713 was flux_detection_limit
cout<<" flux detection limit_sensitivity_file="<<flux_detection_limit_sensitivity_file<<" sample flux="<<sample_flux[i]<<endl;
}
dlnN_dlnS [ii]++;
FS [ii]+= sample_flux[i];
if(sample_flux[i]<flux_detection_limit) //AWS20170123
if(sample_flux[i]<flux_detection_limit_sensitivity_file) //AWS20200713
{ //AWS20170123
dlnN_dlnS_sublimit[ii]++; //AWS20170123
FS_sublimit[ii]+= sample_flux[i]; //AWS20170123
} //AWS20170123
if(sample_flux[i]>flux_detection_limit) //AWS20170123
if(sample_flux[i]>flux_detection_limit_sensitivity_file) //AWS20200713
{ //AWS20170123
dlnN_dlnS_soplimit[ii]++; //AWS20170123
FS_soplimit[ii]+= sample_flux[i]; //AWS20170123
......@@ -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_total_flux_sublimit+=sample_flux[i];
......@@ -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_flux[i]>flux_detection_limit)
if(sample_flux[i]>flux_detection_limit_sensitivity_file) //AWS20200713
{
sample_selected_sourcecnt_soplimit++;
sample_selected_total_flux_soplimit+=sample_flux[i];
......@@ -867,12 +867,12 @@ int SourcePopulation::analyse_sample()
{
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_sourcecnt [ii] ++ ;
if(sample_flux[i]<flux_detection_limit)
if(sample_flux[i]<flux_detection_limit_sensitivity_file) //AWS20200713
longprof_sourcecnt_sublimit[ii] ++ ;
}//if ii
......@@ -891,12 +891,12 @@ int SourcePopulation::analyse_sample()
{
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_sourcecnt [ii] ++ ;
if(sample_flux[i]<flux_detection_limit)
if(sample_flux[i]<flux_detection_limit_sensitivity_file) //AWS20200713
latprof_sourcecnt_sublimit[ii] ++ ;
}//if ii
......@@ -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]
<<" theta="<<theta<<" phi="<<phi;
// cout<<" interpolated value="<<healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_)<<endl;
flux_detection_limit = healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_);
cout<<" flux detection limit="<<flux_detection_limit<<" sample flux="<<sample_flux[i]<<endl;
flux_detection_limit_sensitivity_file = healpix_skymap_Fermi_sensitivity.interpolated_value(pointing_); //AWS20200713
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 );
......@@ -1085,18 +1085,18 @@ int SourcePopulation::analyse_sample()
{
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];
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_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] ++ ;
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] ++ ;
......@@ -1110,15 +1110,15 @@ int SourcePopulation::analyse_sample()
// cout<<"SourcePopulation healpix maps: l="<<sample_l[i]<<" b="<<sample_b[i]<<" ipix="<<ipix<<endl;
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) healpix_skymap_sourcecnt_soplimit[ipix][0]++;
if(sample_flux[i]<flux_detection_limit_sensitivity_file) healpix_skymap_sourcecnt_sublimit[ipix][0]++;
if(sample_flux[i]>flux_detection_limit_sensitivity_file) healpix_skymap_sourcecnt_soplimit[ipix][0]++;
if(skymap_method==1)//AWS20100820
{
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) healpix_skymap_intensity_soplimit[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_sensitivity_file) healpix_skymap_intensity_soplimit[ipix][0]+= sample_flux[i];
}
// using source spectra directly
......@@ -1127,15 +1127,15 @@ int SourcePopulation::analyse_sample()
for(int iE=0;iE<n_E;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) 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_sublimit[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++)
{
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) healpix_skymap_intensity_soplimit [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_sensitivity_file) healpix_skymap_intensity_soplimit [ipix][iE]+= sample_binned_flux_spectra[i][iE];
}
}
......
......@@ -94,6 +94,8 @@ class SourcePopulation
int latprof_nlat;
double flux_detection_limit;
double flux_detection_limit_sensitivity_file; //AWS20200713
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