ucar.unidata.data.point
Class PointObFactory

java.lang.Object
  extended by ucar.unidata.data.point.PointObFactory

public class PointObFactory
extends Object

Factory for dealing with point observations

Version:
$Revision: 1.53 $ $Date: 2007/05/22 14:56:04 $
Author:
MetApps Development Team

Constructor Summary
PointObFactory()
          Constructor
 
Method Summary
static FieldImpl barnes(FieldImpl pointObs, RealType type, double xSpacing, double ySpacing, int numPasses)
          Perform an object analysis on a set of point obs
static FlatField barnesOneTime(FieldImpl pointObs, RealType type, double xSpacing, double ySpacing, int numPasses)
          Do the analysis on the single time.
static List binTimes(List times, double binRoundTo, double binWidth)
          Bin the times
static void main(String[] args)
          main
static PointOb makePointOb(EarthLocation el)
          Make a PointOb from an EarthLocation.
static PointOb makePointOb(EarthLocation el, DateTime dt)
          Make a PointOb from an EarthLocation.
static PointOb makePointOb(EarthLocation el, DateTime dt, Tuple tuple)
           
static FieldImpl makePointObField(PointOb point)
          Returns a point observation as a FieldImpl of type.
static FieldImpl makePointObs(EarthLocation el)
          Make a FieldImpl of PointOb-s from an EarthLocation.
static FieldImpl makePointObs(EarthLocation el, DateTime dt)
          Make a FieldImpl of PointOb-s from an EarthLocation.
static FieldImpl makePointObs(PointOb po)
          Make a FieldImpl from a PointOb.
static FieldImpl makePointObs(ucar.nc2.dt.PointObsDataset input)
          Make point obs from a PointObsDataset
static FieldImpl makePointObs(ucar.nc2.dt.PointObsDataset input, double binRoundTo, double binWidth)
          Make point obs
static FieldImpl makePointObs(ucar.nc2.dt.PointObsDataset input, double binRoundTo, double binWidth, ucar.unidata.geoloc.LatLonRect llr)
          Make point obs
static FieldImpl makePointObsFromField(FieldImpl input)
          Take a field of data and turn it into a field of PointObs.
static FieldImpl makePointObsFromField(FieldImpl input, double binRoundTo, double binWidth)
          Take a field of data and turn it into a field of PointObs.
static FieldImpl makeTimeSequenceOfPointObs(FieldImpl pointObs)
          From a field of point observations, reorder them with time as the outer dimension.
static FieldImpl makeTimeSequenceOfPointObs(FieldImpl pointObs, int lumpMinutes)
          From a field of point observations, reorder them with time as the outer dimension.
static FieldImpl makeTimeSequenceOfPointObs(List pointObs, int lumpMinutes, int componentIndex)
          From a field of point observations, reorder them with time as the outer dimension.
static FieldImpl mergeData(List datas)
          Merge a List of FieldImpls of point obs into one.
static FieldImpl removeTimeDimension(FieldImpl pointObs)
          Remove the time dimension from a field of point obs, returning just and indexed list of the obs
static FieldImpl subSet(FieldImpl pointObs, LinearLatLonSet bounds)
          Returns a subset of the field of point observations that lie within the boundaries of the LinearLatLonSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointObFactory

public PointObFactory()
Constructor

Method Detail

makePointObField

public static FieldImpl makePointObField(PointOb point)
                                  throws VisADException,
                                         RemoteException
Returns a point observation as a FieldImpl of type. The type is:
  (Time -> ((lat, lon, alt) -> (data)))
 

Parameters:
point - point observation
Returns:
PointOb as a field
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

makeTimeSequenceOfPointObs

public static FieldImpl makeTimeSequenceOfPointObs(FieldImpl pointObs)
                                            throws VisADException,
                                                   RemoteException
From a field of point observations, reorder them with time as the outer dimension.

Parameters:
pointObs - Field of point observations (index -> pointobs)
Returns:
time sequence of obs (time -> (index -> pointobs))
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

makeTimeSequenceOfPointObs

public static FieldImpl makeTimeSequenceOfPointObs(FieldImpl pointObs,
                                                   int lumpMinutes)
                                            throws VisADException,
                                                   RemoteException
From a field of point observations, reorder them with time as the outer dimension.

Parameters:
pointObs - Field of point observations (index -> pointobs)
lumpMinutes - If greater then 0 is used to lump the times of the point obs together
Returns:
time sequence of obs (time -> (index -> pointobs))
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

makeTimeSequenceOfPointObs

public static FieldImpl makeTimeSequenceOfPointObs(List pointObs,
                                                   int lumpMinutes,
                                                   int componentIndex)
                                            throws VisADException,
                                                   RemoteException
From a field of point observations, reorder them with time as the outer dimension. If componentIndex > -1 then we extract that real value from the observation tuple and use that in the range. We also skip the intermediate index field and only use the first PointOb for each time step

Parameters:
pointObs - Field of point observations (index -> pointobs)
lumpMinutes - If greater then 0 is used to lump the times of the point obs together
componentIndex - If >= 0 then make a T->componentvalue field
Returns:
time sequence of obs (time -> (index -> pointobs))
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

subSet

public static FieldImpl subSet(FieldImpl pointObs,
                               LinearLatLonSet bounds)
                        throws VisADException,
                               RemoteException
Returns a subset of the field of point observations that lie within the boundaries of the LinearLatLonSet.

Parameters:
pointObs - set of obs.
bounds - LinearLatLonSet bounding box
Returns:
subset within the bounds
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

makePointObsFromField

public static FieldImpl makePointObsFromField(FieldImpl input)
                                       throws VisADException
