Skip to content

Commit

Permalink
Allow binned map to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecThomson committed Jul 23, 2024
1 parent f2f2e0f commit 2175d27
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions arrakis/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,22 @@ def plot_leakage(
hi_i_tab["stokesU_frac"] = hi_i_tab["stokesU"] / hi_i_tab["stokesI"]
leakage_dict = {}
for stokes in "QU":
leakage_dict[stokes] = make_binned_map(
hi_i_tab, f"stokes{stokes}_frac", npix=npix, bins=bins, map_size=map_size
)
try:
leakage_dict[stokes] = make_binned_map(
hi_i_tab,
f"stokes{stokes}_frac",
npix=npix,
bins=bins,
map_size=map_size,
)
except Exception as e:
logger.error(f"Error in making binned map for {stokes}: {e}")
leakage_dict[stokes] = BinnedMap(
np.full((bins, bins), np.nan),
np.linspace(-4, 4, bins),
np.linspace(-4, 4, bins),
WCS(),
)

per_subplot_kw = {
stokes: {"projection": val.wcs} for stokes, val in leakage_dict.items()
Expand Down

0 comments on commit 2175d27

Please sign in to comment.