ucar.atd.dorade
Class DoradeSweep

java.lang.Object
  extended by ucar.atd.dorade.DoradeSweep

public class DoradeSweep
extends Object

Title: DoradeSweep

Description: This class makes available a radar sweep from a DORADE sweep file.

Copyright: Copyright (c) 2003

Company: University Corporation for Atmospheric Research

Version:
$Revision:51 $ $Date:2006-07-12 17:13:13Z $
Author:
Chris Burghart

Nested Class Summary
static class DoradeSweep.DoradeSweepException
           
static class DoradeSweep.MovingSensorException
           
 
Field Summary
static float BAD_VALUE
          Bad data value flag
 
Constructor Summary
DoradeSweep(RandomAccessFile file)
           
DoradeSweep(String filename)
          Construct a DoradeSweep using the named DORADE sweep file.
 
Method Summary
static String formatDate(Date date)
          Return a string with a reasonable representation in UTC of the given Date.
 float getAltitude(int which)
          Get the sensor altitude for a non-moving sensor
 float[] getAltitudes(int which)
          Get the per-ray array of sensor altitudes.
 float getantennaGain(int which)
           
 float[] getAzimuths()
          Get the azimuths for all rays in the sweep.
 float getCellSpacing(int which)
          Return the cell spacing for the given sensor, if constant, otherwise return -1
 float[] getElevations()
          Get the elevations for all rays in the sweep.
 float getFixedAngle()
          Get the fixed angle for this sweep.
 float gethBeamWidth(int which)
           
 float getLatitude(int which)
          Get the sensor latitude for a non-moving sensor
 float[] getLatitudes(int which)
          Get the per-ray array of sensor latitudes.
 float getLongitude(int which)
          Get the sensor longitude for a non-moving sensor
 float[] getLongitudes(int which)
          Get the per-ray array of sensor longitudes.
 int getNCells(int which)
          Get the number of data cells (gates) per ray for the given sensor.
 float getnoisePower(int which)
           
 int getNRays()
          Get the number of rays in this sweep.
 int getNSensors()
          Get the number of sensors associated with this sweep.
 DoradePARM[] getParamList()
          Get the array of available parameters.
 float getpeakPower(int which)
           
 String getProjectName()
           
 float getradarConstant(int which)
           
 float getRangeToFirstCell(int which)
          Get the range to the leading edge of the first cell for the given sensor.
 float[] getRayData(DoradePARM param, int ray)
          Get the array of data for the given parameter and ray.
 float[] getRayData(DoradePARM param, int ray, float[] workingArray)
          Get the array of data for the given parameter and ray.
 Date getRayTime(int ray)
           
 float getrcvrGain(int which)
           
 ScanMode getScanMode()
           
 ScanMode getScanMode(int which)
           
 String getSensorName(int which)
          Get the name of a selected sensor.
 int getSweepNumber()
           
 float getsystemGain(int which)
           
 Date getTime()
          Get the (start) time for this sweep.
 Date[] getTimes()
           
 float getunambiguousRange(int which)
           
 float getUnambiguousVelocity(int which)
           
 short getVolumnNumber()
           
static boolean isDoradeSweep(RandomAccessFile file)
           
 boolean isLittleEndian()
          Is this sweepfile little-endian?
 DoradePARM lookupParamIgnoreCase(String name)
          Get the parameter descriptor with the given name, ignoring case.
static void main(String[] args)
          DoradeSweep class test method.
 boolean sensorIsMoving(int which)
          Return whether the selected sensor is moving.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BAD_VALUE

public static final float BAD_VALUE
Bad data value flag

See Also:
getRayData(ucar.atd.dorade.DoradePARM, int), Constant Field Values
Constructor Detail

DoradeSweep

public DoradeSweep(String filename)
            throws DoradeSweep.DoradeSweepException,
                   FileNotFoundException
Construct a DoradeSweep using the named DORADE sweep file.

Parameters:
filename - the DORADE sweepfile to load
Throws:
DoradeSweep.DoradeSweepException
FileNotFoundException

DoradeSweep

public DoradeSweep(RandomAccessFile file)
            throws DoradeSweep.DoradeSweepException,
                   FileNotFoundException
Throws:
DoradeSweep.DoradeSweepException
FileNotFoundException
Method Detail

isLittleEndian

public boolean isLittleEndian()
Is this sweepfile little-endian?

Returns:
a boolean indicating whether the file is little-endian

getParamList

public DoradePARM[] getParamList()
Get the array of available parameters.

Returns:
the array of available parameters

lookupParamIgnoreCase

public DoradePARM lookupParamIgnoreCase(String name)
Get the parameter descriptor with the given name, ignoring case. If no such descriptor exists, null is returned.

Parameters:
name - the name of the desired parameter
Returns:
the DoradePARM from this sweep with the given name, or null if no such parameter exists.

getNRays

public int getNRays()
Get the number of rays in this sweep.

Returns:
the number of rays in the sweep

getNSensors

public int getNSensors()
Get the number of sensors associated with this sweep.

Returns:
the number of sensors associated with the sweep

getSensorName

public String getSensorName(int which)
Get the name of a selected sensor.

Parameters:
which - the index of the sensor of interest
Returns:
the name of the sensor
See Also:
getNSensors()

sensorIsMoving

public boolean sensorIsMoving(int which)
                       throws DoradeSweep.DoradeSweepException
Return whether the selected sensor is moving.

Parameters:
which - the index of the sensor of interest
Returns:
whether the selected sensor is moving
Throws:
DoradeSweep.DoradeSweepException
See Also:
getNSensors()

getLatitude

public float getLatitude(int which)
                  throws DoradeSweep.MovingSensorException
Get the sensor latitude for a non-moving sensor

Parameters:
which - the index of the sensor of interest
Returns:
static latitude in degrees
Throws:
DoradeSweep.MovingSensorException - if the sensor is moving
See Also:
getLatitudes(int), sensorIsMoving(int), getNSensors()

getLongitude

public float getLongitude(int which)
                   throws DoradeSweep.MovingSensorException
Get the sensor longitude for a non-moving sensor

Parameters:
which - the index of the sensor of interest
Returns:
static longitude in degrees
Throws:
DoradeSweep.MovingSensorException - if the sensor is moving
See Also:
getLongitudes(int), sensorIsMoving(int), getNSensors()

getAltitude

public float getAltitude(int which)
                  throws DoradeSweep.MovingSensorException
Get the sensor altitude for a non-moving sensor

Parameters:
which - the index of the sensor of interest
Returns:
static altitude in km MSL
Throws:
DoradeSweep.MovingSensorException - if the sensor is moving
See Also:
getAltitudes(int), sensorIsMoving(int), getNSensors()

getLatitudes

public float[] getLatitudes(int which)
Get the per-ray array of sensor latitudes.

Parameters:
which - the index of the sensor of interest
Returns:
a per-ray array of sensor latitudes
See Also:
getLatitude(int), getNSensors()

getLongitudes

public float[] getLongitudes(int which)
Get the per-ray array of sensor longitudes.

Parameters:
which - the index of the sensor of interest
Returns:
a per-ray array of sensor longitudes
See Also:
getLongitude(int), getNSensors()

getAltitudes

public float[] getAltitudes(int which)
Get the per-ray array of sensor altitudes.

Parameters:
which - the index of the sensor of interest
Returns:
a per-ray array of sensor altitudes
See Also:
getAltitude(int), getNSensors(), getNRays()

getFixedAngle

public float getFixedAngle()
Get the fixed angle for this sweep.

Returns:
the fixed angle of the sweep, in degrees

getSweepNumber

public int getSweepNumber()

getTime

public Date getTime()
Get the (start) time for this sweep.

Returns:
the start time of the sweep

getTimes

public Date[] getTimes()

getRayTime

public Date getRayTime(int ray)

getRayData

public float[] getRayData(DoradePARM param,
                          int ray)
                   throws DoradeSweep.DoradeSweepException
Get the array of data for the given parameter and ray.

Parameters:
param - the parameter of interest
ray - the index of the ray of interest
Returns:
an array containing unpacked values for every cell for the given parameter and ray. Cells having bad or missing data will hold the value BAD_VALUE
Throws:
DoradeSweep.DoradeSweepException
See Also:
getNCells(int), getNRays(), BAD_VALUE

getRayData

public float[] getRayData(DoradePARM param,
                          int ray,
                          float[] workingArray)
                   throws DoradeSweep.DoradeSweepException
Get the array of data for the given parameter and ray.

Parameters:
param - the parameter of interest
ray - the index of the ray of interest
workingArray - If non-null and the same length as what is needed use this instead.
Returns:
an array containing unpacked values for every cell for the given parameter and ray. Cells having bad or missing data will hold the value BAD_VALUE
Throws:
DoradeSweep.DoradeSweepException
See Also:
getNCells(int), getNRays(), BAD_VALUE

getRangeToFirstCell

public float getRangeToFirstCell(int which)
Get the range to the leading edge of the first cell for the given sensor.

Parameters:
which - index of the sensor of interest
Returns:
range to the leading edge of the first cell for the given sensor, in meters
See Also:
getNSensors()

getCellSpacing

public float getCellSpacing(int which)
Return the cell spacing for the given sensor, if constant, otherwise return -1

Parameters:
which - index of the sensor of interest
Returns:
the constant cell spacing in meters, or -1 if the cell spacing varies
See Also:
getNSensors()

getNCells

public int getNCells(int which)
Get the number of data cells (gates) per ray for the given sensor.

Parameters:
which - index of the sensor of interest
Returns:
the number of cells per ray for the given sensor
See Also:
getNSensors()

getVolumnNumber

public short getVolumnNumber()

getProjectName

public String getProjectName()

getAzimuths

public float[] getAzimuths()
Get the azimuths for all rays in the sweep.

Returns:
array of azimuths for all rays in the sweep, in degrees
See Also:
getNRays()

getElevations

public float[] getElevations()
Get the elevations for all rays in the sweep.

Returns:
array of elevations for all rays in the sweep, in degrees
See Also:
getNRays()

formatDate

public static String formatDate(Date date)
Return a string with a reasonable representation in UTC of the given Date.

Parameters:
date - Date to be represented
Returns:
a string containing a UTC representation of the date

main

public static void main(String[] args)
DoradeSweep class test method. Usage:
$ java ucar.atd.dorade.DoradeSweep <DORADE_sweepfile>


getScanMode

public ScanMode getScanMode()

isDoradeSweep

public static boolean isDoradeSweep(RandomAccessFile file)
                             throws DoradeSweep.DoradeSweepException
Throws:
DoradeSweep.DoradeSweepException

getScanMode

public ScanMode getScanMode(int which)

getUnambiguousVelocity

public float getUnambiguousVelocity(int which)

getunambiguousRange

public float getunambiguousRange(int which)

getradarConstant

public float getradarConstant(int which)

getrcvrGain

public float getrcvrGain(int which)

getantennaGain

public float getantennaGain(int which)

getsystemGain

public float getsystemGain(int which)

gethBeamWidth

public float gethBeamWidth(int which)

getpeakPower

public float getpeakPower(int which)

getnoisePower

public float getnoisePower(int which)


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.