fetch_open_data ignores delete_on_exit=False in some cases
When downloading events from GWTC-1 some events using fetch_open_data
, the delete_on_exit=False
option is ignored, and the HDF5 file is deleted as soon as it's opened (I managed to spot the file briefly appear when I spammed ls
in a separate terminal). It would be very helpful to fix this, and at least document the behavior in the meantime.
In [1]: import os
In [2]: from pesummary.gw.fetch import fetch_open_data
In [3]: fetch_open_data("GW150914", outdir="./", delete_on_exit=False)
Downloading https://dcc.ligo.org/public/0157/P1800370/005/GW150914_GWTC-1.hdf5
|================================================| 7.0M/7.0M (100.00%) 1s
2021-01-22 15:53:27 PESummary WARNING : Failed to find 'log_likelihood' in result file. Setting every sample to have log_likelihood 0
2021-01-22 15:53:27 PESummary WARNING : The redshift is being approximated using interpolation. Bear in mind that this does introduce a small error.
2021-01-22 15:53:28 PESummary WARNING : Could not find reference_frequency in input file. Using 20Hz as default
In [4]: d
Out[4]:
file: GW150914_GWTC-1.hdf5
cls: pesummary.gw.file.formats.GWTC1.GWTC1
nsamples: 8350
parameters: cos_theta_jn, luminosity_distance, ..., cos_tilt_2, log_likelihood
In [5]: os.system("ls GW150914_GWTC-1.hdf5")
ls: cannot access 'GW150914_GWTC-1.hdf5': No such file or directory
Out[5]: 512
Edited by Daniel Wysocki