Skip to content

Commit

Permalink
fix logic when selection mask is array([0])
Browse files Browse the repository at this point in the history
  • Loading branch information
dlakaplan committed Nov 15, 2024
1 parent ab4a22e commit 7c2bf80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pint/models/noise_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 7c2bf80

Please sign in to comment.