Package ucar.atd.dorade
Class DoradeSweep
- java.lang.Object
-
- ucar.atd.dorade.DoradeSweep
-
public class DoradeSweep extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDoradeSweep.DoradeSweepExceptionstatic classDoradeSweep.MovingSensorException
-
Field Summary
Fields Modifier and Type Field Description static floatBAD_VALUEBad data value flag
-
Constructor Summary
Constructors Constructor Description DoradeSweep(RandomAccessFile file)DoradeSweep(String filename)Construct aDoradeSweepusing the named DORADE sweep file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringformatDate(Date date)Return a string with a reasonable representation in UTC of the givenDate.floatgetAltitude(int which)Get the sensor altitude for a non-moving sensorfloat[]getAltitudes(int which)Get the per-ray array of sensor altitudes.floatgetantennaGain(int which)float[]getAzimuths()Get the azimuths for all rays in the sweep.floatgetCellSpacing(int which)Return the cell spacing for the given sensor, if constant, otherwise return -1float[]getElevations()Get the elevations for all rays in the sweep.floatgetFixedAngle()Get the fixed angle for this sweep.floatgethBeamWidth(int which)floatgetLatitude(int which)Get the sensor latitude for a non-moving sensorfloat[]getLatitudes(int which)Get the per-ray array of sensor latitudes.floatgetLongitude(int which)Get the sensor longitude for a non-moving sensorfloat[]getLongitudes(int which)Get the per-ray array of sensor longitudes.intgetNCells(int which)Get the number of data cells (gates) per ray for the given sensor.floatgetnoisePower(int which)intgetNRays()Get the number of rays in this sweep.intgetNSensors()Get the number of sensors associated with this sweep.DoradePARM[]getParamList()Get the array of available parameters.floatgetpeakPower(int which)StringgetProjectName()floatgetradarConstant(int which)floatgetRangeToFirstCell(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.DategetRayTime(int ray)floatgetrcvrGain(int which)ScanModegetScanMode()ScanModegetScanMode(int which)StringgetSensorName(int which)Get the name of a selected sensor.intgetSweepNumber()floatgetsystemGain(int which)DategetTime()Get the (start) time for this sweep.Date[]getTimes()floatgetunambiguousRange(int which)floatgetUnambiguousVelocity(int which)shortgetVolumnNumber()static booleanisDoradeSweep(RandomAccessFile file)booleanisLittleEndian()Is this sweepfile little-endian?DoradePARMlookupParamIgnoreCase(String name)Get the parameter descriptor with the given name, ignoring case.booleansensorIsMoving(int which)Return whether the selected sensor is moving.
-
-
-
Constructor Detail
-
DoradeSweep
public DoradeSweep(String filename) throws DoradeSweep.DoradeSweepException
Construct aDoradeSweepusing the named DORADE sweep file.- Parameters:
filename- the DORADE sweepfile to load- Throws:
DoradeSweep.DoradeSweepException
-
DoradeSweep
public DoradeSweep(RandomAccessFile file) throws DoradeSweep.DoradeSweepException
- Throws:
DoradeSweep.DoradeSweepException
-
-
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,nullis returned.- Parameters:
name- the name of the desired parameter- Returns:
- the
DoradePARMfrom this sweep with the given name, ornullif 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)
Return whether the selected sensor is moving.- Parameters:
which- the index of the sensor of interest- Returns:
- whether the selected sensor is moving
- See Also:
getNSensors()
-
getLatitude
public float getLatitude(int which) throws DoradeSweep.MovingSensorExceptionGet 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.MovingSensorExceptionGet 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.MovingSensorExceptionGet 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 interestray- 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 interestray- the index of the ray of interestworkingArray- 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 givenDate.- Parameters:
date-Dateto be represented- Returns:
- a string containing a UTC representation of the date
-
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)
-
-