[BUG]Code Issues with HERA_H1C_IDR3
Closed this issue · 3 comments
I noticed that HERA_H1C_IDR3 provides data for two redshifts (band8 and band10).
I conducted a test using the following code:
from py21cmmc import core, likelihood
from py21cmmc.cosmoHammer import LikelihoodComputationChain
core_modules = core.Core21cmEMU()
lk = likelihood.Likelihood1DPowerLightcone.from_builtin_data("HERA_H1C_IDR3")
params = None
chain = LikelihoodComputationChain(params)
chain.addCoreModule(core_modules)
chain.addLikelihoodModule(lk)
ctx = chain.createChainContext({})
chain.invokeCoreModules(ctx)
hera_data = lk.data[0]
all_band_keys = []
for key in list(hera_data.keys()):
all_band_keys.append(key)
for j, (band, band_key) in enumerate(zip(lk.redshift, all_band_keys)):
print(j, band, band_key)
This will output:
0 10.37213048494136 band8
1 7.928762977434008 band10
The code snippet
for j, (band, band_key) in enumerate(zip(lk.redshift, all_band_keys))
appears in likelihood.py on line 529. It seems that band8 corresponds to a redshift of 10, while band10 corresponds to a redshift of 8.
If we consider only the HERA_H1C_IDR3 data, I think the following changes might be made:
- Change
interp_ks = self.k[i]
tointerp_ks = self.k[1-i]
at lines 818, 2231, and 2244. - Change
j
to1-j
at lines 544, 551, and 555.
Alternatively, modify the 'z_bands' in the HERA_H1C_IDR3 data from [10.37213048, 7.92876298] to [7.92876298, 10.37213048].
@DanielaBreitman do you have some wise words about this issue?
I just saw this issue I'm so sorry!! Just pushed a fix for this. Will hopefully merge it later today.
@HoisW let us know if the merged fix solves the issue for you!