Accessing OPTAA via TDA DataURL fails but HTTP download OK

Trying to read data from THREDDS for the OPTAA instrument at the URL below, I can use the HTTP link to download the full file and read it OK, but trying to access the OPENDAP DataURL inside MATLAB or at the UNIX command line (e.g. ncdump or ncks) I get errors:

This catalog:
https://thredds.dataexplorer.oceanobservatories.org/thredds/catalog/ooigoldcopy/public/CE01ISSM-MFD37-01-OPTAAD000-recovered_host-optaa_dj_dcl_instrument_recovered/catalog.html?dataset=ooigoldcopy/public/CE01ISSM-MFD37-01-OPTAAD000-recovered_host-optaa_dj_dcl_instrument_recovered/deployment0011_CE01ISSM-MFD37-01-OPTAAD000-recovered_host-optaa_dj_dcl_instrument_recovered_20190420T043018-20190420T222949.993000.nc

This fails:

dataurl=‘http://thredds.dataexplorer.oceanobservatories.org/thredds/dodsC/ooigoldcopy/public/CE01ISSM-MFD37-01-OPTAAD000-recovered_host-optaa_dj_dcl_instrument_recovered/deployment0011_CE01ISSM-MFD37-01-OPTAAD000-recovered_host-optaa_dj_dcl_instrument_recovered_20190805T002801-20190806T222946.744000.nc
ncinfo(dataurl)
Error using netcdflib
The NetCDF library encountered an error during execution of ‘open’
function - ‘Not a valid data type or _FillValue type mismatch
(NC_EBADTYPE)’.

ncdump -h (the same DataURL)
CE01ISSM-MFD37-01-OPTAAD000-recovered_host-optaa_dj_dcl_instrument_recovered_20190420T043018-20190420T222949.993000.nc: NetCDF: Not a valid data type or _FillValue type mismatch

I don’t see these data in ERDDAP.

Appending a “#fillmismatch” to the end of the URL may solve the issue.

See line 103:

The ooi-data-explorations repo also contains some MATLAB code for OPTAA data built on top of custom package.

Hopefully this solves your issue.

I dusted off MATLAB and tried to run your code. I am using MATLAB 2022A.
I did not receive a failure associated with netcdflib. I also tested the URL you supplied in Python 3.10 and did not have problems with accessing the data with and without a #fillmismatch. I think this means that there isn’t anything wrong with how the file is structured.

Here is a forum post about #fillmismatch as a potential solution.

Maybe the issue surrounds the version of MATLAB you are using and its netcdf dependencies?

That immediately solved the issue! … both for reading inside MATLAB and in a UNIX shell (ncdump, ncks etc.) so it’s clearly not just a MATLAB thing.

Thanks, John.