|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.nc2.dataset.CoordSysBuilder
public class CoordSysBuilder
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);
Nested Class Summary | |
---|---|
static interface |
CoordSysBuilder.ConventionNameOk
Allow plug-ins to determine if it owns a file based on the file's Convention attribute. |
class |
CoordSysBuilder.VarProcess
Wrap each variable in the dataset with a VarProcess object. |
Field Summary | |
---|---|
static java.lang.String |
resourcesDir
|
Constructor Summary | |
---|---|
CoordSysBuilder()
|
Method Summary | |
---|---|
static CoordSysBuilderIF |
addCoordinateSystems(NetcdfDataset ds,
CancelTask cancelTask)
|
void |
addUserAdvice(java.lang.String advice)
Give advice for a user trying to figure out why things arent working |
void |
augmentDataset(NetcdfDataset ncDataset,
CancelTask cancelTask)
This is where subclasses make changes to the dataset, like adding new variables, attribuites, etc. |
void |
buildCoordinateSystems(NetcdfDataset ncDataset)
Heres where the work is to identify coordinate axes and coordinate systems. |
static CoordSysBuilderIF |
factory(NetcdfDataset ds,
CancelTask cancelTask)
Get a CoordSysBuilder whose job it is to add Coordinate information to a NetcdfDataset. |
java.lang.String |
getConventionUsed()
Get the name of the Convention. |
java.lang.String |
getParseInfo()
Detailed information when the coordinate systems were parsed |
static boolean |
getUseMaximalCoordSys()
Get whether to make records into Structures. |
java.lang.String |
getUserAdvice()
Specific advice to a user about problems with the coordinate information in the file. |
static VariableDS |
makeDummyTransformVariable(NetcdfDataset ds,
CoordinateTransform ct)
Deprecated. use CoordTransBuilder.makeDummyTransformVariable |
static void |
registerConvention(java.lang.String conventionName,
java.lang.Class c)
Register a class that implements a Convention. |
static void |
registerConvention(java.lang.String conventionName,
java.lang.Class c,
CoordSysBuilder.ConventionNameOk match)
Register a class that implements a Convention. |
static void |
registerConvention(java.lang.String conventionName,
java.lang.String className)
Register a class that implements a Convention. |
static void |
registerNcML(java.lang.String conventionName,
java.lang.String ncmlLocation)
Register an NcML file that implements a Convention by wrappping the dataset in the NcML. |
void |
setConventionUsed(java.lang.String convName)
Pass in the name of the Convention used to locate this CoordSysBuilderIF. |
static void |
setUseMaximalCoordSys(boolean b)
If true, assign implicit CoordinateSystem objects to variables that dont have one yet. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String resourcesDir
Constructor Detail |
---|
public CoordSysBuilder()
Method Detail |
---|
public static void registerNcML(java.lang.String conventionName, java.lang.String ncmlLocation)
conventionName
- name of Convention, must be in the "Conventions" global attribute.ncmlLocation
- location of NcML file, may be local file or URL.NcMLReader.wrapNcML(ucar.nc2.dataset.NetcdfDataset, java.lang.String, ucar.nc2.util.CancelTask)
public static void registerConvention(java.lang.String conventionName, java.lang.Class c)
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.public static void registerConvention(java.lang.String conventionName, java.lang.Class c, CoordSysBuilder.ConventionNameOk match)
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.public static void registerConvention(java.lang.String conventionName, java.lang.String className) throws java.lang.ClassNotFoundException
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.
java.lang.ClassNotFoundException
- if class could not be loadedpublic static void setUseMaximalCoordSys(boolean b)
b
- true if if you want to guess at Coordinate SystemsmakeCoordinateSystemsMaximal(ucar.nc2.dataset.NetcdfDataset)
public static boolean getUseMaximalCoordSys()
public static CoordSysBuilderIF factory(NetcdfDataset ds, CancelTask cancelTask) throws java.io.IOException
ds
- the NetcdfDataset to modifycancelTask
- allow user to bail out.
java.io.IOException
- on io errorNetcdfDataset.enhance(ucar.nc2.dataset.NetcdfDataset, java.util.Set, ucar.nc2.util.CancelTask)
public static CoordSysBuilderIF addCoordinateSystems(NetcdfDataset ds, CancelTask cancelTask) throws java.io.IOException
java.io.IOException
public void setConventionUsed(java.lang.String convName)
CoordSysBuilderIF
setConventionUsed
in interface CoordSysBuilderIF
convName
- the name of the Conventionpublic java.lang.String getConventionUsed()
CoordSysBuilderIF
getConventionUsed
in interface CoordSysBuilderIF
public void addUserAdvice(java.lang.String advice)
CoordSysBuilderIF
addUserAdvice
in interface CoordSysBuilderIF
advice
- add this advice to the User Advice Stringpublic java.lang.String getParseInfo()
CoordSysBuilderIF
getParseInfo
in interface CoordSysBuilderIF
public java.lang.String getUserAdvice()
CoordSysBuilderIF
getUserAdvice
in interface CoordSysBuilderIF
public void augmentDataset(NetcdfDataset ncDataset, CancelTask cancelTask) throws java.io.IOException
augmentDataset
in interface CoordSysBuilderIF
ncDataset
- modify this datasetcancelTask
- give user a chance to bail out
java.io.IOException
public void buildCoordinateSystems(NetcdfDataset ncDataset)
buildCoordinateSystems
in interface CoordSysBuilderIF
ncDataset
- modify this datasetpublic static VariableDS makeDummyTransformVariable(NetcdfDataset ds, CoordinateTransform ct)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |