类 Variable
- java.lang.Object
-
- org.meteoinfo.data.meteodata.Variable
-
public class Variable extends Object
- 作者:
- Yaqiang Wang
-
-
字段概要
字段 修饰符和类型 字段 说明 protected doubleaddOffsetprotected List<Attribute>attributesprotected List<Dimension>dimensionsprotected doublefillValueintNumberprotected doublescaleFactorprotected int[]shape
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddAttribute(String attName, double attValue)Add attributevoidaddAttribute(String attName, String attValue)Add attributevoidaddAttribute(String attName, List attValue)Add attributevoidaddAttribute(Attribute attr)Add an attributevoidaddDimension(int idx, Dimension dim)Add a dimensionvoidaddDimension(String tstr, List<Number> values)Add a dimensionvoidaddDimension(Dimension dim)Add a dimensionvoidaddDimension(DimensionType dType, List<Number> values)Add a dimensionvoidaddLevel(double levelValue)Add a levelObjectclone()ClonebooleandimensionContains(Variable var)If the dimensions contains the diemsions of another variablebooleandimensionEquales(Variable var)If the dimensions equales with another variablebooleandimensionSizeEquals(Variable var)If the dimensions size equales with another variablebooleanequals(Variable aVar)Determine if two parameter are equalAttributefindAttribute(String name)Find an attribute by nameAttributefindAttributeIgnoreCase(String name)Find an attribute by name ignoring string casedoublegetAddOffset()Get add offset valueintgetAttNumber()Get attribute numberAttributegetAttribute(int index)Get attributeintgetAttributeIndex(String attName)Get attribute index by name, return -1 if the name not exist.List<Attribute>getAttributes()Get attributesStringgetAttributeString(String attName)Get attribute value string by nameorg.meteoinfo.ndarray.ArraygetCachedData()Get cached data arrayorg.meteoinfo.ndarray.DataTypegetDataType()Get data typeStringgetDescription()Get descriptionDimensiongetDimension(int index)Get dimensionDimensiongetDimension(DimensionType dimType)Get dimension by typeList<Dimension>getDimensions()Get dimensionsList<Dimension>getDimensions(org.meteoinfo.ndarray.Section section)Get dimensions by sectionint[]getDimIds()Get dimension identifersintgetDimIndex(Dimension aDim)Get index of a dimensionintgetDimLength(int idx)Get dimension lengthintgetDimNumber()Get dimension numberdoublegetFillValue()Get fill valueStringgetHDFPath()Get HDF pathDimensiongetLevelDimension(Variable var)Get level dimension for SWATH data variableList<Integer>getLevelIdxs()Get level index list - for ARL dataintgetLevelNum()Get level numberList<Double>getLevels()Get levelsintgetLevelType()Get level typeStringgetName()Get namedoublegetScaleFactor()Get scale factor valueStringgetShortName()Get short nameintgetStaggerDimIndex()Get stagger dimension indexDimensiongetTDimension()Get T dimensionList<LocalDateTime>getTimes()Get timesintgetTrueLevelNumber()Get true level numberStringgetUnits()Set unitsintgetVarId()Get variable identiferList<Integer>getVarInLevelIdxs()Get variable index in level index list - for ARL dataDimensiongetXDimension()Get X dimensionDimensiongetYDimension()Get Y dimensionDimensiongetZDimension()Get Z dimensionbooleanhasCachedData()Check has cached data or notbooleanhasDimension(int dimId)Determine if the variable has a dimensionbooleanhasNullDimension()If the variable has a null dimensionbooleanhasXtrackDimension()Determine if has Xtrack dimensionbooleanisDimVar()Get if the variable is dimension variablebooleanisMemberOfStructure()Get if the variable is a member of a structurebooleanisPlottable()Get if the variable is plottable (has both X and Y dimension)booleanisStation()Get if the variable is station data setbooleanisSwath()Get if the variable is swath data setvoidresetShape()Use when dimensions have changed, to recalculate the shape.List<Dimension>sectionDimensions(int[] origin, int[] size, int[] stride)Section dimensionsvoidsetAddOffset(double value)Set add offset valuevoidsetCachedData(org.meteoinfo.ndarray.Array value)Set cached data arrayvoidsetDataType(org.meteoinfo.ndarray.DataType value)Set data typevoidsetDescription(String value)Set descriptionvoidsetDimension(int idx, Dimension aDim)Set dimensionvoidsetDimension(String tstr, List<Number> values, boolean reverse)Set a dimensionvoidsetDimension(String tstr, List<Number> values, boolean reverse, int index)Set a dimensionvoidsetDimension(Dimension aDim)Set dimensionvoidsetDimension(Dimension aDim, DimensionType dimType)Set dimension by dimension typevoidsetDimensions(List<Dimension> dims)Set dimensionsvoidsetDimVar(boolean value)Set if the variable is dimension variablevoidsetFillValue(double value)Set fill valuevoidsetHDFPath(String value)Set HDF pathvoidsetLevelIdxs(List<Integer> value)Set level index listvoidsetLevels(List<Double> value)Set levelsvoidsetLevelType(int value)Set level typevoidsetMemberOfStructure(boolean value)Set if the variable is a member of a structurevoidsetName(String value)Set namevoidsetScaleFactor(double value)Set scale factor valuevoidsetShortName(String value)Set short namevoidsetStation(boolean value)Set if the variable is station data setvoidsetSwath(boolean value)Set if the variable is swath data setvoidsetTDimension(Dimension value)Set T dimensionvoidsetUnits(String value)Set unitsvoidsetVarId(int value)Set variable identifervoidsetVarInLevelIdxs(List<Integer> value)Set variable index in level index list - for ARL datavoidsetXDimension(Dimension value)Set X dimensionvoidsetYDimension(Dimension value)Set Y dimensionvoidsetZDimension(Dimension value)Set Z dimensionbooleantEquals(Variable aVar)Determine if two parameter are totally equalStringtoString()To stringvoidupdateZDimension()Update z dimension from levels
-
-
-
方法详细资料
-
getName
public String getName()
Get name- 返回:
- Name
-
getShortName
public String getShortName()
Get short name- 返回:
- Short name
-
setShortName
public void setShortName(String value)
Set short name- 参数:
value- Short name
-
setName
public void setName(String value)
Set name- 参数:
value- Name
-
getDataType
public org.meteoinfo.ndarray.DataType getDataType()
Get data type- 返回:
- Data type
-
setDataType
public void setDataType(org.meteoinfo.ndarray.DataType value)
Set data type- 参数:
value- Data type
-
getDimensions
public List<Dimension> getDimensions(org.meteoinfo.ndarray.Section section)
Get dimensions by section- 参数:
section- The section- 返回:
- Result dimesions
-
getDimension
public Dimension getDimension(int index)
Get dimension- 参数:
index- Dimension index- 返回:
- Dimension
-
getAttribute
public Attribute getAttribute(int index)
Get attribute- 参数:
index- Attribute index- 返回:
- Attribute
-
getAddOffset
public double getAddOffset()
Get add offset value- 返回:
- Add offset value
-
setAddOffset
public void setAddOffset(double value)
Set add offset value- 参数:
value- Add offset value
-
getScaleFactor
public double getScaleFactor()
Get scale factor value- 返回:
- Scale factor value
-
setScaleFactor
public void setScaleFactor(double value)
Set scale factor value- 参数:
value- Scale factor value
-
getFillValue
public double getFillValue()
Get fill value- 返回:
- Fill value
-
setFillValue
public void setFillValue(double value)
Set fill value- 参数:
value- Fill value
-
getLevelType
public int getLevelType()
Get level type- 返回:
- Level type
-
setLevelType
public void setLevelType(int value)
Set level type- 参数:
value- Level type
-
getUnits
public String getUnits()
Set units- 返回:
- Units
-
setUnits
public void setUnits(String value)
Set units- 参数:
value- Units
-
getDescription
public String getDescription()
Get description- 返回:
- Description
-
setDescription
public void setDescription(String value)
Set description- 参数:
value- Description
-
getDimNumber
public int getDimNumber()
Get dimension number- 返回:
- Dimension number
-
getLevelNum
public int getLevelNum()
Get level number- 返回:
- Level number
-
getHDFPath
public String getHDFPath()
Get HDF path- 返回:
- HDF path
-
setHDFPath
public void setHDFPath(String value)
Set HDF path- 参数:
value- HDF path
-
getXDimension
public Dimension getXDimension()
Get X dimension- 返回:
- X dimension
-
setXDimension
public void setXDimension(Dimension value)
Set X dimension- 参数:
value- X dimension
-
getYDimension
public Dimension getYDimension()
Get Y dimension- 返回:
- Y dimension
-
setYDimension
public void setYDimension(Dimension value)
Set Y dimension- 参数:
value- Y dimension
-
getZDimension
public Dimension getZDimension()
Get Z dimension- 返回:
- Z dimension
-
setZDimension
public void setZDimension(Dimension value)
Set Z dimension- 参数:
value- Z dimension
-
getTDimension
public Dimension getTDimension()
Get T dimension- 返回:
- T dimension
-
setTDimension
public void setTDimension(Dimension value)
Set T dimension- 参数:
value- T dimension
-
getDimIds
public int[] getDimIds()
Get dimension identifers- 返回:
- Dimension identifers
-
isStation
public boolean isStation()
Get if the variable is station data set- 返回:
- Boolean
-
setStation
public void setStation(boolean value)
Set if the variable is station data set- 参数:
value- Boolean
-
isSwath
public boolean isSwath()
Get if the variable is swath data set- 返回:
- Boolean
-
setSwath
public void setSwath(boolean value)
Set if the variable is swath data set- 参数:
value- Boolean
-
isPlottable
public boolean isPlottable()
Get if the variable is plottable (has both X and Y dimension)- 返回:
- Boolean
-
getAttNumber
public int getAttNumber()
Get attribute number- 返回:
- Attribute number
-
getVarId
public int getVarId()
Get variable identifer- 返回:
- Variable identifer
-
setVarId
public void setVarId(int value)
Set variable identifer- 参数:
value- Variable identifer
-
isDimVar
public boolean isDimVar()
Get if the variable is dimension variable- 返回:
- Boolean
-
setDimVar
public void setDimVar(boolean value)
Set if the variable is dimension variable- 参数:
value- Boolean
-
isMemberOfStructure
public boolean isMemberOfStructure()
Get if the variable is a member of a structure- 返回:
- Is a member of a structure or not
-
setMemberOfStructure
public void setMemberOfStructure(boolean value)
Set if the variable is a member of a structure- 参数:
value- Boolean
-
getLevelIdxs
public List<Integer> getLevelIdxs()
Get level index list - for ARL data- 返回:
- Level index list
-
setLevelIdxs
public void setLevelIdxs(List<Integer> value)
Set level index list- 参数:
value- Level index list
-
getVarInLevelIdxs
public List<Integer> getVarInLevelIdxs()
Get variable index in level index list - for ARL data- 返回:
- Variable index
-
setVarInLevelIdxs
public void setVarInLevelIdxs(List<Integer> value)
Set variable index in level index list - for ARL data- 参数:
value- Variable index
-
getCachedData
public org.meteoinfo.ndarray.Array getCachedData()
Get cached data array- 返回:
- Cached data array
-
setCachedData
public void setCachedData(org.meteoinfo.ndarray.Array value)
Set cached data array- 参数:
value- Cached data array
-
hasCachedData
public boolean hasCachedData()
Check has cached data or not- 返回:
- Has cached data or not
-
findAttribute
public Attribute findAttribute(String name)
Find an attribute by name- 参数:
name- Attribute name- 返回:
- Attribute
-
findAttributeIgnoreCase
public Attribute findAttributeIgnoreCase(String name)
Find an attribute by name ignoring string case- 参数:
name- Attribute name- 返回:
- Attribute
-
equals
public boolean equals(Variable aVar)
Determine if two parameter are equal- 参数:
aVar- The variable- 返回:
- If equal
-
tEquals
public boolean tEquals(Variable aVar)
Determine if two parameter are totally equal- 参数:
aVar- The variable- 返回:
- If equal
-
addLevel
public void addLevel(double levelValue)
Add a level- 参数:
levelValue- Level value
-
getTrueLevelNumber
public int getTrueLevelNumber()
Get true level number- 返回:
- True level number
-
getDimension
public Dimension getDimension(DimensionType dimType)
Get dimension by type- 参数:
dimType- Dimension type- 返回:
- Dimension
-
resetShape
public void resetShape()
Use when dimensions have changed, to recalculate the shape.
-
setDimension
public void setDimension(String tstr, List<Number> values, boolean reverse)
Set a dimension- 参数:
tstr- Dimension type stringvalues- Dimension valuesreverse- If is reverse
-
setDimension
public void setDimension(String tstr, List<Number> values, boolean reverse, int index)
Set a dimension- 参数:
tstr- Dimension type stringvalues- Dimension valuesindex- Indexreverse- If is reverse
-
setDimension
public void setDimension(Dimension aDim)
Set dimension- 参数:
aDim- The dimension
-
setDimension
public void setDimension(int idx, Dimension aDim)Set dimension- 参数:
aDim- The dimensionidx- Index
-
setDimension
public void setDimension(Dimension aDim, DimensionType dimType)
Set dimension by dimension type- 参数:
aDim- The dimensiondimType- Dimension type
-
getDimIndex
public int getDimIndex(Dimension aDim)
Get index of a dimension- 参数:
aDim- The dimension- 返回:
- Index
-
getDimLength
public int getDimLength(int idx)
Get dimension length- 参数:
idx- Dimension index- 返回:
- Dimension length
-
hasXtrackDimension
public boolean hasXtrackDimension()
Determine if has Xtrack dimension- 返回:
- Boolean
-
hasDimension
public boolean hasDimension(int dimId)
Determine if the variable has a dimension- 参数:
dimId- Dimension identifer- 返回:
- Boolean
-
hasNullDimension
public boolean hasNullDimension()
If the variable has a null dimension- 返回:
- Boolean
-
dimensionEquales
public boolean dimensionEquales(Variable var)
If the dimensions equales with another variable- 参数:
var- Another variable- 返回:
- Boolean
-
dimensionSizeEquals
public boolean dimensionSizeEquals(Variable var)
If the dimensions size equales with another variable- 参数:
var- Another variable- 返回:
- Boolean
-
dimensionContains
public boolean dimensionContains(Variable var)
If the dimensions contains the diemsions of another variable- 参数:
var- Another variable- 返回:
- Boolean
-
getLevelDimension
public Dimension getLevelDimension(Variable var)
Get level dimension for SWATH data variable- 参数:
var- Variable- 返回:
- Dimension
-
getTimes
public List<LocalDateTime> getTimes()
Get times- 返回:
- Times
-
getAttributeIndex
public int getAttributeIndex(String attName)
Get attribute index by name, return -1 if the name not exist.- 参数:
attName- Attribute name- 返回:
- Attribute index
-
getAttributeString
public String getAttributeString(String attName)
Get attribute value string by name- 参数:
attName- Attribute name- 返回:
- Attribute value string
-
addDimension
public void addDimension(Dimension dim)
Add a dimension- 参数:
dim- Dimension
-
addDimension
public void addDimension(int idx, Dimension dim)Add a dimension- 参数:
idx- Indexdim- Dimension
-
addDimension
public void addDimension(DimensionType dType, List<Number> values)
Add a dimension- 参数:
dType- Dimension typevalues- Dimension values
-
addDimension
public void addDimension(String tstr, List<Number> values)
Add a dimension- 参数:
tstr- Dimension type stringvalues- Dimension values
-
getStaggerDimIndex
public int getStaggerDimIndex()
Get stagger dimension index- 返回:
- Stagger dimension index
-
addAttribute
public void addAttribute(Attribute attr)
Add an attribute- 参数:
attr- Attribute
-
addAttribute
public void addAttribute(String attName, List attValue)
Add attribute- 参数:
attName- Attribute nameattValue- Attribute value
-
addAttribute
public void addAttribute(String attName, String attValue)
Add attribute- 参数:
attName- Attribute nameattValue- Attribute value
-
addAttribute
public void addAttribute(String attName, double attValue)
Add attribute- 参数:
attName- Attribute nameattValue- Attribute name
-
updateZDimension
public void updateZDimension()
Update z dimension from levels
-
sectionDimensions
public List<Dimension> sectionDimensions(int[] origin, int[] size, int[] stride) throws org.meteoinfo.ndarray.InvalidRangeException
Section dimensions- 参数:
origin- Originsize- Sizestride- Stride- 返回:
- Section result dimensions
- 抛出:
org.meteoinfo.ndarray.InvalidRangeException
-
-