On 3/14/2013 6:39 AM, Izidor Pelajic wrote:
Hi all,
I'm new at netCDF, new at CF, and moderate MATLAB user. I'm new at
netCDF in a sense of days or week.
So my problem (beyond the fact that I do not have general knowledge)
is next. I was provided with a .nc file. In it there are 3 information
of interest: latitude matrix 160 by 22, longitude matrix 160 by 22 and
SST matrix also 160 by 22. File is created from NOAA satellite data
record (from hdf file, but not by me). I need to convert this custom
made nc file to netCDF CF file.
So far, I managed to open nc file in matlab, edit variables, make some
nice charts and save it as it is. But I do not know how to save in CF
convention. My problem is longitude and latitude that are of same
dimension as variable SST. How do I make sst( lon, lat ) if all lon
and lat elements are of different value? (it was written down in line
as satellite passed over an area)

Any idea, or example?
Izidor
_______________________________________________
CF-metadata mailing list
CF-metadata@cgd.ucar.edu
http://mailman.cgd.ucar.edu/mailman/listinfo/cf-metadata

Hi Izidor:

i presume that you need to compute the 2D lat and lon coordinates and add them to the file.
If you think of renaming your dimensions like this, perhaps it is easier:

dimension
  scan = 160;
  xscan = 22

variables:
  float sst(scan,xscan);
    sst:coordinate = "lat lon";

  float lat(scan,xscan);
    lat:units= "degrees_north";

  float lon(scan,xscan);
    lat:units= "degrees_east";


the

  sst:coordinate = "lat lon";

means add an attribute to the sst variable with name "coordinate" and value "lat lon". This is how CF associates the lat and lon coordinates to the data variable. The "units" attribute on lat and lon is how CF knows what they are (i.e. not by the variable name, which can be anything).

this is just the minimum, of course you might want to add standard_name attribute, etc.

Good luck!

John
_______________________________________________
CF-metadata mailing list
CF-metadata@cgd.ucar.edu
http://mailman.cgd.ucar.edu/mailman/listinfo/cf-metadata

Reply via email to