Skip to content

MAINT: take previous calibration envelope to avoid randomly named calibration files

Colm Talbot requested to merge take-previous-calibration-file into master

The calibration group recently stopped producing useable v0 uncertainty envelopes and changed the naming convention in Calibration/pydarm!385 (merged).

This broke the calibration lookup couldn't handle directories that don't contain a valid uncertainty file. By taking the previous rather than closest calibration envelope we can avoid this issue

This snippet compares the proposed and current versions.

In [4]: calibration_lookup_o4(1407839187.46, "L1")
Out[4]: '/home/cal/public_html/archive/L1/uncertainty/v0/1407/695064/calibration_uncertainty_L1_1407695064.txt'

In [5]: from bilby_pipe.gracedb import calibration_lookup_o4 as calibration_lookup_o4_

In [6]: calibration_lookup_o4_(1407839187.46, "L1")
---------------------------------------------------------------------------
BilbyPipeError                            Traceback (most recent call last)
Cell In[6], line 1
----> 1 calibration_lookup_o4_(1407839187.46, "L1")

File /cvmfs/software.igwn.org/conda/envs/igwn-py310-20240725/lib/python3.10/site-packages/bilby_pipe/gracedb.py:253, in calibration_lookup_o4(trigger_time, detector)
    250                 return os.path.abspath(calib_file)
    251         previous = tt
--> 253 raise BilbyPipeError(
    254     "Requested trigger time prior to earliest calibration file, you may need to "
    255     "use the calibration_lookup_o3."
    256 )

BilbyPipeError: Requested trigger time prior to earliest calibration file, you may need to use the calibration_lookup_o3.

Closes #306 (closed)

Merge request reports