diff --git a/lya_2pt/forest_healpix_reader.py b/lya_2pt/forest_healpix_reader.py index bed5a91..14c0933 100644 --- a/lya_2pt/forest_healpix_reader.py +++ b/lya_2pt/forest_healpix_reader.py @@ -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) diff --git a/lya_2pt/read_io.py b/lya_2pt/read_io.py index 5ba746d..add0257 100644 --- a/lya_2pt/read_io.py +++ b/lya_2pt/read_io.py @@ -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