sot / chandra_aca

Chandra Aspect Camera Tools
https://sot.github.io/chandra_aca
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Prevent crash when IMGTYPE==3 when using blobs #148

Closed javierggt closed 1 year ago

javierggt commented 1 year ago

Description

Image telemetry can be used to download engineering data. In this case IMGTYPE==3. MAUDE is smart enough to recognize that the corresponding pixel MSIDs are not present whenever IMGTYPE==3, and the MSIDs are not present in the blob. This in turn causes an empty list to be assigned to a pixel array, and an exception being raised with the following error:

ValueError: shape mismatch: value array of shape (0,) could not be broadcast to indexing result of shape (16,)

When data comes from frames, the pixels have non-zero values corresponding with the data in telemetry, but they are all masked. If the data comes from blobs, the pixels values are zero and are masked.

Interface impacts

None

Testing

I added a unit test for this case. There was already a test from frames, I just added it for blobs.

This issue showed up using aca_view during anomaly. The changes in this PR were later used during patch uplink.

Unit tests

Independent check of unit tests by Jean

Functional tests

Functional testing using aca_view

taldcroft commented 1 year ago

One general comment is the IMGTYPE=3 means the PEA is putting memory dump data into the image pixel words. Your description and the code comment talk about "engineering data", but it is really only memory dump data.

javierggt commented 1 year ago

One general comment is the IMGTYPE=3 means the PEA is putting memory dump data into the image pixel words. Your description and the code comment talk about "engineering data", but it is really only memory dump data.

I fixed that.