Thread Subject:
Dot Notation in netCDF data files

Subject: Dot Notation in netCDF data files

From: molofishy

Date: 6 Oct, 2009 11:34:38

Message: 1 of 3

I'm looking at climate data files of Southern Africa, in matlab. A single netCDF file has precipitation and temperature data for 360 days, for 26x22 pixels; so for one file there are 2x360x26x22 values. When i type x.VarArray.Str, the following is displayed:
ans =
longitude

ans =
latitude

ans =
ht

ans =
t

ans =
temp

ans =
surface

ans =
precip


To view all the data in matlab I type x.VarArray.Data
However the data set is so large that matlab only displays the last few pixels of data...I cannot scroll up enough to see the values for pixel 1,1; 1,2; 1,3; etc. I only see the last ones:

ans(:,:,26,22) =

  1.0e-003 *

    0.0016
    0.0204
    0.0042
    0.0000
    0.0000
    0.0055
    0.1193
    etc..


Another question: How do I select a single pixel to see the precipitation values for that pixel?

I am new to matlab, and am currently running R2008a. Thanks!

Subject: Dot Notation in netCDF data files

From: Michael

Date: 6 Oct, 2009 12:58:02

Message: 2 of 3

molofishy <angoli001@uct.ac.za> wrote in message <1837753708.19645.1254828908290.JavaMail.root@gallium.mathforum.org>...
> I'm looking at climate data files of Southern Africa, in matlab. A single netCDF file has precipitation and temperature data for 360 days, for 26x22 pixels; so for one file there are 2x360x26x22 values. When i type x.VarArray.Str, the following is displayed:
> ans =
> longitude
>
> ans =
> latitude
>
> ans =
> ht
>
> ans =
> t
>
> ans =
> temp
>


> ans =
> surface
>
> ans =
> precip
>
>
> To view all the data in matlab I type x.VarArray.Data
> However the data set is so large that matlab only displays the last few pixels of data...I cannot scroll up enough to see the values for pixel 1,1; 1,2; 1,3; etc. I only see the last ones:
>
> ans(:,:,26,22) =
>
> 1.0e-003 *
>
> 0.0016
> 0.0204
> 0.0042
> 0.0000
> 0.0000
> 0.0055
> 0.1193
> etc..
>
>
> Another question: How do I select a single pixel to see the precipitation values for that pixel?
>
> I am new to matlab, and am currently running R2008a. Thanks!

You should probably store the data in a variable:
myData = x.VarArray.Data;

Then you can see pixel 1,1 by typing:
myPixel = myData(1,1,:,:);

Subject: Dot Notation in netCDF data files

From: molofishy

Date: 6 Oct, 2009 14:44:02

Message: 3 of 3

Ya it worked! Thanks Mike!

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us