Take a field of data and turn it into a field of PointObs. Right now, this assumes a surface data from an ADDE server.

Parameters:
input - FieldImpl of raw VisAD data
Returns:
field of PointObs
Throws:
VisADException - couldn't create the VisAD data

makePointObsFromField

public static FieldImpl makePointObsFromField(FieldImpl input,
                                              double binRoundTo,
                                              double binWidth)
                                       throws VisADException
Take a field of data and turn it into a field of PointObs. Right now, this assumes a surface data from an ADDE server.

Parameters:
input - FieldImpl of raw VisAD data
binRoundTo - time bin round to
binWidth - time bin size
Returns:
The data
Throws:
VisADException - On badness

makePointObs

public static FieldImpl makePointObs(ucar.nc2.dt.PointObsDataset input)
                              throws Exception
Make point obs from a PointObsDataset

Parameters:
input - pointobs dataset to load
Returns:
FieldImpl of form (index) -> PointOb
Throws:
Exception - problem creating the ob or a cancel

binTimes

public static List binTimes(List times,
                            double binRoundTo,
                            double binWidth)
                     throws VisADException
Bin the times

Parameters:
times - List of times
binRoundTo - round to factor
binWidth - bin size
Returns:
Binned times
Throws:
VisADException - On badness

makePointObs

public static FieldImpl makePointObs(ucar.nc2.dt.PointObsDataset input,
                                     double binRoundTo,
                                     double binWidth)
                              throws Exception
Make point obs

Parameters:
input - the data set
binRoundTo - bin round to
binWidth - time bin size
Returns:
The field
Throws:
Exception - On badness

makePointObs

public static FieldImpl makePointObs(ucar.nc2.dt.PointObsDataset input,
                                     double binRoundTo,
                                     double binWidth,
                                     ucar.unidata.geoloc.LatLonRect llr)
                              throws Exception
Make point obs

Parameters:
input - the data set
binRoundTo - bin round to
binWidth - time bin size
llr - bounding box
Returns:
The field
Throws:
Exception - On badness

mergeData

public static FieldImpl mergeData(List datas)
                           throws VisADException
Merge a List of FieldImpls of point obs into one.

Parameters:
datas - List of FieldImpls of point obs
Returns:
merged FieldImpl
Throws:
VisADException - problem getting the data

makePointOb

public static PointOb makePointOb(EarthLocation el)
                           throws VisADException,
                                  RemoteException
Make a PointOb from an EarthLocation. The time and data are bogus.

Parameters:
el - EarthLocation to use
Returns:
PointOb
Throws:
RemoteException - Java RMI error
VisADException - problem getting the data

makePointOb

public static PointOb makePointOb(EarthLocation el,
                                  DateTime dt)
                           throws VisADException,
                                  RemoteException
Make a PointOb from an EarthLocation. The time and data are bogus.

Parameters:
el - EarthLocation to use
dt - DateTime to use
Returns:
PointOb
Throws:
RemoteException - Java RMI error
VisADException - problem getting the data

makePointOb

public static PointOb makePointOb(EarthLocation el,
                                  DateTime dt,
                                  Tuple tuple)
                           throws VisADException,
                                  RemoteException
Throws:
VisADException
RemoteException

makePointObs

public static FieldImpl makePointObs(EarthLocation el)
                              throws VisADException,
                                     RemoteException
Make a FieldImpl of PointOb-s from an EarthLocation. The time and data are bogus.

Parameters:
el - EarthLocation to use
Returns:
FieldImpl of index->po
Throws:
RemoteException - Java RMI error
VisADException - problem getting the data

makePointObs

public static FieldImpl makePointObs(EarthLocation el,
                                     DateTime dt)
                              throws VisADException,
                                     RemoteException
Make a FieldImpl of PointOb-s from an EarthLocation. The time and data are bogus.

Parameters:
el - EarthLocation to use
dt - DateTime to use
Returns:
FieldImpl of index->po
Throws:
RemoteException - Java RMI error
VisADException - problem getting the data

makePointObs

public static FieldImpl makePointObs(PointOb po)
                              throws VisADException,
                                     RemoteException
Make a FieldImpl from a PointOb.

Parameters:
po - The ob
Returns:
FieldImpl of index->po
Throws:
RemoteException - Java RMI error
VisADException - problem getting the data

removeTimeDimension

public static FieldImpl removeTimeDimension(FieldImpl pointObs)
                                     throws VisADException,
                                            RemoteException
Remove the time dimension from a field of point obs, returning just and indexed list of the obs

Parameters:
pointObs - time field of obs
Returns:
indexed list of obs
Throws:
RemoteException - Java RMI error
VisADException - problem getting the data

barnes

public static FieldImpl barnes(FieldImpl pointObs,
                               RealType type,
                               double xSpacing,
                               double ySpacing,
                               int numPasses)
                        throws VisADException,
                               RemoteException
Perform an object analysis on a set of point obs

Parameters:
pointObs - Observations to analyze
Returns:
Grid of objectively analyzed data
Throws:
RemoteException - Java RMI error
VisADException - problem getting the data

barnesOneTime

public static FlatField barnesOneTime(FieldImpl pointObs,
                                      RealType type,
                                      double xSpacing,
                                      double ySpacing,
                                      int numPasses)
                               throws VisADException,
                                      RemoteException
Do the analysis on the single time. Should be of the structure: (index -> PointOb)

Parameters:
pointObs - Observations to analyze
type - RealTypes of parameter
Returns:
Grid of objectively analyzed data
Throws:
RemoteException - Java RMI error
VisADException - problem getting the data

main

public static void main(String[] args)
                 throws Exception
main

Parameters:
args - args
Throws:
Exception - on badness