discretize_scan#

pride.utils.discretize_scan(reference_epoch: datetime.datetime, initial_offset: int, final_offset: int, scan_id: str = '') list[datetime.datetime]#

Discretize a scan using internal constraints

Given the reference epoch, and the initial and final offsets of a scan, discretizes it according to internal constraints defined in the data submodule (config.yaml). The constraints are: - Minimum number of observations per scan

Given the initial and final offsets of a scan, the function calculates a step size required for the discretization to comply with the minimum number of observations per scan defined in data/config.yaml, as well as with the minimum allowed step size. If all the criteria are met, the function will return the default step size, and the associated number of observations.

Parameters:
  • reference_epoch – Reference initial epoch of the scan

  • initial_offset – Initial offset of the scan

  • final_offset – Final offset of the scan

  • scan_id – ID of the scan (for logging purposes)

Return discretized_time_range:

List of datetime objects representing the

discretized time range for the scan