diff --git a/CHANGELOG-unreleased.md b/CHANGELOG-unreleased.md index d15e5e781..8e7b884e3 100644 --- a/CHANGELOG-unreleased.md +++ b/CHANGELOG-unreleased.md @@ -11,6 +11,8 @@ the released changes. ### Changed ### Added - When TCB->TDB conversion info is missing, will print parameter name +- `add_param` returns the name of the parameter (useful for numbered parameters) ### Fixed - When EQUAD is created from TNEQ, has proper TCB->TDB conversion info +- TOA selection masks will work when only TOA is the first one ### Removed diff --git a/src/pint/models/noise_model.py b/src/pint/models/noise_model.py index b1af8e10f..299787fe5 100644 --- a/src/pint/models/noise_model.py +++ b/src/pint/models/noise_model.py @@ -164,14 +164,14 @@ def scale_toa_sigma(self, toas, warn=True): if equad.quantity is None: continue mask = equad.select_toa_mask(toas) - if np.any(mask): + if len(mask) > 0: sigma_scaled[mask] = np.hypot(sigma_scaled[mask], equad.quantity) elif warn: warnings.warn(f"EQUAD {equad} has no TOAs") for efac_name in self.EFACs: efac = getattr(self, efac_name) mask = efac.select_toa_mask(toas) - if np.any(mask): + if len(mask) > 0: sigma_scaled[mask] *= efac.quantity elif warn: warnings.warn(f"EFAC {efac} has no TOAs") diff --git a/src/pint/models/timing_model.py b/src/pint/models/timing_model.py index a0b27b090..68fe886bf 100644 --- a/src/pint/models/timing_model.py +++ b/src/pint/models/timing_model.py @@ -3425,6 +3425,7 @@ def add_param(self, param, deriv_func=None, setup=False): if deriv_func is not None: self.register_deriv_funcs(deriv_func, param.name) param._parent = self + return param.name def remove_param(self, param): """Remove a parameter from the Component.