Skip to content

Commit

Permalink
Add a test for computed quat bad vals issue
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Mar 23, 2024
1 parent 927be98 commit 33660ad
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cheta/tests/test_comps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

"""Test that computed MSIDs work as expected."""

import warnings

import astropy.units as u
import numpy as np
import pytest
Expand Down Expand Up @@ -269,6 +271,28 @@ def test_quat_comp(msid, maude, offset):
assert isinstance(datq.vals, Quat)


def test_quat_comp_bad_times():
"""Test bad time data on 2024:264. All four quats have zero value and are bad.
The bad sample times are ['2024:064:09:27:02.652' '2024:064:09:27:03.677'].
"""
start = "2024:064:09:26:00"
stop = "2024:064:09:28:00"
# Assert no warnings despite quat with zero normalization. The zero-norm samples are
# marked bad.
with warnings.catch_warnings():
warnings.simplefilter("error") # Assert no warnings
dat = fetch_eng.MSID("quat_aoattqt", start, stop)

assert np.count_nonzero(dat.bads) == 2
assert len(dat.vals) == len(dat.times)

dat2 = fetch_eng.Msid("quat_aoattqt", start, stop)
assert dat2.bads is None # After Msid filtering
assert len(dat2.vals) == len(dat2.times)
assert len(dat2.vals) == len(dat.vals) - 2


def test_pitch_comp():
"""Test pitch_comp during a time with NPNT, NMAN, NSUN and Safe Sun"""
start = "2022:293"
Expand Down

0 comments on commit 33660ad

Please sign in to comment.