Skip to content

Commit

Permalink
Add 12-byte header-3 diagnostic data to MAUDE decom output
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Jan 1, 2025
1 parent 10aaa76 commit c1bd581
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions chandra_aca/maude_decom.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,17 +633,25 @@ def _combine_aca_packets(aca_packets):
res = {}
pixels = np.ma.masked_all((8, 8))
pixels.data[:] = np.nan
diagnostic = np.ma.masked_all((12,), dtype=np.uint8)
for f in aca_packets:
# IMGTYPE 3 is not a real image. It means the pixels are used to download memory dump data
# if IMGTYPE == 3, do nothing. All pixels will be masked
if f["IMGTYPE"] != 3:
i0, i1 = _IMG_INDICES[f["IMGTYPE"]]
pixels[i0, i1] = f["pixels"]
if f["IMGTYPE"] == 6:
diagnostic[:6] = f["DIAGNOSTIC"]
elif f["IMGTYPE"] == 7:
diagnostic[6:] = f["DIAGNOSTIC"]

for f in aca_packets:
res.update(f)

del res["pixels"]
res["IMG"] = pixels
res["DIAGNOSTIC"] = diagnostic

return res


Expand Down Expand Up @@ -910,6 +918,7 @@ def get_raw_aca_packets(start, stop, maude_result=None, **maude_kwargs):
("AAPIXTLM", "<U4"),
("AABGDTYP", "<U4"),
("IMG", "<f8", (8, 8)),
("DIAGNOSTIC", np.uint8, (12,)),
]
)

Expand Down

0 comments on commit c1bd581

Please sign in to comment.