Skip to content

Commit

Permalink
no corrnoise case
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisrkckl committed Dec 9, 2024
1 parent 70902c6 commit 7b0da6b
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/pint/models/timing_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1684,12 +1684,16 @@ def noise_model_designmatrix(self, toas):
return np.hstack(list(result))

def noise_model_wideband_designmatrix(self, toas):
return np.hstack(
[
nc.get_wideband_noise_basis(toas)
for nc in self.NoiseComponent_list
if nc.introduces_correlated_errors
]
return (
np.hstack(
[
nc.get_wideband_noise_basis(toas)
for nc in self.NoiseComponent_list
if nc.introduces_correlated_errors
]
)
if self.has_correlated_errors
else None
)

def full_designmatrix(self, toas: TOAs):
Expand All @@ -1699,7 +1703,7 @@ def full_designmatrix(self, toas: TOAs):
else:
M_tm, par, M_units = self.wideband_designmatrix(toas)
M_nm = self.noise_model_wideband_designmatrix(toas)
return np.hstack((M_tm, M_nm))
return np.hstack((M_tm, M_nm)) if M_nm is not None else M_tm

def noise_model_basis_weight(self, toas):
if len(self.basis_funcs) == 0:
Expand All @@ -1711,7 +1715,7 @@ def full_basis_weight(self, toas):
npar_tm = len(self.free_params) + int("PhaseOffset" not in self.components)
phi_tm = np.ones(npar_tm) * 1e40
phi_nm = self.noise_model_basis_weight(toas)
return np.hstack((phi_tm, phi_nm))
return np.hstack((phi_tm, phi_nm)) if phi_nm is not None else phi_tm

def noise_model_dimensions(self, toas):
"""Number of basis functions for each noise model component.
Expand Down

0 comments on commit 7b0da6b

Please sign in to comment.