org.opensha.sha.gcim.calc
Class GcimCalculator

java.lang.Object
  extended by org.opensha.sha.gcim.calc.GcimCalculator

public class GcimCalculator
extends java.lang.Object

Title: GcimCalculator

Description: This class constructs the generalised conditional intensity measure (GCIM) distributions for a given IMj=imj value from the hazard curve based on the input parameters imr, site and eqkRupforecast.

Copyright: Copyright (c) 2010

Company:

Version:
1.0 - this is a work in progress - see GCIM_thingstodo
Author:
Brendon Bradley

Field Summary
protected static java.lang.String C
           
protected static boolean D
           
 
Constructor Summary
GcimCalculator()
          This no-arg constructor sets defaults
 
Method Summary
 boolean done()
          Checks to see if GCIM calculation for the selected site have been completed.
 double[] getApproxCDFvalues()
          This method gets the Approx CDFvalues
 int getCurrIMi()
          gets the number of current IMi being processed
 boolean getGcimRealizations(int numGcimRealizations, int numIMi, java.util.ArrayList<? extends java.util.Map<TectonicRegionType,ScalarIMR>> imiAttenRels, java.util.ArrayList<java.lang.String> imiTypes, java.util.ArrayList<? extends java.util.Map<TectonicRegionType,ImCorrelationRelationship>> imijCorrRels, java.util.ArrayList<? extends java.util.Map<TectonicRegionType,ImCorrelationRelationship>> imikCorrRels, double maxDist, ArbitrarilyDiscretizedFunc magDistFilter)
          this function obtains realizations of the IMi values from the GCIM distributions.
 java.lang.String getGcimResultsString()
          This methods makes the GCIM results in a string for output to either console or external window
 boolean getMultipleGcims(int numIMi, java.util.ArrayList<? extends java.util.Map<TectonicRegionType,ScalarIMR>> imiAttenRels, java.util.ArrayList<java.lang.String> imiTypes, java.util.ArrayList<? extends java.util.Map<TectonicRegionType,ImCorrelationRelationship>> imijCorrRels, double maxDist, ArbitrarilyDiscretizedFunc magDistFilter)
          this function obtains the GCIM distributions for multiple IMs by successively calling the getSingleGcim method Returns true if it was successfully else return false
 boolean getRandomSourceRupture()
          This method obtains a random earthquake rupture (from a correspondingly random source), based on the empirical CDF of the deaggregation results
 void getRuptureContributions(double iml, Site site, java.util.Map<TectonicRegionType,ScalarIMR> imrjMap, AbstractERF eqkRupForecast, double maxDist, ArbitrarilyDiscretizedFunc magDistFilter)
          This method gets the contribution of each rupture in the ERF toward the probability of IML=iml.
 boolean getSingleGcim(int imiNumber, java.util.Map<TectonicRegionType,ScalarIMR> imriMap, java.util.Map<TectonicRegionType,ImCorrelationRelationship> imijCorrRelMap, double maxDist, ArbitrarilyDiscretizedFunc magDistFilter)
          this function performs the GCIM computations to obtain the conditional distribution of a single input intensity measure.
 int getTotIMi()
          gets the total number of IMi's
 void printResultsToConsole()
           
 void setApproxCDFvalues()
          This method sets the approximate CDF values for which the gcim distributions are calculated for using defaults zmin=-3, zmax=3, and dz=0.2 which gives 51 points
 void setApproxCDFvalues(double zmin, double zmax, double dz)
          This method sets the approximate CDF values for which the gcim distributions are calculated for
 void setGcimOutputDimensions()
          This method sets the dimensions of the imiArray and cdfIMi_IMjArrays
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C

protected static final java.lang.String C
See Also:
Constant Field Values

D

protected static final boolean D
See Also:
Constant Field Values
Constructor Detail

GcimCalculator

public GcimCalculator()
This no-arg constructor sets defaults

Method Detail

getRuptureContributions

public void getRuptureContributions(double iml,
                                    Site site,
                                    java.util.Map<TectonicRegionType,ScalarIMR> imrjMap,
                                    AbstractERF eqkRupForecast,
                                    double maxDist,
                                    ArbitrarilyDiscretizedFunc magDistFilter)
                             throws java.rmi.RemoteException
This method gets the contribution of each rupture in the ERF toward the probability of IML=iml. It also creates a CDF for the sources and ruptures which is later used in simulating source/rups from the deaggregation results

Throws:
java.rmi.RemoteException
java.io.IOException

getMultipleGcims

