sot / kadi

Chandra commands and events
https://sot.github.io/kadi
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Migrate cmds.h5 idx column from 16 to 32 bits #190

Closed taldcroft closed 3 years ago

taldcroft commented 3 years ago

Description

The idx column in the cmds.h5 file was unfortunately sized at unsigned 16-bit int (65536). This identifies unique command parameters. The initial estimate that this would be more than enough proved to be faulty and the number exceeded 65536 with the AUG1720 loads.

Key elements are:

This PR includes a new utility script that was used to migrate the cmds.h5 as of August 8 (which did not suffer from the overflow issue) to a new version. The script contains checks that the new and previous commands are identical except for the dtype of idx.

With this PR that cmds.h5 and cmds.pkl files were updated to the present using python -m kadi.update_cmds from the git repo on this branch. They have been installed to /proj/sot/ska/data/kadi.

The footprint of the fix is small and no current flight code is impacted.

Testing

Functional testing

Original problem report

from kadi import commands
from kadi.commands import states

# Get commands from JUN2720 from backstop
backstop_file = "/data/acis/LoadReviews/2020/JUL2720/oflsb/CR208_1806.backstop"
cmds = commands.get_cmds_from_backstop(backstop_file)

t = states.get_states(cmds=cmds, merge_identical=True)

This produces the expected output on HEAD (kady) and GRETA (cheru).

Starcheck

File contents

Manually examined the cmds.pkl file and confirmed that the idx value jumps as expected and no 65535 is found.

Fixes #189