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

Fix tests after changes in maude #122

Merged
merged 2 commits into from
Mar 30, 2022
Merged
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
10 changes: 7 additions & 3 deletions chandra_aca/tests/test_maude_decom.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def test_vcdu_0_raw():

ref_data = test_data['686111007-686111017']['raw']
data = maude_decom.get_raw_aca_packets(686111007, 686111017)
for key in ['TIME', 'MJF', 'MNF']:
assert np.all(np.isclose(data['TIME'], ref_data['TIME'], rtol=0, atol=1e-3))
for key in ['MJF', 'MNF']:
assert np.all(data[key] == ref_data[key])
assert data['packets'] == ref_data['packets']
assert data['flags'] == ref_data['flags']
Expand All @@ -77,7 +78,7 @@ def test_blob_0_raw():
ref_data = test_data['686111007-686111017']['raw']
blobs = maude_decom.get_raw_aca_blobs(686111007, 686111017)
t = maude.blobs_to_table(**blobs)[['TIME', 'CVCMJCTR', 'CVCMNCTR']]
assert np.all(t['TIME'] == ref_data['TIME'])
assert np.all(np.isclose(t['TIME'], ref_data['TIME'], rtol=0, atol=1e-3))
assert np.all(t['CVCMJCTR'] == ref_data['MJF'])
assert np.all(t['CVCMNCTR'] == ref_data['MNF'])

Expand Down Expand Up @@ -203,7 +204,10 @@ def test_vcdu_vs_level0():
table2 = maude_decom._get_aca_packets(raw, start, stop,
combine=True, adjust_time=True, calibrate=True)
for col, col2 in zip(table.itercols(), table2.itercols()):
assert np.all(col == col2)
if col.name in ['TIME', 'END_INTEG_TIME']:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this to just do the 1e-3 atol on the time columns.

assert np.all(np.isclose(col2, col, rtol=0, atol=1e-3))
else:
assert np.all(col == col2)

names = ['TIME', 'MJF', 'MNF', 'END_INTEG_TIME', 'INTEG', 'GLBSTAT', 'COMMCNT',
'COMMPROG', 'IMGROW0', 'IMGCOL0', 'IMGSCALE', 'BGDAVG', 'BGDRMS',
Expand Down