Re: [netcdf-java] Examples of featureType="trajectory" files and reading same with toolsUI

On 8/9/2011 3:57 PM, Roland Schweitzer wrote:

I'm starting to create some netCDF files using the new discrete sampling
geometries in the CF standard. My first example is a trajectory. The
header is appended below. However, when I try to read the fie in the
latest toolsUI (4.2.26) under the "Trajectory" tab I get a error message
that say "Failed to find DataType factory for datatype = TRAJECTORY. I'm
looking for clues about my clueless-ness that is leading to this error.

I'd be grateful if others who have created example files of the various
discrete sampling geometries would share them with me. Bob Simons, I'm
looking at you. ;-)

My ears are burning.

1) Which version of the Discrete Sampling Geometries (DSG) document to you have? Mine is from Steve Hankin. I don't know where else to get it(!). It says "May 10, 2011" at the top. I believe it is the latest version and the ratified version.

Please, someone tell us where the current version can be found publicly.
It isn't at
It isn't at

2) Which type of trajectory file are you trying to create?
The documentation for "A9.4.3 Contiguous ragged array representation of trajectories" says there will be a variable with an attribute called "sample_dimension". I don't see that in your file. The documentation for "A9.4.4 Indexed ragged representation of trajectories" says there will be a variable with an attribute called "instance_dimension". I don't see that in your file. I do see trajectory_counts:trajectory_dimension in your file -- perhaps that is from a different version of the DSG document. Your file clearly isn't a "multidimensional array" or a "single trajectory". So I'm guessing we're looking at different versions of DSG.

3) As John Caron points out, the problem is also probably that netcdf-java isn't up-to-date with the latest DSG version.

4) Your file's time_coverage_start value is after the time_coverage_end value. Both are probably nonsense values. Perhaps it's better just to omit them?

5) ERDDAP can make "Contiguous ragged array representations" for all of the feature types in the DSG.
In general:
* Find relevant datasets by picking a cdm_data_type here
Note that some datasets are in odd categories (e.g., point) because
of issues with the data.
* Click on the "data" link of the desired dataset.
* For a good test, make a data selection that includes multiple instances of the feature (e.g., >1 trajectory). This may require a little experimenting.
* Change "File type" to ".ncCF"
* Click on Submit.

Examples which directly download DSG .nc files are:
* If the whole URL isn't underlined, copy and paste the whole URL into your browser. * Although the extension of the request is .ncCF, a .nc file will be created. * Or change the file extension of the URL from ".ncCF" to ".html", to see the form to request data.







This is all untested in the sense that there are currently (to my knowledge) no clients which can automatically interpret these files as specific DSG types. If you see problems or have suggestions for improvement, please let me know.

6) I would be grateful if other people would also make sample files (particularly of different types) available.

I hope that is all correct and answers the questions.
If not, please let me know.
Good luck.

netcdf trajectories {
index = 15991 ;
dim_one = 1 ;
trdim = 2 ;
cruise_ID_width = 64 ;
subsample_width = 21 ;
trajectory = 330 ;
trajectory_width = 64 ;
double trdim(trdim) ;
trdim:units = "hours since 1970-01-01 00:00:00" ;
trdim:time_origin = "01-Jan-1970 00:00:00" ;
double trange(trdim) ;
trange:units = "hours" ;
float NUMPROFS(dim_one) ;
NUMPROFS:long_name = "Number of Profiles" ;
NUMPROFS:units = "unitless" ;
float NUMOBS(dim_one) ;
NUMOBS:long_name = "Number of Observations" ;
NUMOBS:units = "unitless" ;
char CRUISE_ID(index, cruise_ID_width) ;
CRUISE_ID:long_name = "CRUISE ID" ;
CRUISE_ID:units = "unitless" ;
CRUISE_ID:missing_value = "" ;
CRUISE_ID:database_table = "data_6hourly" ;
char subsample(index, subsample_width) ;
subsample:long_name = "" ;
subsample:units = "" ;
subsample:missing_value = "" ;
subsample:database_table = "data_6hourly" ;
float latitude(index) ;
latitude:missing = -1.e+34 ;
latitude:units = "degrees_north" ;
latitude:long_name = "Latitude" ;
latitude:database_table = "data_6hourly" ;
latitude:_CoordinateAxisType = "Lat" ;
float longitude(index) ;
longitude:missing = -1.e+34f ;
longitude:units = "degrees_east" ;
longitude:long_name = "Longitude" ;
longitude:database_table = "data_6hourly" ;
longitude:_CoordinateAxisType = "Lon" ;
double sal(index) ;
sal:long_name = "Salinity" ;
sal:units = "PSU" ;
sal:missing_value = -1.e+34 ;
sal:database_table = "" ;
double PROF_ID(index) ;
PROF_ID:long_name = "Profile ID" ;
PROF_ID:units = "unitless" ;
PROF_ID:missing_value = -999. ;
char trajectories(trajectory, trajectory_width) ;
trajectories:cf_role = "trajectory_id" ;
int trajectory_counts(trajectory) ;
trajectory_counts:trajectory_dimension = "index" ;
trajectory_counts:long_name = "Number of observations in this
trajectory." ;

// global attributes:
:featureType = "trajectory" ;
:Conventions = "CF-1.6" ;
:geospatial_lat_min = -69.338996887207 ;
:geospatial_lat_max = 76.3619995117188 ;
:geospatial_lon_min = -179.880996704102 ;
:geospatial_lon_max = 179.998001098633 ;
:time_coverage_start = "9.99999999E8 hours since 1970-01-01 00:00:00" ;
:time_coverage_end = "-9.99999999E8 hours since 1970-01-01 00:00:00" ;

netcdf-java mailing list
For list information or to unsubscribe, visit:


Bob Simons
IT Specialist
Environmental Research Division
NOAA Southwest Fisheries Science Center
1352 Lighthouse Ave
Pacific Grove, CA 93950-2079
Phone: (831)658-3205
Fax:   (831)648-8440
Email: bob.simons@xxxxxxxx

The contents of this message are mine personally and
do not necessarily reflect any position of the
Government or the National Oceanic and Atmospheric
<>< <>< <>< <>< <>< <>< <>< <>< <><

  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: