Package ucar.nc2.dataset
Class CoordSysBuilder
- java.lang.Object
-
- ucar.nc2.dataset.CoordSysBuilder
-
- All Implemented Interfaces:
CoordSysBuilderIF
- Direct Known Subclasses:
ADASConvention,ATDRadarConvention,AvhrrConvention,AWIPSConvention,AWIPSsatConvention,COARDSConvention,Cosmic1Convention,DefaultConvention,EpicInsitu,FslWindProfiler,GIEFConvention,HdfEosModisConvention,HdfEosOmiConvention,IFPSConvention,Jason2Convention,M3IOConvention,MADISStation,ModisSatellite,NppConvention,NsslRadarMosaicConvention,NUWGConvention,Suomi,UnidataObsConvention,WRFConvention
@Deprecated public class CoordSysBuilder extends Object implements CoordSysBuilderIF
Deprecated.do not useAbstract 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
Nested Classes Modifier and Type Class Description static interfaceCoordSysBuilder.ConventionNameOkDeprecated.do not useclassCoordSysBuilder.VarProcessDeprecated.Wrap each variable in the dataset with a VarProcess object.
-
Field Summary
Fields Modifier and Type Field Description protected StringconventionNameDeprecated.protected Map<Dimension,List<CoordSysBuilder.VarProcess>>coordVarMapDeprecated.protected booleandebugDeprecated.protected static org.slf4j.LoggerlogDeprecated.protected FormatterparseInfoDeprecated.static StringresourcesDirDeprecated.protected FormatteruserAdviceDeprecated.protected List<CoordSysBuilder.VarProcess>varListDeprecated.
-
Constructor Summary
Constructors Constructor Description CoordSysBuilder()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddCoordinateVariable(Dimension dim, CoordSysBuilder.VarProcess vp)Deprecated.voidaddUserAdvice(String advice)Deprecated.Give advice for a user trying to figure out why things arent workingprotected voidassignCoordinateSystemsExplicit(NetcdfDataset ncDataset)Deprecated.Assign explicit CoordinateSystem objects to variables.protected voidassignCoordinateTransforms(NetcdfDataset ncDataset)Deprecated.Assign CoordinateTransform objects to Coordinate Systems.voidaugmentDataset(NetcdfDataset ncDataset, CancelTask cancelTask)Deprecated.Make changes to the dataset that are needed before processing scale/offset in NetcdfDataset.static List<String>breakupConventionNames(String convAttValue)Deprecated.Breakup list of Convention names in the Convention attribute in CF compliant way.static StringbuildConventionAttribute(String mainConv, String... convAtts)Deprecated.Build a list of ConventionsvoidbuildCoordinateSystems(NetcdfDataset ncDataset)Deprecated.Heres where the work is to identify coordinate axes and coordinate systems.static CoordSysBuilderIFfactory(NetcdfDataset ds, CancelTask cancelTask)Deprecated.Get a CoordSysBuilder whose job it is to add Coordinate information to a NetcdfDataset.protected voidfindCoordinateAxes(NetcdfDataset ncDataset)Deprecated.Identify coordinate axes, set VarProcess.isCoordinateAxis = true.protected CoordSysBuilder.VarProcessfindCoordinateAxis(String name)Deprecated.protected voidfindCoordinateSystems(NetcdfDataset ncDataset)Deprecated.Identify coordinate systems, set VarProcess.isCoordinateSystem = true.protected voidfindCoordinateTransforms(NetcdfDataset ncDataset)Deprecated.Identify coordinate transforms, set VarProcess.isCoordinateTransform = true.protected CoordSysBuilder.VarProcessfindVarProcess(String name, CoordSysBuilder.VarProcess from)Deprecated.protected AxisTypegetAxisType(NetcdfDataset ncDataset, VariableEnhanced v)Deprecated.Identify what kind of AxisType the named variable is.StringgetConventionUsed()Deprecated.Get the name of the Convention.StringgetParseInfo()Deprecated.Detailed information when the coordinate systems were parsedstatic booleangetUseMaximalCoordSys()Deprecated.Get whether to make records into Structures.StringgetUserAdvice()Deprecated.Specific advice to a user about problems with the coordinate information in the file.protected booleanisCoordinateAxisForVariable(Variable axis, Variable v)Deprecated.Does this axis "fit" this variable.protected voidmakeCoordinateAxes(NetcdfDataset ncDataset)Deprecated.Take previously identified Coordinate Axis and Coordinate Variables and make them into a CoordinateAxis.protected voidmakeCoordinateSystems(NetcdfDataset ncDataset)Deprecated.Take all previously identified Coordinate Systems and create a CoordinateSystem object.protected voidmakeCoordinateSystemsImplicit(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 voidmakeCoordinateSystemsMaximal(NetcdfDataset ncDataset)Deprecated.If a variable still doesnt have a coordinate system, use hueristics to try to find one that was probably forgotten.protected CoordinateTransformmakeCoordinateTransform(NetcdfDataset ds, Variable ctv)Deprecated.protected voidmakeCoordinateTransforms(NetcdfDataset ncDataset)Deprecated.Take all previously identified Coordinate Transforms and create a CoordinateTransform object by calling CoordTransBuilder.makeCoordinateTransform().protected VariableDSmakeCoordinateTransformVariable(NetcdfDataset ds, CoordinateTransform ct)Deprecated.static voidregisterConvention(String conventionName, Class c)Deprecated.Register a class that implements a Convention.static voidregisterConvention(String conventionName, Class c, CoordSysBuilder.ConventionNameOk match)Deprecated.Register a class that implements a Convention.static voidregisterConvention(String conventionName, String className)Deprecated.Register a class that implements a Convention.static voidregisterNcML(String conventionName, String ncmlLocation)Deprecated.Register an NcML file that implements a Convention by wrappping the dataset in the NcML.voidsetConventionUsed(String convName)Deprecated.Pass in the name of the Convention used to locate this CoordSysBuilderIF.static voidsetUseMaximalCoordSys(boolean b)Deprecated.If true, assign implicit CoordinateSystem objects to variables that dont have one yet.
-
-
-
Field Detail
-
resourcesDir
public static final String resourcesDir
Deprecated.- See Also:
- Constant Field Values
-
log
protected static org.slf4j.Logger log
Deprecated.
-
conventionName
protected String conventionName
Deprecated.
-
varList
protected List<CoordSysBuilder.VarProcess> varList
Deprecated.
-
coordVarMap
protected Map<Dimension,List<CoordSysBuilder.VarProcess>> coordVarMap
Deprecated.
-
parseInfo
protected Formatter parseInfo
Deprecated.
-
userAdvice
protected Formatter userAdvice
Deprecated.
-
debug
protected boolean debug
Deprecated.
-
-
Method Detail
-
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 conventionconvAtts- 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 modifycancelTask- 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:CoordSysBuilderIFPass in the name of the Convention used to locate this CoordSysBuilderIF.- Specified by:
setConventionUsedin interfaceCoordSysBuilderIF- Parameters:
convName- the name of the Convention
-
getConventionUsed
public String getConventionUsed()
Deprecated.Description copied from interface:CoordSysBuilderIFGet 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:
getConventionUsedin interfaceCoordSysBuilderIF- Returns:
- Convention name
-
addUserAdvice
public void addUserAdvice(String advice)
Deprecated.Description copied from interface:CoordSysBuilderIFGive advice for a user trying to figure out why things arent working- Specified by:
addUserAdvicein interfaceCoordSysBuilderIF- Parameters:
advice- add this advice to the User Advice String
-
getParseInfo
public String getParseInfo()
Deprecated.Description copied from interface:CoordSysBuilderIFDetailed information when the coordinate systems were parsed- Specified by:
getParseInfoin interfaceCoordSysBuilderIF- Returns:
- String containing parsing info
-
getUserAdvice
public String getUserAdvice()
Deprecated.Description copied from interface:CoordSysBuilderIFSpecific advice to a user about problems with the coordinate information in the file.- Specified by:
getUserAdvicein interfaceCoordSysBuilderIF- 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:CoordSysBuilderIFMake changes to the dataset that are needed before processing scale/offset in NetcdfDataset.- Specified by:
augmentDatasetin interfaceCoordSysBuilderIF- Parameters:
ncDataset- modify this datasetcancelTask- give user a chance to bail out- Throws:
IOException- on error
-
getAxisType
protected AxisType getAxisType(NetcdfDataset ncDataset, VariableEnhanced v)
Deprecated.Identify what kind of AxisType the named variable is. Only called for variables already identified as Coordinate Axes. Default null - subclasses can override.- Parameters:
ncDataset- for this datasetv- a variable alreaddy identified as a Coodinate Axis- Returns:
- AxisType or null if unknown.
-
buildCoordinateSystems
public void buildCoordinateSystems(NetcdfDataset ncDataset)
Deprecated.Heres where the work is to identify coordinate axes and coordinate systems.- Specified by:
buildCoordinateSystemsin interfaceCoordSysBuilderIF- Parameters:
ncDataset- modify this dataset
-
findCoordinateAxes
protected void findCoordinateAxes(NetcdfDataset ncDataset)
Deprecated.Identify coordinate axes, set VarProcess.isCoordinateAxis = true. Default is to look for those referenced by _CoordinateAxes attribute. Note coordinate variables are already identified.- Parameters:
ncDataset- why
-
findCoordinateSystems
protected void findCoordinateSystems(NetcdfDataset ncDataset)
Deprecated.Identify coordinate systems, set VarProcess.isCoordinateSystem = true. Default is to look for those referenced by _CoordinateSystems attribute.- Parameters:
ncDataset- why
-
findCoordinateTransforms
protected void findCoordinateTransforms(NetcdfDataset ncDataset)
Deprecated.Identify coordinate transforms, set VarProcess.isCoordinateTransform = true. Default is to look for those referenced by _CoordinateTransforms attribute ( or has a _CoordinateTransformType attribute, done in VarProcess constructor)- Parameters:
ncDataset- why
-
makeCoordinateAxes
protected void makeCoordinateAxes(NetcdfDataset ncDataset)
Deprecated.Take previously identified Coordinate Axis and Coordinate Variables and make them into a CoordinateAxis. Uses the getAxisType() method to figure out the type, if not already set.- Parameters:
ncDataset- containing dataset
-
makeCoordinateSystems
protected void makeCoordinateSystems(NetcdfDataset ncDataset)
Deprecated.Take all previously identified Coordinate Systems and create a CoordinateSystem object.- Parameters:
ncDataset- why
-
assignCoordinateSystemsExplicit
protected void assignCoordinateSystemsExplicit(NetcdfDataset ncDataset)
Deprecated.Assign explicit CoordinateSystem objects to variables.- Parameters:
ncDataset- why
-
makeCoordinateSystemsImplicit
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. Must be at least 2 axes. All of a variable's _Coordinate Variables_ plus any variables listed in a *__CoordinateAxes_* or *_coordinates_* attribute will be made into an *_implicit_* Coordinate System. If there are at least two axes, and the coordinate system uses all of the variable's dimensions, it will be asssigned to the data variable.
-
makeCoordinateSystemsMaximal
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. Examine existing CS. create a subset of axes that fits the variable. Choose the one with highest rank. It must have X,Y or lat,lon. If so, add it.- Parameters:
ncDataset- need this to see if incomplete coordinate systems are allowed
-
isCoordinateAxisForVariable
protected boolean isCoordinateAxisForVariable(Variable axis, Variable v)
Deprecated.Does this axis "fit" this variable. True if all of the dimensions in the axis also appear in the variable. If char variable, last dimension is left out.- Parameters:
axis- check if this axis is ok for the given variablev- the given variable- Returns:
- true if all of the dimensions in the axis also appear in the variable.
-
makeCoordinateTransforms
protected void makeCoordinateTransforms(NetcdfDataset ncDataset)
Deprecated.Take all previously identified Coordinate Transforms and create a CoordinateTransform object by calling CoordTransBuilder.makeCoordinateTransform().- Parameters:
ncDataset- why
-
makeCoordinateTransform
protected CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv)
Deprecated.
-
assignCoordinateTransforms
protected void assignCoordinateTransforms(NetcdfDataset ncDataset)
Deprecated.Assign CoordinateTransform objects to Coordinate Systems.- Parameters:
ncDataset- why
-
findVarProcess
protected CoordSysBuilder.VarProcess findVarProcess(String name, CoordSysBuilder.VarProcess from)
Deprecated.
-
findCoordinateAxis
protected CoordSysBuilder.VarProcess findCoordinateAxis(String name)
Deprecated.
-
addCoordinateVariable
protected void addCoordinateVariable(Dimension dim, CoordSysBuilder.VarProcess vp)
Deprecated.
-
makeCoordinateTransformVariable
protected VariableDS makeCoordinateTransformVariable(NetcdfDataset ds, CoordinateTransform ct)
Deprecated.
-
-