MAVENSDC / cdflib

A python module for reading NASA's Common Data Format (cdf) files
MIT License
82 stars 45 forks source link

Corrupt CDF generation from IMAP code #271

Open bryan-harter opened 3 months ago

bryan-harter commented 3 months ago

In Ana's commit over here: https://github.com/anamanica/imap_processing/blob/71885c9232fddf1bff590bf39be71f83ad0826cb/imap_processing/cdf/config/imap_idex_l1_variable_attrs.yaml#L42

cdflib was able to create a corrupt cdf file. Specifically, cdflib had the correct attribute entry stuff, but the data was either too long or too short for the data type. It might be an issue with specifically with VALIDMIN and FILLVAL being strings, I'm not entirely sure. But there should be a check added that ensures that the data is not ever created with, say, an 8 bit numerical type, but we give cdflib a string of 200 characters for the data instead.

The first thing we'll need to do is create a minimal code sample that replicates the issue