Skip to content

Commit 32a2a50

Browse files
author
Merry Duparc
committed
add possibility to put no apodization in get_window
1 parent e73cd32 commit 32a2a50

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

project/SO/pISO/python/get_windows.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
we also produce a window that include the pixel weighting.
66
The different masks are apodized.
77
We also produce a kspace-mask that will later be used for the kspace filtering operation, in order to remove the edges of the survey and avoid nasty pixels.
8-
MODIFIED VERSION, SKIP IVAR AND XLINK
98
"""
109

1110
import sys
@@ -23,6 +22,7 @@
2322
d.read_from_file(sys.argv[1])
2423
log = log.get_logger(**d)
2524

25+
use_weight_mask = True
2626

2727
surveys = d["surveys"]
2828
# the apodisation length of the final survey mask
@@ -137,14 +137,14 @@ def sa(emap):
137137
baseline_mask = so_map.car_template_from_shape_wcs(1, *template_geom, dtype=np.float32)
138138
baseline_mask.data = enmap.read_map(baseline_mask_fn, geometry=template_geom).astype(np.float32, copy=False)
139139
baseline_apod = d[f'baseline_apods_{winname}'][i]
140-
baseline_mask = so_window.create_apodization(
141-
baseline_mask, "C1", baseline_apod, use_rmax=True
142-
)
140+
if baseline_apod is not None:
141+
baseline_mask = so_window.create_apodization(
142+
baseline_mask, "C1", baseline_apod, use_rmax=True
143+
)
143144
my_masks["baseline"].data[:] *= baseline_mask.data
144145

145146
my_masks["baseline"].data = my_masks["baseline"].data.astype(np.float32, copy=False)
146-
my_masks["baseline"].write_map(f"{window_dir}/window_{winname}_{"baseline"}.fits")
147-
147+
my_masks["baseline"].write_map(f"{window_dir}/window_{winname}_baseline.fits")
148148
log.info(f"[{task}] joint baseline mask solid angle: {sa(my_masks["baseline"].data)}")
149149

150150
# Plot baseline and kspace windows

0 commit comments

Comments
 (0)