|
2 | 2 | import requests |
3 | 3 | from acispy.units import get_units |
4 | 4 | from acispy.utils import ensure_list, find_load, calc_off_nom_rolls, \ |
5 | | - dict_to_array |
| 5 | + dict_to_array, default_state_keys |
6 | 6 | from acispy.units import APQuantity, APStringArray, Quantity |
7 | 7 | from acispy.time_series import TimeSeriesData |
8 | 8 | import numpy as np |
@@ -83,6 +83,8 @@ def from_kadi_states(cls, tstart, tstop, state_keys=None): |
83 | 83 | tstop = CxoTime(tstop).date |
84 | 84 | if state_keys is not None: |
85 | 85 | state_keys = ensure_list(state_keys) |
| 86 | + else: |
| 87 | + state_keys = default_state_keys |
86 | 88 | t = states.get_states(tstart, tstop, state_keys=state_keys, |
87 | 89 | merge_identical=True).as_array() |
88 | 90 | return cls(t) |
@@ -112,6 +114,10 @@ def from_load_file(cls, states_file): |
112 | 114 | @classmethod |
113 | 115 | def from_commands(cls, cmds, state_keys=None): |
114 | 116 | from kadi.commands import states |
| 117 | + if state_keys is not None: |
| 118 | + state_keys = ensure_list(state_keys) |
| 119 | + else: |
| 120 | + state_keys = default_state_keys |
115 | 121 | t = states.get_states(cmds=cmds, state_keys=state_keys, |
116 | 122 | merge_identical=True).as_array() |
117 | 123 | return cls(t) |
|
0 commit comments