org.opensha.sha.magdist
Class YC_1985_CharMagFreqDist

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

public class YC_1985_CharMagFreqDist
extends IncrementalMagFreqDist

Title: YC_1985_CharMagFreqDist.java

Description: This is the "characteristic" magnitude-frequency distribution defined by Youngs and Coppersmith (1985, Bull. Seism. Soc. Am., 939-964). The distribution is Gutenberg-Richter between magLower and magPrime, and constant between (magUpper-deltaMagChar) and magUpper with a rate equal to that of the Gutenberg-Richter part at (magPrime-deltaMagPrime). See their figure 10 for a graphical explanation of these parameters. Note that magLower, magUpper, magPrime, magUpper-deltaMagChar, and magPrime-deltaMagPrime must all be exactly equal one of the descrete x-axis points.

Version:
1.0
Author:
Edward H. Field Date: Sept. 26, 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
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
YC_1985_CharMagFreqDist(double min, double max, int num)
          Constructor: this is the same as the parent class constructor
YC_1985_CharMagFreqDist(double min, int num, double delta)
          Constructor : this is the same as the parent class constructor
YC_1985_CharMagFreqDist(double min, int num, double delta, double deltaMagChar, double magPrime, double deltaMagPrime, double bValue, double totMoRate)
          Constructor: this constructor assumes magLower is minX and magUpper to be maxX
YC_1985_CharMagFreqDist(double min, int num, double delta, double magLower, double magUpper, double deltaMagChar, double magPrime, double deltaMagPrime, double bValue, double totMoRate)
          Constructor: this is the full constructor /** Constructor: this constructor assumes magLower is minX and magUpper to be maxX
 
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 getDeltaMagChar()
           
 double getDeltaMagPrime()
           
 double getMagLower()
           
 double getMagPrime()
           
 double getMagUpper()
           
 double getTotCumRate()
           
 void set(double x, double y)
          Overriden to prevent value setting.
 void set(int index, double y)
          Overriden to prevent value setting.
 void set(Point2D point)
          Overriden to prevent value setting.
 void setAllButTotCharRate(double magLower, double magUpper, double deltaMagChar, double magPrime, double deltaMagPrime, double bValue, double totMoRate)
          Update distribution (using total moment rate rather than the total rate of char events)
 void setAllButTotMoRate(double magLower, double magUpper, double deltaMagChar, double magPrime, double deltaMagPrime, double bValue, double totCharRate)
          Update distribution (using total rate of char events rather than 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, 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

YC_1985_CharMagFreqDist

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

Parameters:
min - - minimum mag of distribution
num - - number of points in distribution
delta - - discretization interval
Throws:
InvalidRangeException

YC_1985_CharMagFreqDist

public YC_1985_CharMagFreqDist(double min,
                               double max,
                               int num)
                        throws XY_DataSetException,
                               InvalidRangeException
Constructor: this is the same as the parent class constructor

Parameters:
min - - minimum mag of distribution
max - - maximum mag of distribution
num - - number of points in distribution
Throws:
XY_DataSetException
InvalidRangeException

YC_1985_CharMagFreqDist

public YC_1985_CharMagFreqDist(double min,
                               int num,
                               double delta,
                               double magLower,
                               double magUpper,
                               double deltaMagChar,
                               double magPrime,
                               double deltaMagPrime,
                               double bValue,
                               double totMoRate)
                        throws InvalidRangeException,
                               Point2DException
Constructor: this is the full constructor /** Constructor: this constructor assumes magLower is minX and magUpper to be maxX

Parameters:
min - - minimum mag of distribution
num - - number of points in distribution
delta - - discretization interval
magLower - - the lowest non-zero-rate magnitude
magUpper - - the highest non-zero-rate magnitude
deltaMagChar - - the width of the characteristic part (below magUpper)
magPrime - - the upper mag of the GR part
deltaMagPrime - - the distance below magPrime where the rate equals that over the char-rate part
bValue - - the b value
totMoRate - - the total moment rate
Throws:
InvalidRangeException
Point2DException

YC_1985_CharMagFreqDist

public YC_1985_CharMagFreqDist(double min,
                               int num,
                               double delta,
                               double deltaMagChar,
                               double magPrime,
                               double deltaMagPrime,
                               double bValue,
                               double totMoRate)
                        throws InvalidRangeException,
                               Point2DException
Constructor: this constructor assumes magLower is minX and magUpper to be maxX

Parameters:
min - - minimum mag of distribution
num - - number of points in distribution
delta - - discretization interval
deltaMagChar - - the width of the characteristic part (below magUpper)
magPrime - - the upper mag of the GR part
deltaMagPrime - - the distance below magPrime where the rate equals that over the char-rate part
bValue - - the b value
totMoRate - - the total moment rate
Throws:
InvalidRangeException
Point2DException
Method Detail

setAllButTotCharRate

public void setAllButTotCharRate(double magLower,
                                 double magUpper,
                                 double deltaMagChar,
                                 double magPrime,
                                 double deltaMagPrime,
                                 double bValue,
                                 double totMoRate)
                          throws Point2DException,
                                 InvalidRangeException
Update distribution (using total moment rate rather than the total rate of char events)

Parameters:
magLower - - the lowest non-zero-rate magnitude
magUpper - - the highest non-zero-rate magnitude
deltaMagChar - - the width of the characteristic part (below magUpper)
magPrime - - the upper mag of the GR part
deltaMagPrime - - the distance below magPrime where the rate equals that over the char-rate part
bValue - - the b value
totMoRate - - the total moment rate
Throws:
Point2DException
InvalidRangeException

setAllButTotMoRate

public void setAllButTotMoRate(double magLower,
                               double magUpper,
                               double deltaMagChar,
                               double magPrime,
                               double deltaMagPrime,
                               double bValue,
                               double totCharRate)
                        throws Point2DException,
                               InvalidRangeException
Update distribution (using total rate of char events rather than total moment rate)

Parameters:
magLower - - the lowest non-zero-rate magnitude
magUpper - - the highest non-zero-rate magnitude
deltaMagChar - - the width of the characteristic part (below magUpper)
magPrime - - the upper mag of the GR part
deltaMagPrime - - the distance below magPrime where the rate equals that over the char-rate part
bValue - - the b value
totCharRate - - the total rate of characteristic events (cum rate at magUpper-deltaMagChar).
Throws:
Point2DException
InvalidRangeException

set

public void set(Point2D point)
Overriden to prevent value setting.

Specified by:
set in interface XY_DataSet
Overrides:
set in class EvenlyDiscretizedFunc
Throws:
UnsupportedOperationException

set

public void set(double x,
                double y)
Overriden to prevent value setting.

Specified by:
set in interface XY_DataSet
Overrides:
set in class EvenlyDiscretizedFunc
Throws:
UnsupportedOperationException

set

public void set(int index,
                double y)
Overriden to prevent value setting.

Specified by:
set in interface XY_DataSet
Overrides:
set in class EvenlyDiscretizedFunc
Throws:
UnsupportedOperationException

getTotCumRate

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

get_bValue

public double get_bValue()
Returns:
the 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

getMagPrime

public double getMagPrime()
Returns:
the magPrime

getDeltaMagPrime

public double getDeltaMagPrime()
Returns:
the deltaMagPrime

getDeltaMagChar

public double getDeltaMagChar()
Returns:
the deltaMagChar

getDefaultName

public String getDefaultName()
returns the name of this class

Overrides:
getDefaultName in class IncrementalMagFreqDist
Returns:

getDefaultInfo

public String getDefaultInfo()
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