netcdf reading parameters "Error using double Out of memory. Type HELP MEMORY for your options"
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi everyone ! I have an "out of memory" error while reading chlorophyl data from an netcdf file. The file contains :
- latitude
- longitude
- time
- CHL ( chl_a)
when I use ncread for latitude longitude and time , it works without any issue , but when I use the ame function for chlorophyl read, it shows the out of memory error.
I used this code :
ncdisp('dataset-oc-med-chl-multi-l4-interp_1km_daily-rt-v02_1541025401266.nc'); % to display the nc file
lon2 = ncread('dataset-oc-med-chl-multi-l4-interp_1km_daily-rt-v02_1541025401266.nc','lon') ; %to read longitude
lat2 = ncread('dataset-oc-med-chl-multi-l4-interp_1km_daily-rt-v02_1541025401266.nc','lat') ; %to read latitude
time2 = ncread('dataset-oc-med-chl-multi-l4-interp_1km_daily-rt-v02_1541025401266.nc','time') ; %to read time
chl = ncread('dataset-oc-med-chl-multi-l4-interp_1km_daily-rt-v02_1541025401266.nc','CHL') ; %to read chlorophyl , the error shows in this line
the file size is 955 Mo.
any ideas ? Thks in advance!
0 commentaires
Réponse acceptée
Kelly Kearney
le 12 Nov 2018
What does the ncdisp command tell you about the variable sizes? Just paste the output of the following:
ncdisp('dataset-oc-med-chl-multi-l4-interp_1km_daily-rt-v02_1541025401266.nc')
This is probably a pretty straightforward error... you're trying to read a very big dataset on a computer without enough memory to hold it all. So you either need more memory, or you need to read the data in smaller chunks.
4 commentaires
Kelly Kearney
le 14 Nov 2018
Regarding reading, yes, you'll need to read a certain subset of the data. I'd start by seeing if you can read in just the grid that falls inside the bounding box of your line data. Take a look at the START and COUNT inputs for ncread.
As for the offset coordinates, that really depends on how the data is actually stored in each file. Porjection and reference ellipsoid shouldn't matter if you're dealing with lat/lon coordinates. Is one of your datasets actually stored using projected coordinates (i.e. X/Y)? If so, you'll need to find out all the details of that projection to back-calculate the appropriate lat/lon coordinates and compare the two datasets.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur CubeSat and Satellites dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!