1 #include "AnalysisConfig.h" 2 #include "SystemResponse.h" 5 #include "AnitaVersion.h" 7 static const char * peakfinders[] = {
"Abby",
"Bicubic",
"Gaussian",
"QuadraticFit9",
"QuadraticFit16",
"QuadraticFit25",
"Histogram" };
8 static const char * responses[] = {
"None",
"SingleBRotter",
"IndividualBRotter",
"HarmSignalOnly",
"TUFFs",
"A4noNotches",
"A4ImpulseTUFFs",
"A4OldImpulseTUFFs"};
11 #ifdef ENABLE_LIBCONFIG 12 #include "libconfig.h++" 13 #define LOOKUP(X) cfg.lookupValue(#X,X) 15 void lookupEnum(libconfig::Config * cfg,
const char * key,
int * val,
int N,
const char ** allowed)
17 if (!cfg->exists(key))
return;
19 libconfig::Setting &
set = cfg->lookup(key);
21 for (
int i = 0; i < N; i++)
23 if (!strcasecmp(
set, allowed[i]))
30 fprintf(stderr,
"Config Parse Error on line %d: %s must be one of: \n\t",
set.getSourceLine(), key);
33 for (
int i = 0; i < N; i++)
35 fprintf(stderr,
"%s ", allowed[i]);
38 fprintf(stderr,
"\n But %s was given.", (
const char * )
set);
46 libconfig::Config cfg;
47 cfg.setAutoConvert(
true);
48 cfg.readFile(config_file);
51 LOOKUP(correlator_nphi);
69 LOOKUP(spectral_fit_stop);
70 LOOKUP(noise_estimate_t0);
72 LOOKUP(response_npad);
75 LOOKUP(max_mean_power_filtered);
76 LOOKUP(max_median_power_filtered);
77 LOOKUP(max_bottom_to_top_ratio);
82 LOOKUP(fill_channel_info);
85 LOOKUP(max_theta_adjustment);
96 LOOKUP(r_time_shift_correction);
97 LOOKUP(simulation_time_shift_correction);
98 LOOKUP(correlator_gain_correction);
99 const char * pols[] = {
"horizontal",
"vertical" };
100 lookupEnum(&cfg,
"start_pol", (
int*) &
start_pol, 2,pols);
101 lookupEnum(&cfg,
"end_pol", (
int*) &
end_pol, 2,pols);
102 lookupEnum(&cfg,
"fine_peak_finding_option", (
int*) &fine_peak_finding_option,
sizeof(peakfinders)/
sizeof(
char *), peakfinders);
103 lookupEnum(&cfg,
"response_option", (
int*) &response_option,
sizeof(responses)/
sizeof(
char *), responses);
111 fprintf(stderr,
"Not compiled with support for reading config files. You need libconfig for that.\n");
117 const int wais_hpol_time_offset[5] = {0,0,0,93,11000};
118 const int wais_vpol_time_offset[5] = {0,0,0,-99757,1000};
119 const int siple_hpol_time_offset = -41;
120 const int siple_vpol_time_offset = +328;
124 wais_hpol(wais_hpol_time_offset[
AnitaVersion::get()], 800e3, 1e3),
125 wais_vpol(wais_vpol_time_offset[
AnitaVersion::get()], 800e3, 1e3),
126 siple_hpol(siple_hpol_time_offset, 800e3, 1e3),
127 siple_vpol(siple_vpol_time_offset, 800e3, 1e3)
129 correlator_nphi = 180;
162 spectral_fit_stop =0.55;
164 noise_estimate_t0 = 70;
167 response_option = ResponseNone;
171 max_mean_power_filtered = 1e6;
172 max_median_power_filtered = 1e6;
173 max_bottom_to_top_ratio = 5;
174 max_theta_adjustment = 3;
187 fill_channel_info =
true;
195 r_time_shift_correction =
true;
196 simulation_time_shift_correction =
false;
214 if (the_ldb_hist)
return the_ldb_hist;
217 fname.Form(
"%s/share/UCorrelator/ldbSelection.root", getenv(
"ANITA_UTIL_INSTALL_DIR"));
223 fprintf(stderr,
"WARNING: data/ldbSelection.root doesn't exist. This is probably because you haven't generated it.\n. If you don't care about LDB pulsers, ignore this. Otherwise, you can generate one using the makeLDBSelection.C macro.\n");
229 the_ldb_hist = (TH2*) f.Get(
"ldbHist")->Clone(
"LDBHistogram");
230 the_ldb_hist->SetDirectory(0);
236 const char * UCorrelator::AnalysisConfig::getPeakFindingString(FinePeakFindingOption_t opt)
238 return peakfinders[opt];
241 const char * UCorrelator::AnalysisConfig::getResponseString(ResponseOption_t opt)
244 return opt == ResponseCustomString ? 0 : responses[opt];
248 UCorrelator::AnalysisConfig::~AnalysisConfig()
250 if (the_ldb_hist)
delete the_ldb_hist;
AnalysisConfig(const char *config_file=0)
double zoomed_dphi
number of theta bins in zoomed correlation map
double cross_correlate_hv
double correlation_gain_correction
exponent for baseline weighting of correlation maps (since longer baselines give you better resolutio...
bool use_forced_trigger_rms
bool use_coherent_spectra
double noise_estimate_t1
this is used to pick parts of the waveform for calcuating the N in SNR
bool scale_by_cos_theta
this is used to pick parts of the waveform for calcuating the N in SNR
bool use_hilbert_for_antenna_average
int zoomed_nant
size of theta bins in zoomed correlation map
double max_peak_trigger_angle
Minimum distance.
int zoomed_ntheta
number of phi bins in zoomed correlation map
bool compute_shape_parameters
int zoomed_nphi
enable group delay in interferometer
quadratic fit near peak, using 16 bins
unsigned combine_nantennas
If non-zero, limit antennas considered in zoomed correlation map to nearest zoomed_nant antennas...
double baseline_weight
use offline phi masking / l1 triggers (default true)
int use_antenna_level_snr
AnitaResponse::DeconvolutionMethod * deconvolution_method
unsigned correlator_ntheta
Number of phi bins in rough correlation map.
double peak_isolation_requirement
End polarization for Analyer (kHORIZONTAL if you want just hpo. kVERTICAL if you want just vpol or bo...
double correlator_theta_lowest
Number of theta bins in rough correlation map.
double zoomed_dtheta
size of phi bins in zoomed correlation map
double bw_ndb
True to use bin center in interferometric map.
unsigned combine_npad
number of antennas used to create coherent / deconvolved waveforms
bool use_offline_mask
Scale peak values by cos theta when picking max (due to different bin sizes)
bool use_bin_center
number of maxima computed
int min_peak_distance_from_unmasked
Maximum distance from trigger angle to consider a peak (<=0 is any, default 0);.
bool enable_group_delay
Highest elevation considered, measured as positive above horizon. (negative would be below horizon) ...
double saturation_threshold
supersampling factor for combining waveforms (i.e. how many times to pad in fourier domain...
void loadFromFile(const char *config_file)
double correlator_theta_highest
Lowest elevation considred, measured as positive below horizon. (negative would be above horizon) ...
AnitaPol::AnitaPol_t start_pol
threshold to consider a waveform saturated
double spectral_fit_start
the bandwidth of a waveform is defined as the portion of the power spectrum near the highest value ab...
AnitaPol::AnitaPol_t end_pol
Start polarization for Analyer (kHORIZONTAL if you want just hpol or both, kVERTICAL if you want just...