public boolean getMultipleGcims(int numIMi,
                                java.util.ArrayList<? extends java.util.Map<TectonicRegionType,ScalarIMR>> imiAttenRels,
                                java.util.ArrayList<java.lang.String> imiTypes,
                                java.util.ArrayList<? extends java.util.Map<TectonicRegionType,ImCorrelationRelationship>> imijCorrRels,
                                double maxDist,
                                ArbitrarilyDiscretizedFunc magDistFilter)
this function obtains the GCIM distributions for multiple IMs by successively calling the getSingleGcim method Returns true if it was successfully else return false

Parameters:
imri: - selected IMRi object (that for which the distribution is desired i.e. IMi)
imCorrelationRelationship: - selected correlation object for IMi and IMj
maxDist: - maxDist of sources to consider
magDistFilter: - Magnitude-Distance filter for sources
Returns:
boolean

getSingleGcim

public boolean getSingleGcim(int imiNumber,
                             java.util.Map<TectonicRegionType,ScalarIMR> imriMap,
                             java.util.Map<TectonicRegionType,ImCorrelationRelationship> imijCorrRelMap,
                             double maxDist,
                             ArbitrarilyDiscretizedFunc magDistFilter)
this function performs the GCIM computations to obtain the conditional distribution of a single input intensity measure. Returns true if it was successfully else return false

Parameters:
imiNumber - - the imi counter used for storing results in array
imri: - selected IMRi object (that for which the distribution is desired i.e. IMi)
imCorrelationRelationship: - selected correlation object for IMi and IMj
maxDist: - maxDist of sources to consider
magDistFilter: - Magnitude-Distance filter for sources
Returns:
boolean

getGcimRealizations

public boolean getGcimRealizations(int numGcimRealizations,
                                   int numIMi,
                                   java.util.ArrayList<? extends java.util.Map<TectonicRegionType,ScalarIMR>> imiAttenRels,
                                   java.util.ArrayList<java.lang.String> imiTypes,
                                   java.util.ArrayList<? extends java.util.Map<TectonicRegionType,ImCorrelationRelationship>> imijCorrRels,
                                   java.util.ArrayList<? extends java.util.Map<TectonicRegionType,ImCorrelationRelationship>> imikCorrRels,
                                   double maxDist,
                                   ArbitrarilyDiscretizedFunc magDistFilter)
this function obtains realizations of the IMi values from the GCIM distributions. The primary purpose of this method is to output random realizations of the IMi values which can then be used to select ground motion records for seismic response analysis Returns true if it was successfully else return false

Parameters:
numGcimRealizations: - the number of random realizations of the IMi vector to compute
imri: - selected IMRi object (that for which the distribution is desired i.e. IMi)
imCorrelationRelationship: - selected correlation object for IMi and IMj
maxDist: - maxDist of sources to consider
magDistFilter: - Magnitude-Distance filter for sources
Returns:
boolean

getRandomSourceRupture

public boolean getRandomSourceRupture()
This method obtains a random earthquake rupture (from a correspondingly random source), based on the empirical CDF of the deaggregation results


setApproxCDFvalues

public void setApproxCDFvalues(double zmin,
                               double zmax,
                               double dz)
This method sets the approximate CDF values for which the gcim distributions are calculated for

Parameters:
zmin - - the minimum z (normalised CDF value) to compute gcim for
zmax - - the maximum z (normalised CDF value) to compute gcim for
dz - - the increment of z (normalised CDF value) which determines the number of points

setApproxCDFvalues

public void setApproxCDFvalues()
This method sets the approximate CDF values for which the gcim distributions are calculated for using defaults zmin=-3, zmax=3, and dz=0.2 which gives 51 points


getApproxCDFvalues

public double[] getApproxCDFvalues()
This method gets the Approx CDFvalues


setGcimOutputDimensions

public void setGcimOutputDimensions()
This method sets the dimensions of the imiArray and cdfIMi_IMjArrays


getGcimResultsString

public java.lang.String getGcimResultsString()
This methods makes the GCIM results in a string for output to either console or external window


printResultsToConsole

public void printResultsToConsole()

getCurrIMi

public int getCurrIMi()
               throws java.rmi.RemoteException
gets the number of current IMi being processed

Returns:
Throws:
java.rmi.RemoteException

getTotIMi

public int getTotIMi()
              throws java.rmi.RemoteException
gets the total number of IMi's

Returns:
Throws:
java.rmi.RemoteException

done

public boolean done()
             throws java.rmi.RemoteException
Checks to see if GCIM calculation for the selected site have been completed.

Returns:
Throws:
java.rmi.RemoteException