ucar.unidata.data.radar
Class CDMRadarAdapter

java.lang.Object
  extended by ucar.unidata.data.radar.CDMRadarAdapter
All Implemented Interfaces:
RadarAdapter, RadarConstants

public class CDMRadarAdapter
extends Object
implements RadarAdapter

A data adapter for Common Data Model radial data (Level II, Level III, DORADE)

Version:
$Revision: 1.54 $
Author:
IDV Development Team

Field Summary
 
Fields inherited from interface ucar.unidata.data.radar.RadarAdapter
AZIMUTH_TYPE, ELEVATION_ANGLE_TYPE, RANGE_TYPE
 
Fields inherited from interface ucar.unidata.data.radar.RadarConstants
AZIMUTH, ELEVATION_ANGLE, PROP_2DOR3D, PROP_ANGLE, PROP_ANGLES, PROP_AZIMUTH, PROP_CAPPI_LEVEL, PROP_CAPPI_LEVELS, PROP_TIMEHEIGHT, PROP_VCS, PROP_VOLUMEORSWEEP, PROP_VWP, RADAR_MOST_RECENT, RADIAL_VELOCITY_NAME, RANGE, REFLECTIVITY, REFLECTIVITY_NAME, SPECTRUM_WIDTH, SPECTRUM_WIDTH_NAME, STATION_LOCATION, VALUE_2D, VALUE_3D, VALUE_SWEEP, VALUE_VOLUME, VELOCITY
 
Constructor Summary
CDMRadarAdapter()
          Zero-argument constructor for construction via unpersistence.
CDMRadarAdapter(DataSourceImpl source, String fileName)
          Construct a new DORADE adapter.
 
Method Summary
 void clearCachedData()
          Clear the rds data
 boolean equals(Object o)
          Check to see if this CDMDataSource is equal to the object in question.
