|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.visad.Util
public final class Util
Provides support for utility functions.
| Field Summary | |
|---|---|
static String |
REALTYPE_ROOT
The default root name for generic RealTypes |
static String |
TEXT_IDENTIFIER
The suffix added to text type names |
| Method Summary | |
|---|---|
static boolean |
allMissing(RealTuple rt)
Check to see if a RealTuple is all missing data. |
static Real |
bearingDistance(EarthLocation el1,
EarthLocation el2)
Return the distance from a bearing as Real |
static ucar.unidata.geoloc.Bearing |
calculateBearing(LatLonPoint pt1,
LatLonPoint pt2,
ucar.unidata.geoloc.Bearing result)
Calculate the bearing between the 2 points. |
static String |
cleanName(String name)
Make a valid VisAD RealType name from the string. |
static String |
cleanTypeName(MathType mathType)
Remove any of the extra unit suffixes that get added to the type name |
static String |
cleanTypeName(String name)
A utility to strip off the unit name that gets appended to the real type name. |
static Data |
clone(Data data,
MathType type)
Clones a data object, replacing the MathType. |
static Data |
clone(Data data,
MathType type,
boolean unitOverride,
boolean copy)
Clones a data object, replacing the MathType. |
static Data |
clone(Data data,
MathType type,
boolean unitOverride,
boolean copy,
boolean copyDomain)
Clones a data object, replacing the MathType. |
static Field |
clone(Field field,
Set domain)
Clones a Field replacing the domain Set and copying the range values. |
static Field |
clone(Field field,
Set domain,
boolean copyRange)
Clones a Field replacing the domain Set. |
static FlatField |
clone(FlatField flatField,
Set domain,
boolean copyRange)
Clones a FlatField replacing the domain Set. |
static RealType |
clone(RealType realType,
String name)
Clones a RealType but changes the name. |
static Set |
clone(Set set,
CoordinateSystem coordSys)
Clones a set, replacing the CoordinateSystem. |
static Field |
convertDomain(Field field,
RealTupleType newDomainType,
CoordinateSystem coordinateSystem)
Converts the MathType of the domain of a Field. |
static FlatField |
convertDomain(FlatField field,
RealTupleType newDomainType,
CoordinateSystem coordinateSystem)
Converts the domain of a FlatField. |
static SampledSet |
convertDomain(SampledSet oldDomain,
RealTupleType newDomainType,
CoordinateSystem coordinateSystem)
Converts a SampledSet domain. |
static Range |
convertRange(Range range,
Unit rangeUnit,
Unit outUnit)
Utility to convert the given raw data range into the other units |
static double |
distance(LatLonPoint p1,
LatLonPoint p2)
Return the distance between the 2 points |
static void |
dumpTypes(Data d)
Wrapper for JPythonMethods.dumpTypes(Data) |
static Set |
ensureCoordinateSystem(Set set,
CoordinateSystem coordSys)
Ensures that a set has a particular CoordinateSystem. |
static Field |
ensureDomain(Field field,
RealTupleType newDomainType,
CoordinateSystem coordinateSystem)
Ensures that a Field has a particular domain MathType. |
static Field |
ensureDomain(Field field,
Set domain)
Ensures that a Field has a particular domain Set. |
static FlatField |
ensureFlatFieldRangeType(FlatField flatField,
RealType realType)
Ensures that the MathType of the range of a FlatField is a specified RealType. |
static Data |
ensureMathType(Data data,
MathType type)
Ensures that a data object has a particular MathType. |
static Field |
ensureTupleRange(Field field)
Ensures that the range of a Field is a Tuple. |
static RealType[] |
ensureUnit(RealType[] types,
Unit u)
Ensure that the units for the array of RealTypes are compatible with the given unit. |
static RealType |
ensureUnit(RealType type,
Unit u)
Ensure that the units for the RealType are compatible with the given unit. |
static boolean |
exportAsNetcdf(Data data)
Export the data object as a netCDF file |
static int |
findIndex(Set set,
Real value)
Find the index of a value in a Set |
static String |
formatAltitude(Real alt)
Format an Altitude |
static String |
formatEarthLocation(EarthLocation el,
boolean includeAlt)
Format a EarthLocation as a lat/lon/(alt) string. |
static String |
formatLatLonPoint(LatLonPoint llp)
Format an LatLonPoint as a lat/lon string. |
static String |
formatReal(Real r)
Format a real value to a nice looking number |
static String |
formatUtcDate(DateTime dt,
String pattern)
Deprecated. use UtcDate.formatUtcDate(DateTime, String) |
static String |
getCompatibleUnitName(Unit u)
Replace illegal RealType characters in a Unit spec with underscores. |
static Unit[] |
getDefaultRangeUnits(FieldImpl field)
Gets the default units of the (flat) components of the range of a FlatField. |
protected static Unit[] |
getDefaultUnits(FlatField field,
int[] indexes,
RealType[] types)
Gets the default units of the given range components of a FlatField. |
static Set |
getDomainSet(Field field)
Utility method to get the domain set from the given field. |
static Set |
getDomainSetForClone(Field field)
Get the domain for cloning |
static int |
getIndex(TupleType tupleType,
String lookingFor)
Find the index of the MathType in the given tuple type whose cleaned name is equals to the lookingFor parameter. |
static CoordinateSystem |
getRangeCoordinateSystem(Field field)
Gets the coordinate sytem of the RealTuple range of a Field. |
static CoordinateSystem[] |
getRangeCoordinateSystems(Field field)
Gets the coordinate sytems of the components of the range of a Field. |
static SampledSet |
getRangeSampledSet(Field field,
MathType type)
Extracts the given range component from a Field as a SampledSet. |
static Unit[] |
getRangeUnits(FlatField field)
Gets the units of the (flat) components of the range of a FlatField. |
static double[] |
getRayPositionAtZ(VisADRay ray,
double zValue)
Get the position of the ray at a particular Z value. |
static Real |
getReal(double value,
String unitString)
Get a Real with the specified value and Unit |
static Real |
getReal(double value,
Unit unit)
Get a Real with the specified value and Unit |
static RealType |
getRealType(RealTupleType type,
String start)
Get the RealType from the RealTupleType that corresponds to one that begins with start. |
static RealType |
getRealType(Unit unit)
Get a realtype with the unit |
static RealTuple |
getSample(Set set,
int index)
Deprecated. use visad.util.DataUtility.getSample() now |
static double |
getValueAs(Real r,
String unitString)
Get the value of a Real in the unit specified |
static double[] |
getVWorldCoords(DisplayImpl display,
int x,
int y,
double[] retVals)
Get the VisAD Virtual World x,y coordinates for the given screen coords |
static FieldImpl |
indexedField(Data[] datas,
boolean copy)
Get a FieldImpl with a domain of index and the range of the datas. |
static boolean |
isCompatible(Data data,
MathType type)
Indicates if a Data object is compatible with a MathType. |
static boolean |
isEarthCoordinates(RealTuple position)
_more_ |
static boolean |
isSorted(double[] values)
Indicates if an array is sorted. |
static boolean |
isSorted(float[] values)
Indicates if an array is sorted. |
static boolean |
isStrictlySorted(double[] values)
Indicates if an array is strictly sorted. |
static boolean |
isStrictlySorted(float[] values)
Indicates if an array is strictly sorted. |
static TwoFacedObject |
labeledReal(Real r)
Wrap a Real as a TwoFacedObject with a formatted label |
static TwoFacedObject |
labeledReal(Real r,
boolean includeUnit)
Wrap a Real as a TwoFacedObject with a formatted label |
static void |
main(String[] args)
Test |
static Date |
makeDate(DateTime dttm)
Make a date from a DateTime |
static List<Date> |
makeDates(DateTime[] timesArray)
Make a list of Date object from the array of DateTime's |
static GriddedSet |
makeEarthDomainSet(float[] lats,
float[] lons,
float[] alts)
This makes a gridded earth domain set with the given lats, lons and (possible null) alts It uses RealTupleType.LatitudeLongitudeAltitude or RealTupleType.LatitudeLongitudeTuple as the type |
static EarthLocation |
makeEarthLocation(double lat,
double lon)
Utility to make an earth location with a 0 altitude |
static EarthLocation |
makeEarthLocation(LatLonPoint llp)
Utility to make an earth location with a 0 altitude |
static FlatField |
makeField(float lon1,
float lon2,
int length1,
float lat1,
float lat2,
int length2,
float fill,
String unitString)
this makes a empty flat field with the given lat/lon bounds and lengths, the given fill value and the unit |
static FlatField |
makeField(Image image,
boolean makeNansForAnyAlpha)
Create a VisAD Data object from the given Image |
static FlatField |
makeField(Image image,
float alphaThreshold)
Create a VisAD Data object from the given Image |
static FlatField |
makeField(Image image,
float alphaThreshold,
boolean makeAlpha)
Create a VisAD Data object from the given Image |
static FlatField |
makeField(Image image,
float alphaThreshold,
boolean makeAlpha,
boolean incNames)
Create a VisAD Data object from the given Image |
static MapProjection |
makeMapProjection(double lat1,
double lon1,
double lat2,
double lon2)
Make a map projection from the points |
static MapProjection |
makeMapProjection(double lat1,
double lon1,
double lat2,
double lon2,
boolean makeSquare)
_more_ |
static RealType |
makeRealType(String name,
String alias,
Unit unit)
Make a RealType |
static RealType |
makeRealType(String name,
Unit unit)
Create a RealType from the name and unit. |
static Data |
makeTimeField(Data range,
List times)
This makes a field of T->range for the times in the list. |
static FieldImpl |
makeTimeField(List ranges,
List times)
Make a time field |
static Data |
makeTimeRangeField(Data range,
List times)
This makes a field of T->range for the times in the list. |
static Set |
makeTimeSet(List times)
Make a time set from a list of times |
static SampledSet |
newSampledSet(int[] manifoldLengths,
RealTupleType newSampledSetType,
double[][] newValues,
CoordinateSystem coordinateSystem,
Unit[] newUnits,
ErrorEstimate[] newErrors)
Creates a new SampledSet using a given manifold dimensionality. |
static SampledSet |
newSampledSet(int[] manifoldLengths,
RealTupleType newSampledSetType,
float[][] newValues,
CoordinateSystem coordinateSystem,
Unit[] newUnits,
ErrorEstimate[] newErrors)
Creates a new SampledSet using a given manifold dimensionality. |
static SampledSet |
newSampledSet(MathType type,
float[][] values,
int[] manifoldLengths,
CoordinateSystem coordinateSystem,
Unit[] units,
ErrorEstimate[] errors,
boolean copy)
Creates a new SampledSet. |
static SampledSet |
newSampledSet(SampledSet oldSampledSet,
double[][] newValues,
int[] manifoldLengths)
Creates a new SampledSet based on an existing SampledSet and new values. |
static SampledSet |
newSampledSet(SampledSet oldSampledSet,
float[][] newValues,
int[] manifoldLengths)
Creates a new SampledSet based on an existing SampledSet and new values. |
static SampledSet |
newSampledSet(SampledSet oldSampledSet,
RealTupleType newSampledSetType,
double[][] newValues,
CoordinateSystem coordinateSystem,
Unit[] newUnits,
ErrorEstimate[] newErrors)
Creates a new SampledSet using the topology of an existing SampledSet. |
static SampledSet |
newSampledSet(SampledSet oldSampledSet,
RealTupleType newSampledSetType,
float[][] newValues,
CoordinateSystem coordinateSystem,
Unit[] newUnits,
ErrorEstimate[] newErrors)
Creates a new SampledSet using the topology of an existing SampledSet. |
static Unit |
parseUnit(String unitIdentifier)
Parse a unit string specification and return the appropriate unit. |
static Unit |
parseUnit(String unitIdentifier,
String unitName)
Parse a unit string specification and return the appropriate unit. |
static double[] |
performRotationAboutArbitraryVector(MouseBehavior mouse,
double[] initialTransFormMatrix,
double angle,
double axisIComp,
double axisJComp,
double axisKComp,
double offsetIComp,
double offsetJComp,
double offsetKComp)
Perform rotation about an arbitrary vector |
static void |
printData(Data d)
Print out the data summary. |
static void |
printDataType(Data d)
Print out the data type summary. |
static boolean |
propertySet(Object object,
String name,
Object value,
boolean ignoreError)
Use reflection to find the Method with name "set" + Name. |
static void |
setGlobeRadius(float[] position,
float radius)
_more_ |
static int[] |
sortedIndexes(double[] values,
boolean increasing)
Returns the element indexes that would sort an array. |
static int[] |
sortedIndexes(float[] values,
boolean increasing)
Returns the element indexes that would sort an array. |
static int[] |
strictlySortedIndexes(double[] values,
boolean increasing)
Returns the element indexes that would strictly sort an array. |
static int[] |
strictlySortedIndexes(float[] values,
boolean increasing)
Returns the element indexes that would strictly sort an array. |
static double[] |
take(double[] values,
int[] indexes)
Takes indicated values from an array. |
static float[] |
take(float[] values,
int[] indexes)
Takes indicated values from an array. |
static ucar.unidata.geoloc.LatLonPointImpl |
toLatLonPoint(LatLonPoint llp)
Create a LatLonPointImpl from the VisAD LatLonPoint |
static List |
toList(Set set)
Convert the elements in the set to a List |
static ucar.unidata.geoloc.LatLonPoint |
toLLP(EarthLocation el)
convert the visad EarthLocation into a ucar.unidata.geoloc.LatLonPoint |
static ucar.unidata.geoloc.LatLonPoint |
toLLP(LatLonPoint llp)
Convert the visad LatLonPoint to a unidata.geoloc.LatLonPoint |
static Real |
toReal(String value)
Parses the given String and returns the Real (if possible) that the string represents. |
static Real |
toReal(String value,
String unitOpener,
String unitCloser)
Create a Real from a string value |
static Data |
vetType(MathType type,
Data data)
Vets a data object against a MathType. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String TEXT_IDENTIFIER
public static String REALTYPE_ROOT
| Method Detail |
|---|
protected static Unit[] getDefaultUnits(FlatField field,
int[] indexes,
RealType[] types)
throws IllegalArgumentException,
TypeException,
VisADException
field - The field to be examined.indexes - Indexes of the components in the range of the
field.types - Expected, compatible types for the components.
IllegalArgumentException - field == null ||
indexes.length != types.length,
or indexes out-of-bounds.
TypeException - Type of component in range of field not
compatible with expected type.
VisADException - Couldn't create necessary VisAD object.
public static RealType clone(RealType realType,
String name)
throws VisADException
realType - The realtype to be cloned.name - The new name for the clone.
VisADException - Couldn't create necessary VisAD object.
public static boolean isCompatible(Data data,
MathType type)
throws VisADException,
RemoteException
Data object is compatible with a MathType.
data - The Data object.type - The MathType.
true if and only if the given
Data object is compatible with the given
MathType.
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.
public static Data vetType(MathType type,
Data data)
throws TypeException,
VisADException,
RemoteException
This method should probably become MathType.vet(Data).
type - The MathType that the data object must be
compatible with.data - The data object.
data (as a programming
convenience).
TypeException - The MathType and data object are incompatible.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static RealType ensureUnit(RealType type,
Unit u)
throws VisADException
type - RealType to checku - unit to check
VisADException - couldn't get a new RealTypepublic static String getCompatibleUnitName(Unit u)
u - Unit
public static String cleanName(String name)
name - name to clean
public static RealType[] ensureUnit(RealType[] types,
Unit u)
throws VisADException
types - array of RealTypes to checku - unit to check
VisADException - couldn't get a new RealType
public static Data ensureMathType(Data data,
MathType type)
throws UnimplementedException,
VisADException,
RemoteException
This method should probably become "abstract Data Data.ensureMathType(MathType)" with subclass-dependent implementations.
data - The data object.type - The type for the returned data object. Must be
compatible with the current type of the data
object. The data object will be cloned only
if necessary.
UnimplementedException - Method not yet implemented.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static Field ensureDomain(Field field,
Set domain)
throws UnimplementedException,
VisADException,
RemoteException
field - The Field the have a particular domain Set.domain - The particular domain Set for the Field to have.
Must be compatible with the Field's existing
domain set.
UnimplementedException - Can't yet clone the class of the Field.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static Field ensureDomain(Field field,
RealTupleType newDomainType,
CoordinateSystem coordinateSystem)
throws UnimplementedException,
VisADException,
RemoteException
field - The Field the have a particular domain Set.newDomainType - The particular MathType for the domain of the
Field to have. Coordinate conversions are
done if and when necessary and possible.coordinateSystem - The CoordinateSystem which, together with
newDomainType, form the basis for
the desired domain. May be null.
UnimplementedException - Can't yet clone the class of the Field.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static Field ensureTupleRange(Field field)
throws RemoteException,
VisADException
field - The Field.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static Field clone(Field field,
Set domain)
throws UnimplementedException,
VisADException,
RemoteException
field - The Field to be cloned..domain - The domain Set for the cloned Field to have.
Must be compatible with the Field's existing
domain set.
UnimplementedException - Can't yet clone the class of the Field.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static Field clone(Field field,
Set domain,
boolean copyRange)
throws UnimplementedException,
VisADException,
RemoteException
field - The Field to be cloned.domain - The domain Set for the cloned Field to have.
Need only be topologically equivalent to the
Field's existing domain set.copyRange - If true then the range of the old
Field will be copied to the new Field;
otherwise not.
UnimplementedException - Can't yet clone the class of the Field.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static FlatField clone(FlatField flatField,
Set domain,
boolean copyRange)
throws VisADException,
RemoteException
flatField - The FlatField to be cloned.domain - The domain Set for the cloned FlatField to have.
Need only be topologically equivalent to
existing domain.copyRange - If true then the range of the old
FlatField will be copied to the new Field;
otherwise not.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static Field convertDomain(Field field,
RealTupleType newDomainType,
CoordinateSystem coordinateSystem)
throws UnimplementedException,
VisADException,
RemoteException
field - The Field to be converted.newDomainType - The MathType of the domain for the converted
Field to have. Coordinate conversions are
done if and when necessary and possible.coordinateSystem - The CoordinateSystem which, together with
newDomainType, form the basis for
the desired domain. May be null.
UnimplementedException - Can't yet clone the class of the Field.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static FlatField convertDomain(FlatField field,
RealTupleType newDomainType,
CoordinateSystem coordinateSystem)
throws VisADException,
RemoteException
field - The FlatField to be converted.newDomainType - The MathType for the converted FlatField.
Coordinate conversions are done if and when
necessary and possible.coordinateSystem - The CoordinateSystem which, together with
newDomainType, form the basis for
the desired domain. May be null.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static SampledSet convertDomain(SampledSet oldDomain,
RealTupleType newDomainType,
CoordinateSystem coordinateSystem)
throws VisADException,
RemoteException
oldDomain - The domain to be converted.newDomainType - The type of the new domain.coordinateSystem - The CoordinateSystem which, together with
newDomainType, form the basis for
the desired domain. May be null.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static SampledSet newSampledSet(SampledSet oldSampledSet,
float[][] newValues,
int[] manifoldLengths)
throws VisADException,
RemoteException
oldSampledSet - The existing SampledSet.newValues - The values for the new SampledSet.manifoldLengths - The manifold dimensionality (i.e. the
number and size of each dimension). May be
null in which case an IrregularSet
is created and returned; otherwise, the first
element is the size of the innermost dimension,
etc.
VisADException - Couldn't perform necessary VisAD operation.
RemoteException - Java RMI failure.
public static SampledSet newSampledSet(SampledSet oldSampledSet,
double[][] newValues,
int[] manifoldLengths)
throws VisADException,
RemoteException
oldSampledSet - The existing SampledSet.newValues - The values for the new SampledSet.manifoldLengths - The manifold dimensionality (i.e. the
number and size of each dimension). May be
null in which case an IrregularSet
is created and returned; otherwise, the first
element is the size of the innermost dimension,
etc.
VisADException - Couldn't perform necessary VisAD operation.
RemoteException - Java RMI failure.
public static SampledSet newSampledSet(SampledSet oldSampledSet,
RealTupleType newSampledSetType,
float[][] newValues,
CoordinateSystem coordinateSystem,
Unit[] newUnits,
ErrorEstimate[] newErrors)
throws VisADException,
RemoteException
oldSampledSet - The old SampledSet to be used for the topology
of the new SampledSet.newSampledSetType - The type of the new SampledSet.newValues - The values for the new SampledSet.coordinateSystem - The CoordinateSystem for the new SampledSet.newUnits - The units for the new SampledSet.newErrors - The new ErrorEstimate-s for the new SampledSet.
VisADException - Couldn't perform necessary VisAD operation.
RemoteException - Java RMI failure.
public static SampledSet newSampledSet(SampledSet oldSampledSet,
RealTupleType newSampledSetType,
double[][] newValues,
CoordinateSystem coordinateSystem,
Unit[] newUnits,
ErrorEstimate[] newErrors)
throws VisADException,
RemoteException
oldSampledSet - The old SampledSet to be used for the topology
of the new SampledSet.newSampledSetType - The type of the new SampledSet.newValues - The values for the new SampledSet.coordinateSystem - The CoordinateSystem for the new SampledSet.newUnits - The units for the new SampledSet.newErrors - The new ErrorEstimate-s for the new SampledSet.
VisADException - Couldn't perform necessary VisAD operation.
RemoteException - Java RMI failure.
public static SampledSet newSampledSet(int[] manifoldLengths,
RealTupleType newSampledSetType,
double[][] newValues,
CoordinateSystem coordinateSystem,
Unit[] newUnits,
ErrorEstimate[] newErrors)
throws VisADException,
RemoteException
manifoldLengths - The manifold dimensionality (i.e. the
number and size of each dimension). May be
null in which case an IrregularSet
is created and returned; otherwise, the first
element is the size of the innermost dimension,
etc.newSampledSetType - The type of the new SampledSet.newValues - The values for the new SampledSet.coordinateSystem - The CoordinateSystem for the new SampledSet.newUnits - The units for the new SampledSet.newErrors - The new ErrorEstimate-s for the new SampledSet.
VisADException - Couldn't perform necessary VisAD operation.
RemoteException - Java RMI failure.
public static SampledSet newSampledSet(int[] manifoldLengths,
RealTupleType newSampledSetType,
float[][] newValues,
CoordinateSystem coordinateSystem,
Unit[] newUnits,
ErrorEstimate[] newErrors)
throws VisADException,
RemoteException
manifoldLengths - The manifold dimensionality (i.e. the
number and size of each dimension). May be
null in which case an IrregularSet
is created and returned; otherwise, the first
element is the size of the innermost dimension,
etc.newSampledSetType - The type of the new SampledSet.newValues - The values for the new SampledSet.coordinateSystem - The CoordinateSystem for the new SampledSet.newUnits - The units for the new SampledSet.newErrors - The new ErrorEstimate-s for the new SampledSet.
VisADException - Couldn't perform necessary VisAD operation.
RemoteException - Java RMI failure.
public static CoordinateSystem getRangeCoordinateSystem(Field field)
throws VisADException,
RemoteException
field - The Field.
null.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static CoordinateSystem[] getRangeCoordinateSystems(Field field)
throws VisADException,
RemoteException
field - The Field.
null.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.public static Unit[] getRangeUnits(FlatField field)
field - The FlatField.
null.public static Unit[] getDefaultRangeUnits(FieldImpl field)
field - The FlatField.
null.
public static Data clone(Data data,
MathType type)
throws UnimplementedException,
VisADException,
RemoteException
This method should probably become "abstract Data Data.clone(MathType)" with subclass-dependent implementations.
data - The data object to be cloned.type - The type for the returned data object. Must be
compatible with the current type of the data
object.
UnimplementedException - Method not yet implemented.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.public static Set getDomainSet(Field field)
field - The field
public static Set getDomainSetForClone(Field field)
field - the field
public static Data clone(Data data,
MathType type,
boolean unitOverride,
boolean copy)
throws UnimplementedException,
VisADException,
RemoteException
This method should probably become "abstract Data Data.clone(MathType)" with subclass-dependent implementations.
data - The data object to be cloned.type - The type for the returned data object. Must be
compatible with the current type of the data
object.unitOverride - if the units are not compatible, if true,
assume values are in units of new type.copy - if true, copy the data values for Fields.
UnimplementedException - Method not yet implemented.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static Data clone(Data data,
MathType type,
boolean unitOverride,
boolean copy,
boolean copyDomain)
throws UnimplementedException,
VisADException,
RemoteException
This method should probably become "abstract Data Data.clone(MathType)" with subclass-dependent implementations.
data - The data object to be cloned.type - The type for the returned data object. Must be
compatible with the current type of the data
object.unitOverride - if the units are not compatible, if true,
assume values are in units of new type.copy - if true, copy the data values for Fields.copyDomain - if true, make a copy of the domain as well
UnimplementedException - Method not yet implemented.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static Set ensureCoordinateSystem(Set set,
CoordinateSystem coordSys)
throws UnimplementedException,
VisADException,
RemoteException
This method should probably become "abstract Set Set.ensureCoordinateSystem(CoordinateSystem)".
set - The set.coordSys - The CoordinateSystem for the returned Set. May
be null.
set with the given
coordinate system. Clones the set only if
necessary.
UnimplementedException - Can't clone set.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static Set clone(Set set,
CoordinateSystem coordSys)
throws UnimplementedException,
VisADException,
RemoteException
This method should probably become "abstract Set Set.clone(CoordinateSystem)".
set - The set to be cloned.coordSys - The CoordinateSystem for the returned Set. May
be null.
set but with the given
CoordinateSystem.
UnimplementedException - Method not yet implemented for particular set.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static SampledSet getRangeSampledSet(Field field,
MathType type)
throws VisADException,
RemoteException
field - The field to have a component extracted.type - The MathType of the component to be
extracted.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static FlatField ensureFlatFieldRangeType(FlatField flatField,
RealType realType)
throws VisADException,
RemoteException
flatField - The FlatField to have it's range be
type.realType - The type for the returned FlatField.
flatFieldield with
realType as the MathType of the
range. May be flatField.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static SampledSet newSampledSet(MathType type,
float[][] values,
int[] manifoldLengths,
CoordinateSystem coordinateSystem,
Unit[] units,
ErrorEstimate[] errors,
boolean copy)
throws VisADException,
RemoteException
type - The type for the SampledSet.values - The values for the SampledSet.manifoldLengths - The dimensionality of the manifold with the
first element corresponding to the innermost
manifold dimension. Ignored if the values
constitute a single data point. May be
null, in which case the manifold
is assumed to be 1-dimensional and the
resulting set will be an IrregularSet. If non-
null, then the resulting set will
be a GriddedSet.coordinateSystem - The coordinate system transformation for the
SampledSet. May be null.units - The units of the values. May be
null.errors - The uncertainty of the values. May be
null.copy - Whether or not to copy the values.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static RealTuple getSample(Set set,
int index)
throws VisADException,
RemoteException
set - The set to have a sample returned.index - The index of the sample to be returned.
VisADException - Couldn't create necessary VisAD object.
RemoteException - Java RMI failure.
public static float[] take(float[] values,
int[] indexes)
values - The input array of values.indexes - Which elements to extract.
public static double[] take(double[] values,
int[] indexes)
values - The input array of values.indexes - Which elements to extract.
public static boolean isSorted(float[] values)
values - The array to check.
public static boolean isSorted(double[] values)
values - The array to check.
public static boolean isStrictlySorted(float[] values)
values - The array to check.
public static boolean isStrictlySorted(double[] values)
values - The array to check.
public static int[] sortedIndexes(float[] values,
boolean increasing)
values - The array to examine.increasing - Whether the sort is to be increasing or decreasing.
public static int[] sortedIndexes(double[] values,
boolean increasing)
values - The array to examine.increasing - Whether the sort is to be increasing or decreasing.
public static int[] strictlySortedIndexes(float[] values,
boolean increasing)
values - The array to examine.increasing - Whether the sort is to be increasing or decreasing.
public static int[] strictlySortedIndexes(double[] values,
boolean increasing)
values - The array to examine.increasing - Whether the sort is to be increasing or decreasing.
public static RealType getRealType(RealTupleType type,
String start)
throws VisADException
type - type to searchstart - starting characters of name. This is useful when
Plain import creates names like "pres_0"
VisADException
public static Unit parseUnit(String unitIdentifier)
throws VisADException
unitIdentifier - unit specification
VisADException - problem parsing unit
public static Unit parseUnit(String unitIdentifier,
String unitName)
throws VisADException
unitIdentifier - unit specificationunitName - Name to clone unit with
VisADException - problem parsing unit
public static String formatUtcDate(DateTime dt,
String pattern)
dt - DateTime objectpattern - format pattern
public static Date makeDate(DateTime dttm)
throws VisADException
dttm - DateTime to use
VisADException - problem converting units
public static List<Date> makeDates(DateTime[] timesArray)
throws VisADException
timesArray - array of DateTimes
VisADException - problem createing the dates
public static Real toReal(String value)
throws Exception
dddd
dddd unit
dddd[unit]
dddd(unit)
dddd{unit}
dddd
value - The string value
Exception - problem with unit spec or parsing.
public static Real toReal(String value,
String unitOpener,
String unitCloser)
throws Exception
value - numeric valueunitOpener - character for start of Unit specunitCloser - character for end of Unit spec
Exception - problem parsing the strings or creating the Real
public static double distance(LatLonPoint p1,
LatLonPoint p2)
p1 - Point 1p2 - Point 2
public static ucar.unidata.geoloc.LatLonPointImpl toLatLonPoint(LatLonPoint llp)
throws VisADException
llp - the LatLonPoint
VisADException - problem getting values from LatLonPoint
public static ucar.unidata.geoloc.Bearing calculateBearing(LatLonPoint pt1,
LatLonPoint pt2,
ucar.unidata.geoloc.Bearing result)
throws VisADException
pt1 - Point 1pt2 - Point 2result - Object to use if non-null
VisADException - When pt2 cannot be converted to the unit of pt1public static String formatReal(Real r)
r - real to format
public static TwoFacedObject labeledReal(Real r)
r - real to wrap
public static TwoFacedObject labeledReal(Real r,
boolean includeUnit)
r - real to wrapincludeUnit - if true, add the unit to the label
public static FieldImpl indexedField(Data[] datas,
boolean copy)
throws VisADException,
RemoteException
datas - Data objects for range. Must all be of same type.copy - true to copy data.
RemoteException - Java RMI problem
VisADException - problem creating fieldpublic static void main(String[] args)
args - cmd line args
public static Real bearingDistance(EarthLocation el1,
EarthLocation el2)
throws Exception
el1 - start locationel2 - end location
Exception - problem calculating the distance
public static double getValueAs(Real r,
String unitString)
throws VisADException,
RemoteException
r - RealunitString - string representation of the return Unit
RemoteException - Java RMI Exception
VisADException - Unit problem
public static Real getReal(double value,
String unitString)
throws VisADException,
RemoteException
value - the valueunitString - the Unit
RemoteException - Java RMI Exception
VisADException - Unit problem
public static Real getReal(double value,
Unit unit)
throws VisADException,
RemoteException
value - the valueunit - the Unit
RemoteException - Java RMI Exception
VisADException - Unit problem
public static RealType getRealType(Unit unit)
throws VisADException,
RemoteException
unit - unit
RemoteException - Java RMI Exception
VisADException - Unit problem
public static double[] getRayPositionAtZ(VisADRay ray,
double zValue)
ray - ray to usezValue - Z value
public static String cleanTypeName(String name)
name - Initial real type name
public static String cleanTypeName(MathType mathType)
mathType - the type
public static int getIndex(TupleType tupleType,
String lookingFor)
tupleType - Tuple typelookingFor - String to search for
public static RealType makeRealType(String name,
Unit unit)
throws VisADException
name - name of typeunit - can be null
VisADException - unable to create the RealType (shouldn't happen)
public static RealType makeRealType(String name,
String alias,
Unit unit)
throws VisADException
name - name of the RealTypealias - the aliasunit - the default unit
VisADException - problem creating the RealTypepublic static String formatLatLonPoint(LatLonPoint llp)
llp - LatLonPoint to format
public static EarthLocation makeEarthLocation(double lat,
double lon)
throws Exception
lat - latitudelon - longitude
Exception - problem creating earth location
public static EarthLocation makeEarthLocation(LatLonPoint llp)
throws Exception
llp - lat/lon
Exception - problem creating earth location
public static String formatEarthLocation(EarthLocation el,
boolean includeAlt)
el - EarthLocation to formatincludeAlt - include Altitude in the return
public static String formatAltitude(Real alt)
alt - The altitude
public static void dumpTypes(Data d)
throws VisADException
d - the Data object
VisADException - problem dumping the data
public static double[] getVWorldCoords(DisplayImpl display,
int x,
int y,
double[] retVals)
display - the displayx - the canvas X coordinatey - the canvas Y coordinateretVals - the return array (may be null)
public static FlatField makeField(Image image,
boolean makeNansForAnyAlpha)
throws IOException,
VisADException
image - image to usemakeNansForAnyAlpha - If true then we make a field with an alpha
value and we turn the other values into nan-s
IOException - problem reading the image
VisADException - problem creating the FlatField
public static FlatField makeField(Image image,
float alphaThreshold)
throws IOException,
VisADException
image - image to usealphaThreshold - If there is an alpha channel in the image then set the field value to nan
for any alhpa greater than the given threshold. Do nothing if threshold<0
value and we turn the other values into nan-s
IOException - problem reading the image
VisADException - problem creating the FlatField
public static FlatField makeField(Image image,
float alphaThreshold,
boolean makeAlpha)
throws IOException,
VisADException
image - image to usealphaThreshold - If there is an alpha channel in the image then set the field value to nan
for any alhpa greater than the given threshold. Do nothing if threshold<0
value and we turn the other values into nan-smakeAlpha - if true, make an alpha channel as well
IOException - problem reading the image
VisADException - problem creating the FlatField
public static FlatField makeField(Image image,
float alphaThreshold,
boolean makeAlpha,
boolean incNames)
throws IOException,
VisADException
image - image to usealphaThreshold - If there is an alpha channel in the image then set the field value to nan
for any alhpa greater than the given threshold. Do nothing if threshold<0
value and we turn the other values into nan-smakeAlpha - if true, make an alpha channel as well
IOException - problem reading the image
VisADException - problem creating the FlatField
public static MapProjection makeMapProjection(double lat1,
double lon1,
double lat2,
double lon2)
throws VisADException
lat1 - lower left latitudelon1 - lower left longitudelat2 - upper right latitudelon2 - upper right longitude
VisADException - problem creating the map projection
VisADException - problem making projection
public static MapProjection makeMapProjection(double lat1,
double lon1,
double lat2,
double lon2,
boolean makeSquare)
throws VisADException
lat1 - _more_lon1 - _more_lat2 - _more_lon2 - _more_makeSquare - _more_
VisADException - _more_
public static boolean propertySet(Object object,
String name,
Object value,
boolean ignoreError)
throws Exception
object - The object to invoke the set property method on.name - The name of the method.value - The String representation of the value to set.ignoreError - If true then don't print out an error
Exception - problem setting the property
public static Data makeTimeField(Data range,
List times)
throws VisADException,
RemoteException
range - The rangetimes - List of times
RemoteException - Java RMI problem
VisADException - VisAD problem
public static FieldImpl makeTimeField(List ranges,
List times)
throws VisADException,
RemoteException
ranges - ranges for each timetimes - list of times
RemoteException - Java RMI problem
VisADException - VisAD problem
public static Data makeTimeRangeField(Data range,
List times)
throws VisADException,
RemoteException
range - The rangetimes - List of times
RemoteException - Java RMI problem
VisADException - VisAD problem
public static int findIndex(Set set,
Real value)
throws VisADException,
RemoteException
set - the setvalue - the value
RemoteException - Java RMI problem
VisADException - VisAD problem
public static List toList(Set set)
throws VisADException,
RemoteException
set - The set
RemoteException - Java RMI problem
VisADException - VisAD problem
public static Set makeTimeSet(List times)
throws VisADException,
RemoteException
times - the times
RemoteException - Java RMI problem
VisADException - VisAD problem
public static boolean exportAsNetcdf(Data data)
throws Exception
data - the VisAD data to export
Exception - can't write data as netCDF
public static FlatField makeField(float lon1,
float lon2,
int length1,
float lat1,
float lat2,
int length2,
float fill,
String unitString)
throws VisADException,
RemoteException
lon1 - longitude 1lon2 - longitude 2length1 - number of lon pointslat1 - lat 1lat2 - lat 2length2 - number of lat pointsfill - the fill value for the rangeunitString - the unit
RemoteException - on badness
VisADException - on badness
public static GriddedSet makeEarthDomainSet(float[] lats,
float[] lons,
float[] alts)
throws VisADException
lats - the latslons - the lonsalts - the (possibly null) altitudes
VisADException - on badnesspublic static ucar.unidata.geoloc.LatLonPoint toLLP(EarthLocation el)
el - the earth location
public static ucar.unidata.geoloc.LatLonPoint toLLP(LatLonPoint llp)
llp - the visad llp
public static Range convertRange(Range range,
Unit rangeUnit,
Unit outUnit)
range - data rangerangeUnit - the unit for the rangeoutUnit - the converted unit
public static boolean allMissing(RealTuple rt)
rt - RealTuple in question
public static double[] performRotationAboutArbitraryVector(MouseBehavior mouse,
double[] initialTransFormMatrix,
double angle,
double axisIComp,
double axisJComp,
double axisKComp,
double offsetIComp,
double offsetJComp,
double offsetKComp)
mouse - MouseBehavior for matrix manipulationinitialTransFormMatrix - the initial matrixangle - the angle of rotationaxisIComp - i component of the axisaxisJComp - j component of the axisaxisKComp - k component of the axisoffsetIComp - offset i componentoffsetJComp - offset j componentoffsetKComp - offset k component
public static boolean isEarthCoordinates(RealTuple position)
position - _more_
public static void setGlobeRadius(float[] position,
float radius)
position - _more_radius - _more_public static void printData(Data d)
d - the Data to printpublic static void printDataType(Data d)
d - the Data to print
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||