Creating NetCDF CF Files

From Federation of Earth Science Information Partners
(Difference between revisions)
Jump to: navigation, search
(The NetCDF-CF convention)
(The NetCDF-CF convention)
Line 24: Line 24:
 
Conventions come to rescue. For example, if a variable has attribute axis='X', there's only one interpretation for the values of this variable: it must have just one dimension, and the values are points on X-axis along that dimension. No more guesswork, and wrong guesses, for the programmers.
 
Conventions come to rescue. For example, if a variable has attribute axis='X', there's only one interpretation for the values of this variable: it must have just one dimension, and the values are points on X-axis along that dimension. No more guesswork, and wrong guesses, for the programmers.
  
== The NetCDF-CF convention ==
 
  
 
The best documentation is at [http://cf-pcmdi.llnl.gov/ CF Metadata] page.  
 
The best documentation is at [http://cf-pcmdi.llnl.gov/ CF Metadata] page.  

Revision as of 16:01, 16 July 2009

UNDER CONSTRUCTION


Back to WCS Access to netCDF Files

Back to WCS NetCDF Development

NetCDF-CF conventions

The reason to use CF convention: Enable plug and play connectivity.

Well done NetCDF files are human readable. After all: what could dimension longitude mean besides longitude. If you get data in NetCDF format, it's usually fairly easy to see what really is there.

It's also easy to write a generic browser, that can display every variable for you.

But since a lot of data in NetCDF files have geographical meaning, a graphical viewer should be able to draw the data ion the map, on it's own. This involves, at minimum:

  • finding the three grographical dimensions
  • Finding time dimension, if any
  • Understanding the geographical projection

From any generic NetCDF, this requires human intelligence. After all, the n-dimensional data variables, dimensional variables and other metadata variables look precisely the same for the program code. There are legion of ways to code projection information, and decoding it reliably is very difficult.

Conventions come to rescue. For example, if a variable has attribute axis='X', there's only one interpretation for the values of this variable: it must have just one dimension, and the values are points on X-axis along that dimension. No more guesswork, and wrong guesses, for the programmers.


The best documentation is at CF Metadata page.

In short, a simple ncdump output for a NetCDF-CF file looks like this:

netcdf TOMS_AI_57 {
dimensions:
	time = UNLIMITED ; // (0 currently)
	lat = 1 ;
	lon = 1 ;
variables:
	double time(time) ;
		time:standard_name = "time" ;
		time:long_name = "time" ;
		time:units = "days since 1979-01-01" ;
		time:axis = "T" ;
	double lat(lat) ;
		lat:standard_name = "latitude" ;
		lat:long_name = "latitude" ;
		lat:units = "degrees_north" ;
		lat:axis = "Y" ;
	double lon(lon) ;
		lon:standard_name = "longitude" ;
		lon:long_name = "longitude" ;
		lon:units = "degrees_east" ;
		lon:axis = "X" ;
	byte AI(time, lat, lon) ;
		AI:long_name = "Aerosol Index" ;
		AI:units = "fraction" ;
		AI:_FillValue = -1b ;
		AI:missing_value = -1b ;

// global attributes:
		:query_timesequence = "2006-01-01T00:00:00Z" ;
		:query_homedomain = "u\'http://128.252.167.125:8080\'" ;
		:query_service = "WCS" ;
		:query_format = "image/netcdf" ;
		:query_request = "GetCoverage" ;
		:query_version = "1.1.0" ;
		:query_provider = "TOMS" ;
		:query_boundingbox = "260,32,280,48,urn:ogc:def:crs:OGC:2:84" ;
		:query_rangesubset = "*" ;
		:query_identifier = "TOMS_AI" ;
		:query_store = "true" ;
		:title = "NASA TOMS Project" ;
		:comment = "NASA Total Ozone Mapping Spectrometer Project" ;
		:Conventions = "CF-1.0" ;
data:

 lat = 32.5 ;

 lon = 0 ;
}

Verifying NetCDF-CF Files

Since CF-1.0 conventions contain a lot of definitions, verifying them by machine is necessary. There is a fairly complete compliance checker online

Creating NetCDF-CF files using NetCDF Markup Language

NCML utlilities here.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox