org.opensha.sha.magdist
Class GutenbergRichterMagFreqDist

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.GutenbergRichterMagFreqDist
All Implemented Interfaces:
Serializable, Iterable<Point2D>, DiscretizedFunc, XY_DataSet, Named, PlotElement, XMLSaveable, IncrementalMagFreqDistAPI

public class GutenbergRichterMagFreqDist
extends IncrementalMagFreqDist

Title: GutenbergRichterMagFreqDist.java

Description: This is a truncated incremental Gutenberg-Richter distribution. Note that magLower and magUpper must exactly equal one of the descrete x-axis values.

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

Field Summary
static String NAME
           
 
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
GutenbergRichterMagFreqDist(double bValue, double totCumRate, double min, double max, int num)
          constructor: this is sameas parent class constructor
GutenbergRichterMagFreqDist(double min, double max, int num)
          constructor: this is sameas parent class constructor
GutenbergRichterMagFreqDist(double min, int num, double delta)
          constructor : this is same as parent class constructor
GutenbergRichterMagFreqDist(double min, int num, double delta, double totMoRate, double bValue)
          constructor: this constructor assumes magLower is minX and magUpper to be maxX
GutenbergRichterMagFreqDist(double min, int num, double delta, double magLower, double magUpper, double totMoRate, double bValue)
          constructor:
 
Method Summary
 double get_bValue()
           
 String getDefaultInfo()
          this function returns String for drawing Legen in JFreechart
 String getDefaultName()
          returns the name of this class
 double getMagLower()
           
 double getMagUpper()
           
 double getTotCumRate()
           
static void main(String[] args)
          this method (defined in parent) is deactivated here (name is finalized) public void setName(String name) throws UnsupportedOperationException{ throw new UnsupportedOperationException("setName not allowed for MagFreqDist."); } this method (defined in parent) is deactivated here (name is finalized) public void setInfo(String info)throws UnsupportedOperationException{ throw new UnsupportedOperationException("setInfo not allowed for MagFreqDist."); }
 void setAllButMagUpper(double magLower, double totMoRate, double totCumRate, double bValue, boolean relaxTotMoRate)
          Set All but magUpper
 void setAllButTotCumRate(double magLower, double magUpper, double totMoRate, double bValue)
          Set all values except Cumulative Rate
 void setAllButTotMoRate(double magLower, double magUpper, double totCumRate, double bValue)
          Set all values except total moment rate
 
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
Constructor Detail

GutenbergRichterMagFreqDist

public GutenbergRichterMagFreqDist(double min,
                                   int num,
                                   double delta)
                            throws InvalidRangeException
constructor : this is same as parent class constructor

Parameters:
min -
num -
delta - using the parameters we call the parent class constructors to initialise the parent class variables
Throws:
InvalidRangeException

GutenbergRichterMagFreqDist

public GutenbergRichterMagFreqDist(double min,
                                   double max,
                                   int num)
                            throws XY_DataSetException,
                                   InvalidRangeException
constructor: this is sameas parent class constructor

Parameters:
min -
max -
num - using the min, max and num we calculate the delta
Throws:
XY_DataSetException
InvalidRangeException

GutenbergRichterMagFreqDist

public GutenbergRichterMagFreqDist(double bValue,
                                   double totCumRate,
                                   double min,
                                   double max,
                                   int num)
                            throws XY_DataSetException,
                                   InvalidRangeException
constructor: this is sameas parent class constructor

Parameters:
min -
max -
num - using the min, max and num we calculate the delta
Throws:
XY_DataSetException
InvalidRangeException

GutenbergRichterMagFreqDist

public GutenbergRichterMagFreqDist(double min,
                                   int num,
                                   double delta,
                                   double totMoRate,
                                   double bValue)
                            throws Point2DException
constructor: this constructor assumes magLower is minX and magUpper to be maxX

Parameters:
min -
num -
delta -
totMoRate - : total Moment Rate
bValue - : b value for this distribution
Throws:
Point2DException

GutenbergRichterMagFreqDist

public GutenbergRichterMagFreqDist(double min,
                                   int num,
                                   double delta,
                                   double magLower,
                                   double magUpper,
                                   double totMoRate,
                                   double bValue)
                            throws InvalidRangeException,
                                   Point2DException
constructor:

Parameters:
min -
num -
delta -
magLower - : lowest magnitude that has non zero rate
magUpper - : highest magnitude that has non zero rate
totMoRate - : total Moment Rate
bValue - : b value for this distribution
Throws:
InvalidRangeException
Point2DException
Method Detail

setAllButTotCumRate

public void setAllButTotCumRate(double magLower,
                                double magUpper,
                                double totMoRate,
                                double bValue)
                         throws Point2DException
Set all values except Cumulative Rate

Parameters:
magLower - : lowest magnitude that has non zero rate
magUpper - : highest magnitude that has non zero rate
totMoRate - : Total Moment Rate
bValue - : b Value
Throws:
Point2DException

setAllButTotMoRate

public void setAllButTotMoRate(double magLower,
                               double magUpper,
                               double totCumRate,
                               double bValue)
                        throws Point2DException
Set all values except total moment rate

Parameters:
magLower - : lowest magnitude that has non zero rate
magUpper - : highest magnitude that has non zero rate
totCumRate - : Total Cumulative Rate
bValue - : b value
Throws:
Point2DException

setAllButMagUpper

public void setAllButMagUpper(double magLower,
                              double totMoRate,
                              double totCumRate,
                              double bValue,
                              boolean relaxTotMoRate)
                       throws XY_DataSetException,
                              Point2DException
Set All but magUpper

Parameters:
magLower - : lowest magnitude that has non zero rate
totMoRate - : total moment rate
totCumRate - : total cumulative rate
bValue - : b value
relaxTotMoRate - : It is "true" or "false". It accounts for tha fact that due to magnitude discretization, the specified totCumRate and totMoRate cannot both be satisfied simultaneously. if it is false, it means that match totMoRate exactly else it matches totCumRate exactly
Throws:
XY_DataSetException
Point2DException

getTotCumRate

public double getTotCumRate()
                     throws Point2DException
Returns:
the cumulative rate at magLower
Throws:
Point2DException

get_bValue

public double get_bValue()
Returns:
th bValue for this distribution

getMagLower

public double getMagLower()
Returns:
the magLower : lowest magnitude that has non zero rate

getMagUpper

public double getMagUpper()
Returns:
the magUpper : highest magnitude that has non zero rate

getDefaultName

public String getDefaultName()
returns the name of this class

Overrides:
getDefaultName in class IncrementalMagFreqDist
Returns:

getDefaultInfo

public String getDefaultInfo()
                      throws Point2DException
this function returns String for drawing Legen in JFreechart

Overrides:
getDefaultInfo in class IncrementalMagFreqDist
Returns:
: returns the String which is needed for Legend in graph
Throws:
Point2DException

main

public static void main(String[] args)
this method (defined in parent) is deactivated here (name is finalized) public void setName(String name) throws UnsupportedOperationException{ throw new UnsupportedOperationException("setName not allowed for MagFreqDist."); } this method (defined in parent) is deactivated here (name is finalized) public void setInfo(String info)throws UnsupportedOperationException{ throw new UnsupportedOperationException("setInfo not allowed for MagFreqDist."); }