From 1d7923aaeb9bdf2a5933322dbaf25a0529db3a2f Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Tue, 29 Oct 2024 06:47:55 -0400 Subject: [PATCH] Add IMG_VCDUCTR column to match maude --- mica/archive/aca_l0.py | 4 ++++ mica/archive/tests/test_aca_l0.py | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/mica/archive/aca_l0.py b/mica/archive/aca_l0.py index 66c96c2d..4b74f6e4 100644 --- a/mica/archive/aca_l0.py +++ b/mica/archive/aca_l0.py @@ -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. diff --git a/mica/archive/tests/test_aca_l0.py b/mica/archive/tests/test_aca_l0.py index 8b7d9ac9..731a894b 100644 --- a/mica/archive/tests/test_aca_l0.py +++ b/mica/archive/tests/test_aca_l0.py @@ -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 @@ -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"))