Skip to content

Commit

Permalink
feedback changes and additional comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tech3371 committed Sep 6, 2024
1 parent 3802533 commit bc38e92
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
11 changes: 8 additions & 3 deletions imap_processing/cdf/config/imap_swapi_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ counts_default: &counts_default
SCALETYP: linear

flags_default:
CATDESC: Data quality flags.
CATDESC: Bitwise flag. There are 13 flags. See VAR_NOTES for more details.
FIELDNAM: Quality Flag
LABLAXIS: Flags
DEPEND_0: epoch
Expand All @@ -44,12 +44,17 @@ flags_default:
FORMAT: I1
UNITS: ' '
VALIDMIN: 0
VALIDMAX: 1
VALIDMAX: 32767
VAR_TYPE: data
SCALETYP: linear
VAR_NOTES: >
There are 13 flags in total, first three flags are from science packets
and remaining 10 flags are from housekeeping packets.
and remaining 10 flags are from housekeeping packets. Flags are stored
as bitwise flag. 32767 is the value when all 15-bits are 1s. Eg.
int('0111111111111111', 2). First two bits from right are saved to save defaults.
Then, the remaining 13 bits from right are used for 13 flags. The flags are
as follows, "OVR_T_ST", "UND_T_ST", "PCEM_CNT_ST", "SCEM_CNT_ST","PCEM_V_ST",
"PCEM_I_ST", "PCEM_INT_ST", "SCEM_V_ST", "SCEM_I_ST", "SCEM_INT_ST".
uncertainty_default: &uncertainty_default
DEPEND_0: epoch
Expand Down
12 changes: 3 additions & 9 deletions imap_processing/swapi/l1/swapi_l1.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,6 @@ def process_swapi_science(
dataset : xarray.Dataset
Dataset.
"""
# pylint: disable=too-many-statements
# error:
# imap_processing/swapi/l1/swapi_l1.py:412:5: PLR0915
# Too many statements (51 > 50)

# ====================================================
# Step 1: Filter full cycle data
# ====================================================
Expand Down Expand Up @@ -486,10 +481,9 @@ def process_swapi_science(
# Add housekeeping-derived quality flags
# --------------------------------------
# Get times of good and full sweep data from science dataset.
# Then use these times to get housekeeping data.
# TODO: how to handle time delta between SWAPI HK and SWAPI SCI packets?
# For now, we assume that SHCOARSE in the SWAPI HK and SWAPI SCI packets
# are exactly equal at any given point, no significant time delta.
# Then use these times to get housekeeping data. Something is wrong if
# there is no science data that matches exactly one housekeeping data. It
# should be one-to-one matching per SWAPI team, Jamie Rankin.
good_sweep_times = good_sweep_sci["epoch"].data
good_sweep_hk_data = hk_dataset.sel({"epoch": good_sweep_times})

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ lint.select = ["B", "D", "E", "F", "I", "N", "S", "W", "PL", "PT", "UP", "RUF"]
# D104: Missing docstring in public package
# PLR2004: Magic value in comparison
# RUF200: pyproject missing field (poetry doesn't follow the spec)
# PLR0915: too-many-statements error
lint.ignore = ["D104", "PLR2004", "RUF200", "S311", "PLR0915"]

[tool.ruff.lint.per-file-ignores]
Expand Down

0 comments on commit bc38e92

Please sign in to comment.