|
pueoAnalysisTools
|
Applies SciPy's function minimize() to calibrate antenna phase centers More...
Functions | |
| pl.DataFrame | generate_antenna_phase_center_pairs_with_placeholders (Path qrh_dot_dat, Path|None offset_inSIM=None, ant_type='MI') |
| Creates antenna pairs with placeholder integers as antenna phase centers. | |
| [int] | __get_all_run_numbers (Path pueo_data) |
| A temporary helper function of load_dataset_and_measure_time_delays() | |
| pl.DataFrame | load_dataset_and_measure_time_delays (ROOT.pueo.Dataset dataset, pl.DataFrame phase_center_pairs, str pulser_station='taylor_dome', MC=False, AntType='MI', str IcefinalFileDir='', int singlerun='', list event_list=None, UPSAMPLE=1) |
| Uses SciPy's correlate() to "measure" the delays of waveforms between antenna pairs. | |
| pl.DataFrame | _scipy_cross_correlate_all_pairs_for_one_event (pl.DataFrame phase_center_pairs, pl.DataFrame waveforms) |
| A helper function of load_dataset_and_measure_time_delays() | |
| retrieve_relevant_antennas_from_all_pairs (pl.DataFrame phase_center_pairs) | |
| Retrieves the (unique) antennas, given a bunch of antenna pairs. | |
| float | objective_function (pl.Series phase_center_guess, pl.Series phase_center_placeholders, pl.DataFrame pulser_directions_and_measured_time_delays, str axis, str loss_type="l2", float delta=0.3) |
| Computes the expected time delays and compares them with the measured time delays, designed to be run by SciPy's minimizer. | |
| _plot_calibration_result (str axis, pl.DataFrame before, np.ndarray after, anttype='MI') | |
Applies SciPy's function minimize() to calibrate antenna phase centers
| pl.DataFrame generate_antenna_phase_center_pairs_with_placeholders | ( | Path | qrh_dot_dat, |
| Path | None | offset_inSIM = None, | ||
| ant_type = 'MI' ) |
Creates antenna pairs with placeholder integers as antenna phase centers.
| [in] | qrh_dot_dat | Path to qrh.dat |
| nominal_phase_center_pairs |
qrh.dat to obtain antenna face center positionsDefinition at line 20 of file calibration.py.
|
private |
A temporary helper function of load_dataset_and_measure_time_delays()
| [in] | pueo_data | See the parameter of initialise.load_pueoEvent_Dataset |
run/ subdirectories in pueo_dataDefinition at line 111 of file calibration.py.
| pl.DataFrame load_dataset_and_measure_time_delays | ( | ROOT.pueo.Dataset | dataset, |
| pl.DataFrame | phase_center_pairs, | ||
| str | pulser_station = 'taylor_dome', | ||
| MC = False, | |||
| AntType = 'MI', | |||
| str | IcefinalFileDir = '', | ||
| int | singlerun = '', | ||
| list | event_list = None, | ||
| UPSAMPLE = 1 ) |
Uses SciPy's correlate() to "measure" the delays of waveforms between antenna pairs.
| [in] | dataset | The output of initialise.load_pueoEvent_Dataset |
| [in] | phase_center_pairs | The output of generate_antenna_phase_center_pairs_with_placeholders |
| [in] | pulser_station | For data, which pulser station the data is from, taylor_dome, ldb, s200 |
| [in] | MC | This is MC or not |
| [in] | AntType | This is for MI or LF |
| [in] | IcefinalFileDir | Temporary input, only for the LF + MC combination, the dataformat is not ready, so we read waveform from root file diretly. Path to the IceFinal Root file |
| [in] | singlerun | If specified, only use one run instead of all runs in the data directory |
| [in] | UPSAMPPLE | Upsample factor |
| pulser_directions_and_measured_time_delays |
dataset should have been initialized with a (valid) run number, but that is not the only run that gets loaded. For now, all runs are used.dataset is also used to load the directions of the incoming pulses ( \(^\circ\phi\) and \(^\circ\theta\) in payload coordinates).measured time delays (ns) is computed by the helper function _scipy_cross_correlate_all_pairs_for_one_event(). Definition at line 131 of file calibration.py.
|
protected |
A helper function of load_dataset_and_measure_time_delays()
| [in] | phase_center_pairs | The output of generate_antenna_phase_center_pairs_with_placeholders |
| [in] | waveforms | The output of waveform_plots.load_waveforms |
| measured_time_delays |
measured time delays (ns) in the output dataframe.Definition at line 263 of file calibration.py.
| retrieve_relevant_antennas_from_all_pairs | ( | pl.DataFrame | phase_center_pairs | ) |
Retrieves the (unique) antennas, given a bunch of antenna pairs.
| [in] | phase_center_pairs | The output of load_dataset_and_measure_time_delays |
| relevant_antennas |
Definition at line 349 of file calibration.py.
| float objective_function | ( | pl.Series | phase_center_guess, |
| pl.Series | phase_center_placeholders, | ||
| pl.DataFrame | pulser_directions_and_measured_time_delays, | ||
| str | axis, | ||
| str | loss_type = "l2", | ||
| float | delta = 0.3 ) |
Computes the expected time delays and compares them with the measured time delays, designed to be run by SciPy's minimizer.
| [in] | phase_center_guess | The output of retrieve_relevant_antennas_from_all_pairs |
| [in] | phase_center_placeholders | The output of retrieve_relevant_antennas_from_all_pairs |
| [in] | pulser_directions_and_measured_time_delays | The output of load_dataset_and_measure_time_delays |
| [in] | axis | Axis to fit: \(\rho\), \(\phi\), or \(z\) |
| [in] | loss_type | The loss function type to minimize, "l2" is sum(residual square), "l1" is sum(abs(residual)), "huber_loss" is a combined of l1 and l2. l2 is default. |
| [in] | delta | paramter if you use "huber_loss" |
| total_difference_bw_expected_time_delay_and_measured_time_delay | A scalar |
measured_time_delay has already been computed.phase_center_guess, replace the placeholder antenna phase centers in pulser_directions_and_pairwise_time_delaysexpected time delay based on the dot product between \(\bf{d}\) and incoming pulse direction (Phi Theta), see this figure for an illustration. phase_center_guess. Definition at line 421 of file calibration.py.
|
protected |
| [in] | axis | Axis to fit: \(\rho\), \(\phi\), or \(z\) |
| [in] | before | The output of of retrieve_relevant_antennas_from_all_pairs |
| [in] | after | The restul.x of running scipy.optimize.minimize on objective_function |
Nothing crazy here!
Definition at line 587 of file calibration.py.