org.opensha.sha.magdist
Class ArbIncrementalMagFreqDist
java.lang.Object
org.opensha.commons.data.function.AbstractXY_DataSet
org.opensha.commons.data.function.AbstractDiscretizedFunc
org.opensha.commons.data.function.EvenlyDiscretizedFunc
org.opensha.sha.magdist.IncrementalMagFreqDist
org.opensha.sha.magdist.ArbIncrementalMagFreqDist
- All Implemented Interfaces:
- Serializable, Iterable<Point2D>, DiscretizedFunc, XY_DataSet, Named, PlotElement, XMLSaveable, IncrementalMagFreqDistAPI
public class ArbIncrementalMagFreqDist
- extends IncrementalMagFreqDist
Title: ArbIncrementalMagFreqDist.java
Description: This class allows the user to create a Arbitrary
IncrementalMagFreqDist.
- Version:
- 1.0
- Author:
- Nitin Gupta , Ned Field
- See Also:
- Serialized Form
| Methods inherited from class org.opensha.sha.magdist.IncrementalMagFreqDist |
compute_bValue, compute_bValue, deepClone, findMagJustAboveMomentRate, getCumMomentRateDist, getCumRate, getCumRate, getCumRateDist, getCumRateDistWithOffset, getIncrRate, getIncrRate, getInfo, getMaxMagWithNonZeroRate, getMinMagWithNonZeroRate, getMomentRate, getMomentRate, getMomentRateDist, getName, getTotalIncrRate, getTotalMomentRate, normalizeByTotalRate, scaleToCumRate, scaleToCumRate, scaleToIncrRate, scaleToIncrRate, scaleToTotalMomentRate, setValuesAboveMomentRateToZero, zeroAboveMag, zeroAtAndAboveMag |
| Methods inherited from class org.opensha.commons.data.function.EvenlyDiscretizedFunc |
add, add, areAllXValuesInteger, clear, equalXAndYValues, equalXValues, get, getClosestXIndex, getClosestY, getDelta, getFirstInterpolatedX_inLogXLogYDomain, getFirstInterpolatedX, getIndex, getInterpolatedY_inLogXLogYDomain, getInterpolatedY_inLogYDomain, getInterpolatedY, getMaxX, getMaxY, getMetadataString, getMinX, getMinY, getNum, getPointsIterator, getX, getXIndex, getY, getY, hasPoint, hasPoint, set, set, set, set, set, toString, withinTolerance |
| Methods inherited from class org.opensha.commons.data.function.AbstractDiscretizedFunc |
calcSumOfY_Vals, equals, fromXMLMetadata, getTolerance, loadFuncFromSimpleFile, loadFuncFromSimpleFile, scale, setTolerance, toXMLMetadata, toXMLMetadata, writeSimpleFuncFile, writeSimpleFuncFile |
| Methods inherited from class org.opensha.commons.data.function.AbstractXY_DataSet |
getClosestX, getDatasetsToPlot, getPlotNumColorList, getXAxisName, getXValuesIterator, getYAxisName, getYValuesIterator, iterator, setInfo, setName, setXAxisName, setYAxisName, xValues, yValues |
| Methods inherited from interface org.opensha.commons.data.function.XY_DataSet |
getClosestX, getXAxisName, getXValuesIterator, getYAxisName, getYValuesIterator, setInfo, setName, setXAxisName, setYAxisName, xValues, yValues |
NAME
public static String NAME
ArbIncrementalMagFreqDist
public ArbIncrementalMagFreqDist(double min,
double max,
int num)
throws XY_DataSetException,
InvalidRangeException
- Throws:
XY_DataSetException
InvalidRangeException
ArbIncrementalMagFreqDist
public ArbIncrementalMagFreqDist(double min,
int num,
double delta)
throws XY_DataSetException,
InvalidRangeException
- Throws:
XY_DataSetException
InvalidRangeException
setResampledMagFreqDist
public void setResampledMagFreqDist(DiscretizedFunc func,
boolean preserveRates)
- This sets each mag & rate value here according to the function passed in. Each x-axis value of
the function passed in is rounded to the nearest x-axis value here, and rates are summed if more
than one x-axis value of the input function fall on the same x-axis value here. X-axis values from
the input function that are out of the bounds of the present MFD are ignored. Zeros will be present
at any x-axis values where there wasn't a corresponding value in the input function.
If the preserveRates boolean is false, then the moment rate of each point
is preserved (although the total moment rates of the two functions may differ if any
endpoints were ignored). Otherwise total rates are preserved (assuming no endpoints are
ignored). Discretization of this MFD should be same (or more densely discretized) than
that passed in or significant biases will result from the rounding (due to ??? rules for
values exactly halfway between).
- Parameters:
func - the new Magnitude Frequency distribution to be addedpreserveRates - specifies whether to preserve rates or moment rates
setCumRateDist
public void setCumRateDist(DiscretizedFunc cumFunc)
- This sets incremental rate according to the cumulative rates passed in.
- Parameters:
cumFunc -
addResampledMagRate
public void addResampledMagRate(double mag,
double rate,
boolean preserveRates)
- This and adds the rate & mag passed in to the MFD after rounding to the nearest x-axis
value (ignoring those out of range). If the preserveRates boolean is false, then the moment
rate of the point is preserved (assuming it's in range). Otherwise the rate of that point
is preserved. Discretization of this MFD should be same (or more densely discretized) than
that passed in or significant biases will result from the rounding (due to ??? rules for
values exactly halfway between).
- Parameters:
mag - & rate to be addedpreserveRates - specifies whether to preserve rates or moment rates
getDefaultName
public String getDefaultName()
- returns the name of the class
- Overrides:
getDefaultName in class IncrementalMagFreqDist
- Returns:
getDefaultInfo
public String getDefaultInfo()
- Returns the default Info String for the Distribution
- Overrides:
getDefaultInfo in class IncrementalMagFreqDist
- Returns:
- String