org.opensha.sha.magdist
Class SingleMagFreqDist

java.lang.Object
  extended by org.opensha.commons.data.function.AbstractXY_DataSet
      extended by org.opensha.commons.data.function.AbstractDiscretizedFunc
          extended by org.opensha.commons.data.function.EvenlyDiscretizedFunc
              extended by org.opensha.sha.magdist.IncrementalMagFreqDist
                  extended by org.opensha.sha.magdist.SingleMagFreqDist
All Implemented Interfaces:
Serializable, Iterable<Point2D>, DiscretizedFunc, XY_DataSet, Named, PlotElement, XMLSaveable, IncrementalMagFreqDistAPI

public class SingleMagFreqDist
extends IncrementalMagFreqDist

Title: SingleMagFreqDist

Description: This has only a single magnitude with a non-zero rate. Note that this magnitude must equal one of the descrete x-axis points.

Version:
1.0
Author:
:Nitin Gupta Date:Aug,8,2002
See Also:
Serialized Form

Field Summary
static String NAME
          todo variables
 
Fields inherited from class org.opensha.sha.magdist.IncrementalMagFreqDist
defaultInfo, defaultName
 
Fields inherited from class org.opensha.commons.data.function.EvenlyDiscretizedFunc
C, delta, first, maxX, minX, num, points
 
Fields inherited from class org.opensha.commons.data.function.AbstractDiscretizedFunc
tolerance, XML_METADATA_NAME, XML_METADATA_POINT_NAME, XML_METADATA_POINTS_NAME
 
Fields inherited from class org.opensha.commons.data.function.AbstractXY_DataSet
info, name, xAxisName, yAxisName
 
Constructor Summary
SingleMagFreqDist(double min, double max, int num)
          Constructor
SingleMagFreqDist(double min, int num, double delta)
          Constructor
SingleMagFreqDist(double min, int num, double delta, double mag, double moRate)
          Constructor
 
Method Summary
 String getDefaultInfo()
          Returns the default Info String for the Distribution
 String getDefaultName()
          Returns the default Name for the Distribution
 double getMag()
          Gets the magnitude which has non-zero rate
 double getRate()
          returns the rate for which magnitude has non-zero rate
 void setMagAndMomentRate(double mag, double moRate)
          Sets the magnitude For this magnitude it calculates the non-zero rate from a static function getMoment of the class MomentMagCalc and moRate
 void setMagAndRate(double mag, double rate)
          sets the magnitude for non-zero rate
 void setRateAndMomentRate(double rate, double moRate, boolean relaxTotMoRate)
          sets the non-zero rate For this rate the magnitude is calculated using the static function getMag of the class MomentMagCalc and moRate.
 
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, getAllInterpolatedX, getClosestXIndex, getClosestY, getDelta, getFirstInterpolatedX_afterXindex, getFirstInterpolatedX_inLogXLogYDomain, getFirstInterpolatedX, getIndex, getInterpolatedY_inLogXLogYDomain, getInterpolatedY_inLogYDomain, getInterpolatedY, getMaxX, getMaxY, getMetadataString, getMinX, getMinY, getNum, getPointsIterator, getX, getXIndex, getXindexForMaxY, 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 class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opensha.commons.data.function.XY_DataSet
getClosestX, getXAxisName, getXValuesIterator, getYAxisName, getYValuesIterator, setInfo, setName, setXAxisName, setYAxisName, xValues, yValues
 
Methods inherited from interface org.opensha.commons.gui.plot.PlotElement
getDatasetsToPlot, getPlotNumColorList
 
Methods inherited from interface java.lang.Iterable
iterator
 

Field Detail

NAME

public static String NAME
todo variables

Constructor Detail

SingleMagFreqDist

public SingleMagFreqDist(double min,
                         int num,
                         double delta)
                  throws InvalidRangeException
Constructor

Parameters:
min -
num -
delta -
Throws:
InvalidRangeException

SingleMagFreqDist

public SingleMagFreqDist(double min,
                         double max,
                         int num)
                  throws XY_DataSetException,
                         InvalidRangeException
Constructor

Parameters:
min -
max -
num -
Throws:
XY_DataSetException
InvalidRangeException

SingleMagFreqDist

public SingleMagFreqDist(double min,
                         int num,
                         double delta,
                         double mag,
                         double moRate)
                  throws InvalidRangeException,
                         Point2DException
Constructor

Parameters:
min -
delta -
num -
mag -
moRate -
Throws:
InvalidRangeException
Point2DException
Method Detail

getRate

public double getRate()
returns the rate for which magnitude has non-zero rate

Returns:

getMag

public double getMag()
Gets the magnitude which has non-zero rate

Returns:

setMagAndRate

public void setMagAndRate(double mag,
                          double rate)
                   throws Point2DException
sets the magnitude for non-zero rate

Parameters:
mag -
rate -
Throws:
Point2DException

setMagAndMomentRate

public void setMagAndMomentRate(double mag,
                                double moRate)
                         throws Point2DException
Sets the magnitude For this magnitude it calculates the non-zero rate from a static function getMoment of the class MomentMagCalc and moRate

Parameters:
mag -
moRate -
Throws:
Point2DException

setRateAndMomentRate

public void setRateAndMomentRate(double rate,
                                 double moRate,
                                 boolean relaxTotMoRate)
                          throws Point2DException
sets the non-zero rate For this rate the magnitude is calculated using the static function getMag of the class MomentMagCalc and moRate. NOTE: this does not give the exact magnitude, but rather the closest magnitude given the discretization.

Parameters:
rate -
moRate -
Throws:
Point2DException

getDefaultName

public String getDefaultName()
Description copied from class: IncrementalMagFreqDist
Returns the default Name for the Distribution

Overrides:
getDefaultName in class IncrementalMagFreqDist
Returns:
the name of the class which was invoked by the user

getDefaultInfo

public String getDefaultInfo()
Description copied from class: IncrementalMagFreqDist
Returns the default Info String for the Distribution

Overrides:
getDefaultInfo in class IncrementalMagFreqDist
Returns:
the total information stored in the class in form of a string