Hey all -
We’ve run into a precarious situation when trying to open data sets when using xarray.
Specifically - we notice in some operations the datatype of our data changes, which impacts its precision.
We have confirmed that our raw data is in the correct format.
In this specific example, the data values change from float32 to float64, which for the values of latitude and longitude, impacts the precision, meaning that some data retrieval is not consistent with the expected behavior.
The data can be downloaded from Github here.
Here is the snippet:
import xarray as xr
data = xr.open_dataset('test_slice.nc4')
print(data)
print(data.indexes['lat'])
And here’s the output:
<xarray.Dataset>
Dimensions: (lat: 11, lon: 1, time: 1)
Coordinates:
* time (time) datetime64[ns] 2018-01-30T09:00:00
* lat (lat) float32 10.43 10.44 10.45 10.46 ... 10.51 10.52 10.53
* lon (lon) float32 -68.0
Data variables:
analysed_sst (time, lat, lon) float32 ...
Attributes: (12/47)
Conventions: CF-1.5
title: Daily MUR SST, Final product
summary: A merged, multi-sensor L4 Foundation SST anal...
references: http://podaac.jpl.nasa.gov/Multi-scale_Ultra-...
institution: Jet Propulsion Laboratory
history: created at nominal 4-day latency; replaced nr...
... ...
project: NASA Making Earth Science Data Records for Us...
publisher_name: GHRSST Project Office
publisher_url: http://www.ghrsst.org
publisher_email: ghrsst-po@nceo.ac.uk
processing_level: L4
cdm_data_type: grid
Float64Index([10.430000305175781, 10.4399995803833, 10.449999809265137,
10.460000038146973, 10.470000267028809, 10.479999542236328,
10.489999771118164, 10.5, 10.510000228881836,
10.520000457763672, 10.529999732971191],
dtype='float64', name='lat')
My question is - has anyone seen this behavior before, and if so - do you know if there is a temporary workaround for this kind of behavior, or what can be done to fix this? I think this ultimately needs a long-term fix from xarray, but knowing how long that might take, I’m looking for any/all ideas that might help our less technical users.
If downloading the file doesn’t work, I can provide a stripped down version via text also.
Thank you in advance!