ucar.unidata.data.radar
Class Level2Adapter

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

public class Level2Adapter
extends Object
implements RadarAdapter

Adapt an Archive Level II file to a VisAD data structure.

Version:
$Revision: 1.111 $
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
Level2Adapter(DataSourceImpl source, String filename)
          Construct a new Level2Adapter
Level2Adapter(DataSourceImpl source, String filename, EarthLocation radarLocation)
          Construct a new Level2Adapter for the radar location given
 
Method Summary
 void clearCachedData()
          Implement the interce.
 double[] getAngles()
          Get the array of sweep tilts in this files volume scan.
 DateTime getBaseTime()
          Get the starting time of this Volume
 FieldImpl getCAPPI(int moment, Real level)
          Get a CAPPI for the given moment at the given level
 FlatField getCut(int moment, double elevation)
          Get a 2D sweep of a particular moment at the specified elevation angle.
 FlatField getCut(int moment, double elevation, boolean want3D)
          Get a 2D sweep of a particular moment at the specified elevation angle.
 DataImpl getData(DataChoice choice, DataSelection ds, Hashtable requestProperties)
          Get the data for this DataChoice
static String getMomentName(int moment)
          Print out the name of the moment.
 String getName()
          Return the name of the file
 FieldImpl getRHI(int moment, double rhiAz)
          Get an RHI for the given azimuth
static NamedStationTable getStations()
          Read in the nexrad stations from the idv/resources/nexradstns.xml resource
 FlatField getVolume(int moment)
          Makes a field of all data from one level II file (one volume scan); which is composed of severla azimuthal sweeps at different angles (titls, elevations) above the horizontal.
 FlatField getVWP(double altitudeLimit)
          Make a data object to display in the IDV as a VAD Wind Profile.
 void setRadarLocation(EarthLocation el)
          Set the radar location
 String toString()
          String representation of this adapter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Level2Adapter

public Level2Adapter(DataSourceImpl source,
                     String filename)
              throws VisADException,
                     RemoteException,
                     IOException
Construct a new Level2Adapter

Parameters:
source - DataSource for caching
filename - path of file
Throws:
VisADException - couldn't create VisAD object
RemoteException - couldn't create remote object
IOException - problem opening or reading file

Level2Adapter

public Level2Adapter(DataSourceImpl source,
                     String filename,
                     EarthLocation radarLocation)
              throws VisADException,
                     RemoteException,
                     IOException
Construct a new Level2Adapter for the radar location given

Parameters:
source - DataSource for caching
filename - path of file
radarLocation - location of the radar
Throws:
VisADException - couldn't create VisAD object
RemoteException - couldn't create remote object
IOException - problem opening or reading file
Method Detail

clearCachedData

public void clearCachedData()
Implement the interce. For now lets not do anything

Specified by:
clearCachedData in interface RadarAdapter

getBaseTime

public DateTime getBaseTime()
Get the starting time of this Volume

Specified by:
getBaseTime in interface RadarAdapter
Returns:
starting time

getAngles

public double[] getAngles()
Get the array of sweep tilts in this files volume scan.

Returns:
tilts

setRadarLocation

public void setRadarLocation(EarthLocation el)
                      throws VisADException,
                             RemoteException
Set the radar location

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

getData

public DataImpl getData(DataChoice choice,
                        DataSelection ds,
                        Hashtable requestProperties)
                 throws VisADException,
                        RemoteException
Get the data for this DataChoice

Specified by:
getData in interface RadarAdapter
Parameters:
choice - choice describing the data
ds - sub-selection criteria
requestProperties - extra request criteria (e.g, used to get RHI azimuth)
Returns:
VisAD Data object corresponding to this DataChoice
Throws:
VisADException - couldn't create VisAD object
RemoteException - couldn't create remote object

getCut

public FlatField getCut(int moment,
                        double elevation)
                 throws VisADException,
                        RemoteException
Get a 2D sweep of a particular moment at the specified elevation angle.

Parameters:
moment - moment (REFLECTIVITY, VELOCITY, SPECTRUM_WIDTH) of data
elevation - elevation angle
Returns:
a FlatField representation of the cut
Throws:
RemoteException - couldn't create remote object
VisADException - couldn't create VisAD object

getCut

public FlatField getCut(int moment,
                        double elevation,
                        boolean want3D)
                 throws VisADException,
                        RemoteException
Get a 2D sweep of a particular moment at the specified elevation angle.

Parameters:
moment - moment (REFLECTIVITY, VELOCITY, SPECTRUM_WIDTH) of data
elevation - elevation angle
want3D - true if you want this as a 3-D field
Returns:
a 2- or 3-D FlatField representation of the cut
Throws:
RemoteException - couldn't create remote object
VisADException - couldn't create VisAD object

getVWP

public FlatField getVWP(double altitudeLimit)
                 throws VisADException,
                        RemoteException
Make a data object to display in the IDV as a VAD Wind Profile. for one time.

Parameters:
altitudeLimit - typically 10 to 15 km; highest wind used.
Returns:
VWP for the given altitude limit
Throws:
RemoteException - couldn't create remote object
VisADException - couldn't create VisAD object

getRHI

public FieldImpl getRHI(int moment,
                        double rhiAz)
                 throws VisADException,
                        RemoteException
Get an RHI for the given azimuth

Parameters:
moment - moment (REFLECTIVITY, VELOCITY, SPECTRUM_WIDTH) of data
rhiAz - azimuth for the RHI
Returns:
RHI as a Field of FlatFields, each for a particular elevation angle
Throws:
RemoteException - couldn't create remote object
VisADException - couldn't create VisAD object

getCAPPI

public FieldImpl getCAPPI(int moment,
                          Real level)
                   throws VisADException,
                          RemoteException
Get a CAPPI for the given moment at the given level

Parameters:
moment - moment (REFLECTIVITY, VELOCITY, SPECTRUM_WIDTH) of data
level - level (Altitude)
Returns:
CAPPI as a Field
Throws:
RemoteException - couldn't create remote object
VisADException - couldn't create VisAD object

toString

public String toString()
String representation of this adapter.

Overrides:
toString in class Object
Returns:
String representation of this object

getName

public String getName()
Return the name of the file

Specified by:
getName in interface RadarAdapter
Returns:
name

getVolume

public FlatField getVolume(int moment)
                    throws VisADException,
                           RemoteException
Makes a field of all data from one level II file (one volume scan); which is composed of severla azimuthal sweeps at different angles (titls, elevations) above the horizontal. Character of data field when plotted with ColorRadarVolumeControl is colored data point values (pixels) along beam lines, forming semi-transparent nested cones, not filled surfaces.

Parameters:
moment - moment (REFLECTIVITY, VELOCITY, SPECTRUM_WIDTH) of data
Returns:
volume as a FieldImpl
Throws:
RemoteException - couldn't create remote object
VisADException - couldn't create VisAD object

getStations

public static NamedStationTable getStations()
Read in the nexrad stations from the idv/resources/nexradstns.xml resource

Returns:
List of of NamedStation-s

getMomentName

public static String getMomentName(int moment)
Print out the name of the moment.

Parameters:
moment - radar moment (ex: REFLECTIVITY)
Returns:
a String name of the moment (ex: "Reflectivity");