public class DoradePARM
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static float |
BAD_VALUE
Bad data value flag returned by getParamValues().
|
protected java.lang.String |
descName |
protected java.lang.String |
expectedName |
protected java.io.RandomAccessFile |
file |
static int |
FORMAT_16BIT_FLOAT
16-bit IEEE float format.
|
static int |
FORMAT_16BIT_INT
16-bit signed integer format.
|
static int |
FORMAT_32BIT_FLOAT
32-bit IEEE float format.
|
static int |
FORMAT_32BIT_INT
32-bit signed integer format.
|
static int |
FORMAT_8BIT_INT
8-bit signed integer format.
|
protected boolean |
littleEndianData |
protected static java.util.TimeZone |
TZ_UTC |
protected boolean |
verbose |
Constructor and Description |
---|
DoradePARM(java.io.RandomAccessFile file,
boolean littleEndianData,
ucar.atd.dorade.DoradeRADD radd) |
Modifier and Type | Method and Description |
---|---|
protected long |
findNext(java.io.RandomAccessFile file) |
protected static long |
findNextWithName(java.lang.String expectedName,
java.io.RandomAccessFile file,
boolean littleEndianData) |
static java.lang.String |
formatDate(java.util.Date date)
Return a string with a reasonable and complete representation of the
given
Date , shown in UTC. |
int |
getBadDataFlag() |
int |
getBinaryFormat()
Get the binary format used for encoding this parameter.
|
float |
getCellSpacing()
Get the cell spacing.
|
static boolean |
getDefaultVerboseState()
Get the default verbose state for new
DoradeDescriptor -s. |
static boolean |
getDefaultVerboseState(java.lang.String descriptorName)
Get the default verbose state for new
DoradeDescriptor -s
of the given name. |
java.lang.String |
getDescription()
Get the long description for this parameter.
|
java.lang.String |
getName()
Get the name of this parameter.
|
int |
getNCells()
Get the number of cells in a ray.
|
int |
getnSamples() |
float[] |
getParamValues(ucar.atd.dorade.DoradeRDAT rdat)
Get the unpacked data values for a selected parameter.
|
float[] |
getParamValues(ucar.atd.dorade.DoradeRDAT rdat,
float[] workingArray)
Get the unpacked data values for a selected parameter.
|
int |
getPolarization() |
float |
getScale() |
java.lang.String |
getthresholdParamName() |
float |
getThresholdValue() |
java.lang.String |
getUnitName() |
java.lang.String |
getUnits()
Get the units string for this parameter.
|
int |
getusedFrequencies() |
int |
getusedPRTs() |
protected double |
grabDouble(byte[] bytes,
int offset)
Unpack an eight-byte IEEE float from the given byte array.
|
protected float |
grabFloat(byte[] bytes,
int offset)
Unpack a four-byte IEEE float from the given byte array.
|
protected int |
grabInt(byte[] bytes,
int offset)
Unpack a four-byte integer from the given byte array.
|
protected static int |
grabInt(byte[] bytes,
int offset,
boolean littleEndianData)
Unpack a four-byte integer from the given byte array.
|
protected short |
grabShort(byte[] bytes,
int offset)
Unpack a two-byte integer from the given byte array.
|
protected static java.lang.String |
peekName(java.io.RandomAccessFile file)
Return the name of the DORADE descriptor at the current location
in the file.
|
protected byte[] |
readDescriptor(java.io.RandomAccessFile file,
boolean littleEndianData,
java.lang.String expectedName)
Read and set the descriptor name, size, and endianness, and return the
entire contents of the descriptor (including the name and size) as a
byte array.
|
static void |
setDefaultVerboseState(boolean verbose)
Set the default verbose state for new
DoradeDescriptor -s. |
static void |
setDefaultVerboseState(java.lang.String descriptorName,
boolean verbose)
Set the default verbose state for new
DoradeDescriptor -s
of the given name. |
protected static void |
skipDescriptor(java.io.RandomAccessFile file,
boolean littleEndianData)
Skip the current DORADE descriptor in the file, leaving the file position
at the beginning of the next descriptor (or at the end of file).
|
static boolean |
sweepfileIsLittleEndian(java.io.RandomAccessFile file)
Determine if the given DORADE sweepfile contains little-endian data
(in violation of the DORADE definition...).
|
java.lang.String |
toString() |
public static final float BAD_VALUE
public static final int FORMAT_8BIT_INT
public static final int FORMAT_16BIT_INT
public static final int FORMAT_32BIT_INT
public static final int FORMAT_32BIT_FLOAT
public static final int FORMAT_16BIT_FLOAT
protected java.lang.String descName
protected java.lang.String expectedName
protected java.io.RandomAccessFile file
protected boolean littleEndianData
protected boolean verbose
protected static final java.util.TimeZone TZ_UTC
public DoradePARM(java.io.RandomAccessFile file, boolean littleEndianData, ucar.atd.dorade.DoradeRADD radd) throws ucar.atd.dorade.DoradeDescriptor.DescriptorException
ucar.atd.dorade.DoradeDescriptor.DescriptorException
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
public int getBadDataFlag()
public float getThresholdValue()
public int getPolarization()
public float getScale()
public java.lang.String getUnitName()
public int getusedPRTs()
public int getusedFrequencies()
public int getnSamples()
public java.lang.String getthresholdParamName()
public java.lang.String getUnits()
public java.lang.String getDescription()
public int getBinaryFormat()
FORMAT_8BIT_INT
FORMAT_16BIT_INT
FORMAT_32BIT_INT
FORMAT_16BIT_FLOAT
FORMAT_32BIT_FLOAT
public int getNCells()
public float getCellSpacing() throws ucar.atd.dorade.DoradeDescriptor.DescriptorException
DescriptorException
- if the cell spacing is not constant.ucar.atd.dorade.DoradeDescriptor.DescriptorException
public float[] getParamValues(ucar.atd.dorade.DoradeRDAT rdat) throws ucar.atd.dorade.DoradeDescriptor.DescriptorException
rdat
- the name of the desired parameterDescriptorException
ucar.atd.dorade.DoradeDescriptor.DescriptorException
public float[] getParamValues(ucar.atd.dorade.DoradeRDAT rdat, float[] workingArray) throws ucar.atd.dorade.DoradeDescriptor.DescriptorException
rdat
- the name of the desired parameterworkingArray
- If non-null and the same length as needed then use this.DescriptorException
ucar.atd.dorade.DoradeDescriptor.DescriptorException
protected byte[] readDescriptor(java.io.RandomAccessFile file, boolean littleEndianData, java.lang.String expectedName) throws ucar.atd.dorade.DoradeDescriptor.DescriptorException
file
- the DORADE sweepfile, positioned at the beginning of a
descriptorlittleEndianData
- set to true iff the file contains little-endian
dataexpectedName
- the expected name for the descriptor being readDescriptorException
- for file read errors, descriptor name
mismatch, etc.ucar.atd.dorade.DoradeDescriptor.DescriptorException
protected static void skipDescriptor(java.io.RandomAccessFile file, boolean littleEndianData) throws ucar.atd.dorade.DoradeDescriptor.DescriptorException, java.io.IOException
file
- the DORADE sweepfile, positioned at the beginning of a
descriptorjava.io.IOException
ucar.atd.dorade.DoradeDescriptor.DescriptorException
protected static java.lang.String peekName(java.io.RandomAccessFile file) throws ucar.atd.dorade.DoradeDescriptor.DescriptorException
file
- the DORADE sweep file, positioned at the beginning of a
descriptorDescriptorException
ucar.atd.dorade.DoradeDescriptor.DescriptorException
public static boolean sweepfileIsLittleEndian(java.io.RandomAccessFile file) throws ucar.atd.dorade.DoradeDescriptor.DescriptorException
file
- the DORADE sweepfile,true
iff the file contains little-endian dataDescriptorException
ucar.atd.dorade.DoradeDescriptor.DescriptorException
protected short grabShort(byte[] bytes, int offset)
bytes
- byte array to be readoffset
- number of bytes to skip in the byte array before readingprotected static int grabInt(byte[] bytes, int offset, boolean littleEndianData)
bytes
- byte array to be readoffset
- number of bytes to skip in the byte array before readinglittleEndianData
- true iff the byte array contains little-endian
dataprotected int grabInt(byte[] bytes, int offset)
bytes
- byte array to be readoffset
- number of bytes to skip in the byte array before readingprotected float grabFloat(byte[] bytes, int offset) throws ucar.atd.dorade.DoradeDescriptor.DescriptorException
bytes
- byte array to be readoffset
- number of bytes to skip in the byte array before readingucar.atd.dorade.DoradeDescriptor.DescriptorException
protected double grabDouble(byte[] bytes, int offset) throws ucar.atd.dorade.DoradeDescriptor.DescriptorException
bytes
- byte array to be readoffset
- number of bytes to skip in the byte array before readingucar.atd.dorade.DoradeDescriptor.DescriptorException
protected static long findNextWithName(java.lang.String expectedName, java.io.RandomAccessFile file, boolean littleEndianData) throws ucar.atd.dorade.DoradeDescriptor.DescriptorException, java.io.IOException
ucar.atd.dorade.DoradeDescriptor.DescriptorException
java.io.IOException
protected long findNext(java.io.RandomAccessFile file) throws ucar.atd.dorade.DoradeDescriptor.DescriptorException, java.io.IOException
ucar.atd.dorade.DoradeDescriptor.DescriptorException
java.io.IOException
public static java.lang.String formatDate(java.util.Date date)
Date
, shown in UTC.date
- Date
to be representedpublic static boolean getDefaultVerboseState()
DoradeDescriptor
-s.public static void setDefaultVerboseState(boolean verbose)
DoradeDescriptor
-s.verbose
- the new default verbose statepublic static boolean getDefaultVerboseState(java.lang.String descriptorName)
DoradeDescriptor
-s
of the given name.descriptorName
- the descriptor name for which the new default
verbose state will applypublic static void setDefaultVerboseState(java.lang.String descriptorName, boolean verbose)
DoradeDescriptor
-s
of the given name.descriptorName
- the descriptor name for which the new default
verbose state will applyverbose
- the new default verbose state