Closed claytharrison closed 4 months ago
This problem also exists for some other variables:
"f_kp"
, "f_usable"
:
https://github.com/TUW-GEO/ascat/blob/e5c02d4ccc08c59ca9057bfc148a40f0a098f792/src/ascat/read_native/eps_native.py#L1331-L1340
and "flagfield_gen2"
:
https://github.com/TUW-GEO/ascat/blob/e5c02d4ccc08c59ca9057bfc148a40f0a098f792/src/ascat/read_native/eps_native.py#L1546-L1558
On current numpy versions for Python > 3.8, lines 1329 and 1647 in
eps_native.py
raiseOverflowError: Python integer -128 out of bounds for uint8
when settingnan_val
ondata["swath_indicator"]
, becausedata["swath_indicator"]
is of dtypenp.uint8
at this point, while thenan_val
being set on it isint8_nan
(-128).https://github.com/TUW-GEO/ascat/blob/e5c02d4ccc08c59ca9057bfc148a40f0a098f792/src/ascat/read_native/eps_native.py#L1322C1-L1329C34
https://github.com/TUW-GEO/ascat/blob/e5c02d4ccc08c59ca9057bfc148a40f0a098f792/src/ascat/read_native/eps_native.py#L1623-L1647
In current numpy for Python <= 3.8 this operation casts
nan_val
touint8
(changing its value from -128 to 128) and produces a warning, but this warning is apparently suppressed somewhere in the script when reading from eps files. This behavior is now deprecated.If it is possible for
swath_indicator
to have any nan values before it reaches this line, this silent casting may cause some incorrect data, but I think it's not possible, so I don't think it's an issue in that sense.