public class CDFReader extends GenericReader
| Constructor and Description |
|---|
CDFReader() |
CDFReader(java.lang.String cdfFile)
Constructs a reader for the given CDF file.
|
CDFReader(java.net.URL url)
Constructs a reader for the given URL for CDF file.
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
firstAvailableTime(java.lang.String varName)
Returns first available time for a variable.
|
int[] |
firstAvailableTime(java.lang.String varName,
int[] start)
Returns first available time which is not before the given time for a
variable.
|
double[] |
getAvailableTimeRange(java.lang.String varName)
Returns available time range using default
time instant model. |
java.lang.String[] |
getDependent(java.lang.String varName)
Returns names of variables that the specified variable depends on.
|
java.lang.String |
getIndexName(java.lang.String varName,
int index)
Returns the name of the specified index of a multi-dimensional
variable
|
double[][] |
getScalarTimeSeries(java.lang.String varName)
Returns the time series of the specified scalar variable, ignoring
points whose value equals fill value.
|
double[][] |
getScalarTimeSeries(java.lang.String varName,
boolean ignoreFill)
Returns the time series of the specified scalar variable, optionally
ignoring points whose value equals fill value.
|
double[][] |
getScalarTimeSeries(java.lang.String varName,
boolean ignoreFill,
int[] startTime,
int[] stopTime)
Returns the time series of the specified scalar variable in the
specified time range, optionally ignoring points whose value equals
fill value.
|
TimeSeries |
getScalarTimeSeries(java.lang.String varName,
boolean ignoreFill,
int[] startTime,
int[] stopTime,
TimeInstantModel tspec)
Returns the time series as a
TimeSeries of the
specified scalar variable in the specified time range using the given
time instant model, optionally ignoring points
whose
value equals fill value. |
double[][] |
getScalarTimeSeries(java.lang.String varName,
int[] startTime,
int[] stopTime)
Returns the time series of the specified scalar variable in the
specified time range, ignoring points whose value equals
fill value.
|
TimeSeries |
getScalarTimeSeries(java.lang.String varName,
int[] startTime,
int[] stopTime,
TimeInstantModel tspec)
Returns the time series as a
TimeSeries, of the
specified scalar variable in the specified time range, using the given
time instant model, ignoring points whose
value equals fill value. |
TimeSeries |
getTimeSeries(java.lang.String varName)
Returns
TimeSeries of the specified variable
using the default time instant model. |
TimeSeries |
getTimeSeries(java.lang.String varName,
int[] startTime,
int[] stopTime)
Returns
TimeSeries of the specified variable
in the specified time range using the default
time instant model. |
TimeSeries |
getTimeSeries(java.lang.String varName,
int[] startTime,
int[] stopTime,
TimeInstantModel tspec)
Returns
TimeSeries of the specified variable in
the specified time range using the given
time instant model. |
TimeSeries |
getTimeSeries(java.lang.String varName,
TimeInstantModel tspec)
Returns
TimeSeries of the specified variable
using the specified time instant model. |
TimeSeriesOneD |
getTimeSeriesOneD(java.lang.String varName,
int[] startTime,
int[] stopTime,
TimeInstantModel tspec,
boolean columnMajor)
Returns
time series of the specified variable
in the specified time range using the given
time instant model. |
double[][] |
getVectorTimeSeries(java.lang.String varName,
int component)
Returns the time series of the specified component of a 1 dimensional
variable, ignoring points whose value equals fill value.
|
double[][] |
getVectorTimeSeries(java.lang.String varName,
int component,
boolean ignoreFill)
Returns the time series of the specified component of a 1 dimensional
variable, optionally ignoring points whose value equals fill value.
|
double[][] |
getVectorTimeSeries(java.lang.String varName,
int component,
boolean ignoreFill,
int[] startTime,
int[] stopTime)
Returns the time series of the specified component of 1 dimensional
variable in the specified time range, optionally ignoring points whose
value equals fill value.
|
TimeSeries |
getVectorTimeSeries(java.lang.String varName,
int component,
boolean ignoreFill,
int[] startTime,
int[] stopTime,
TimeInstantModel tspec)
Returns the
time series of the specified component
of 1 dimensional variable in the specified time range using the given
time instant model, optionally ignoring points
whose
value
equals fill value. |
double[][] |
getVectorTimeSeries(java.lang.String varName,
int component,
int[] startTime,
int[] stopTime)
Returns the time series of the specified component of 1 dimensional
variable in the specified time range, ignoring points whose
value equals fill value.
|
TimeSeries |
getVectorTimeSeries(java.lang.String varName,
int component,
int[] startTime,
int[] stopTime,
TimeInstantModel tspec)
Returns the time series as a
TimeSeries, of the
specified component of a vector variable in the specified time range
using the given time instant model, ignoring
points
whose value
equals fill value. |
int[] |
lastAvailableTime(java.lang.String varName)
Returns last available time for a variable.
|
int[] |
lastAvailableTime(java.lang.String varName,
int[] stop)
Returns last available time which is not later than the given time
for a variable.
|
static TimeInstantModel |
timeModelInstance()
Returns default
time instant model. |
static TimeInstantModel |
timeModelInstance(java.lang.String offsetUnits)
Returns
time instant model that uses
given units for the offset.. |
TimeInstantModel |
timeModelInstance(java.lang.String varName,
int[] baseTime)
Returns
time instant model with specified base
time and default offset units (millisecond) for a variable. |
TimeInstantModel |
timeModelInstance(java.lang.String varName,
int[] baseTime,
TimePrecision offsetUnits)
Returns
time instant model with specified base
time and specified offset units (millisecond) for a variable. |
asDouble0, asDouble1, asDouble2, asDouble3, get, getBuffer, getBuffer, getBuffer, getBuffer, getBufferCapacity, getLong, getOneD, getOneDArray, getOneDArray, getRange, getRangeForComponent, getRangeForComponents, getRangeOneD, getSampled, getSampled, getSource, getVectorComponent, getVectorComponents, isScalar, isVector, sourceIsFile, startContainerThread, threadFinished, userTimeVariableNameexistsVariable, getAttribute, getAttribute, getAttributeEntries, getAttributeEntries, getBlockingFactor, getByteOrder, getDataItemSize, getDimensions, getEffectiveDimensions, getEffectiveRank, getElementCount, getGlobalAttribute, getLastLeapSecondId, getNumber, getNumberOfElements, getNumberOfValues, getPadValue, getPadValue, getRecordRange, getTimeVariableName, getType, getVariableNames, getVariableNames, getVarys, globalAttributeEntryCount, globalAttributeNames, isCompatible, isCompatible, isCompressed, isMissingRecords, isTimeType, isTypeR, missingRecordValueIsPad, missingRecordValueIsPrevious, recordVariance, rowMajority, variableAttributeNamespublic CDFReader()
public CDFReader(java.lang.String cdfFile)
throws CDFException.ReaderError
cdfFile - the cdf file nameCDFException.ReaderError - If there was a problempublic CDFReader(java.net.URL url)
throws CDFException.ReaderError
url - the URL for CDF fileCDFException.ReaderError - If there was a problempublic TimeSeries getTimeSeries(java.lang.String varName) throws CDFException.ReaderError
TimeSeries of the specified variable
using the default time instant model.varName - variable nameCDFException.ReaderError - If there was a problempublic TimeSeries getTimeSeries(java.lang.String varName, TimeInstantModel tspec) throws CDFException.ReaderError
TimeSeries of the specified variable
using the specified time instant model.varName - variable nametspec - time instant model, May be
null, in which case the default model is used.CDFException.ReaderError - If there was a problempublic TimeSeries getTimeSeries(java.lang.String varName, int[] startTime, int[] stopTime) throws CDFException.ReaderError
TimeSeries of the specified variable
in the specified time range using the default
time instant model.varName - variable namestartTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the first available time is used.stopTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the stop time is assumed to be later than the last available time.CDFException.ReaderError - if not a valid variable name.public TimeSeries getTimeSeries(java.lang.String varName, int[] startTime, int[] stopTime, TimeInstantModel tspec) throws CDFException.ReaderError
TimeSeries of the specified variable in
the specified time range using the given
time instant model.varName - variable namestartTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the first available time is used.stopTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the stop time is assumed to be later than the last available time.tspec - time instant model, May be
null, in which case the default model is used.time seriesCDFException.ReaderError - if not a valid variable name.public TimeSeriesOneD getTimeSeriesOneD(java.lang.String varName, int[] startTime, int[] stopTime, TimeInstantModel tspec, boolean columnMajor) throws CDFException.ReaderError
time series of the specified variable
in the specified time range using the given
time instant model.varName - variable namestartTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the first available time is used.stopTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the stop time is assumed to be later than the last available time.tspec - time instant model, May be
null, in which case the default model is used.columnMajor - specifies whether the first index of the
variable dimension varies the fastest, i.e. IDL like.time seriesCDFException.ReaderError - if not a valid variable name.public double[] getAvailableTimeRange(java.lang.String varName)
throws CDFException.ReaderError
time instant model.varName - variable nameCDFException.ReaderError - if not a valid variable name.public int[] firstAvailableTime(java.lang.String varName)
throws CDFException.ReaderError
varName - the variable nameCDFException.ReaderError - if not a valid variable name.public int[] firstAvailableTime(java.lang.String varName,
int[] start)
throws CDFException.ReaderError
varName - the variable namestart - a 3 to 7 element int[], containing year,
month (January is 1), day, hour, minute, second and millisecond.CDFException.ReaderError - if not a valid variable name.public int[] lastAvailableTime(java.lang.String varName)
throws CDFException.ReaderError
varName - the variable nameCDFException.ReaderError - if not a valid variable name.public int[] lastAvailableTime(java.lang.String varName,
int[] stop)
throws CDFException.ReaderError
varName - the variable namestop - a 3 to 7 element int[], containing year,
month (January is 1), day, hour, minute, second and millisecond.CDFException.ReaderError - if not a valid variable name.public TimeInstantModel timeModelInstance(java.lang.String varName, int[] baseTime) throws CDFException.ReaderError
time instant model with specified base
time and default offset units (millisecond) for a variable.varName - variable namebaseTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond.CDFException.ReaderError - if not a valid variable name or
incomplete base time.public TimeInstantModel timeModelInstance(java.lang.String varName, int[] baseTime, TimePrecision offsetUnits) throws CDFException.ReaderError
time instant model with specified base
time and specified offset units (millisecond) for a variable.varName - variable namebaseTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond.offsetUnits - offset units in millisecondsCDFException.ReaderError - if not a valid variable name or
incomplete base time.public static TimeInstantModel timeModelInstance()
time instant model.
The base of default TimeInstantModel is January 1,1970 0:0:0
public static TimeInstantModel timeModelInstance(java.lang.String offsetUnits)
time instant model that uses
given units for the offset..
The base of default TimeInstantModel is January 1,1970 0:0:0
offsetUnits - offset units in millisecondspublic java.lang.String[] getDependent(java.lang.String varName)
varName - the variable namepublic java.lang.String getIndexName(java.lang.String varName,
int index)
throws CDFException.ReaderError
varName - variable nameindex - index to a multi-dimensional variableCDFException.ReaderError - if there is an errorpublic double[][] getScalarTimeSeries(java.lang.String varName)
throws CDFException.ReaderError
A double[2][] array is returned. The 0th element is the array containing times, and the 1st element is the array containing corresponding values. If a fill value has been specified for this variable via the FILLVAL attribute, then points where the value is equal to fill value are excluded.
varName - variable nameCDFException.ReaderError - if variables is non-numeric, or
is not a scalar.public double[][] getScalarTimeSeries(java.lang.String varName,
int[] startTime,
int[] stopTime)
throws CDFException.ReaderError
A double[2][] array is returned. The 0th element is the array containing times, and the 1st element is the array containing corresponding values. If a fill value has been specified for this variable via the FILLVAL attribute, then points where the value is equal to fill value are excluded.
For numeric variables of dimension other than 0, and for character string variables an exception is thrown.varName - variable namestartTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the first available time is used.stopTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the stop time is assumed to be later than the last available time.CDFException.ReaderError - if variables is non-numeric, or
is not a scalar.public TimeSeries getScalarTimeSeries(java.lang.String varName, int[] startTime, int[] stopTime, TimeInstantModel tspec) throws CDFException.ReaderError
TimeSeries, of the
specified scalar variable in the specified time range, using the given
time instant model, ignoring points whose
value equals fill value.
If a fill value has been specified for this variable via the FILLVAL attribute, then points where the value is equal to fill value are excluded.
varName - the variable namestartTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the first available time is used.stopTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the stop time is assumed to be later than the last available time.tspec - time instant model, May be
null, in which case the default model is used.CDFException.ReaderError - if variables is non-numeric, or
is not a scalar.public double[][] getScalarTimeSeries(java.lang.String varName,
boolean ignoreFill)
throws CDFException.ReaderError
A double[2][] array is returned. The 0th element is the array containing times, and the 1st element is the array containing corresponding values. If a fill value has been specified for this variable via the FILLVAL attribute, then points where the value is equal to fill value are excluded if ignoreFill = true.
varName - the variable nameignoreFill - A flag indicating whether to ignore the FILLVAL valueCDFException.ReaderError - if variables is non-numeric, or
is not a scalar.public double[][] getScalarTimeSeries(java.lang.String varName,
boolean ignoreFill,
int[] startTime,
int[] stopTime)
throws CDFException.ReaderError
A double[2][] array is returned. The 0th element is the array containing times, and the 1st element is the array containing corresponding values. If a fill value has been specified for this variable via the FILLVAL attribute, then if ignoreFill has the value true, points where the value is equal to fill value are excluded if ignoreFill = true.
varName - the variable nameignoreFill - A flag indicating whether to ignore the FILLVAL valuestartTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the first available time is used.stopTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the stop time is assumed to be later than the last available time.CDFException.ReaderError - if variables is non-numeric, or
is not a scalar.public TimeSeries getScalarTimeSeries(java.lang.String varName, boolean ignoreFill, int[] startTime, int[] stopTime, TimeInstantModel tspec) throws CDFException.ReaderError
TimeSeries of the
specified scalar variable in the specified time range using the given
time instant model, optionally ignoring points
whose
value equals fill value.
If a fill value has been specified for this variable via the FILLVAL attribute, then if ignoreFill has the value true, points where the value is equal to fill value are excluded if ignoreFill = true.
varName - the variable nameignoreFill - A flag indicating whether to ignore the FILLVAL valuestartTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the first available time is used.stopTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the stop time is assumed to be later than the last available time.tspec - time instant model, May be
null, in which case the default model is used.CDFException.ReaderError - if variables is non-numeric, or
is not a scalar.public double[][] getVectorTimeSeries(java.lang.String varName,
int component)
throws CDFException.ReaderError
A double[2][] array is returned. The 0th element is the array containing times, and the 1st element is the array containing corresponding values. If a fill value has been specified for this variable via the FILLVAL attribute, then points where the value is equal to fill value are excluded.
varName - the variable namecomponent - The component in 1-D arrayCDFException.ReaderError - if variables is non-numeric, or is
not a vector.public double[][] getVectorTimeSeries(java.lang.String varName,
int component,
int[] startTime,
int[] stopTime)
throws CDFException.ReaderError
A double[2][] array is returned. The 0th element is the array containing times, and the 1st element is the array containing corresponding values. If a fill value has been specified for this variable via the FILLVAL attribute, then points where the value is equal to fill value are excluded.
varName - the variable namecomponent - The component in 1-D arraystartTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the first available time is used.stopTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the stop time is assumed to be later than the last available time.CDFException.ReaderError - if variables is non-numeric, or is
not a vector.public TimeSeries getVectorTimeSeries(java.lang.String varName, int component, int[] startTime, int[] stopTime, TimeInstantModel tspec) throws CDFException.ReaderError
TimeSeries, of the
specified component of a vector variable in the specified time range
using the given time instant model, ignoring
points
whose value
equals fill value.
If a fill value has been specified for this variable via the FILLVAL attribute, then points where the value is equal to fill value are excluded.
varName - variable namecomponent - index of the vector componentstartTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the first available time is used.stopTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the stop time is assumed to be later than the last available time.tspec - time instant model, May be
null, in which case the default model is used.CDFException.ReaderError - if variables is non-numeric, or is
not a vector.public double[][] getVectorTimeSeries(java.lang.String varName,
int component,
boolean ignoreFill)
throws CDFException.ReaderError
A double[2][] array is returned. The 0th element is the array containing times, and the 1st element is the array containing corresponding values. If a fill value has been specified for this variable via the FILLVAL attribute, then points where the value is equal to fill value are excluded if ignoreFill = true.
varName - variable namecomponent - index of the vector componentignoreFill - A flag indicating whether to ingore the FILLVAL
valueCDFException.ReaderError - if variables is non-numeric, or is
not a vector.public double[][] getVectorTimeSeries(java.lang.String varName,
int component,
boolean ignoreFill,
int[] startTime,
int[] stopTime)
throws CDFException.ReaderError
A double[2][] array is returned. The 0th element is the array containing times, and the 1st element is the array containing corresponding values. If a fill value has been specified for this variable via the FILLVAL attribute, then points where the value is equal to fill value are excluded if ignoreFill = true.
varName - variable namecomponent - index of the vector componentignoreFill - A flag indicating whether to ingore the FILLVAL
valuestartTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond.stopTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the stop time is assumed to be later than the last available time.CDFException.ReaderError - if variables is non-numeric, or is
not a vector.public TimeSeries getVectorTimeSeries(java.lang.String varName, int component, boolean ignoreFill, int[] startTime, int[] stopTime, TimeInstantModel tspec) throws CDFException.ReaderError
time series of the specified component
of 1 dimensional variable in the specified time range using the given
time instant model, optionally ignoring points
whose
value
equals fill value.
If a fill value has been specified for this variable via the FILLVAL attribute, then if ignoreFill has the value true, points where the value is equal to fill value are excluded if ignoreFill = true.
varName - variable namecomponent - index of the vector componentignoreFill - A flag indicating whether to ingore the FILLVAL
valuestartTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the first available time is used.stopTime - a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond. May be null, in which case
the stop time is assumed to be later than the last available time.tspec - time instant model, May be
null, in which case the default model is used.CDFException.ReaderError - if variables is non-numeric, or
is not a vector.
Use getTimeSeries(
String varName) for string type.