Improve error handling for failed PSD
If the PSD cannot be read in with np.genfromtxt
(for example if the PSD has a few corrupt lines) pesummary returns the warning message:
2021-03-16 11:51:52 PESummary INFO : Failed to read in PSD data because Some errors were detected !
Line #72313 (got 3 columns instead of 2)
Line #85622 (got 1 columns instead of 2).
But later fails with the error:
Traceback (most recent call last):
File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py37//bin/summarypages", line 10, in <module>
sys.exit(main())
File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py37/lib/python3.7/site-packages/pesummary/cli/summarypages.py", line 208, in main
args = func["input"](opts)
File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py37/lib/python3.7/site-packages/pesummary/gw/inputs.py", line 914, in __init__
self.copy_files()
File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py37/lib/python3.7/site-packages/pesummary/gw/inputs.py", line 922, in copy_files
self.psd[label][ifo].save_to_file(
AttributeError: 'dict' object has no attribute 'save_to_file'
This error message should be improved to highlight the exact issue with the PSD. cc @aaron.zimmerman
Edited by Charlie Hoy