|
5 | 5 | we also produce a window that include the pixel weighting. |
6 | 6 | The different masks are apodized. |
7 | 7 | 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 |
9 | 8 | """ |
10 | 9 |
|
11 | 10 | import sys |
|
23 | 22 | d.read_from_file(sys.argv[1]) |
24 | 23 | log = log.get_logger(**d) |
25 | 24 |
|
| 25 | +use_weight_mask = True |
26 | 26 |
|
27 | 27 | surveys = d["surveys"] |
28 | 28 | # the apodisation length of the final survey mask |
@@ -137,14 +137,14 @@ def sa(emap): |
137 | 137 | baseline_mask = so_map.car_template_from_shape_wcs(1, *template_geom, dtype=np.float32) |
138 | 138 | baseline_mask.data = enmap.read_map(baseline_mask_fn, geometry=template_geom).astype(np.float32, copy=False) |
139 | 139 | 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 | + ) |
143 | 144 | my_masks["baseline"].data[:] *= baseline_mask.data |
144 | 145 |
|
145 | 146 | 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") |
148 | 148 | log.info(f"[{task}] joint baseline mask solid angle: {sa(my_masks["baseline"].data)}") |
149 | 149 |
|
150 | 150 | # Plot baseline and kspace windows |
|
0 commit comments