@Deprecated public class CoordSysBuilder extends java.lang.Object implements CoordSysBuilderIF
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);
Modifier and Type | Class and Description |
---|---|
static interface |
CoordSysBuilder.ConventionNameOk
Deprecated.
do not use
|
class |
CoordSysBuilder.VarProcess
Deprecated.
Wrap each variable in the dataset with a VarProcess object.
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
conventionName
Deprecated.
|
protected java.util.Map<Dimension,java.util.List<CoordSysBuilder.VarProcess>> |
coordVarMap
Deprecated.
|
protected boolean |
debug
Deprecated.
|
protected static org.slf4j.Logger |
log
Deprecated.
|
protected java.util.Formatter |
parseInfo
Deprecated.
|
static java.lang.String |
resourcesDir
Deprecated.
|
protected java.util.Formatter |
userAdvice
Deprecated.
|
protected java.util.List<CoordSysBuilder.VarProcess> |
varList
Deprecated.
|
Constructor and Description |
---|
CoordSysBuilder()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCoordinateVariable(Dimension dim,
CoordSysBuilder.VarProcess vp)
Deprecated.
|
void |
addUserAdvice(java.lang.String advice)
Deprecated.
Give advice for a user trying to figure out why things arent working
|
protected void |
assignCoordinateSystemsExplicit(NetcdfDataset ncDataset)
Deprecated.
Assign explicit CoordinateSystem objects to variables.
|
protected void |
assignCoordinateTransforms(NetcdfDataset ncDataset)
Deprecated.
Assign CoordinateTransform objects to Coordinate Systems.
|
void |
augmentDataset(NetcdfDataset ncDataset,
CancelTask cancelTask)
Deprecated.
Make changes to the dataset that are needed before processing scale/offset in NetcdfDataset.
|
static java.util.List<java.lang.String> |
breakupConventionNames(java.lang.String convAttValue)
Deprecated.
Breakup list of Convention names in the Convention attribute in CF compliant way.
|
static java.lang.String |
buildConventionAttribute(java.lang.String mainConv,
java.lang.String... convAtts)
Deprecated.
Build a list of Conventions
|
void |
buildCoordinateSystems(NetcdfDataset ncDataset)
Deprecated.
Heres where the work is to identify coordinate axes and coordinate systems.
|
static CoordSysBuilderIF |
factory(NetcdfDataset ds,
CancelTask cancelTask)
Deprecated.
Get a CoordSysBuilder whose job it is to add Coordinate information to a NetcdfDataset.
|
protected void |
findCoordinateAxes(NetcdfDataset ncDataset)
Deprecated.
Identify coordinate axes, set VarProcess.isCoordinateAxis = true.
|
protected CoordSysBuilder.VarProcess |
findCoordinateAxis(java.lang.String name)
Deprecated.
|
protected void |
findCoordinateSystems(NetcdfDataset ncDataset)
Deprecated.
Identify coordinate systems, set VarProcess.isCoordinateSystem = true.
|
protected void |
findCoordinateTransforms(NetcdfDataset ncDataset)
Deprecated.
Identify coordinate transforms, set VarProcess.isCoordinateTransform = true.
|
protected CoordSysBuilder.VarProcess |
findVarProcess(java.lang.String name,
CoordSysBuilder.VarProcess from)
Deprecated.
|
protected AxisType |
getAxisType(NetcdfDataset ncDataset,
VariableEnhanced v)
Deprecated.
Identify what kind of AxisType the named variable is.
|
java.lang.String |
getConventionUsed()
Deprecated.
Get the name of the Convention.
|
java.lang.String |
getParseInfo()
Deprecated.
Detailed information when the coordinate systems were parsed
|
static boolean |
getUseMaximalCoordSys()
Deprecated.
Get whether to make records into Structures.
|
java.lang.String |
getUserAdvice()
Deprecated.
Specific advice to a user about problems with the coordinate information in the file.
|
protected boolean |
isCoordinateAxisForVariable(Variable axis,
Variable v)
Deprecated.
Does this axis "fit" this variable.
|
protected void |
makeCoordinateAxes(NetcdfDataset ncDataset)
Deprecated.
Take previously identified Coordinate Axis and Coordinate Variables and make them into a
CoordinateAxis.
|
protected void |
makeCoordinateSystems(NetcdfDataset ncDataset)
Deprecated.
Take all previously identified Coordinate Systems and create a
CoordinateSystem object.
|
protected void |
makeCoordinateSystemsImplicit(NetcdfDataset ncDataset)
Deprecated.
Make implicit CoordinateSystem objects for variables that dont already have one, by using the
variables' list of coordinate axes, and any coordinateVariables for it.
|
protected void |
makeCoordinateSystemsMaximal(NetcdfDataset ncDataset)
Deprecated.
If a variable still doesnt have a coordinate system, use hueristics to try to find one that was probably forgotten.
|
protected CoordinateTransform |
makeCoordinateTransform(NetcdfDataset ds,
Variable ctv)
Deprecated.
|
protected void |
makeCoordinateTransforms(NetcdfDataset ncDataset)
Deprecated.
Take all previously identified Coordinate Transforms and create a
CoordinateTransform object by calling CoordTransBuilder.makeCoordinateTransform().
|
protected VariableDS |
makeCoordinateTransformVariable(NetcdfDataset ds,
CoordinateTransform ct)
Deprecated.
|
static void |
registerConvention(java.lang.String conventionName,
java.lang.Class c)
Deprecated.
Register a class that implements a Convention.
|
static void |
registerConvention(java.lang.String conventionName,
java.lang.Class c,
CoordSysBuilder.ConventionNameOk match)
Deprecated.
Register a class that implements a Convention.
|
static void |
registerConvention(java.lang.String conventionName,
java.lang.String className)
Deprecated.
Register a class that implements a Convention.
|
static void |
registerNcML(java.lang.String conventionName,
java.lang.String ncmlLocation)
Deprecated.
Register an NcML file that implements a Convention by wrappping the dataset in the NcML.
|
void |
setConventionUsed(java.lang.String convName)
Deprecated.
Pass in the name of the Convention used to locate this CoordSysBuilderIF.
|
static void |
setUseMaximalCoordSys(boolean b)
Deprecated.
If true, assign implicit CoordinateSystem objects to variables that dont have one yet.
|
public static final java.lang.String resourcesDir
protected static org.slf4j.Logger log
protected java.lang.String conventionName
protected java.util.List<CoordSysBuilder.VarProcess> varList
protected java.util.Map<Dimension,java.util.List<CoordSysBuilder.VarProcess>> coordVarMap
protected java.util.Formatter parseInfo
protected java.util.Formatter userAdvice
protected boolean debug
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 java.util.List<java.lang.String> breakupConventionNames(java.lang.String convAttValue)
convAttValue
- original value of Convention attributepublic static java.lang.String buildConventionAttribute(java.lang.String mainConv, java.lang.String... convAtts)
mainConv
- this is the main conventionconvAtts
- list of others, onbly use "extra" Conventions@Nonnull 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 errorpublic 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
CoordSysBuilderIF
augmentDataset
in interface CoordSysBuilderIF
ncDataset
- modify this datasetcancelTask
- give user a chance to bail outjava.io.IOException
- on errorprotected AxisType getAxisType(NetcdfDataset ncDataset, VariableEnhanced v)
ncDataset
- for this datasetv
- a variable alreaddy identified as a Coodinate Axispublic void buildCoordinateSystems(NetcdfDataset ncDataset)
buildCoordinateSystems
in interface CoordSysBuilderIF
ncDataset
- modify this datasetprotected void findCoordinateAxes(NetcdfDataset ncDataset)
ncDataset
- whyprotected void findCoordinateSystems(NetcdfDataset ncDataset)
ncDataset
- whyprotected void findCoordinateTransforms(NetcdfDataset ncDataset)
ncDataset
- whyprotected void makeCoordinateAxes(NetcdfDataset ncDataset)
ncDataset
- containing datasetprotected void makeCoordinateSystems(NetcdfDataset ncDataset)
ncDataset
- whyprotected void assignCoordinateSystemsExplicit(NetcdfDataset ncDataset)
ncDataset
- whyprotected void makeCoordinateSystemsImplicit(NetcdfDataset ncDataset)
protected void makeCoordinateSystemsMaximal(NetcdfDataset ncDataset)
ncDataset
- need this to see if incomplete coordinate systems are allowedprotected boolean isCoordinateAxisForVariable(Variable axis, Variable v)
axis
- check if this axis is ok for the given variablev
- the given variableprotected void makeCoordinateTransforms(NetcdfDataset ncDataset)
ncDataset
- whyprotected CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv)
protected void assignCoordinateTransforms(NetcdfDataset ncDataset)
ncDataset
- whyprotected CoordSysBuilder.VarProcess findVarProcess(java.lang.String name, CoordSysBuilder.VarProcess from)
protected CoordSysBuilder.VarProcess findCoordinateAxis(java.lang.String name)
protected void addCoordinateVariable(Dimension dim, CoordSysBuilder.VarProcess vp)
protected VariableDS makeCoordinateTransformVariable(NetcdfDataset ds, CoordinateTransform ct)