Skip to content

Unit problem with bandpass_integration in input sky generation #548

Description

@mj-gomes

It seems that when bandpass_integration is set to True in SkyGenerationParams, the output units of the generated maps are incorrect.

Comparing a map generated for the same channel, using only the center frequency vs integrating over the band, we have a factor 1e6 between them. It happens with uK_CMB and K_CMB, so it doesn't seem like a simple conversion missing from one to the other.

I'll look into the source problem as soon as I can. Meanwhile, here is a simple script showing the problem.

UPDATE: I just realized that this happens for the CMB but not for the foregrounds, which may make it easier to find the problem.

imo = lbs.Imo(flatfile_location="schema.json")

chinfo = lbs.FreqChannelInfo.from_imo(
     url=f"/releases/IMo_vPostKDP2_Option2/LMHFT/L1_L/channel_info",
     imo=imo,
)
    
params = SkyGenerationParams(
        nside=256,
        bandpass_integration=True,
        units=Units.uK_CMB,
        output_type="map",
        make_cmb=True,
        seed_cmb=0,
        make_fg=False,
        make_dipole=False,
        apply_beam=True,
    )

sky_gen = SkyGenerator(
            parameters=params,
            channels=chinfo,
        )
sky_cmb = sky_gen.execute()

params = SkyGenerationParams(
        nside=256,
        bandpass_integration=False,
        units=Units.uK_CMB,
        output_type="map",
        make_cmb=True,
        seed_cmb=0,
        make_fg=False,
        make_dipole=False,
        apply_beam=True,
    )

sky_gen = SkyGenerator(
            parameters=params,
            channels=chinfo,
        )
sky_cmb_noBP = sky_gen.execute()

plt.figure()
for i in range(3):
      hp.mollview(sky_cmb["L1_L"].values[i], sub=(2,3,i+1))
      hp.mollview(sky_cmb_noBP["L1_L"].values[i], sub=(2,3,i+4))

plt.show()

Here is the output:

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions