org.opensha.sha.cybershake
Class MedianCalc_Cybershake

java.lang.Object
  extended by org.opensha.sha.cybershake.MedianCalc_Cybershake
All Implemented Interfaces:
java.util.EventListener, ParameterChangeWarningListener
Direct Known Subclasses:
IML_Calc_Cybershake

public class MedianCalc_Cybershake
extends java.lang.Object
implements ParameterChangeWarningListener

Title: MeanSigmaCalc

Description: This class computes the Mean and Sigma for any Attenuation supported and any IMT supported by these AttenuationRelationships. Sites information is read from a input file.

Version:
1.0
Author:
Ned Field, Nitin Gupta and Vipin Gupta

Field Summary
protected  java.util.ArrayList basinDepthVals
           
protected  java.lang.String dirName
           
protected  ERF forecast
           
protected  java.text.DecimalFormat format
           
protected  java.lang.String inputFileName
           
protected  LocationList locList
           
protected static java.lang.String MEAN
           
protected static double MIN_DIST
           
protected static java.lang.String SIGMA
           
protected  Site siteForSourceCutOff
           
protected  double sourceCutOffDistance
           
protected  java.util.ArrayList supportedAttenuationsList
           
protected  java.util.ArrayList supportedIMTs
           
protected  java.util.ArrayList willsSiteClassVals
           
 
Constructor Summary
MedianCalc_Cybershake(java.lang.String inpFile, java.lang.String outDir)
           
 
Method Summary
protected  void createSiteList()
          Creates a location using the given locations to find source cut-off disance.
protected  void generateMedian(ScalarIMR imr, java.lang.String imtLine, java.lang.String dirName)
          Generates the Mean and Sigma files for selected Attenuation Relationship application
protected  void getERF(java.lang.String line)
           
protected  void getMedian()
          Starting with the Mean and Sigma calculation.
static void main(java.lang.String[] args)
           
 void parameterChangeWarning(ParameterChangeWarningEvent e)
          Function that must be implemented by all Listeners for ParameterChangeWarnEvents.
protected  void parseFile()
           
protected  void setIMR(java.lang.String str)
          Creates the IMR instances and adds to the list of supported IMRs
protected  void setIMT(java.lang.String line)
          Gets the suported IMTs as String
protected  void setRupOffset(double rupOffset)
           
protected  void setSite(java.lang.String line)
          Gets the list of locations with their Wills Site Class values
protected  void setSiteParamsInIMR(ScalarIMR imr, java.lang.String willsClass, java.lang.Double basinDepth)
          set the site params in IMR according to basin Depth and vs 30
protected  void toApplyBackGroud(boolean toApply)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

willsSiteClassVals

protected java.util.ArrayList willsSiteClassVals

basinDepthVals

protected java.util.ArrayList basinDepthVals

locList

protected LocationList locList

forecast

protected ERF forecast

supportedAttenuationsList

protected java.util.ArrayList supportedAttenuationsList

MEAN

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

SIGMA

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

supportedIMTs

protected java.util.ArrayList supportedIMTs

sourceCutOffDistance

protected double sourceCutOffDistance

MIN_DIST

protected static final double MIN_DIST
See Also:
Constant Field Values

siteForSourceCutOff

protected Site siteForSourceCutOff

format

protected java.text.DecimalFormat format

inputFileName

protected java.lang.String inputFileName

dirName

protected java.lang.String dirName
Constructor Detail

MedianCalc_Cybershake

public MedianCalc_Cybershake(java.lang.String inpFile,
                             java.lang.String outDir)
Method Detail

parseFile

protected void parseFile()
                  throws java.io.FileNotFoundException,
                         java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

setSite

protected void setSite(java.lang.String line)
Gets the list of locations with their Wills Site Class values

Parameters:
line - String

setIMT

protected void setIMT(java.lang.String line)
Gets the suported IMTs as String

Parameters:
line - String

setIMR

protected void setIMR(java.lang.String str)
Creates the IMR instances and adds to the list of supported IMRs

Parameters:
str - String

getERF

protected void getERF(java.lang.String line)

toApplyBackGroud

protected void toApplyBackGroud(boolean toApply)

setRupOffset

protected void setRupOffset(double rupOffset)

getMedian

protected void getMedian()
Starting with the Mean and Sigma calculation. Creates the directory to put the mean and sigma files.


setSiteParamsInIMR

protected void setSiteParamsInIMR(ScalarIMR imr,
                                  java.lang.String willsClass,
                                  java.lang.Double basinDepth)
set the site params in IMR according to basin Depth and vs 30

Parameters:
imr -
lon -
lat -
willsClass -
basinDepth -

createSiteList

protected void createSiteList()
Creates a location using the given locations to find source cut-off disance.


generateMedian

protected void generateMedian(ScalarIMR imr,
                              java.lang.String imtLine,
                              java.lang.String dirName)
Generates the Mean and Sigma files for selected Attenuation Relationship application

Parameters:
imr - AttenuationRelationshipAPI
dirName - String

parameterChangeWarning

public void parameterChangeWarning(ParameterChangeWarningEvent e)
Function that must be implemented by all Listeners for ParameterChangeWarnEvents.

Specified by:
parameterChangeWarning in interface ParameterChangeWarningListener
Parameters:
event - The Event which triggered this function call

main

public static void main(java.lang.String[] args)