Skip to content

Commit

Permalink
Add IMG_VCDUCTR column to match maude
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Oct 29, 2024
1 parent daac55a commit 1d7923a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 4 additions & 0 deletions mica/archive/aca_l0.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,11 @@ def get_aca_images(
out.rename_column("PIXTLM", "AAPIXTLM")
del out["FILENAME"]
del out["QUALITY"]

# maude_decom.get_aca_images() provides both VCDUCTR (VCDU for each sub-image) and
# IMG_VCDUCTR (VCDU of first sub-image). For combined images, these are identical.
out["VCDUCTR"] = out["MJF"] * 128 + out["MNF"]
out["IMG_VCDUCTR"] = out["VCDUCTR"]

# Split uint8 GLBSTAT and IMGSTAT into individual bits. The stat_bit_names are
# in MSB order so we need to reverse them below.
Expand Down
9 changes: 1 addition & 8 deletions mica/archive/tests/test_aca_l0.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ def test_get_aca_images():
assert set(imgs_mica["COMMPROG_REPEAT"]) == {0, 1}

for colname in imgs_maude.colnames:
if colname in ["IMG_VCDUCTR"]:
# These derived cols are not matched in mica at this time
continue
if imgs_maude[colname].dtype.kind == "f":
assert np.allclose(
imgs_mica[colname], imgs_maude[colname], rtol=0, atol=1e-3
Expand Down Expand Up @@ -95,11 +92,7 @@ def test_get_aca_images_empty():
# zero-length table with the required columns to match maude_decom
assert len(imgs_mica) == 0
assert type(imgs_mica) is Table
maude_cols = imgs_maude.colnames.copy()
for extra_maude_col in ["IMG_VCDUCTR"]:
if extra_maude_col in maude_cols:
maude_cols.remove(extra_maude_col)
assert set(maude_cols).issubset(imgs_mica.colnames)
assert set(imgs_maude.colnames).issubset(imgs_mica.colnames)


has_l0_2007_archive = os.path.exists(os.path.join(aca_l0.CONFIG["data_root"], "2007"))
Expand Down

0 comments on commit 1d7923a

Please sign in to comment.