Package edu.gsu.cs.dmlab.interpolation
Class BaseInterpolation
- java.lang.Object
-
- edu.gsu.cs.dmlab.interpolation.BaseInterpolation
-
- Direct Known Subclasses:
STArealPolygonInterpolator
,STComplexPolygonInterpolator
,STFilamentPolygonInterpolator
,STMBRInterpolator
public abstract class BaseInterpolation extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected ITemporalAligner
aligner
protected IInterpolationFactory
factory
protected org.joda.time.Duration
step
-
Constructor Summary
Constructors Constructor Description BaseInterpolation(IInterpolationFactory factory, ITemporalAligner aligner, org.joda.time.Duration step, String derivedName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ISTInterpolationEvent
createInterpolatedSTEvent(org.joda.time.DateTime startTime, org.joda.time.DateTime endTime, EventType type, org.locationtech.jts.geom.Coordinate[] i_coordinates)
This method is used to produce and verify the polygon of an event with the input data.protected List<ISTInterpolationEvent>
interpolateBetween(ISTInterpolationEvent first, ISTInterpolationEvent second)
Interpolates new event reports between the two reports that are passed in and returns a list of the interpolated polygon representations.protected abstract List<ISTInterpolationEvent>
interpolateBetweenAlignedNoCopy(ISTInterpolationEvent first, ISTInterpolationEvent second)
This method assumes that the events are already aligned and that it is not supposed to add them to the results.protected ISTInterpolationTrajectory
interpolateTrajectory(ISTInterpolationTrajectory inTrajectory)
Interpolates new event reports between the reports contained within the input trajectory and returns a new trajectory object with the new data.protected double
linearInterpolate(double x_0, double x_n, double factor)
Linearly interpolates a 1D variable (between x_0 and x_n).protected ISTInterpolationEvent
projectEventBack(ISTInterpolationEvent ev, org.joda.time.DateTime time)
Method projects an event back using the approximate differential rotation of the sunprotected ISTInterpolationEvent
projectEventForward(ISTInterpolationEvent ev, org.joda.time.DateTime time)
Method projects an event forward using the approximate differential rotation of the sun
-
-
-
Field Detail
-
factory
protected IInterpolationFactory factory
-
aligner
protected ITemporalAligner aligner
-
step
protected org.joda.time.Duration step
-
-
Constructor Detail
-
BaseInterpolation
public BaseInterpolation(IInterpolationFactory factory, ITemporalAligner aligner, org.joda.time.Duration step, String derivedName)
-
-
Method Detail
-
interpolateBetweenAlignedNoCopy
protected abstract List<ISTInterpolationEvent> interpolateBetweenAlignedNoCopy(ISTInterpolationEvent first, ISTInterpolationEvent second)
This method assumes that the events are already aligned and that it is not supposed to add them to the results.- Parameters:
first
- The first event to be used for interpolation betweensecond
- The second event to be used for interpolation between- Returns:
- A list of event reports that were created as a
-
createInterpolatedSTEvent
protected abstract ISTInterpolationEvent createInterpolatedSTEvent(org.joda.time.DateTime startTime, org.joda.time.DateTime endTime, EventType type, org.locationtech.jts.geom.Coordinate[] i_coordinates)
This method is used to produce and verify the polygon of an event with the input data.- Parameters:
startTime
- The start time of the eventendTime
- The end time of the eventtype
- The type of the eventi_coordinates
- The coordinates of the polygon to use in the event- Returns:
-
interpolateTrajectory
protected ISTInterpolationTrajectory interpolateTrajectory(ISTInterpolationTrajectory inTrajectory)
Interpolates new event reports between the reports contained within the input trajectory and returns a new trajectory object with the new data. The original event reports are copied and temporally aligned with a epoch and a set cadence rate. The original trajectory shall remain unedited.- Parameters:
inTrajectory
- The input trajectory that is to be interpolated.- Returns:
- An interpolated trajectory that is a representation of the input if it had reports at the desired cadence rate.
-
interpolateBetween
protected List<ISTInterpolationEvent> interpolateBetween(ISTInterpolationEvent first, ISTInterpolationEvent second)
Interpolates new event reports between the two reports that are passed in and returns a list of the interpolated polygon representations. The original event reports are copied to be the first and last elements in the returned list. They are also temporally aligned with an epoch and a set cadence rate. The original objects shall remain unedited.- Parameters:
first
- The first element to interpolate betweensecond
- The end element to interpolate between- Returns:
- A list of interpolated polygon objects between the two input objects
-
projectEventForward
protected ISTInterpolationEvent projectEventForward(ISTInterpolationEvent ev, org.joda.time.DateTime time)
Method projects an event forward using the approximate differential rotation of the sun- Parameters:
ev
- The event to project forwardtime
- The new time to project the location of the event at- Returns:
- A new interpolated event projected forward in time
-
projectEventBack
protected ISTInterpolationEvent projectEventBack(ISTInterpolationEvent ev, org.joda.time.DateTime time)
Method projects an event back using the approximate differential rotation of the sun- Parameters:
ev
- The event to project backwardstime
- The new time to project the location of the event at- Returns:
- A new interpolated event project back in time
-
linearInterpolate
protected double linearInterpolate(double x_0, double x_n, double factor)
Linearly interpolates a 1D variable (between x_0 and x_n). factor is the step size Say you have x_0 = 1, x_n = 11, factor=0.4, your interpolated result will be 5- Parameters:
x_0
- - minimum boundx_n
- - maximum boundfactor
- - the factor of linear interpolation (factor must be between 0 and 1)- Returns:
- - interpolated result
-
-