HERA-Team/hera_pspec

`check_uniform_input` breaks when the first and last integrations are flagged and the covariances are all 0s

Opened this issue · 0 comments

# check if the covariance matrix is uniform along the time axis. If so, we just calculate the result for one timestamp and duplicate its copies
# along the time axis.
check_uniform_input = False
if model != 'foreground_dependent':
# When model is 'foreground_dependent', since we are processing the outer products of visibilities from different times,
# we are expected to have time-dependent inputs, thus check_uniform_input is always set to be False here.
C11_first = self.C_model(key1, model=model, known_cov=known_cov, time_index=0)
C11_last = self.C_model(key1, model=model, known_cov=known_cov, time_index=self.dsets[0].Ntimes-1)
if np.isclose(C11_first, C11_last).all():
check_uniform_input = True

This should probably look for the first and last non-zero, finite covariance to compare to the last one to see if it's actually time stable.