Class CoordSysBuilder

java.lang.Object
ucar.nc2.dataset.CoordSysBuilder
All Implemented Interfaces:
CoordSysBuilderIF

@Deprecated public class CoordSysBuilder extends Object implements CoordSysBuilderIF
Deprecated.
do not use
Abstract class for implementing Convention-specific parsing of netCDF files.

You can use an NcML file alone (use registerNcML()) if file uses a convention attribute. If not, you must implement a class that implements isMine() to identify your files, and call wrapNcML in the augmentDataset method (see eg ATDRadarConvention class).

Subclasses Info:

 // identify which variables are coordinate axes
 // default: 1) coordinate variables 2) variables with _coordinateAxisType attribute 3) variables listed
 // in a coordinates attribute on another variable.
 findCoordinateAxes(ncDataset);

 // identify which variables are used to describe coordinate system
 findCoordinateSystems(ncDataset);
 // identify which variables are used to describe coordinate transforms
 findCoordinateTransforms(ncDataset);
 // turn Variables into CoordinateAxis objects
 makeCoordinateAxes(ncDataset);
 // make Coordinate Systems for all Coordinate Systems Variables
 makeCoordinateSystems(ncDataset);

 // Assign explicit CoordinateSystem objects to variables
 assignExplicitCoordinateSystems(ncDataset);
 makeCoordinateSystemsImplicit(ncDataset);
 if (useMaximalCoordSys)
   makeCoordinateSystemsMaximal(ncDataset);

 makeCoordinateTransforms(ncDataset);
 assignCoordinateTransforms(ncDataset);
 
  • Field Details

  • Constructor Details

    • CoordSysBuilder

      public CoordSysBuilder()
      Deprecated.
  • Method Details

    • registerNcML

      public static void registerNcML(String conventionName, String ncmlLocation)
      Deprecated.
      Register an NcML file that implements a Convention by wrappping the dataset in the NcML. It is then processed by CoordSysBuilder, using the _Coordinate attributes.
      Parameters:
      conventionName - name of Convention, must be in the "Conventions" global attribute.
      ncmlLocation - location of NcML file, may be local file or URL.
      See Also:
      • NcMLReader.wrapNcML(ucar.nc2.dataset.NetcdfDataset, java.lang.String, ucar.nc2.util.CancelTask)
    • registerConvention

      public static void registerConvention(String conventionName, Class c)
      Deprecated.
      Register a class that implements a Convention. Will match (ignoring case) the COnvention name.
      Parameters:
      conventionName - name of Convention. This name will be used to look in the "Conventions" global attribute. Otherwise, you must implement the isMine() static method.
      c - implementation of CoordSysBuilderIF that parses those kinds of netcdf files.
    • registerConvention

      public static void registerConvention(String conventionName, Class c, CoordSysBuilder.ConventionNameOk match)
      Deprecated.
      Register a class that implements a Convention.
      Parameters:
      conventionName - name of Convention. This name will be used to look in the "Conventions" global attribute. Otherwise, you must implement the isMine() static method.
      match - pass in your own matcher. if null, equalsIgnoreCase() will be used.
      c - implementation of CoordSysBuilderIF that parses those kinds of netcdf files.
    • registerConvention

      public static void registerConvention(String conventionName, String className) throws ClassNotFoundException
      Deprecated.
      Register a class that implements a Convention.
      Parameters:
      conventionName - name of Convention. This name will be used to look in the "Conventions" global attribute. Otherwise, you must implement the isMine() static method.
      className - name of class that implements CoordSysBuilderIF.
      Throws:
      ClassNotFoundException - if class could not be loaded
    • setUseMaximalCoordSys

      public static void setUseMaximalCoordSys(boolean b)
      Deprecated.
      If true, assign implicit CoordinateSystem objects to variables that dont have one yet. Default value is false.
      Parameters:
      b - true if if you want to guess at Coordinate Systems
      See Also:
      • makeCoordinateSystemsMaximal(ucar.nc2.dataset.NetcdfDataset)
    • getUseMaximalCoordSys

      public static boolean getUseMaximalCoordSys()
      Deprecated.
      Get whether to make records into Structures.
      Returns:
      whether to make records into Structures.
    • breakupConventionNames

      public static List<String> breakupConventionNames(String convAttValue)
      Deprecated.
      Breakup list of Convention names in the Convention attribute in CF compliant way.
      Parameters:
      convAttValue - original value of Convention attribute
      Returns:
      list of Convention names
    • buildConventionAttribute

      public static String buildConventionAttribute(String mainConv, String... convAtts)
      Deprecated.
      Build a list of Conventions
      Parameters:
      mainConv - this is the main convention
      convAtts - list of others, onbly use "extra" Conventions
      Returns:
      comma separated list of Conventions
    • factory

      @Nonnull public static CoordSysBuilderIF factory(NetcdfDataset ds, CancelTask cancelTask) throws IOException
      Deprecated.
      Get a CoordSysBuilder whose job it is to add Coordinate information to a NetcdfDataset.
      Parameters:
      ds - the NetcdfDataset to modify
      cancelTask - allow user to bail out.
      Returns:
      the builder used
      Throws:
      IOException - on io error
    • setConventionUsed

      public void setConventionUsed(String convName)
      Deprecated.
      Description copied from interface: CoordSysBuilderIF
      Pass in the name of the Convention used to locate this CoordSysBuilderIF.
      Specified by:
      setConventionUsed in interface CoordSysBuilderIF
      Parameters:
      convName - the name of the Convention
    • getConventionUsed

      public String getConventionUsed()
      Deprecated.
      Description copied from interface: CoordSysBuilderIF
      Get the name of the Convention. In the case where the Convention attribute is not set in the file, this name cannot be used to identify the Convention. The isMine() method is called instead.
      Specified by:
      getConventionUsed in interface CoordSysBuilderIF
      Returns:
      Convention name
    • addUserAdvice

      public void addUserAdvice(String advice)
      Deprecated.
      Description copied from interface: CoordSysBuilderIF
      Give advice for a user trying to figure out why things arent working
      Specified by:
      addUserAdvice in interface CoordSysBuilderIF
      Parameters:
      advice - add this advice to the User Advice String
    • getParseInfo

      public String getParseInfo()
      Deprecated.
      Description copied from interface: CoordSysBuilderIF
      Detailed information when the coordinate systems were parsed
      Specified by:
      getParseInfo in interface CoordSysBuilderIF
      Returns:
      String containing parsing info
    • getUserAdvice

      public String getUserAdvice()
      Deprecated.
      Description copied from interface: CoordSysBuilderIF
      Specific advice to a user about problems with the coordinate information in the file.
      Specified by:
      getUserAdvice in interface CoordSysBuilderIF
      Returns:
      String containing advice to a user about problems with the coordinate information in the file.
    • augmentDataset

      public void augmentDataset(NetcdfDataset ncDataset, CancelTask cancelTask) throws IOException
      Deprecated.
      Description copied from interface: CoordSysBuilderIF
      Make changes to the dataset that are needed before processing scale/offset in NetcdfDataset.
      Specified by:
      augmentDataset in interface CoordSysBuilderIF
      Parameters:
      ncDataset - modify this dataset
      cancelTask - give user a chance to bail out
      Throws:
      IOException - on error
    • buildCoordinateSystems

      public void buildCoordinateSystems(NetcdfDataset ncDataset)
      Deprecated.
      Heres where the work is to identify coordinate axes and coordinate systems.
      Specified by:
      buildCoordinateSystems in interface CoordSysBuilderIF
      Parameters:
      ncDataset - modify this dataset