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.Returned time has millisecond precision.
|
int[] |
firstAvailableTime(java.lang.String varName,
int[] start)
Returns first available time which is not before the given time for a
variable.Returned time has millisecond precision.
|
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.Returned time has millisecond precision.
|
int[] |
lastAvailableTime(java.lang.String varName,
int[] stop)
Returns last available time which is not later than the given time
for a variable.Returned time has millisecond precision.
|
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, userTimeVariableName
existsVariable, 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, variableAttributeNames
public CDFReader()
public CDFReader(java.lang.String cdfFile) throws CDFException.ReaderError
cdfFile
- CDFException.ReaderError
public CDFReader(java.net.URL url) throws CDFException.ReaderError
url
- CDFException.ReaderError
public TimeSeries getTimeSeries(java.lang.String varName) throws CDFException.ReaderError
TimeSeries
of the specified variable
using the default time instant model
.varName
- CDFException.ReaderError
public 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
public 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
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 series
CDFException.ReaderError
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 series
CDFException.ReaderError
public double[] getAvailableTimeRange(java.lang.String varName) throws CDFException.ReaderError
time instant model
.varName
- variable nameCDFException.ReaderError
public int[] firstAvailableTime(java.lang.String varName) throws CDFException.ReaderError
varName
- CDFException.ReaderError
- if not a valid variable name.public int[] firstAvailableTime(java.lang.String varName, int[] start) throws CDFException.ReaderError
varName
- start
- 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
- CDFException.ReaderError
- if not a valid variable name.public int[] lastAvailableTime(java.lang.String varName, int[] stop) throws CDFException.ReaderError
varName
- stop
- 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
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
- CDFException.ReaderError
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
- public java.lang.String[] getDependent(java.lang.String varName)
varName
- public java.lang.String getIndexName(java.lang.String varName, int index) throws CDFException.ReaderError
varName
- variable nameindex
- index whose name is requiredCDFException.ReaderError
public 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
- CDFException.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
- startTime
- 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
- startTime
- 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
- ignoreFill
- CDFException.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
- startTime
- 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.ignoreFill
- 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
- startTime
- 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.ignoreFill
- 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
- component
- CDFException.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
- startTime
- 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.component
- 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
- ignoreFill
- component
- CDFException.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
- startTime
- a 3 to 7 element int[], containing year,
month (January is 1),
day,hour, minute, second and millisecond.component
- 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.ignoreFill
- 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
- startTime
- 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.ignoreFill
- 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.