Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ACIS raw-mode SI modes to ACIS states #152

Merged
merged 1 commit into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions kadi/commands/states.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,13 @@ def set_transitions(cls, transitions, cmds, start, stop):
elif tlmsid.startswith('WC'):
transitions[date].update(si_mode='CC_' + tlmsid[2:7])

# Two special-case raw-mode SI modes (https://github.com/sot/cmd_states/issues/23)
elif tlmsid == 'WT000B5024':
transitions[date].update(si_mode='TN_000B4')

elif tlmsid == 'WT000B7024':
transitions[date].update(si_mode='TN_000B6')

elif tlmsid.startswith('WT'):
transitions[date].update(si_mode='TE_' + tlmsid[2:7])

Expand Down
22 changes: 17 additions & 5 deletions kadi/commands/tests/test_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ def test_quick():
assert np.all(rc['datestop'][:-1] == rk['datestop'][:-1])


def test_acis_raw_mode():
"""Test ACIS raw-mode SI modes"""
# Minimal test that they are found in a period of time known to have
# raw mode commanding.
kstates = states.get_states(start='2017:189', stop='2017:197',
state_keys=['si_mode'])
assert 'TN_000B4' in kstates['si_mode']
assert 'TN_000B6' in kstates['si_mode']


def test_states_2017():
"""
Test for 200 days in 2017. Includes 2017:066, 068, 090 anomalies and
Expand All @@ -134,18 +144,20 @@ def test_states_2017():
Skip 'vid_board' because https://github.com/sot/cmd_states/pull/31 was put
in place around 2017:276 and so the behavior of this changed then. (Tested later).

Skip 'si_mode' because raw-mode SI modes occur in this time frame and are
not found in cmd_states. Si_mode is tested in other places.

Skip 'ccd_count' because https://github.com/sot/cmd_states/pull/39 changed
that behavior.

Skip 'pitch' because Chandra.cmd_states only avoids pitch breaks within actual
maneuver commanding (so the NMAN period before maneuver starts is OK) while kadi
will insert pitch breaks only in NPNT. (Tested later).
"""
state_keys = (['obsid', 'clocking', 'power_cmd', 'fep_count',
'si_mode'] +
['q1', 'q2', 'q3', 'q4', 'pcad_mode', 'dither', 'ra', 'dec', 'roll'] +
['letg', 'hetg'] +
['simpos', 'simfa_pos'])
state_keys = (['obsid', 'clocking', 'power_cmd', 'fep_count']
+ ['q1', 'q2', 'q3', 'q4', 'pcad_mode', 'dither', 'ra', 'dec', 'roll']
+ ['letg', 'hetg']
+ ['simpos', 'simfa_pos'])
rcstates, rkstates = compare_states('2017:060', '2017:260', state_keys, compare_dates=False)

# Check state datestart. There are 4 known discrepancies of 0.001 sec
Expand Down