Data timing and signal calibration¶
Determine calibration values for data
This module can be used to determine calibration values from data.
Determine timing offsets for detectors and stations to correct arrival times. Determine the PMT response curve to correct the detected number of MIPs.
- sapphire.analysis.calibration.determine_detector_timing_offsets(events, station=None)¶
Determine the timing offsets between station detectors.
- Parameters:
events – events table of processed events.
station –
sapphire.clusters.Station
object, to determine number of detectors and relative altitudes.
- Returns:
list of detector offsets.
- sapphire.analysis.calibration.determine_detector_timing_offset(dt, dz=0)¶
Determine the timing offset between station detectors.
- Parameters:
dt – array of time differences between detectors (t - t_ref).
dz – height difference between the detectors (z - z_ref).
- Returns:
mean of a gaussian fit to the data corrected for height, and the error of the mean.
- class sapphire.analysis.calibration.DetermineStationTimingOffsets(stations=None, data=None, progress=False, force_stale=False, time_deltas_group='/coincidences/time_deltas')¶
Determine the timing offsets between stations
Initialize the class
- Parameters:
stations – list of stations for which to determine offsets.
data – the PyTables datafile with timedelta tables.
progress – if True show progressbar when determining offsets.
force_stale – if true: do not get network information from API.
time_deltas_group – path to the time deltas group.
- MAX_DISTANCE = 1000¶
- MIN_LEN_DT = 200¶
- read_dt(station, ref_station, start, end)¶
Read timedeltas from HDF5 file
- determine_first_and_last_date(date, station, ref_station)¶
Determine first and last date to include in determination of station offset around date
- Parameters:
date – date around which the bounds are to be determined.
station – station number.
ref_station – reference station number.
- Returns:
start and end date bounds.
- determine_station_timing_offset(date, station, ref_station)¶
Determine the timing offset between a station pair at certain date
- Parameters:
date – date for which to determine offset as datetime.date.
station – station number.
ref_station – reference station number.
- Returns:
station offset and error.
- determine_station_timing_offsets(station, ref_station, start=None, end=None)¶
Determine the timing offsets between a station pair
- Parameters:
station – station number.
ref_station – reference station number.
start – datetime.date object.
end – datetime.date object.
- Returns:
list of station offsets as tuple (timestamp, offset, error).
- determine_station_timing_offsets_for_date(date)¶
Determine the timing offsets between a station pair
- Parameters:
date – date for which to determine offsets as datetime.date.
- Returns:
list of station offsets as tuple (station, ref_station, offset, error).
- get_station_pairs_within_max_distance(date=None)¶
Iterator that yields stations pairs that are close to each other
- sapphire.analysis.calibration.determine_station_timing_offset(dt, dz=0)¶
Determine the timing offset between stations.
- Parameters:
dt – a list of time differences between stations (t - t_ref).
dz – height difference between the stations (z - z_ref).
- Returns:
mean of a gaussian fit to the data corrected for height, and the error of the mean.
- sapphire.analysis.calibration.fit_timing_offset(dt, bins)¶
Fit the time difference distribution.
- Parameters:
dt – a list of time differences between stations (t - t_ref).
bins – bins edges to use for the histogram.
- Returns:
mean of a gaussian fit to the data and the error of the mean.
- sapphire.analysis.calibration.determine_best_reference(filters)¶
Find which detector has most events in common with the others
- Parameters:
filters – list of filters for each detector, selecting rows where that detector has data.
- Returns:
index for the detector that has most rows in common with the other detectors.
- sapphire.analysis.calibration.datetime_range(start, end, step=1)¶
Generator that splits a date range in (almost) equal intervals
The yielded interval lengths are integer days Spreads remaining days over first intervals
- Parameters:
start – date instance
end – date instance
step – the integer number of days in each interval
- Returns:
a tuple of datetime instances for each interval
- sapphire.analysis.calibration.pairwise(iterable)¶
s -> (s0, s1), (s1, s2), (s2, s3), …