|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectgov.usgs.earthquake.event.EventSanityCheck
public class EventSanityCheck
Compare 2 versions of the same event to see if it has changed significantly and requires human inspection.
| Field Summary | |
|---|---|
static java.math.BigDecimal |
DEPTH_THRESHOLD
|
static java.math.BigDecimal |
DISTANCE_THRESHOLD
|
static java.math.BigDecimal |
MAGNITUDE_THRESHOLD
|
static java.math.BigDecimal |
TIME_THRESHOLD
|
| Constructor Summary | |
|---|---|
EventSanityCheck()
Default constructor with values as follows: |
|
EventSanityCheck(java.math.BigDecimal timeThreshold,
java.math.BigDecimal distanceThreshold,
java.math.BigDecimal depthThreshold,
java.math.BigDecimal magnitudeThreshold)
Constructor with configurable thresholds. |
|
| Method Summary | |
|---|---|
java.math.BigDecimal |
getDepthThreshold()
|
double |
getDistance(EventComparison c)
Calculate the "euclidean" distance between 2 events. |
java.math.BigDecimal |
getDistanceThreshold()
|
java.math.BigDecimal |
getMagnitudeThreshold()
|
java.math.BigDecimal |
getTimeThreshold()
|
java.lang.String |
isMatch(EventComparison c)
Compares two events and returns a string of errors if they are not similar enough or null otherwise. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.math.BigDecimal DISTANCE_THRESHOLD
public static final java.math.BigDecimal MAGNITUDE_THRESHOLD
public static final java.math.BigDecimal DEPTH_THRESHOLD
public static final java.math.BigDecimal TIME_THRESHOLD
| Constructor Detail |
|---|
public EventSanityCheck()
TIME_THRESHOLD = 5s DISTANCE_THRESHOLD = 30km DEPTH_THRESHOLD = 30km MAGNITUDE_THRESHOLD = .4
public EventSanityCheck(java.math.BigDecimal timeThreshold,
java.math.BigDecimal distanceThreshold,
java.math.BigDecimal depthThreshold,
java.math.BigDecimal magnitudeThreshold)
timeThreshold - distanceThreshold - depthThreshold - magnitudeThreshold - | Method Detail |
|---|
public java.lang.String isMatch(EventComparison c)
c - comparison to test.
public double getDistance(EventComparison c)
sqrt((distance / distanceThreshold) ˆ 2
+ (magnitudeDifference / magnitudeThreshold) ˆ 2
+ (depthDifference / depthThreshold) ˆ 2
+ (timeDifference / timeThreshold) ˆ 2)
c -
public java.math.BigDecimal getTimeThreshold()
public java.math.BigDecimal getDistanceThreshold()
public java.math.BigDecimal getDepthThreshold()
public java.math.BigDecimal getMagnitudeThreshold()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||