Problem reading aggregated data

Thematic Realtime Environmental Distributed Data Services

Problem reading aggregated data

Postby cgentemann » Tue Oct 01, 2019 12:43 pm

I'm following code here:
https://climate-cms.org/2019/01/18/using-opendap.html

run:
import xarray as xr
aggr_url = "https://thredds.jpl.nasa.gov/thredds/dodsC/OceanTemperature/MUR-JPL-L4-GLOB-v4.1.nc"
data = xr.open_dataset(aggr_url)

returns:
OSError: [Errno -45] NetCDF: Not a valid data type or _FillValue type mismatch: b'https://thredds.jpl.nasa.gov/thredds/dodsC/OceanTemperature/MUR-JPL-L4-GLOB-v4.1.nc'

I tried
data = xr.open_dataset(aggr_url,decode_cf=False)

returns same error as above

suggestions?
thanks, chelle
cgentemann
 
Posts: 3
Joined: Tue Sep 10, 2019 4:18 pm

Re: Problem reading aggregated data

Postby yiboj » Wed Oct 02, 2019 10:50 am

Hi Chelle,

I am not familiar with xarray package and you may have to check your xarray installation. But please check the following code which uses popular netCDF package to read the thredds aggregated data:

Code: Select all
import numpy as np
from netCDF4 import Dataset  # http://code.google.com/p/netcdf4-python/

nc_f = 'https://thredds.jpl.nasa.gov/thredds/dodsC/OceanTemperature/MUR-JPL-L4-GLOB-v4.1.nc'
nc_fid = Dataset(nc_f, 'r')  # Dataset is the class behavior to open the file
                             # and create an instance of the ncCDF4 class

# Extract data from NetCDF file
lats = nc_fid.variables['lat'][:]  # extract/copy the data
lons = nc_fid.variables['lon'][:]
# Close original NetCDF file.
nc_fid.close()


Regards,

PODAAC DE
yiboj
 
Posts: 93
Joined: Mon Mar 30, 2015 11:22 am

Re: Problem reading aggregated data

Postby cgentemann » Wed Oct 02, 2019 11:15 am

I tried this code and still get the same error.

I ran:
Code: Select all
import numpy as np
from netCDF4 import Dataset  # http://code.google.com/p/netcdf4-python/
nc_f = 'https://thredds.jpl.nasa.gov/thredds/dodsC/OceanTemperature/MUR-JPL-L4-GLOB-v4.1.nc'
nc_fid = Dataset(nc_f, 'r')  # Dataset is the class behavior to open the file
                             # and create an instance of the ncCDF4 class

# Extract data from NetCDF file
lats = nc_fid.variables['lat'][:]  # extract/copy the data
lons = nc_fid.variables['lon'][:]
# Close original NetCDF file.
nc_fid.close()
nc_fid


error:
OSError: [Errno -45] NetCDF: Not a valid data type or _FillValue type mismatch: b'https://thredds.jpl.nasa.gov/thredds/dodsC/OceanTemperature/MUR-JPL-L4-GLOB-v4.1.nc'
cgentemann
 
Posts: 3
Joined: Tue Sep 10, 2019 4:18 pm

Re: Problem reading aggregated data

Postby yiboj » Wed Oct 02, 2019 11:21 am

Hi Chelle,

Looks like your netCDF library or netCDF package may have issue, please check your installation.

Regards,

PODAAC DE
yiboj
 
Posts: 93
Joined: Mon Mar 30, 2015 11:22 am


Return to PO.DAAC THREDDS

cron