protected  double[] getAngles(String vname)
          Get the angles for this parameter
 DateTime getBaseTime()
          Get the base time for this sweep
 FieldImpl getCAPPI(int moment, String varName, Real level)
          This api is based on the rsl c library from TRMM Office Radar Software Library.
 Object[] getCutIdx(ucar.nc2.dt.RadialDatasetSweep.RadialVariable sweepVar)
           
 DataImpl getData(DataChoice dataChoice, DataSelection subset, Hashtable requestProperties)
          Get the data for the given DataChoice and selection criteria.
 String getDataFormatName()
          Get the data format name (e.g.
 float[] getFloatNaN(int n)
           
 String getName()
          Return the name of the file
protected  RealType[] getParams()
          Get the parameters for this adapter
 FlatField getRaster(int moment, String varName)
          Create the initial spatial domain
 FieldImpl getRHI(int moment, String varName, double rhiAz)
          Makes a field of all data from one common data model radar adapter;
 FieldImpl getRHIOld(int moment, String varName, double rhiAz)
          Makes a field of all data from one common data model radar adapter;
 String getStationID()
          Get the station ID
 EarthLocation getStationLocation()
          Get the parameters for this adapter
 String getStationName()
          Get the parameters for this adapter
 FlatField getSweep(int moment, double elevation, String varName, int idx, boolean want3D)
          Makes a field of all data from one common data model radar adapter;
 int getSweepNumber(String vname, double angle)
          Get the sweep number for the particular variable and elevation angle
protected  double getVCPAngle(double angle, short id)
          Find the closest angle to the given VCP angles
protected  double[] getVCPAngles(short id, double[] origAngles)
          Get the parameters for this adapter
protected  short getVCPid(String vname)
          Get the parameters for this adapter
 FlatField getVolume(int moment, String varName)
          Makes a field of all data from one common data model radar adapter;
 int hashCode()
          Get the hash code for this object.
 boolean isRaster()
          Get the parameters for this adapter
 boolean isVolume()
          Get the parameters for this adapter
static void main(String[] args)
          main
static void mainDorade(String[] args)
          Test main
 void setStationLocation(EarthLocation el)
          Set the station location
 String toString()
          to String.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CDMRadarAdapter

public CDMRadarAdapter()
Zero-argument constructor for construction via unpersistence.


CDMRadarAdapter

public CDMRadarAdapter(DataSourceImpl source,
                       String fileName)
                throws VisADException
Construct a new DORADE adapter.

Parameters:
source - DataSource (may be null)
fileName - name of the DORADE file to read
Throws:
VisADException - problem creating data
Method Detail

equals

public boolean equals(Object o)
Check to see if this CDMDataSource is equal to the object in question.

Overrides:
equals in class Object
Parameters:
o - object in question
Returns:
true if they are the same or equivalent objects

hashCode

public int hashCode()
Get the hash code for this object.

Overrides:
hashCode in class Object
Returns:
hash code.

toString

public String toString()
to String.

Overrides:
toString in class Object
Returns:
to string

getAngles

protected double[] getAngles(String vname)
Get the angles for this parameter

Parameters:
vname - variable name
Returns:
angles for that variable

getBaseTime

public DateTime getBaseTime()
Get the base time for this sweep

Specified by:
getBaseTime in interface RadarAdapter
Returns:
time of sweep

getVCPid

protected short getVCPid(String vname)
Get the parameters for this adapter

Parameters:
vname - variable name
Returns:
id for that variable

getVCPAngles

protected double[] getVCPAngles(short id,
                                double[] origAngles)
Get the parameters for this adapter

Parameters:
id - vcp id number
origAngles - The original angles
Returns:
dd vcp angles

getVCPAngle

protected double getVCPAngle(double angle,
                             short id)
Find the closest angle to the given VCP angles

Parameters:
angle - to find
id - of VCP
Returns:
ang for angle;

getCAPPI

public FieldImpl getCAPPI(int moment,
                          String varName,
                          Real level)
                   throws VisADException,
                          RemoteException,
                          IOException
This api is based on the rsl c library from TRMM Office Radar Software Library.

Parameters:
moment - the moment
varName - variable name
level - the level
Returns:
capi as a FieldImpl
Throws:
IOException - problem reading the file
RemoteException - problem with Java RMI
VisADException - problem creating VisAD object

getData

public DataImpl getData(DataChoice dataChoice,
                        DataSelection subset,
                        Hashtable requestProperties)
                 throws VisADException,
                        RemoteException
Get the data for the given DataChoice and selection criteria.

Specified by:
getData in interface RadarAdapter
Parameters:
dataChoice - DataChoice for selection
subset - subsetting criteria
requestProperties - extra request properties
Returns:
the Data object for the request
Throws:
RemoteException - couldn't create a remote data object
VisADException - couldn't create the data

clearCachedData

public void clearCachedData()
Clear the rds data

Specified by:
clearCachedData in interface RadarAdapter

getName

public String getName()
Return the name of the file

Specified by:
getName in interface RadarAdapter
Returns:
name

getParams

protected RealType[] getParams()
Get the parameters for this adapter

Returns:
parameters

getRHIOld

public FieldImpl getRHIOld(int moment,
                           String varName,
                           double rhiAz)
                    throws VisADException,
                           RemoteException,
                           IOException
Makes a field of all data from one common data model radar adapter;

Parameters:
moment - moment
varName - variable name
rhiAz - azimuth for RHI
Returns:
rhi as a FieldImpl
Throws:
IOException - Problem reading data
RemoteException - Java RMI problem
VisADException - Couldn't create VisAD Object

getRHI

public FieldImpl getRHI(int moment,
                        String varName,
                        double rhiAz)
                 throws VisADException,
                        RemoteException,
                        IOException
Makes a field of all data from one common data model radar adapter;

Parameters:
moment - moment
varName - variable name
rhiAz - azimuth for RHI
Returns:
rhi as a FieldImpl
Throws:
IOException - Problem reading data
RemoteException - Java RMI problem
VisADException - Couldn't create VisAD Object

getStationID

public String getStationID()
Get the station ID

Returns:
the station ID

getStationLocation

public EarthLocation getStationLocation()
Get the parameters for this adapter

Returns:
parameters

setStationLocation

public void setStationLocation(EarthLocation el)
                        throws VisADException,
                               RemoteException
Set the station location

Parameters:
el - location of the radar
Throws:
VisADException - couldn't create VisAD object
RemoteException - couldn't create remote object

getStationName

public String getStationName()
Get the parameters for this adapter

Returns:
parameters

getDataFormatName

public String getDataFormatName()
Get the data format name (e.g. Level II, DORADE, etc)

Returns:
the format name

getRaster

public FlatField getRaster(int moment,
                           String varName)
                    throws VisADException,
                           RemoteException,
                           IOException,
                           ucar.ma2.InvalidRangeException
Create the initial spatial domain

Parameters:
moment -
varName - variable name
Returns:
The initial spatial domain
Throws:
IOException - Problem reading data
ucar.ma2.InvalidRangeException - Problem reading data
RemoteException - Java RMI problem
VisADException - problem creating domain

getSweep

public FlatField getSweep(int moment,
                          double elevation,
                          String varName,
                          int idx,
                          boolean want3D)
                   throws VisADException,
                          RemoteException,
                          IOException
Makes a field of all data from one common data model radar adapter;

Parameters:
moment - moment
elevation - elevation angle
varName - variable name
want3D - true if should return a 3D field
Returns:
sweep as a FieldImpl
Throws:
IOException - Problem reading data
RemoteException - Java RMI problem
VisADException - Couldn't create VisAD Object

getSweepNumber

public int getSweepNumber(String vname,
                          double angle)
Get the sweep number for the particular variable and elevation angle

Parameters:
vname - variable name
angle - elevation angle
Returns:
the index of the sweep in the dataset

getCutIdx

public Object[] getCutIdx(ucar.nc2.dt.RadialDatasetSweep.RadialVariable sweepVar)
Returns:
_more_

getVolume

public FlatField getVolume(int moment,
                           String varName)
                    throws VisADException,
                           RemoteException,
                           IOException
Makes a field of all data from one common data model radar adapter;

Parameters:
moment - moment
varName - variable name
Returns:
volume as a FieldImpl
Throws:
IOException - Problem reading data
RemoteException - Java RMI problem
VisADException - Couldn't create VisAD Object

getFloatNaN

public float[] getFloatNaN(int n)

isRaster

public boolean isRaster()
Get the parameters for this adapter

Returns:
parameters

isVolume

public boolean isVolume()
Get the parameters for this adapter

Returns:
parameters

mainDorade

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

Parameters:
args - cmd line args
Throws:
Exception - when bad things happen

main

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

Parameters:
args - args
Throws:
Exception - On badness