Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecation warnings from MBS #158

Merged
merged 2 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

- Upgrade NumPy from 1.20 to 1.21, Numba from 0.54 to 0.55, Rich from 6.2 to 11.0 [#152](https://github.com/litebird/litebird_sim/pull/152)

- Remove NumPy's and Healpy's deprecation warnings [#158](https://github.com/litebird/litebird_sim/pull/158)

- Fix issue [#148](https://github.com/litebird/litebird_sim/issues/148)

- Use a cache to speed up CI builds [PR#147](https://github.com/litebird/litebird_sim/pull/147)
Expand Down
17 changes: 10 additions & 7 deletions litebird_sim/mbs/mbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def generate_cmb(self):
band = instr[chnl].bandwidth_ghz
fmin = freq - band / 2.0
fmax = freq + band / 2.0
fsteps = np.int(np.ceil(fmax - fmin) + 1)
fsteps = int(np.ceil(fmax - fmin) + 1)
bandpass_frequencies = np.linspace(fmin, fmax, fsteps) * u.GHz
weights = np.ones(len(bandpass_frequencies))
cmb_map = sky.get_emission(bandpass_frequencies, weights)
Expand All @@ -609,7 +609,8 @@ def generate_cmb(self):
fwhm_arcmin = instr[chnl].fwhm_arcmin
if smooth:
cmb_map_smt = hp.smoothing(
cmb_map, fwhm=np.radians(fwhm_arcmin / 60.0), verbose=False
cmb_map,
fwhm=np.radians(fwhm_arcmin / 60.0),
)
else:
cmb_map_smt = cmb_map
Expand Down Expand Up @@ -685,7 +686,7 @@ def generate_fg(self):
band = instr[chnl].bandwidth_ghz
fmin = freq - band / 2.0
fmax = freq + band / 2.0
fsteps = np.int(np.ceil(fmax - fmin) + 1)
fsteps = int(np.ceil(fmax - fmin) + 1)
bandpass_frequencies = np.linspace(fmin, fmax, fsteps) * u.GHz
weights = np.ones(len(bandpass_frequencies))
sky_extrap = sky.get_emission(bandpass_frequencies, weights)
Expand All @@ -699,7 +700,8 @@ def generate_fg(self):
)
if smooth:
sky_extrap_smt = hp.smoothing(
sky_extrap, fwhm=np.radians(fwhm_arcmin / 60.0), verbose=False
sky_extrap,
fwhm=np.radians(fwhm_arcmin / 60.0),
)
else:
sky_extrap_smt = sky_extrap
Expand Down Expand Up @@ -743,10 +745,11 @@ def write_coadded_maps(self, saved_maps):
fg_file_name = f"{chnl}_{cmp}_{file_str}.fits"
try:
fg_cmp = hp.read_map(
fg_dir_cmp / fg_file_name, (0, 1, 2), verbose=False
fg_dir_cmp / fg_file_name,
(0, 1, 2),
)
except IndexError:
fg_cmp = hp.read_map(fg_dir_cmp / fg_file_name, verbose=False)
fg_cmp = hp.read_map(fg_dir_cmp / fg_file_name)
fg_cmp = np.array(
[fg_cmp, np.zeros_like(fg_cmp), np.zeros_like(fg_cmp)]
)
Expand All @@ -762,7 +765,7 @@ def write_coadded_maps(self, saved_maps):
]

assert len(cmb_map_path) == 1
cmb = hp.read_map(cmb_map_path[0], (0, 1, 2), verbose=False)
cmb = hp.read_map(cmb_map_path[0], (0, 1, 2))
map_tot = fg_tot + cmb

nmc_str = f"{nmc:04d}"
Expand Down