ucar.unidata.data.radar
Class Level2Record

java.lang.Object
  extended by ucar.unidata.data.radar.Level2Record

public class Level2Record
extends Object

This class reads a specified record a NEXRAD level II file and provides methods to retrieve selected data from it. Will probably change in the future. Adapted with permission from the Java Iras software developed by David Priegnitz at NSSL.

Version:
$Revision: 1.13 $ $Date: 2006/12/01 20:42:38 $
Author:
MetApps Development Team

Field Summary
static int data_lut_init_flag
          Initialization flag for lookup tables
static int DATA_NOT_FOUND
          Value for data not fount
static float DOPPLER_RESOLUTION_HIGH
          High resolution value
static int DOPPLER_RESOLUTION_HIGH_CODE
          High doppler resolution code
static float DOPPLER_RESOLUTION_LOW
          Low resolution value
static int DOPPLER_RESOLUTION_LOW_CODE
          Low doppler resolution code
static int FILE_HEADER_SIZE
          Size of the file header
static float HORIZONTAL_BEAM_WIDTH
          Horizontal beam width
static float KM_PER_NM
          Kilometer to nautical mile conversion
static int MAX_RADIALS_IN_CUT
          Maximum radials in a cut
static int RADAR_DATA_SIZE
          Size of the radar data
static int RECORD_HEADER_SIZE
          Size of the record header
static int REFLECTIVITY
          Reflectivity moment identifier
static float[] Reflectivity_LUT
          Reflectivity look up table
static int SIGNAL_BELOW_THRESHOLD
          Value for signal below threshold
static int SIGNAL_OVERLAID
          Value for overlaid signal
static int SPECTRUM_WIDTH
          Sprectrum Width moment identifier
static int VELOCITY
          Radial Velocity moment identifier
static float[] Velocity_1km_LUT
          1 km Velocity look up table
static float[] Velocity_hkm_LUT
          1/2 km Velocity look up table
 
Constructor Summary
Level2Record()
          Default constructor; does nothing
 
Method Summary
 int eof()
          Get the end-of-file flag
 float getAzimuth()
          Get the azimuth for the current read
 int getBinData(int moment, int radial, int bin)
          This method returns a bin data element from the specified read level II record.
 int getBinNum(int moment)
          This method returns the number of bins defined for the specified moment in a read level II record.
 int getBinSize(int moment)
          This method returns the radial bin size (meters) for the specified moment in a read level II record.
 float getBinValue(int moment, int radial, int bin)
          This method returns a bin data value from the specified read level II record.
 float getElevation()
          Get the elevation angle for the current read
 short getElevationNum()
          Get the elevation number for the current read
 short getMessageType()
          Get the message type for the current read
 short getVCP()
          Get the Volume Coverage Pattern (VCP) for this record
 void readAngles(ucar.netcdf.RandomAccessFile din, int record)
          Read the angles from the file
 int readCut(ucar.netcdf.RandomAccessFile din, int record)
          Method to read a selected cut from a specified level II file.
 void readHeader(ucar.netcdf.RandomAccessFile din, int record)
          Method to read a selected header from a specified level II file.
 void readRecord(ucar.netcdf.RandomAccessFile din, int record)
          Method to read a selected record from a specified level II file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RECORD_HEADER_SIZE

public static final int RECORD_HEADER_SIZE
Size of the record header

See Also:
Constant Field Values

FILE_HEADER_SIZE

public static final int FILE_HEADER_SIZE
Size of the file header

See Also:
Constant Field Values

RADAR_DATA_SIZE

public static final int RADAR_DATA_SIZE
Size of the radar data

See Also:
Constant Field Values

REFLECTIVITY

public static final int REFLECTIVITY
Reflectivity moment identifier

See Also:
Constant Field Values

VELOCITY

public static final int VELOCITY
Radial Velocity moment identifier

See Also:
Constant Field Values

SPECTRUM_WIDTH

public static final int SPECTRUM_WIDTH
Sprectrum Width moment identifier

See Also:
Constant Field Values

SIGNAL_BELOW_THRESHOLD

