|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--saaps.util.TimeSeries
Field Summary | |
static int |
aveArrDptOffset
|
static int |
aveArrStdvOffset
|
static int |
aveArrTypes
Describes how many different types of data is in the average array. |
private java.util.Calendar |
cal
|
private Jama.Matrix |
data
|
private java.util.Date[] |
dates
|
private java.lang.String[] |
fieldNames
|
private java.lang.String[] |
fieldUnits
|
private java.lang.String |
longDescription
|
private int |
numOfData
|
private int |
numOfDataFields
|
private int |
numOfFields
|
private java.lang.String |
shortDescription
|
private java.util.TimeZone |
tz
|
Constructor Summary | |
TimeSeries(java.util.Date[] d,
double[] m)
Create a TimeSeries object from a Date vector and a double vector. |
|
TimeSeries(java.util.Date[] d,
double[][] m,
java.lang.String[] fn,
java.lang.String[] fu)
Create the object from date array and the 2-D array. |
|
TimeSeries(java.util.Date[] d,
double[] m,
java.lang.String fn,
java.lang.String fu)
Create a TimeSeries object from a Date vector and a double vector,
and specify the data field names and units. |
|
TimeSeries(java.util.Date[] d,
Jama.Matrix m)
Create a TimeSeries object from an array of Date objects and a Matrix. |
|
TimeSeries(long st,
long et,
long si,
int nodf)
Create an empty time series object. |
|
TimeSeries(ObjectTimeSeries ots,
java.lang.String[] fn,
java.lang.String[] fu)
Create a TimeSeries object from an ObjectTimeSeries. |
|
TimeSeries(java.util.Vector dbov)
Create a TimeSeries object from a Vector of DatabaseObject:s |
|
TimeSeries(java.util.Vector dbov,
int fieldIndex)
Create a TimeSeries object from a Vector of DatabaseObjects Use only the indicated data field. |
|
TimeSeries(java.util.Vector dbov,
java.lang.String[] fn,
java.lang.String[] fu)
Create a TimeSeries object from a Vector of DatabaseObject:s |
Method Summary | |
double[] |
average(boolean ignoreNaN)
Get the average of a time series object. |
double[] |
average(java.util.Calendar date,
boolean ignoreNaN)
Gets the average of a time series object. |
int |
average(java.util.Date sampleTime,
long wa,
long wb,
java.util.Date mdate,
double[] mdata)
Averages all fields in the data for the selected time interval. |
int |
average(int[] fields,
java.util.Date sampleTime,
long wa,
long wb,
java.util.Date mdate,
double[] mdata)
Averages the selected fields in the data for the selected time interval. |
TimeSeries |
averageFields()
Average over the data fields. |
TimeSeries |
dailySum()
Get the daily sum for each parameter for each day. |
TimeSeries |
extract(long st,
long et)
Extract a time period. |
Jama.Matrix |
getData()
Get the data as a Matrix object. |
double[] |
getData(int i)
Get the data for one row. |
double |
getData(int i,
int j)
Get one data element. |
java.util.Date |
getDate(int i)
Get one Date object. |
java.util.Date[] |
getDates()
Get the Date objects. |
java.lang.String[] |
getFieldNames()
Gets the field names array. |
java.lang.String[] |
getFieldUnits()
Gets the field units array. |
java.util.Date |
getLastDate()
Get the last date in the time series. |
int |
getLength()
Get the length of the TimeSeries object. |
java.lang.String |
getLongDescription()
Get the long description of the data. |
int |
getNumOfDataFields()
Get the number of data fields. |
long |
getSampleInterval()
Get the sample interval. |
java.lang.String |
getShortDescription()
Get the short description of the data. |
static void |
main(java.lang.String[] args)
|
TimeSeries |
normalize(NormParam np)
Method to normalize the data according to a NormParam object. |
byte |
resample(int[] fields,
long dt0,
long dt,
long wa,
long wb)
Resamples selected fields in the data. |
byte |
resample(long dt0,
long dt,
long wa,
long wb)
Resamples all fields in the data. |
private java.util.Calendar |
setCalDay(java.util.Date d)
|
void |
setData(int i,
double[] x)
Set one row of data. |
void |
setData(int i,
int j,
double x)
Set data for observation i and data field j. |
private void |
setDefaultMeta()
Set the default meta data for the time series. |
void |
setFieldNames(java.lang.String[] fn)
Sets the field names array. |
void |
setFieldUnits(java.lang.String[] fu)
Sets the field units array. |
void |
setLongDescription(java.lang.String ld)
Set the long description of the data. |
void |
setShortDescription(java.lang.String sd)
Set the short description of the data. |
TimeSeries |
sumFields()
Sum over the data fields. |
Jama.Matrix |
timeDelay(NormParam np)
Method to create a time delay line. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.util.Date[] dates
private Jama.Matrix data
private int numOfData
private int numOfFields
private int numOfDataFields
private java.util.TimeZone tz
private java.util.Calendar cal
private java.lang.String shortDescription
private java.lang.String longDescription
private java.lang.String[] fieldNames
private java.lang.String[] fieldUnits
public static final int aveArrDptOffset
public static final int aveArrStdvOffset
public static final int aveArrTypes
Constructor Detail |
public TimeSeries(java.util.Date[] d, double[] m)
TimeSeries
object from a Date vector and a double vector.d
- The dates.m
- The data.public TimeSeries(java.util.Date[] d, double[] m, java.lang.String fn, java.lang.String fu)
TimeSeries
object from a Date vector and a double vector,
and specify the data field names and units.d
- The dates.m
- The data.fn
- The field name.fu
- The field unit.public TimeSeries(java.util.Date[] d, double[][] m, java.lang.String[] fn, java.lang.String[] fu)
Note: All 2-D array rows must have the same length.
d
- date arraym
- 2-D array of double data (all rows same length)fn
- field namesfu
- field unitspublic TimeSeries(java.util.Vector dbov)
dbov
- The DatabaseObject vectorpublic TimeSeries(java.util.Vector dbov, java.lang.String[] fn, java.lang.String[] fu)
dbov
- The DatabaseObject vectorfn
- Field namesfu
- Field unitspublic TimeSeries(ObjectTimeSeries ots, java.lang.String[] fn, java.lang.String[] fu)
ots
- The ObjectTimeSeriesfn
- Field namesfu
- Field unitspublic TimeSeries(java.util.Vector dbov, int fieldIndex) throws TimeSeriesIndexException
dbov
- The DatabaseObject vectorfieldIndex
- field number in DatabaseObject
datapublic TimeSeries(java.util.Date[] d, Jama.Matrix m)
d
- Array of Date objectm
- Matrix of data.public TimeSeries(long st, long et, long si, int nodf)
Method Detail |
private void setDefaultMeta()
public void setFieldNames(java.lang.String[] fn)
field
- namespublic void setFieldUnits(java.lang.String[] fu)
field
- unitsprivate java.util.Calendar setCalDay(java.util.Date d)
public TimeSeries dailySum()
Future version should include a check that all days contain the same number of data.
public TimeSeries normalize(NormParam np)
np
- A NormParam object.public Jama.Matrix timeDelay(NormParam np)
np
- A NormParam object.public int getLength()
public java.util.Date[] getDates()
public java.util.Date getDate(int i)
public Jama.Matrix getData()
public double getData(int i, int j)
public double[] getData(int i)
public int getNumOfDataFields()
public java.lang.String getShortDescription()
public java.lang.String getLongDescription()
public java.lang.String[] getFieldNames()
public java.lang.String[] getFieldUnits()
public void setShortDescription(java.lang.String sd)
sd
- The short descriptionpublic void setLongDescription(java.lang.String ld)
ld
- The short descriptionpublic void setData(int i, double[] x)
public void setData(int i, int j, double x)
i
- The index for one observationj
- The index of the data fieldx
- The value to be setpublic double[] average(boolean ignoreNaN)
public double[] average(java.util.Calendar date, boolean ignoreNaN)
date
- centre time of data interval is returned hereignoreNaN
- if true
ignore NaN datapublic int average(java.util.Date sampleTime, long wa, long wb, java.util.Date mdate, double[] mdata)
sampleTime
- time of the resulting data.wa
- time offset 1 (negative value means before sampleTime)wb
- time offset 2 (positive value means after sampleTime)public int average(int[] fields, java.util.Date sampleTime, long wa, long wb, java.util.Date mdate, double[] mdata)
fields
- which are included in the averagesampleTime
- time of the resulting data.wa
- time offset 1 (negative value means before sampleTime)wb
- time offset 2 (positive value means after sampleTime)public TimeSeries extract(long st, long et)
public TimeSeries sumFields()
public TimeSeries averageFields()
public java.util.Date getLastDate()
public long getSampleInterval()
public byte resample(long dt0, long dt, long wa, long wb)
dt0
- offset time from the first time in the series [ms]dt
- new sample interval (timestep [ms])wa
- time offset where resampling begins [ms]wb
- time offset where resampling ends [ms]public byte resample(int[] fields, long dt0, long dt, long wa, long wb)
fields
- which will be included in the resultdt0
- offset time from the first time in the series [ms]dt
- new sample interval (timestep [ms])wa
- time offset where resampling begins [ms]wb
- time offset where resampling ends [ms]public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |