org.opensha.sha.calc.disaggregation
Class DisaggregationCalculator

java.lang.Object
  extended by org.opensha.sha.calc.disaggregation.DisaggregationCalculator
All Implemented Interfaces:
DisaggregationCalculatorAPI

public class DisaggregationCalculator
extends Object
implements DisaggregationCalculatorAPI

Title: DisaggregationCalculator

Description: This class disaggregates a hazard curve based on the input parameters imr, site and eqkRupforecast. See Bazzurro and Cornell (1999, Bull. Seism. Soc. Am., 89, pp. 501-520) for a complete discussion of disaggregation. The Dbar computed here is for rupture distance. This assumes all sources in the ERF are Poissonian.

Copyright: Copyright (c) 2002

Company:

Version:
1.0
Author:
Ned Field

Field Summary
protected static String C
           
protected static boolean D
           
static String DISAGGREGATION_PLOT_JPG_NAME
           
static String DISAGGREGATION_PLOT_NAME
           
static String DISAGGREGATION_PLOT_PDF_NAME
           
static String DISAGGREGATION_PLOT_PNG_NAME
           
static String OPENSHA_SERVLET_URL
           
 
Constructor Summary
DisaggregationCalculator()
          creates the DisaggregationCalculator object
 
Method Summary
static ArrayList<String> createGMTScriptForDisaggregationPlot(DisaggregationPlotData data, String dir)
          Creates the GMT_Script lines
 boolean disaggregate(double iml, Site site, Map<TectonicRegionType,ScalarIMR> imrMap, AbstractERF eqkRupForecast, ParameterList calcParams)
          this function performs the disaggregation.
 boolean disaggregate(double iml, Site site, ScalarIMR imr, AbstractERF eqkRupForecast, ParameterList calcParams)
          this function performs the disaggregation.
 boolean done()
          Checks to see if disaggregation calculation for the selected site have been completed.
 String getBinData()
          Returns the Bin Data in the String format
 int getCurrRuptures()
          gets the number of current rupture being processed
 DisaggregationPlotData getDisaggPlotData()
           
 String getDisaggregationPlotUsingServlet(String metadata)
          Gets the plot image for the Disaggregation
 String getDisaggregationSourceInfo()
          Returns the disaggregated source list with following info ( in each line) 1)Source Id as given by OpenSHA 2)Name of the Source 3)Rate Contributed by that source 4)Percentage Contribution of the source in Hazard at the site.
 String getMeanAndModeInfo()
           
 int getTotRuptures()
          gets the total number of ruptures
 void setDistanceRange(double[] distBinEdges)
          Setting up the Distance Range
 void setDistanceRange(double minDist, int numDist, double deltaDist)
          Setting up the Distance Range
 void setMagRange(double[] magBinEdges)
          Setting up the Mag Range
 void setMagRange(double minMag, int numMags, double deltaMag)
          Setting up the Mag Range
 void setMaxZAxisForPlot(double zMax)
          Sets the Max Z Axis Range value for plotting purposes
 void setNumSourcestoShow(int numSources)
          Sets the number of sources to be shown in the Disaggregation.
 void setShowDistances(boolean showDistances)
          Enables/disables calculation and display of source distances in source data list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C

protected static final String C
See Also:
Constant Field Values

D

protected static final boolean D
See Also:
Constant Field Values

OPENSHA_SERVLET_URL

public static final String OPENSHA_SERVLET_URL

DISAGGREGATION_PLOT_NAME

public static final String DISAGGREGATION_PLOT_NAME
See Also:
Constant Field Values

DISAGGREGATION_PLOT_JPG_NAME

public static final String DISAGGREGATION_PLOT_JPG_NAME
See Also:
Constant Field Values

DISAGGREGATION_PLOT_PNG_NAME

public static final String DISAGGREGATION_PLOT_PNG_NAME
See Also:
Constant Field Values

DISAGGREGATION_PLOT_PDF_NAME

public static final String DISAGGREGATION_PLOT_PDF_NAME
See Also:
Constant Field Values
Constructor Detail

DisaggregationCalculator

public DisaggregationCalculator()
creates the DisaggregationCalculator object

Throws:
IOException
Method Detail

disaggregate

public boolean disaggregate(double iml,
                            Site site,
                            ScalarIMR imr,
                            AbstractERF eqkRupForecast,
                            ParameterList calcParams)
this function performs the disaggregation. Returns true if it was succesfully able to disaggregate above a given IML else return false

