Plotting global flux data with colormap

5 views (last 30 days)
I have global flux data and latitude longitude data with dimension: flux=9*30*4, lat=9*30*4, lon=9*30*4. How can I get a colormap that will show the value (color) of the flux data on a global map including the color axis next to it? I have the mapping toolbox. I am looking to plot image like the one below. I tried surfacem, but my matlab crashes as the data is too big to load.

Accepted Answer

Kelly Kearney
Kelly Kearney on 14 Jun 2016
Your example image looks very Ferret-y, so I'm assuming your data is currently in netCDF files. Can you give us some more details about those files? Are you sure about those variable sizes? They seem awfully small for what looks like satellite data (and a handful of 9 x 30 x 4 matrices are nowhere near large enough to cause Matlab memory problems).
Can you show us some code you've tried, and the full text of the error message you receive when you try surfacem?
  7 Comments
Silver
Silver on 12 Nov 2018
Hi Kelly !
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!
Chad Greene
Chad Greene on 13 Nov 2018
Silver: You posed this question both as a comment on an answer to an old question, and as an answer to the old question. I deleted the answer version, and I'll offer some guidance here, but you'll generally have better luck starting a new question whenever you have a new question.
If you're running out of memory I recommend just loading a small portion of the data when you call ncread. To do that, use the start and count options. If you're only interested in a few years of data, just load those years. If you only need a small region of the world, just load that region's worth of data. If you need all the data from all times and all locations, you might need to find a way to do your processing in chunks.

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!