Skip to content

Commit

Permalink
iTVAC: Updated processing scripts for improved messages & alarms output.
Browse files Browse the repository at this point in the history
  • Loading branch information
Connor Colombo committed Mar 2, 2023
1 parent 45380b8 commit fff7e4d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 10 additions & 3 deletions Apps/GroundSoftware/scripts/testing/_peregrine_tvac_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,20 +818,20 @@ def range_check(
VSysAll = data['Adc_FullSystemVoltage'].data
if VSysAll > 5:
alarms.append(
f"V_SYS_ALL APPEARS TO BE ON: {VSysAll:.3f} > 5V (should be "
f"V_SYS_ALL ON or FLOATING HIGH: {VSysAll:.3f} > 5V (should be "
f"~1.2V at STP when off)."
)
VBattSw = data['Adc_SwitchedBatteryVoltage'].data
if VBattSw > 10:
alarms.append(
f"BATTERY APPEARS TO BE ON: {VBattSw:.3f} > 10V. This sensor "
f"BATTERY ON or FLOATING HIGH: {VBattSw:.3f} > 10V. This sensor "
f"is only loosely calibrated should be less than ~5 at STP "
f"when off)."
)
Vcc24 = data['Adc_Vcc24Voltage'].data
if Vcc24 > 5:
alarms.append(
f"24V MOTOR POWER APPEARS TO BE ON: {Vcc24:.3f} > 5V (should "
f"24V MOTOR PWR ON or FLOATING HIGH: {Vcc24:.3f} > 5V (should "
f"be ~0.5V at STP when off)."
)

Expand Down Expand Up @@ -1338,6 +1338,13 @@ def print_from_db(opts) -> None:
print("Loading Stored YAMCS Data . . .")
lander_data = DataSet.load_from('yamcs', db)

# There are duplicates of all rows in some time windows due to overlaps in
# YAMCS archives that were replayed and reprocessing of some archives.
# Only keep the first row of a collection of rows with the **exact** same
# timestamp:
keep = ~lander_data.data.index.duplicated(keep='first')
lander_data.data = lander_data.data[keep]

# Extract all the packets:
print("Extracting and processing all Iris Packets. . .")
times, packets = extract_packets(lander_data, IRIS_TELEM_PARAMS)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Converts an `h5` (HDF) archive from integrated TVAC to an excel file.
NOTE: This only extracts the `telem` table containing parsed telemtery and not
the raw `yamcs` table containing raw data received from YAMCS.
NOTE: If this gives protobuf warnings, either resolve them or run:
- `PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python ./run-script.sh ...`
- instead of: `./run-script.sh ...`
Expand Down Expand Up @@ -245,7 +247,7 @@ def main(opts):
print(TITLE)

in_file = os.path.join(opts.db_dir, f"{opts.name}.h5")
out_file = os.path.join(opts.db_dir, f"{opts.name}_export.xlsx")
out_file = os.path.join(opts.db_dir, f"{opts.name}_telem_export.xlsx")

print(f"Connecting to Local DB: {in_file}. . .")
db = pd.HDFStore(in_file)
Expand Down

0 comments on commit fff7e4d

Please sign in to comment.