Specified by:
disaggregate in interface DisaggregationCalculatorAPI
Parameters:
iml: - the intensity measure level to disaggregate
site: - site parameter
imr: - selected IMR object
eqkRupForecast: - selected Earthquake rup forecast
calcParams: - calculation parameters from the HazardCurveCalculator
Returns:
boolean

disaggregate

public boolean disaggregate(double iml,
                            Site site,
                            Map<TectonicRegionType,ScalarIMR> imrMap,
                            AbstractERF eqkRupForecast,
                            ParameterList calcParams)
Description copied from interface: DisaggregationCalculatorAPI
this function performs the disaggregation. Returns true if it was succesfully able to disaggregate above a given IML else return false

Specified by:
disaggregate in interface DisaggregationCalculatorAPI
Returns:
boolean

getDisaggregationSourceInfo

public String getDisaggregationSourceInfo()
Returns the disaggregated source list with following info ( in each line) 1)Source Id as given by OpenSHA 2)Name of the Source 3)Rate Contributed by that source 4)Percentage Contribution of the source in Hazard at the site.

Specified by:
getDisaggregationSourceInfo in interface DisaggregationCalculatorAPI
Returns:
String

setMagRange

public void setMagRange(double minMag,
                        int numMags,
                        double deltaMag)
Setting up the Mag Range

Specified by:
setMagRange in interface DisaggregationCalculatorAPI
Parameters:
minMag - double - this is the center of the first bin
numMags - int
deltaMag - double

setMagRange

public void setMagRange(double[] magBinEdges)
Setting up the Mag Range

Parameters:
dmagBinEdges - - a double array of the distance-bin edges (in correct order, from low to high)

setDistanceRange

public void setDistanceRange(double minDist,
                             int numDist,
                             double deltaDist)
Setting up the Distance Range

Specified by:
setDistanceRange in interface DisaggregationCalculatorAPI
Parameters:
minDist - double - this is the center of the first bin
numDist - int
deltaDist - double

setDistanceRange

public void setDistanceRange(double[] distBinEdges)
Setting up the Distance Range

Specified by:
setDistanceRange in interface DisaggregationCalculatorAPI
Parameters:
distBinEdges - - a double array of the distance-bin edges (in correct order, from low to high)

setMaxZAxisForPlot

public void setMaxZAxisForPlot(double zMax)
Sets the Max Z Axis Range value for plotting purposes

Specified by:
setMaxZAxisForPlot in interface DisaggregationCalculatorAPI
Parameters:
zMax -

getCurrRuptures

public int getCurrRuptures()
gets the number of current rupture being processed

Specified by:
getCurrRuptures in interface DisaggregationCalculatorAPI
Returns:

getTotRuptures

public int getTotRuptures()
gets the total number of ruptures

Specified by:
getTotRuptures in interface DisaggregationCalculatorAPI
Returns:

done

public boolean done()
Checks to see if disaggregation calculation for the selected site have been completed.

Specified by:
done in interface DisaggregationCalculatorAPI
Returns:

getMeanAndModeInfo

public String getMeanAndModeInfo()
Specified by:
getMeanAndModeInfo in interface DisaggregationCalculatorAPI
Returns:
resultant disaggregation in a String format.

getBinData

public String getBinData()
Returns the Bin Data in the String format

Specified by:
getBinData in interface DisaggregationCalculatorAPI
Returns:
String

getDisaggregationPlotUsingServlet

public String getDisaggregationPlotUsingServlet(String metadata)
Gets the plot image for the Disaggregation

Specified by:
getDisaggregationPlotUsingServlet in interface DisaggregationCalculatorAPI
Parameters:
metadata - String
Returns:
String

getDisaggPlotData

public DisaggregationPlotData getDisaggPlotData()

createGMTScriptForDisaggregationPlot

public static ArrayList<String> createGMTScriptForDisaggregationPlot(DisaggregationPlotData data,
                                                                     String dir)
Creates the GMT_Script lines


setNumSourcestoShow

public void setNumSourcestoShow(int numSources)
Sets the number of sources to be shown in the Disaggregation.

Specified by:
setNumSourcestoShow in interface DisaggregationCalculatorAPI
Parameters:
numSources - int

setShowDistances

public void setShowDistances(boolean showDistances)
Description copied from interface: DisaggregationCalculatorAPI
Enables/disables calculation and display of source distances in source data list.

Specified by:
setShowDistances in interface DisaggregationCalculatorAPI