Skip to content

Commit

Permalink
Fix missing delta lambda flag
Browse files Browse the repository at this point in the history
  • Loading branch information
andreicuceu committed Jun 27, 2024
1 parent 8ddea35 commit d0df9f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lya_2pt/forest_healpix_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def __init__(self, config, file, cosmo, auto_flag=False, need_distortion=False):
rebin_factor = reader_config.getint("rebin")
use_ivar = reader_config.getboolean("use-ivar")
if rebin_factor > 1:
assert self.dwave is not None, "Rebinning does not work with old delta files"
for tracer in self.tracers:
tracer.rebin(rebin_factor, self.dwave, absorption_line, use_ivar=use_ivar)

Expand Down
6 changes: 5 additions & 1 deletion lya_2pt/read_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ def read_from_hdu(hdul, absorption_line, healpix_id, need_distortion=False, proj
ReaderException if both LOGLAM and LAMBDA extensions are not
in the HDU list
"""
dwave = hdul[1].read_header()['DELTA_LAMBDA']
header = hdul[1].read_header()
if 'DELTA_LAMBDA' in header:
dwave = ['DELTA_LAMBDA']
else:
dwave = None

tracers = []
wave_solution = None
Expand Down

0 comments on commit d0df9f1

Please sign in to comment.