Skip to content

Type wrong in PDS labels #15

@michaelaye

Description

@michaelaye

Reported by @mace-space on Dec 12, 2022:

The calibration issue I've found is that the calibration values archived in PDS3 appear to be erroneously described – although the CALIB/ PDS3 labels state CORE_ITEM_TYPE = IEEE_REAL, they are in fact integers (CORE_ITEM_TYPE = MSB_INTEGER).

This affects your io.py code (https://github.com/Cassini-UVIS/pyuvis/blob/master/pyuvis/io.py), lines 72-73, as the dtype should be ">i4", not ">f4".

To demonstrate, I've tried to reproduce an example from the Users Guide (see https://pds-rings.seti.org/cassini/uvis/1-UVIS_Users_Guide_-2018-Jan%2015-For%20PDS-REV-2018-07-06.pdf, page 27 onwards), with observation FUV2009_173_15_16.

I attach some plots for this example, chosen to try to reproduce Figs 3.3 & 3.4 from the UVIS Users Guide, with the calibration matrix read in with dtype=">f4" and dtype=">i4", respectively, for comparison. I also include plots of the raw data.

Below are my plots of FUV2009_173_15_16:

  • raw data:
Image Image

(I scaled from 0 - 0.6 counts in the lower plot to match the UVIS Users Guide Fig. 3.3).

  • Calibrated data, with calibration values read in as float:

    np.fromfile(str(datapath), ">f4")).astype(np.float32)

Image

and then replacing values of -1 in the calibration matrix with NaNs:

caldata[caldata == -1] = np.nan
Image
  • Calibrated data, with calibration values read in as integer:

    np.fromfile(str(datapath), ">i4")

Image
  • Calibrated data, with calibration values read in as integer then cast to float:

    (np.fromfile(str(datapath), ">i4")).astype(np.float32)

Image

Looking at the plots above, it appears that float is not the correct data type for the calibration matrices archived in PDS3, despite what the labels say.

Comparing the calibrated plots for dtype=">i4" above (values of order 10^9) to Fig 3.4 of the UVIS Users Guide (shown below), I'm puzzled by what scaling factor is used to obtain the values of 0-2 rayleigh per angstrom:

Image

Do you have any thoughts on what might be going on here?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions