Class TimeSeries
java.lang.Object
llnl.gnem.core.waveform.seismogram.TimeSeries
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<TimeSeries>
,SeismicSignal
public class TimeSeries
extends Object
implements Comparable<TimeSeries>, Serializable, Cloneable, SeismicSignal
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static interface
static enum
static interface
-
Field Summary
-
Constructor Summary
ConstructorDescriptionno-arg constructor only for SerializationTimeSeries
(float[] data, double samprate, TimeT time) TimeSeries
(BinaryData data, double samprate, TimeT time) -
Method Summary
Modifier and TypeMethodDescriptionadd
(TimeSeries other) boolean
AddAlignedSeismogram
(TimeSeries otherseis) A method to add this seismogram to another equal length seismogram A check is made to ensure that the epoch times are aligned.void
addInPlace
(TimeSeries other) void
addListener
(TimeSeries.SeriesListener listener) void
AddScalar
(double value) Add a scalar to the time series of this CssSeismogramboolean
AddSeismogram
(TimeSeries otherseis) A method to add this seismogram to another equal length seismogram Note that the sample rate is not constrained and should be checked if necessary before calling this methodappend
(TimeSeries other) protected Object
clone()
int
compareTo
(TimeSeries other) double
boolean
crop
(int start, int end) void
cut
(double start, double end) Truncate the CssSeismogram to be a subsection of itself.void
cut
(int idx0, int idx1) void
Truncate the Seismogram to be a subsection of itself.void
void
void
decimate
(int decimationfactor) Decimate the data (Note this should be interchangeable with the interpolate methods)void
Differentiate the time series of this CssSeismogram.divide
(TimeSeries other) protected void
doNormalize
(double scale) void
Envelope()
boolean
void
fill
(float[] buffer, int inc, double start, double end) void
filter
(double lc, double hc) void
filter
(double lc, double hc, boolean twoPass) void
Apply a Butterworth filter to the time series data of this CssSeismogram.findDiscontinuities
(int winLength, double factor) float[]
getData()
Gets the time-series data of the CssSeismogram as a float arrayint
double
getDelta()
double
getDistinctValueRatio
(int numSamples) Gets the endtime attribute of the CssSeismogram objectdouble
getEpoch()
float
int
getIndexForTime
(double epochtime) int
getJdate()
int
double
float
getMax()
Gets the maximum value of the time series of the CssSeismogram objectdouble[]
Gets the maximum value of the series and the time offset it occurs at.double
getMean()
Gets the mean value of the time series of the CssSeismogram objectdouble
Gets the median value of the time series of the CssSeismogram objectfloat
getMin()
Gets the minimum value of the time series of the BasicSeismogram objectdouble
getNormalizedRMSE
(TimeSeries other) int
getNsamp()
double
double
Gets the Nyquist Frequency of the CssSeismogramdouble
getPeakToPeakAmplitude
(double period) Gets the peakToPeakAmplitude attribute of the CssSeismogram's timeseries at the specified period.static double
getPeakToPeakAmplitude
(float[] data, double sampleInterval, double period) Gets the peakToPeakAmplitude attribute of an input timeseries at the specified period.int
getPointsIn
(double timeRange) int
getPointsIn
(TimeT start, TimeT end) double
getPower()
double
getRange()
Gets the range of the time seriesdouble
double
getRMS()
Gets the RMS value of the CssSeismogram's time series.double
getRMSE
(TimeSeries other) double
Gets the samprate attribute of the CssSeismogram objectdouble
Gets the segment Length in seconds of the CssSeismogram objectdouble
getSnr
(double pickEpochTime, double preSeconds, double postSeconds) double
double
getStDev()
Gets the variance of the time series of the CssSeismogram objectfloat[]
getSubSection
(double startEpoch, double requesteduration) Gets a float array which is a subsection of the CssSeismogram's time series.float[]
getSubSection
(double startEpoch, double requestedDuration, float[] result) float[]
getSubSection
(int startIndex, int sampsRequired) Get subsection explicitly using the data indicesfloat[]
getSubSection
(TimeT start, double duration) Gets a float array which is a subsection of the CssSeismogram's time series.float[]
getSubSection
(TimeT start, TimeT end) Gets a float array which is a subsection of the Seismogram's time series.float[]
getSubSection
(TimeT start, TimeT end, float[] result) double
getSubsectionStartTime
(double startEpoch) double
getSum()
Gets the sum of the time series values of this CssSeismogramgetTime()
Gets the start time of the CssSeismogram as a TimeT objectdouble
Gets the start time of the CssSeismogram as a double holding the epoch time of the start.float
getValueAt
(double epochtime) Get the value at a specific point in timefloat
getValueAt
(int j) double
Gets the variance of the time series of the CssSeismogram objectdouble
This method returns what the zero time offset of the series is for this segment.boolean
hasFlatSegments
(int minsegmentlength) Check whether the data series has flat segments - where every element of the segment is identicalint
hashCode()
void
interpolate
(double newsamprate) Interpolate the dataprotected TimeSeries
intersect
(TimeSeries other, TimeSeries.BivariateFunction f) boolean
boolean
isEmpty()
boolean
isSubset
(TimeSeries other) void
Log10()
Replaces each point in this Seismogram with its log10 value.multiply
(TimeSeries other) void
MultiplyScalar
(double value) Multiply the time series values of this CssSeismogram by a scalar constant.void
void
normalize
(double value) void
Normalize the seismogram based on String input 1.void
normalize
(TimeSeries.Norm norm) Normalize all the seismograms Usage : 'normalize', 'normalize (value)' or 'normalize (type)' where (type) is 'mean' 'min' or 'max' Traces are initially demeaned then scaled default - each trace is multiplied by abs(1/extremum) value - where value is a number - the traces are normalized so that the absolute value of the extremum equals the value entered mean - traces are multiplied by the mean of the absolute values of the trace min - traces are multiplied by -1/min max - traces are multiplied by 1/maxvoid
onModify()
double
Computed the median in O(n) time in contrast to standard O(n lg n) time.boolean
rateIsComparable
(TimeSeries other) Performs a check to see if the sample rates of two timeseries is close enough to equal.void
removeGlitches
(double Threshhold) Remove glitches from the seismogram where glitches are defined by data that exceed a threshhold above the variance defined by a moving windowvoid
removeListener
(TimeSeries.SeriesListener listener) void
Remove the mean of the time series of this CssSeismogramvoid
Remove the median value of the time series of this CssSeismogramvoid
Remove a linear trend from the time series data of this CssSeismogram.void
resample
(double newRate) void
reverse()
Reverse the data series.void
static <T extends TimeSeries>
PairT<T,T> rotateTraces
(T seis1, T seis2, double theta) void
scaleTo
(double min, double max) void
setData
(float[] v) Sets the data array of the CssSeismogram objectvoid
setDataPoint
(float v, int index) Sets the value of the data at a particular point to a valuevoid
setDataPoints
(float[] v, int startindex) Sets the data at a collection of pointsvoid
setIdentifier
(String identifier) void
setMaximumRange
(double maxRange) void
setSampleRateErrorThreshold
(double value) void
setSamprate
(double samprate) void
Sets the time attribute of the CssSeismogram objectvoid
setZeroTimeOffsetSeconds
(double timeOffset) This method sets what the zero time offset of the series is for this segment.shift
(int samples) Shifts the values of this time series by the number of specified samples and returns the result as a new time series.shift
(int samples, boolean keepLength) Shifts the values of this time series by the number of specified samples and returns the result as a new time series.void
Replaces each point in the Seismogram its signed sqrt Note: values LT 0 are returned -1* sqrt(abs(value)).void
Replaces each point in the Seismogram its signed square value Note: values LT 0 are returned -1* value*value.void
Signum()
Convert to single bit (+1, -1 or 0)void
Smooth
(int halfwidth) Smooth the Seismogram using a sliding window of width halfWidth.void
Sqrt()
Replaces each point in the Seismogram with its sqrt Note: values LT 0 are returned 0.void
Square()
Replaces each point in the Seismogram with its square valuevoid
stretch
(double interpolationfactor) subtract
(TimeSeries other) void
Taper
(double TaperPercent) Apply a cosine taper to the time series of this seismogramtoString()
void
triangleTaper
(double taperPercent) trim()
void
union
(TimeSeries other, boolean ignoreMismatch) void
WriteASCIIfile
(String filename)
-
Field Details
-
EPSILON
public static final double EPSILON- See Also:
-
-
Constructor Details
-
TimeSeries
public TimeSeries()no-arg constructor only for Serialization -
TimeSeries
-
TimeSeries
-
TimeSeries
-
-
Method Details
-
getPeakToPeakAmplitude
public static double getPeakToPeakAmplitude(float[] data, double sampleInterval, double period) Gets the peakToPeakAmplitude attribute of an input timeseries at the specified period. Advances a sliding window of length period through the time series a point at a time. At each position, the Peak-To-Peak range of the current window is computed. The maximum value of all these values is returned.- Parameters:
period
- The period in seconds at which to compute the value.data
- An array of floats whose Peak-To-Peak value is to be determined.sampleInterval
- The sample interval of the data in the data array.- Returns:
- The maximum Peak-To-Peak value for the array.
-
rotateTraces
-
setSampleRateErrorThreshold
public void setSampleRateErrorThreshold(double value) -
AddAlignedSeismogram
A method to add this seismogram to another equal length seismogram A check is made to ensure that the epoch times are aligned.- Parameters:
otherseis
- the other SacSeismogram object- Returns:
-
AddScalar
public void AddScalar(double value) Add a scalar to the time series of this CssSeismogram- Specified by:
AddScalar
in interfaceSeismicSignal
- Parameters:
value
- The scalar value to be added to the time series
-
AddSeismogram
A method to add this seismogram to another equal length seismogram Note that the sample rate is not constrained and should be checked if necessary before calling this method- Parameters:
otherseis
- the other CssSeismogram object- Returns:
- Returns true if the operation was successful.
-
Log10
public void Log10()Replaces each point in this Seismogram with its log10 value.- Specified by:
Log10
in interfaceSeismicSignal
-
MultiplyScalar
public void MultiplyScalar(double value) Multiply the time series values of this CssSeismogram by a scalar constant.- Specified by:
MultiplyScalar
in interfaceSeismicSignal
- Parameters:
value
- The scalar value with which to multiply the time series values
-
RemoveMean
public void RemoveMean()Remove the mean of the time series of this CssSeismogram- Specified by:
RemoveMean
in interfaceSeismicSignal
-
RemoveMedian
public void RemoveMedian()Remove the median value of the time series of this CssSeismogram- Specified by:
RemoveMedian
in interfaceSeismicSignal
-
SignedSqrt
public void SignedSqrt()Replaces each point in the Seismogram its signed sqrt Note: values LT 0 are returned -1* sqrt(abs(value)).- Specified by:
SignedSqrt
in interfaceSeismicSignal
-
SignedSquare
public void SignedSquare()Replaces each point in the Seismogram its signed square value Note: values LT 0 are returned -1* value*value.- Specified by:
SignedSquare
in interfaceSeismicSignal
-
Signum
public void Signum()Convert to single bit (+1, -1 or 0)- Specified by:
Signum
in interfaceSeismicSignal
-
Smooth
public void Smooth(int halfwidth) Smooth the Seismogram using a sliding window of width halfWidth. replaces the data with it's smoothed result Note halfwidth refers to number of samples, not seconds- Specified by:
Smooth
in interfaceSeismicSignal
- Parameters:
halfwidth
- half width in samples.
-
Sqrt
public void Sqrt()Replaces each point in the Seismogram with its sqrt Note: values LT 0 are returned 0.- Specified by:
Sqrt
in interfaceSeismicSignal
-
Square
public void Square()Replaces each point in the Seismogram with its square value- Specified by:
Square
in interfaceSeismicSignal
-
Taper
public void Taper(double TaperPercent) Apply a cosine taper to the time series of this seismogram- Specified by:
Taper
in interfaceSeismicSignal
- Parameters:
TaperPercent
- The (one-sided) percent of the time series to which a taper will be applied. The value ranges from 0 (no taper) to 50 ( The taper extends half the length of the CssSeismogram ). Since the taper is symmetric, a 50% taper means that all but the center value of the CssSeismogram will be scaled by some value less than 1.0.
-
WriteASCIIfile
- Throws:
IOException
-
add
-
addInPlace
-
addListener
-
append
-
compareTo
- Specified by:
compareTo
in interfaceComparable<TimeSeries>
-
computeExtremeStat
public double computeExtremeStat()- Specified by:
computeExtremeStat
in interfaceSeismicSignal
-
contains
- Specified by:
contains
in interfaceSeismicSignal
-
crop
-
crop
-
crop
-
cut
Truncate the Seismogram to be a subsection of itself. The time interval to which the Seismogram will be cut is specified by the start and end parameters. The Seismogram start time will be adjusted to conform to the new starting time.- Parameters:
start
- The starting time of the desired subsection. If start is less than the Seismogram begin time, the begin time will be used. If start is GT than the Seismogram endtime, then an IllegalArgumentException will be thrown.end
- The end time of the desired subsection. If end is GT than the Seismogram end, then the Seismogram end will be used. If end is less than start then an IllegalArgumentException will be thrown.
-
cut
public void cut(double start, double end) Truncate the CssSeismogram to be a subsection of itself. The time interval to which the CssSeismogram will be cut is specified by the start and end parameters. The CssSeismogram start time will be adjusted to conform to the new starting time. Note that, in this method, start and end are in seconds relative to the current Seismogram time- Parameters:
start
- The start time in seconds after the start of the uncut seismogramend
- The end time in seconds after the start of the uncut seismogram
-
cut
public void cut(int idx0, int idx1) -
cutAfter
-
cutBefore
-
decimate
public void decimate(int decimationfactor) Decimate the data (Note this should be interchangeable with the interpolate methods)
The data series it is decimated so that only every Nth point is retained where N is the decimationfactor
Note the samprate and number of points in the data series changes- Parameters:
decimationfactor
- The amount by which to decimate the series.
-
differentiate
public void differentiate()Differentiate the time series of this CssSeismogram. First two points are differentiated using a forward-difference with error Oh2, Last two points using a backward-difference operator with error Oh2. Remaining points differentiated using a central-difference operator with order Oh4 (page 397 - 399 of Applied Numerical Methods for Digital Computation by James et al. ) Must be at least 4 points in series for this to work.- Specified by:
differentiate
in interfaceSeismicSignal
-
divide
-
Envelope
public void Envelope() -
equals
-
fill
public void fill(float[] buffer, int inc, double start, double end) -
filter
public void filter(double lc, double hc) - Specified by:
filter
in interfaceSeismicSignal
-
filter
public void filter(double lc, double hc, boolean twoPass) - Specified by:
filter
in interfaceSeismicSignal
-
filter
Description copied from interface:SeismicSignal
Apply a Butterworth filter to the time series data of this CssSeismogram.- Specified by:
filter
in interfaceSeismicSignal
- Parameters:
order
- The order of the filter to be appliedpassband
- The passband of the filter. Passband is one of Passband.LOW_PASS, Passband.HIGH_PASS, Passband.BAND_PASS, Passband.BAND_REJECTcutoff1
- For BAND_PASS and BAND_REJECT filters this is the low corner of the filter. For HIGH_PASS and LOW_PASS filters, this is the single corner frequencycutoff2
- For BAND_PASS and BAND_REJECT filters, this is the high-frequency corner. For other filters, this argument is ignored.two_pass
- When true, the filter is applied in both forward and reverse directions to achieve zero-phase.
-
findDiscontinuities
- Specified by:
findDiscontinuities
in interfaceSeismicSignal
-
getData
public float[] getData()Gets the time-series data of the CssSeismogram as a float array- Specified by:
getData
in interfaceSeismicSignal
- Returns:
- The data array
-
getDataBytes
public int getDataBytes() -
getDelta
public double getDelta()- Specified by:
getDelta
in interfaceSeismicSignal
-
getDistinctValueRatio
public double getDistinctValueRatio(int numSamples) - Specified by:
getDistinctValueRatio
in interfaceSeismicSignal
-
getEndtime
Gets the endtime attribute of the CssSeismogram object- Specified by:
getEndtime
in interfaceSeismicSignal
- Returns:
- The endtime value
-
getEndtimeAsDouble
public double getEndtimeAsDouble() -
getEpoch
- Specified by:
getEpoch
in interfaceSeismicSignal
-
getExtremum
public float getExtremum()- Specified by:
getExtremum
in interfaceSeismicSignal
-
getIdentifier
- Specified by:
getIdentifier
in interfaceSeismicSignal
-
setIdentifier
- Specified by:
setIdentifier
in interfaceSeismicSignal
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
getIndexForTime
public int getIndexForTime(double epochtime) - Specified by:
getIndexForTime
in interfaceSeismicSignal
-
getJdate
public int getJdate()- Specified by:
getJdate
in interfaceSeismicSignal
-
getLength
public int getLength()- Specified by:
getLength
in interfaceSeismicSignal
-
getLengthInSeconds
public double getLengthInSeconds()- Specified by:
getLengthInSeconds
in interfaceSeismicSignal
-
getMax
public float getMax()Gets the maximum value of the time series of the CssSeismogram object- Specified by:
getMax
in interfaceSeismicSignal
- Returns:
- The max value
-
getMaxTime
public double[] getMaxTime()Gets the maximum value of the series and the time offset it occurs at.- Specified by:
getMaxTime
in interfaceSeismicSignal
- Returns:
- The (time offset at the max in seconds, the max value) of the series
-
getMean
public double getMean()Gets the mean value of the time series of the CssSeismogram object- Specified by:
getMean
in interfaceSeismicSignal
- Returns:
- The mean value
-
getMedian
public double getMedian()Gets the median value of the time series of the CssSeismogram object- Specified by:
getMedian
in interfaceSeismicSignal
- Returns:
- The median value
-
getMin
public float getMin()Gets the minimum value of the time series of the BasicSeismogram object- Specified by:
getMin
in interfaceSeismicSignal
- Returns:
- The min value
-
getMinMax
- Specified by:
getMinMax
in interfaceSeismicSignal
-
getNormalizedRMSE
-
getNsamp
public int getNsamp()- Specified by:
getNsamp
in interfaceSeismicSignal
-
getNseconds
public double getNseconds() -
getNyquistFreq
public double getNyquistFreq()Gets the Nyquist Frequency of the CssSeismogram- Specified by:
getNyquistFreq
in interfaceSeismicSignal
- Returns:
- The nyquistFreq value
-
getPeakToPeakAmplitude
public double getPeakToPeakAmplitude(double period) Gets the peakToPeakAmplitude attribute of the CssSeismogram's timeseries at the specified period. Advances a sliding window of length period through the time series a point at a time. At each position, the Peak-To-Peak range of the current window is computed. The maximum value of all these values is returned.- Specified by:
getPeakToPeakAmplitude
in interfaceSeismicSignal
- Parameters:
period
- The period in seconds at which to compute the value.- Returns:
- The maximum Peak-To-Peak value for the entire seismogram.
-
getPointsIn
- Specified by:
getPointsIn
in interfaceSeismicSignal
-
getPointsIn
public int getPointsIn(double timeRange) - Specified by:
getPointsIn
in interfaceSeismicSignal
-
getPower
public double getPower()- Specified by:
getPower
in interfaceSeismicSignal
-
getRMS
public double getRMS()Gets the RMS value of the CssSeismogram's time series.- Specified by:
getRMS
in interfaceSeismicSignal
- Returns:
- The RMS value
-
getRMSE
-
getRange
public double getRange()Gets the range of the time series- Specified by:
getRange
in interfaceSeismicSignal
- Returns:
- The statistical range for all values in the data
-
getRange
-
getSamprate
public double getSamprate()Gets the samprate attribute of the CssSeismogram object- Specified by:
getSamprate
in interfaceSeismicSignal
- Returns:
- The samprate value
-
getSegmentLength
public double getSegmentLength()Gets the segment Length in seconds of the CssSeismogram object- Specified by:
getSegmentLength
in interfaceSeismicSignal
- Returns:
- The segmentLength value
-
getSnr
public double getSnr(double pickEpochTime, double preSeconds, double postSeconds) - Specified by:
getSnr
in interfaceSeismicSignal
-
getSnr
- Specified by:
getSnr
in interfaceSeismicSignal
-
getStDev
public double getStDev()Gets the variance of the time series of the CssSeismogram object- Specified by:
getStDev
in interfaceSeismicSignal
- Returns:
- The variance value
-
getStatistics
-
getSubSection
Gets a float array which is a subsection of the Seismogram's time series. The start and end times must be within the Seismogram's time window or an IllegalArgument exception will be thrown- Parameters:
start
- the starting time of the subsectionend
- the ending time of the subsection- Returns:
- the subsection float[] array
-
getSubSection
-
getSubSection
Gets a float array which is a subsection of the CssSeismogram's time series. The subsection starts at time start (presumed to be within the CssSeismogram's time series) and has a length of duration.- Parameters:
start
- The starting time of the subsection.duration
- The duration in seconds of the subsection.- Returns:
- The subSection array
-
getSubSection
public float[] getSubSection(double startEpoch, double requesteduration) Gets a float array which is a subsection of the CssSeismogram's time series. The subsection starts at time start (presumed to be within the CssSeismogram's time series) and has a length of duration.- Parameters:
startEpoch
- The starting time expressed as a double epoch time.requesteduration
- The duration in seconds of the subsection.- Returns:
- The subSection array
-
getSubSection
public float[] getSubSection(double startEpoch, double requestedDuration, float[] result) -
getSubSection
public float[] getSubSection(int startIndex, int sampsRequired) Get subsection explicitly using the data indices- Parameters:
startIndex
-sampsRequired
-- Returns:
-
getSubsectionStartTime
public double getSubsectionStartTime(double startEpoch) -
getSum
public double getSum()Gets the sum of the time series values of this CssSeismogram- Specified by:
getSum
in interfaceSeismicSignal
- Returns:
- The sum of the time series values
-
getTime
Gets the start time of the CssSeismogram as a TimeT object- Specified by:
getTime
in interfaceSeismicSignal
- Returns:
- The time value
-
getTimeAsDouble
public double getTimeAsDouble()Gets the start time of the CssSeismogram as a double holding the epoch time of the start.- Specified by:
getTimeAsDouble
in interfaceSeismicSignal
- Returns:
- The CssSeismogram start epoch time value
-
getValueAt
public float getValueAt(double epochtime) Get the value at a specific point in time- Specified by:
getValueAt
in interfaceSeismicSignal
- Parameters:
epochtime
- The time expressed as a double epoch time.- Returns:
- the value at the requested time
-
getValueAt
public float getValueAt(int j) -
getVariance
public double getVariance()Gets the variance of the time series of the CssSeismogram object- Specified by:
getVariance
in interfaceSeismicSignal
- Returns:
- The variance value
-
hasFlatSegments
public boolean hasFlatSegments(int minsegmentlength) Check whether the data series has flat segments - where every element of the segment is identical- Parameters:
minsegmentlength
- the shortest number of datapoints that must be identical before it qualifies as "flat"
-
hashCode
public int hashCode() -
interpolate
public void interpolate(double newsamprate) Interpolate the data- Parameters:
newsamprate
- is the new sample rate (Hz)Note the samprate changes and the number of points in the data series changes based on the new desired sample rate
-
isConstant
public boolean isConstant() -
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceSeismicSignal
-
isSubset
-
multiply
-
normalize
public void normalize()- Specified by:
normalize
in interfaceSeismicSignal
-
normalize
Normalize all the seismograms Usage : 'normalize', 'normalize (value)' or 'normalize (type)' where (type) is 'mean' 'min' or 'max' Traces are initially demeaned then scaled default - each trace is multiplied by abs(1/extremum) value - where value is a number - the traces are normalized so that the absolute value of the extremum equals the value entered mean - traces are multiplied by the mean of the absolute values of the trace min - traces are multiplied by -1/min max - traces are multiplied by 1/max- Parameters:
norm
-
-
normalize
public void normalize(double value) -
normalize
Normalize the seismogram based on String input 1. Attempt to parse as a Double valued number and use normalize(double) 2. Attempt to parse as a Norm object and use normalize(Norm) 3. do nothing if neither 1 or 2 passes- Parameters:
value
- a String containing either a number or a Norm type e.g. normalize("10") or normalize("EXTREMUM")
-
onModify
public void onModify() -
quickMedian
public double quickMedian()Computed the median in O(n) time in contrast to standard O(n lg n) time. The only tradeoff is that the median is not the average of the two center points for series with even length. Rather, the median is arbitrarily selected from amongst one of those two approximate centers.- Specified by:
quickMedian
in interfaceSeismicSignal
- Returns:
- The median or pseudo-median for even length series
-
rateIsComparable
Performs a check to see if the sample rates of two timeseries is close enough to equal.- Parameters:
other
- the other timeseries to compare this one with- Returns:
- true if the sample rates are close enough
-
removeGlitches
public void removeGlitches(double Threshhold) Remove glitches from the seismogram where glitches are defined by data that exceed a threshhold above the variance defined by a moving window
value = Math.abs((data[j] - median)); if (value GT Threshhold * Math.sqrt(variance)) replace data[j] with the median value- Specified by:
removeGlitches
in interfaceSeismicSignal
- Parameters:
Threshhold
- - the threshhold value
-
removeListener
-
removeTrend
public void removeTrend()Remove a linear trend from the time series data of this CssSeismogram.- Specified by:
removeTrend
in interfaceSeismicSignal
-
resample
public void resample(double newRate) -
reverse
public void reverse()Reverse the data series. This method is used in cross correlation routines. Note none of the times are being reset. The user must be careful to understand the implications- Specified by:
reverse
in interfaceSeismicSignal
-
reverseAt
-
scaleTo
public void scaleTo(double min, double max) - Specified by:
scaleTo
in interfaceSeismicSignal
-
setData
public void setData(float[] v) Sets the data array of the CssSeismogram object- Parameters:
v
- The new data value
-
setDataPoint
public void setDataPoint(float v, int index) Sets the value of the data at a particular point to a value- Parameters:
v
-index
-
-
setDataPoints
public void setDataPoints(float[] v, int startindex) Sets the data at a collection of points- Parameters:
v
-startindex
-
-
setMaximumRange
public void setMaximumRange(double maxRange) - Specified by:
setMaximumRange
in interfaceSeismicSignal
-
setSamprate
public void setSamprate(double samprate) - Specified by:
setSamprate
in interfaceSeismicSignal
-
setTime
Sets the time attribute of the CssSeismogram object- Parameters:
v
- The new time value
-
shift
Shifts the values of this time series by the number of specified samples and returns the result as a new time series. this method also modifies the origin time of the new time series as appropriate.- Parameters:
samples
- The number of samples to shift. a value less than 0 shifts data left, and greater than 0 shifts data right.- Returns:
- a new timeseries, based on this one, shifted by the specified number of samples. The new time series will have a length different than that of this instance.
-
shift
Shifts the values of this time series by the number of specified samples and returns the result as a new time series. this method also modifies the origin time of the new time series as appropriate.- Parameters:
samples
- The number of samples to shift. a value less than 0 shifts data left, and greater than 0 shifts data right.keepLength
- should the original time series data length remain unchanged regardless of shift?- Returns:
- a new timeseries, based on this one, shifted by the specified number of samples
-
stretch
public void stretch(double interpolationfactor) -
subtract
-
toString
-
triangleTaper
public void triangleTaper(double taperPercent) - Specified by:
triangleTaper
in interfaceSeismicSignal
-
trim
-
trimTo
-
union
- Throws:
MergeException
-
doNormalize
protected void doNormalize(double scale) -
intersect
-
getZeroTimeOffsetSeconds
public double getZeroTimeOffsetSeconds()Description copied from interface:SeismicSignal
This method returns what the zero time offset of the series is for this segment. This should define where your time axis should set 0 at in the trace relative to the begin time of the segment.- Specified by:
getZeroTimeOffsetSeconds
in interfaceSeismicSignal
- Returns:
- double Offset defining time in seconds that the segment should be shifted.
-
setZeroTimeOffsetSeconds
public void setZeroTimeOffsetSeconds(double timeOffset) Description copied from interface:SeismicSignal
This method sets what the zero time offset of the series is for this segment. This should define where your time axis should set 0 at in the trace relative to the begin time of the segment.- Specified by:
setZeroTimeOffsetSeconds
in interfaceSeismicSignal
- Parameters:
timeOffset
- Offset defining time in seconds that the segment should be shifted.
-