public static final int SIGNAL_BELOW_THRESHOLD
Value for signal below threshold

See Also:
Constant Field Values

SIGNAL_OVERLAID

public static final int SIGNAL_OVERLAID
Value for overlaid signal

See Also:
Constant Field Values

DATA_NOT_FOUND

public static final int DATA_NOT_FOUND
Value for data not fount

See Also:
Constant Field Values

DOPPLER_RESOLUTION_LOW_CODE

public static final int DOPPLER_RESOLUTION_LOW_CODE
Low doppler resolution code

See Also:
Constant Field Values

DOPPLER_RESOLUTION_HIGH_CODE

public static final int DOPPLER_RESOLUTION_HIGH_CODE
High doppler resolution code

See Also:
Constant Field Values

DOPPLER_RESOLUTION_LOW

public static final float DOPPLER_RESOLUTION_LOW
Low resolution value

See Also:
Constant Field Values

DOPPLER_RESOLUTION_HIGH

public static final float DOPPLER_RESOLUTION_HIGH
High resolution value

See Also:
Constant Field Values

MAX_RADIALS_IN_CUT

public static final int MAX_RADIALS_IN_CUT
Maximum radials in a cut

See Also:
Constant Field Values

HORIZONTAL_BEAM_WIDTH

public static final float HORIZONTAL_BEAM_WIDTH
Horizontal beam width

See Also:
Constant Field Values

KM_PER_NM

public static final float KM_PER_NM
Kilometer to nautical mile conversion

See Also:
Constant Field Values

data_lut_init_flag

public static int data_lut_init_flag
Initialization flag for lookup tables


Reflectivity_LUT

public static float[] Reflectivity_LUT
Reflectivity look up table


Velocity_1km_LUT

public static float[] Velocity_1km_LUT
1 km Velocity look up table


Velocity_hkm_LUT

public static float[] Velocity_hkm_LUT
1/2 km Velocity look up table

Constructor Detail

Level2Record

public Level2Record()
Default constructor; does nothing

Method Detail

readAngles

public void readAngles(ucar.netcdf.RandomAccessFile din,
                       int record)
Read the angles from the file

Parameters:
din - file to read from
record - record to read

readHeader

public void readHeader(ucar.netcdf.RandomAccessFile din,
                       int record)
Method to read a selected header from a specified level II file.

Parameters:
din - file to read from
record - record to read

readRecord

public void readRecord(ucar.netcdf.RandomAccessFile din,
                       int record)
Method to read a selected record from a specified level II file.

Parameters:
din - file to read from
record - record to read

readCut

public int readCut(ucar.netcdf.RandomAccessFile din,
                   int record)
Method to read a selected cut from a specified level II file.

Parameters:
din - file to read from
record - record to read
Returns:
number of radials in the cut

getAzimuth

public float getAzimuth()
Get the azimuth for the current read

Returns:
azimuth value

getElevation

public float getElevation()
Get the elevation angle for the current read

Returns:
elevation angle

getElevationNum

public short getElevationNum()
Get the elevation number for the current read

Returns:
elevation number

getMessageType

public short getMessageType()
Get the message type for the current read

Returns:
message type

getVCP

public short getVCP()
Get the Volume Coverage Pattern (VCP) for this record

Returns:
volume coverage pattern

eof

public int eof()
Get the end-of-file flag

Returns:
EOF flag

getBinSize

public int getBinSize(int moment)
This method returns the radial bin size (meters) for the specified moment in a read level II record.

Parameters:
moment - moment id
Returns:
radial bin size

getBinNum

public int getBinNum(int moment)
This method returns the number of bins defined for the specified moment in a read level II record.

Parameters:
moment - moment id
Returns:
number of bins for this moment

getBinData

public int getBinData(int moment,
                      int radial,
                      int bin)
This method returns a bin data element from the specified read level II record.

Parameters:
moment - moment id
radial - radial index
bin - bin index
Returns:
bin data element

getBinValue

public float getBinValue(int moment,
                         int radial,
                         int bin)
This method returns a bin data value from the specified read level II record.

Parameters:
moment - moment ID
radial - radial index
bin - bin index
Returns:
bin data value