@@ -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