Package ucar.unidata.data.radar
Class Level2Data
java.lang.Object
ucar.unidata.data.radar.Level2Data
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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLevel2Data
(File file, DataContext context) Create a new Level II data wrapper for the fileLevel2Data
(String filename, DataContext context) Create a new Level II data wrapper for the file -
Method Summary
Modifier and TypeMethodDescriptionfloat
getAzimuth
(int record) This method returns the azimuth angle for the specified record.float
getCutElevation
(int i) Get the elevation angle of a particular cutint
getCutIndex
(int i) Get the index of the particular cutint
getCutStart
(int cut_num) This method returns the record number where the specified elevation cut begins.ucar.netcdf.RandomAccessFile
Get the DataInput for this this dataGet the data type (ARCHIVE2, AR2V0001) for this file.float
getElevation
(int record) This method returns the elevation angle for the specified record.Get the filename that this is using for inputint
Get the starting Julian date for this volumeint
Get the number of cuts found in this file.int
Get the true number of slices from the file.int
Get the starting time in seconds since midnight.Get the station ID for this datafloat
getTrueElevation
(int i) Get the true elevation for a particular cutint
getVCP()
Get the Volume Coverage Pattern number for this data.static void
Test the class.int
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.
-
Field Details
-
ARCHIVE2
Identifier for ARCHIVE2 format- See Also:
-
AR2V0001
Identifier for AR2V0001 format- See Also:
-
-
Constructor Details
-
Level2Data
Create a new Level II data wrapper for the file- Parameters:
file
- file to readcontext
- DataContext for finding temporary directory- Throws:
IOException
- problem reading or writing file
-
Level2Data
Create a new Level II data wrapper for the file- Parameters:
filename
- name of the file to readcontext
- DataContext for finding temporary directory- Throws:
IOException
- problem reading or writing file
-
-
Method Details
-
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
Get the station ID for this data- Returns:
- station ID (may be null)
-
getDataType
Get the data type (ARCHIVE2, AR2V0001) for this file.- Returns:
- data type
-
getFilename
Get the filename that this is using for input- Returns:
- filename
-
main
Test the class.- Parameters:
args
- file to read- Throws:
IOException
- problem reading file
-