NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: [netcdf-java] NetCDF CDM Station question

Tom Kunicki wrote:
Hi John,

Yes we are working with Rich Signell.

For this project we will be working against a large number of ThreDDS based 
NetCDF sources.  For this particular case we were hoping to implement a 
generalized solution to provide a user with a drop down list of range variables 
for a given FeatureDatasource (currently of FeatureType.GRID or 
FeatureType.STATION).  This list would have all the domain variables removed.

With the source at 
http://motherlode.ucar.edu:8080/thredds/dodsC/station/metar/Surface_METAR_20100114_0000.nc
 the domain variables are prefixed with 'station.' while the range variables 
are prefixed with 'record.'.  Is this a convention that we could use to strip 
out domain variables?

the most general thing is to look for the "_CoordinateAxisType" on each VariableIF, if present its a "domain variable". eg:

for (VariableSimpleIF v : dataset.getDataVariables()) {
 if (v.findAttributeIgnoreCase("_CoordinateAxisType")  != null) {
   // its a domain variable
 }
}

Im not sure this is exactly what you want, but I think its a good approximation. Th distinction of domain and range variables is not always clear.



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