Package ucar.unidata.data.point
Class PointObFactory
java.lang.Object
ucar.unidata.data.point.PointObFactory
Factory for dealing with point observations
- Author:
- IDV Development Team
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldImpl
Perform an object analysis on a set of point obsstatic FieldImpl
barnes
(FieldImpl pointObs, RealType type, float xSpacing, float ySpacing, int numPasses, float gain, float scaleLength, au.gov.bom.aifs.osa.analysis.Barnes.AnalysisParameters params, FieldImpl firstGuessField) Perform an object analysis on a set of point obsstatic FlatField
barnesOneTime
(FieldImpl pointObs, RealType type, float xSpacing, float ySpacing, int numPasses) Do the analysis on the single time.static FlatField
barnesOneTime
(FieldImpl pointObs, RealType type, float xSpacing, float ySpacing, int numPasses, float gain, float scaleLength, au.gov.bom.aifs.osa.analysis.Barnes.AnalysisParameters params) Do the analysis on the single time.static FlatField
barnesOneTime
(FieldImpl pointObs, RealType type, float xSpacing, float ySpacing, int numPasses, float gain, float scaleLength, au.gov.bom.aifs.osa.analysis.Barnes.AnalysisParameters params, FlatField firstGuess) Do the analysis on the single time.static List
Bin the timesstatic FieldImpl
extractParameter
(FieldImpl obs, String paramName) Extract the parameter from some point obsstatic FieldImpl
extractParameter
(FieldImpl obs, RealType parameter) Extract the parameter from some point obsstatic double[]
getBoundingBox
(FieldImpl pointObs) Get the bounding box of the given obsstatic double[]
getBoundingBoxOneTime
(FieldImpl pointObs) Get the bounding box of the given obsgetPointObs
(FieldImpl field) Get the list of PointOb objects from the given fieldstatic double
heatIndex
(double T, double RH) Create heatIndex from temperature and relative humidity.static FieldImpl
makePointCloud
(FieldImpl pointObs, String param) Make a point cloud structure from point obsstatic PointOb
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) Make a point obstatic FieldImpl
makePointObField
(PointOb point) Returns a point observation as a FieldImpl of type.static FieldImpl
makePointObs
(ucar.nc2.dt.PointObsDataset input) Make point obs from a PointObsDatasetstatic FieldImpl
makePointObs
(ucar.nc2.dt.PointObsDataset input, double binRoundTo, double binWidth) Make point obsstatic FieldImpl
makePointObs
(ucar.nc2.dt.PointObsDataset input, double binRoundTo, double binWidth, ucar.unidata.geoloc.LatLonRect llr) Make point obsstatic FieldImpl
makePointObs
(ucar.nc2.dt.PointObsDataset input, double binRoundTo, double binWidth, ucar.unidata.geoloc.LatLonRect llr, boolean sample) Make point obsstatic FieldImpl
makePointObs
(ucar.nc2.ft.FeatureDatasetPoint input, double binRoundTo, double binWidth, ucar.unidata.geoloc.LatLonRect llr, DateSelection dateSelection, boolean sample) Make point obsstatic FieldImpl
makePointObs
(ucar.nc2.ft.FeatureDatasetPoint input, DataChoice dataChoice, double binRoundTo, double binWidth, ucar.unidata.geoloc.LatLonRect llr, DateSelection dateSelection, boolean sample) Make point obsstatic FieldImpl
makePointObs
(PointOb po) Make a FieldImpl from a PointOb.static FieldImpl
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
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
makePointObsWRF
(ucar.nc2.ft.FeatureDatasetPoint input, double binRoundTo, double binWidth, ucar.unidata.geoloc.LatLonRect llr, DateSelection dateSelection, boolean sample) _more_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
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 ucar.nc2.dt.point.CFPointObWriter
makeWriter
(DataOutputStream dos, TupleType type, int[] skipIndices, int defaultStringLength, String altUnit, int cnt, int[] slengths) Make a CFPointObWriterstatic FieldImpl
Merge a List of FieldImpls of point obs into one.static double
relativeHumidity
(double T, double TD) 100*(EXP((17.625*TD)/(243.04+TD))/EXP((17.625*T)/(243.04+T)))static FieldImpl
removeTimeDimension
(FieldImpl pointObs) Remove the time dimension from a field of point obs, returning just and indexed list of the obsstatic FieldImpl
Returns a subset of the field of point observations that lie within the boundaries of the LinearLatLonSet.static FieldImpl
subSet
(FieldImpl pointObs, LinearLatLonSet bounds) Returns a subset of the field of point observations that lie within the boundaries of the LinearLatLonSet.static double
windChill
(double speed, double T) WC = 35.74 + 0.6215 * (T - 273.15) - 35.75 * (WS)**0.16 + 0.4275 * ( T - 273.15) * (WS)**0.16static void
writeToNetcdf
(File file, FieldImpl field) Write the PointObs contained in the given field as a netcdf file
-
Field Details
-
OA_GRID_DEFAULT
public static final float OA_GRID_DEFAULTOA Grid Default value- See Also:
-
-
Constructor Details
-
PointObFactory
public PointObFactory()Constructor
-
-
Method Details
-
makePointObField
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 errorVisADException
- VisAD Error
-
makePointCloud
public static FieldImpl makePointCloud(FieldImpl pointObs, String param) throws VisADException, RemoteException Make a point cloud structure from point obs- Parameters:
pointObs
- the point obsparam
- the parameter to extract - null if want all- Returns:
- a PointCloud (time->((index)->((Latitude, Longitude, Altitude),param)))
- Throws:
RemoteException
- Java RMI problemVisADException
- VisAD problem
-
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 errorVisADException
- 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 errorVisADException
- 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 togethercomponentIndex
- If >= 0 then make a T->componentvalue field- Returns:
- time sequence of obs (time -> (index -> pointobs))
- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD Error
-
subSet
public static FieldImpl subSet(FieldImpl pointObs, ucar.unidata.geoloc.LatLonRect 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 errorVisADException
- 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 errorVisADException
- VisAD Error
-
getPointObs
Get the list of PointOb objects from the given field- Parameters:
field
- the field that contains the PointObs- Returns:
- List of PointObs
- Throws:
RemoteException
- on badnessVisADException
- on badness
-
writeToNetcdf
public static void writeToNetcdf(File file, FieldImpl field) throws VisADException, RemoteException, IOException Write the PointObs contained in the given field as a netcdf file- Parameters:
file
- file to write tofield
- The field- Throws:
IOException
- on badnessRemoteException
- on badnessVisADException
- on badness
-
makeWriter
public static ucar.nc2.dt.point.CFPointObWriter makeWriter(DataOutputStream dos, TupleType type, int[] skipIndices, int defaultStringLength, String altUnit, int cnt, int[] slengths) throws Exception Make a CFPointObWriter- Parameters:
dos
- the output streamtype
- the tupeskipIndices
- which indices to skipdefaultStringLength
- the default string lengthaltUnit
- the altitude unitcnt
- the numberslengths
- string lengths- Returns:
- the writer
- Throws:
Exception
- problem creating something
-
makePointObsFromField
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 databinRoundTo
- time bin round tobinWidth
- time bin size- Returns:
- The data
- Throws:
VisADException
- On badness
-
makePointObs
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
Bin the times- Parameters:
times
- List of timesbinRoundTo
- round to factorbinWidth
- 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 setbinRoundTo
- bin round tobinWidth
- 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 setbinRoundTo
- bin round tobinWidth
- time bin sizellr
- bounding box- 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, boolean sample) throws Exception Make point obs- Parameters:
input
- the data setbinRoundTo
- bin round tobinWidth
- time bin sizellr
- bounding boxsample
- If true then just sample the data, i.e., read the first ob- Returns:
- The field
- Throws:
Exception
- On badness
-
makePointObs
public static FieldImpl makePointObs(ucar.nc2.ft.FeatureDatasetPoint input, DataChoice dataChoice, double binRoundTo, double binWidth, ucar.unidata.geoloc.LatLonRect llr, DateSelection dateSelection, boolean sample) throws Exception Make point obs- Parameters:
input
- the data setbinRoundTo
- bin round tobinWidth
- time bin sizellr
- bounding boxdateSelection
- the date selectionsample
- If true then just sample the data, i.e., read the first ob- Returns:
- The field
- Throws:
Exception
- On badness
-
makePointObs
public static FieldImpl makePointObs(ucar.nc2.ft.FeatureDatasetPoint input, double binRoundTo, double binWidth, ucar.unidata.geoloc.LatLonRect llr, DateSelection dateSelection, boolean sample) throws Exception Make point obs- Parameters:
input
- the data setbinRoundTo
- bin round tobinWidth
- time bin sizellr
- bounding boxdateSelection
- the date selectionsample
- If true then just sample the data, i.e., read the first ob- Returns:
- The field
- Throws:
Exception
- On badness
-
makePointObsWRF
public static FieldImpl makePointObsWRF(ucar.nc2.ft.FeatureDatasetPoint input, double binRoundTo, double binWidth, ucar.unidata.geoloc.LatLonRect llr, DateSelection dateSelection, boolean sample) throws Exception _more_- Parameters:
input
- _more_binRoundTo
- _more_binWidth
- _more_llr
- _more_dateSelection
- _more_sample
- _more_- Returns:
- _more_
- Throws:
Exception
- _more_
-
mergeData
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
Make a PointOb from an EarthLocation. The time and data are bogus.- Parameters:
el
- EarthLocation to use- Returns:
- PointOb
- Throws:
RemoteException
- Java RMI errorVisADException
- 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 usedt
- DateTime to use- Returns:
- PointOb
- Throws:
RemoteException
- Java RMI errorVisADException
- problem getting the data
-
makePointOb
public static PointOb makePointOb(EarthLocation el, DateTime dt, Tuple tuple) throws VisADException, RemoteException Make a point ob- Parameters:
el
- earth locationdt
- date timetuple
- data- Returns:
- the point ob
- Throws:
RemoteException
- Java RMI errorVisADException
- problem getting the data
-
makePointObs
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 errorVisADException
- 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 usedt
- DateTime to use- Returns:
- FieldImpl of index->po
- Throws:
RemoteException
- Java RMI errorVisADException
- problem getting the data
-
makePointObs
Make a FieldImpl from a PointOb.- Parameters:
po
- The ob- Returns:
- FieldImpl of index->po
- Throws:
RemoteException
- Java RMI errorVisADException
- 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 errorVisADException
- problem getting the data
-
barnes
public static FieldImpl barnes(FieldImpl pointObs, RealType type, float xSpacing, float ySpacing, int numPasses) throws VisADException, RemoteException Perform an object analysis on a set of point obs- Parameters:
pointObs
- Observations to analyzetype
- RealTypes of parameterxSpacing
- x spacing (degrees)ySpacing
- y spacing (degrees)numPasses
- number of passes- Returns:
- Grid of objectively analyzed data
- Throws:
RemoteException
- Java RMI errorVisADException
- problem getting the data
-
barnes
public static FieldImpl barnes(FieldImpl pointObs, RealType type, float xSpacing, float ySpacing, int numPasses, float gain, float scaleLength, au.gov.bom.aifs.osa.analysis.Barnes.AnalysisParameters params, FieldImpl firstGuessField) throws VisADException, RemoteException Perform an object analysis on a set of point obs- Parameters:
pointObs
- Observations to analyzetype
- RealTypes of parameterxSpacing
- x spacing (degrees)ySpacing
- y spacing (degrees)numPasses
- number of passesgain
- grid convergence/passscaleLength
- search radiusparams
- analysis parameters - used to pass back computed valsfirstGuessField
- The data to use for a first guess. May be null.- Returns:
- Grid of objectively analyzed data
- Throws:
RemoteException
- Java RMI errorVisADException
- problem getting the data
-
barnesOneTime
public static FlatField barnesOneTime(FieldImpl pointObs, RealType type, float xSpacing, float ySpacing, int numPasses) throws VisADException, RemoteException Do the analysis on the single time. Should be of the structure: (index -> PointOb)- Parameters:
pointObs
- Observations to analyzetype
- RealTypes of parameterxSpacing
- x spacing (degrees)ySpacing
- y spacing (degrees)numPasses
- number of passes- Returns:
- Grid of objectively analyzed data
- Throws:
RemoteException
- Java RMI errorVisADException
- problem getting the data
-
barnesOneTime
public static FlatField barnesOneTime(FieldImpl pointObs, RealType type, float xSpacing, float ySpacing, int numPasses, float gain, float scaleLength, au.gov.bom.aifs.osa.analysis.Barnes.AnalysisParameters params) throws VisADException, RemoteException Do the analysis on the single time. Should be of the structure: (index -> PointOb)- Parameters:
pointObs
- Observations to analyzetype
- RealTypes of parameterxSpacing
- x spacing (degrees)ySpacing
- y spacing (degrees)numPasses
- number of passesgain
- grid convergence/passscaleLength
- search radiusparams
- analysis parameters - used to pass back computed vals- Returns:
- Grid of objectively analyzed data
- Throws:
RemoteException
- Java RMI errorVisADException
- problem getting the data
-
barnesOneTime
public static FlatField barnesOneTime(FieldImpl pointObs, RealType type, float xSpacing, float ySpacing, int numPasses, float gain, float scaleLength, au.gov.bom.aifs.osa.analysis.Barnes.AnalysisParameters params, FlatField firstGuess) throws VisADException, RemoteException Do the analysis on the single time. Should be of the structure: (index -> PointOb)- Parameters:
pointObs
- Observations to analyzetype
- RealTypes of parameterxSpacing
- x spacing (degrees)ySpacing
- y spacing (degrees)numPasses
- number of passesgain
- grid convergence/passscaleLength
- search radiusparams
- analysis parameters - used to pass back computed valsfirstGuess
- analysis parameters - used to pass back computed vals- Returns:
- Grid of objectively analyzed data
- Throws:
RemoteException
- Java RMI errorVisADException
- problem getting the data
-
extractParameter
public static FieldImpl extractParameter(FieldImpl obs, String paramName) throws VisADException, RemoteException Extract the parameter from some point obs- Parameters:
obs
- Field of point obsparamName
- name of the parameter to extract- Returns:
- new FieldImpl where the data for each Point ob is just the param
- Throws:
RemoteException
- Java RMI exceptionVisADException
- problem extracting parameter
-
extractParameter
public static FieldImpl extractParameter(FieldImpl obs, RealType parameter) throws VisADException, RemoteException Extract the parameter from some point obs- Parameters:
obs
- Field of point obsparameter
- parameter to extract- Returns:
- new FieldImpl where the data for each Point ob is just the param
- Throws:
RemoteException
- Java RMI exceptionVisADException
- problem extracting parameter
-
getBoundingBox
Get the bounding box of the given obs- Parameters:
pointObs
- the obs- Returns:
- bbox of the given time field- { minY, minX, maxY, maxX };
- Throws:
RemoteException
- On badnessVisADException
- On badness
-
getBoundingBoxOneTime
public static double[] getBoundingBoxOneTime(FieldImpl pointObs) throws VisADException, RemoteException Get the bounding box of the given obs- Parameters:
pointObs
- the obs- Returns:
- bbox of the given time field- { minY, minX, maxY, maxX };
- Throws:
RemoteException
- On badnessVisADException
- On badness
-
heatIndex
public static double heatIndex(double T, double RH) Create heatIndex from temperature and relative humidity.- Parameters:
T
- temperature (F)RH
- wind direction (%)
-
windChill
public static double windChill(double speed, double T) WC = 35.74 + 0.6215 * (T - 273.15) - 35.75 * (WS)**0.16 + 0.4275 * ( T - 273.15) * (WS)**0.16- Parameters:
speed
- wind speed (mph)T
- temperature(F)
-
relativeHumidity
public static double relativeHumidity(double T, double TD) 100*(EXP((17.625*TD)/(243.04+TD))/EXP((17.625*T)/(243.04+T)))- Parameters:
T
- temperature (Celsius)TD
- dewPoint(Celsius)
-