Is there a limit to the size of an array accessed via OPeNDAP with ncread?

2 Ansichten (letzte 30 Tage)
I've found when trying to access a large(ish) array via OPeNDAP using Matlab and ncread, the result returns all zeros at some array size limit.
I'm trying to figure out if this is a Matlab/ncread limit or OPeNDAP issue.
I'm accessing a data set served via OPeNDAP (GrADS-DODS to be exact) via Matlab's ncread function.
  • If I select the entire array, which is 192 by 94 by 58676 (lon, lat, time), ncread does not throw an error but the resulting array is all zeros.
  • If I subset to, for example, the first 25,000 times, it works fine. I suspect there is a 2GB limit but would like confirmation. It also seems odd that there is no error, but rather a return of zeros.
For example:
% matlab R2018b 64-bit (maci64)
URL = 'http://apdrc.soest.hawaii.edu:80/dods/public_data/Reanalysis_Data/NCEP/NCEP2/6_hourly/gaussian_grid/uwnd_10m';
lat = ncread(URL,'lat');
lon = ncread(URL,'lon');
% this returns valid data
uwind = ncread(URL,'uwnd_10m',[1 1 1],[Inf Inf 29746]);
% this returns all zeros
uwind = ncread(URL,'uwnd_10m',[1 1 1],[Inf Inf 29747]);
% as does this (note there are 192x94x58676 values)
uwind = ncread(URL,'uwnd_10m');
  2 Kommentare
G. M. Wolfe
G. M. Wolfe am 12 Mai 2020
I am encountering the same problem with a different file, and the variable size is signficantly smaller (1800 * 3600, ~51 MB). I can read in the first half or second half by themselves, but it returns all 0s when I try to read the whole variable.
Please help, this is very frustrating.
James Potemra
James Potemra am 12 Mai 2020
@GW, just an FYI I posted a similar question to stackoverflow (https://stackoverflow.com/questions/57487174/array-size-limit-for-matlab-ncread) with no responses.
Meanwhile, discovered that netcdf libs have a limit that can be set, but I'm not sure how/if this impacts matlab (libnetcdf has a time-out setting for http requests).

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by