Skip to content

Commit 8503c4b

Browse files
author
Thomas Morris
committed
repack
1 parent 90e550d commit 8503c4b

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

docs/source/usage/inputs/instruments/arrays/custom.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ We can generate an array with pre-defined focal plane offsets with a config
1414
"sky_x": sky_x,
1515
"sky_y": sky_y,
1616
"pol_angle": [22.5, 112.5, ..., 87.5, 157.5],
17-
"band_name": ["my_first_band", "my_first_band", ..., "my_other_band", "my_other_band"],
17+
"band_name": ["my_first_band_name", "my_first_band_name", ..., "my_other_band_name", "my_other_band_name"],
1818
"degrees": True}
1919
2020
where ``sky_x`` and ``sky_y`` are each a one-dimensional array of focal plane offsets in the x and y directions, and where
2121
each value in the ``band_name`` parameter matches the name of one of the bands in the supplied ``bands`` parameter.
2222

23-
Similarly, custom baselines can be supplied as
23+
Similarly, custom baselines can be supplied as e.g.
2424

2525
.. code-block:: python
2626

maria/mappers/ml_mapper.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def __init__(
105105
"remove_modes": {"modes_to_remove": 1},
106106
"remove_spline": {"knot_spacing": 10, "remove_el_gradient": True},
107107
},
108-
map_postprocessing={},
108+
map_postprocessing={"gaussian_filter": {"sigma": 2}},
109109
progress_bars=False,
110110
)
111111

@@ -196,19 +196,21 @@ def update_noise_model(self):
196196

197197
t["residual_ps"] = (t["fd"]).square().abs().float()
198198

199-
n_bin = 32
199+
n_bin = 64
200200
mid_f = np.geomspace(t["abs_f"][t["abs_f"] > 0].min() * 0.99, t["abs_f"].max() * 1.01, n_bin)
201201
dlogf = np.exp(np.gradient(np.log(mid_f)).mean())
202202
bin_f = np.geomspace(mid_f[0] / np.sqrt(dlogf), mid_f[-1] * np.sqrt(dlogf), n_bin + 1)
203-
bin_y = sp.stats.binned_statistic(t["abs_f"], t["residual_ps"].log(), bins=bin_f).statistic
203+
bin_y = sp.stats.binned_statistic(t["abs_f"], t["residual_ps"], bins=bin_f).statistic
204204

205205
use = ~np.isnan(bin_y).any(axis=0)
206206
t["int_ps"] = torch.tensor(
207207
sp.interpolate.interp1d(
208208
mid_f[use], np.median(bin_y[:, use], axis=0), axis=0, bounds_error=False, fill_value="extrapolate"
209209
)(t["abs_f"]),
210210
dtype=torch.float,
211-
).exp() # * torch.ones_like(t["d"])
211+
) # * torch.ones_like(t["d"])
212+
213+
t["int_ps"] = t["residual_ps"].mean(axis=0)
212214

213215
# t["V"] = (t["a"].T.unsqueeze(-1) * t["b"].unsqueeze(-2)).reshape(t["k"], -1)
214216
# t["ViA"] = (t["V"].reshape(t["k"], *t["d"].shape) / t["int_ps"]).reshape(t["k"], -1)

0 commit comments

Comments
 (0)