ucar.unidata.data.radar
Class Level2Data

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

public class Level2Data
extends Object

This class reads a NEXRAD level II data file and keeps track of cut start and other info. Will probably change in the future.

Adapted with permission from the Java Iras software developed by David Priegnitz at NSSL.

Documentation on Archive Level II data format can be found at: http://www.ncdc.noaa.gov/oa/radar/leveliidoc.html

Version:
$Revision: 1.27 $ $Date: 2007/05/04 16:00:18 $
Author:
MetApps Development Team

Field Summary
static String AR2V0001
          Identifier for AR2V0001 format
static String ARCHIVE2
          Identifier for ARCHIVE2 format
 
Constructor Summary
Level2Data(File file, DataContext context)
          Create a new Level II data wrapper for the file
Level2Data(String filename, DataContext context)
          Create a new Level II data wrapper for the file
 
Method Summary
 float getAzimuth(int record)
          This method returns the azimuth angle for the specified record.
 float getCutElevation(int i)
          Get the elevation angle of a particular cut
 int getCutIndex(int i)
          Get the index of the particular cut
 int getCutStart(int cut_num)
          This method returns the record number where the specified elevation cut begins.
 ucar.netcdf.RandomAccessFile getDataInput()
          Get the DataInput for this this data
 String getDataType()
          Get the data type (ARCHIVE2, AR2V0001) for this file.
 float getElevation(int record)
          This method returns the elevation angle for the specified record.
 String getFilename()
          Get the filename that this is using for input
 int getJulianDate()
          Get the starting Julian date for this volume
 int getNumberOfCuts()
          Get the number of cuts found in this file.
 int getNumberOfTrueCuts()
          Get the true number of slices from the file.
 int getSecsSinceMidnight()
          Get the starting time in seconds since midnight.
 String getStationId()
          Get the station ID for this data
 float getTrueElevation(int i)
          Get the true elevation for a particular cut
 int getVCP()
          Get the Volume Coverage Pattern number for this data.
static void main(String[] args)
          Test the class.
 int numberOfRecords()
          This method returns the number of records read in from a file.
 void read(int startFlag)
          Method to read the file.
 void read(int startFlag, boolean onlyVCP)
          Method to read the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARCHIVE2

public static final String ARCHIVE2
Identifier for ARCHIVE2 format

See Also:
Constant Field Values

AR2V0001

public static final String AR2V0001
Identifier for AR2V0001 format

See Also:
Constant Field Values
Constructor Detail

Level2Data

public Level2Data(File file,
                  DataContext context)
           throws IOException
Create a new Level II data wrapper for the file

Parameters:
file - file to read
context - DataContext for finding temporary directory
Throws:
IOException - problem reading or writing file

Level2Data

public Level2Data(String filename,
                  DataContext context)
           throws IOException
Create a new Level II data wrapper for the file

Parameters:
filename - name of the file to read
context - DataContext for finding temporary directory
Throws:
IOException - problem reading or writing file
Method Detail

read

public void read(int startFlag)
Method to read the file.

Parameters:
startFlag - starting record number (unused)

read

public void read(int startFlag,
                 boolean onlyVCP)
Method to read the file. If * onlyVCP, only read enough data to get the levels.

Parameters:
startFlag - starting record number (unused)
onlyVCP - if true, only read until we get the VCP info

getNumberOfTrueCuts

public int getNumberOfTrueCuts()
Get the true number of slices from the file. May differ from expected cuts.

Returns:
number of true cuts

getCutIndex

public int getCutIndex(int i)
Get the index of the particular cut

Parameters:
i - cut number
Returns:
cut index

getNumberOfCuts

public int getNumberOfCuts()
Get the number of cuts found in this file.

Returns:
the number of cuts

getCutElevation

public float getCutElevation(int i)
Get the elevation angle of a particular cut

Parameters:
i - cut number
Returns:
elevation angle

getTrueElevation

public float getTrueElevation(int i)
Get the true elevation for a particular cut

Parameters:
i - cut number
Returns:
true elevation angle (may differ from published values)

getCutStart

public int getCutStart(int cut_num)
This method returns the record number where the specified elevation cut begins.

Parameters:
cut_num - cut number
Returns:
starting record number for that cut.

getAzimuth

public float getAzimuth(int record)
This method returns the azimuth angle for the specified record.

Parameters:
record - record number
Returns:
azimuth angle for the specified record.

getElevation

public float getElevation(int record)
This method returns the elevation angle for the specified record.

Parameters:
record - record number
Returns:
elevation angle for the specified record.

numberOfRecords

public int numberOfRecords()
This method returns the number of records read in from a file.

Returns:
number of data records read in this file.

getVCP

public int getVCP()
Get the Volume Coverage Pattern number for this data.

Returns:
VCP with:
 Value of:    11 = 14 elev. scans/ 5 mins.
              12 = 14 elev. scans/ 4.1 mins.
              21 = 11 elev. scans/ 6 mins.
              31 = 8 elev. scans/ 10 mins.
              32 = 7 elev. scans/ 10 mins.
             121 = 9 elev. scans/ 5 mins.
 

getJulianDate

public int getJulianDate()
Get the starting Julian date for this volume

Returns:
Modified Julian date referenced from 1/1/70.

getSecsSinceMidnight

public int getSecsSinceMidnight()
Get the starting time in seconds since midnight.

Returns:
Generation time of data in milliseconds of day past midnight (UTC).

getDataInput

public ucar.netcdf.RandomAccessFile getDataInput()
Get the DataInput for this this data

Returns:
the DataInput

getStationId

public String getStationId()
Get the station ID for this data

Returns:
station ID (may be null)

getDataType

public String getDataType()
Get the data type (ARCHIVE2, AR2V0001) for this file.

Returns:
data type

getFilename

public String getFilename()
Get the filename that this is using for input

Returns:
filename

main

public static void main(String[] args)
                 throws IOException
Test the class.

Parameters:
args - file to read
Throws:
IOException - problem reading file