org.opensha.sha.earthquake.rupForecastImpl.WGCEP_UCERF_2_Final.analysis
Class LogicTreeMFDsPlotter

java.lang.Object
  extended by org.opensha.sha.earthquake.rupForecastImpl.WGCEP_UCERF_2_Final.analysis.LogicTreeMFDsPlotter
Direct Known Subclasses:
NoCalSoCalMFDsPlotter

public class LogicTreeMFDsPlotter
extends java.lang.Object

This is used for plotting various logic tree MFDs. It generates MFDs for each source type for each branch in UCERF2. The MFDs are saved in a text file. Actually, this class can generate the MFD files and also plot (using JFreeChart) after reading those files. To Generate the files, use the generateMFDsData() method call. To plot the MFDs from files, use the method plotMFDs(). The main() function of this class provides valuable insight into this.

Author:
vipingupta

Field Summary
protected static java.lang.String A_FAULTS_MFD_FILENAME
           
protected  java.util.ArrayList<IncrementalMagFreqDist> aFaultMFDsList
           
protected static java.lang.String B_FAULTS_CHAR_MFD_FILENAME
           
protected static java.lang.String B_FAULTS_GR_MFD_FILENAME
           
protected  java.util.ArrayList<IncrementalMagFreqDist> bFaultCharMFDsList
           
protected  java.util.ArrayList<IncrementalMagFreqDist> bFaultGRMFDsList
           
protected  java.util.ArrayList funcs
           
protected static java.lang.String NON_CA_B_FAULTS_MFD_FILENAME
           
protected  java.util.ArrayList<IncrementalMagFreqDist> nonCA_B_FaultsMFDsList
           
protected  PlotCurveCharacterstics PLOT_CHAR1
           
protected  PlotCurveCharacterstics PLOT_CHAR10
           
protected  PlotCurveCharacterstics PLOT_CHAR2
           
protected  PlotCurveCharacterstics PLOT_CHAR3
           
protected  PlotCurveCharacterstics PLOT_CHAR4
           
protected  PlotCurveCharacterstics PLOT_CHAR5
           
protected  PlotCurveCharacterstics PLOT_CHAR6
           
protected  PlotCurveCharacterstics PLOT_CHAR7
           
protected  PlotCurveCharacterstics PLOT_CHAR8
           
protected  PlotCurveCharacterstics PLOT_CHAR9
           
protected  java.util.ArrayList<PlotCurveCharacterstics> plottingFeaturesList
           
protected static java.lang.String TOT_MFD_FILENAME
           
protected  java.util.ArrayList<IncrementalMagFreqDist> totMFDsList
           
protected  UCERF2 ucerf2
           
 
Constructor Summary
LogicTreeMFDsPlotter()
           
 
Method Summary
protected  void doWeightedSum(java.lang.String constantParamName, java.lang.Object value, SummedMagFreqDist aFaultTotMFD, SummedMagFreqDist bFaultTotCharMFD, SummedMagFreqDist bFaultTotGRMFD, SummedMagFreqDist nonCA_B_FaultsTotMFD, SummedMagFreqDist totMFD)
          Do Weighted Sum
 void generateMFDsData(java.lang.String path)
          This method caclulates MFDs for all logic tree branches and saves them to files.
protected  double getCumRateAt6_5(IncrementalMagFreqDist mfd)
          Cum rate at 6.5
 java.util.ArrayList getCurveFunctionList()
           
protected  double getMaxMag()
          Max Mag
protected  double getMinMag()
          Min Mag
protected  int getNumMags()
          Get num Mag
protected  java.util.ArrayList<EvenlyDiscretizedFunc> getObsCumMFD(UCERF2 ucerf2)
          Get Observed Cum MFD
protected  java.util.ArrayList<ArbitrarilyDiscretizedFunc> getObsIncrMFD(UCERF2 ucerf2)
          Get Observed Incr MFD
 java.util.ArrayList getPlottingFeatures()
           
protected  IncrementalMagFreqDist getTotal_A_FaultsMFD(UCERF2 ucerf2)
          Get A_Faults MFD
protected  IncrementalMagFreqDist getTotal_B_FaultsCharMFD(UCERF2 ucerf2)
          Get B_Faults Char MFD
protected  IncrementalMagFreqDist getTotal_B_FaultsGR_MFD(UCERF2 ucerf2)
          Get B_Faults GR MFD
protected  IncrementalMagFreqDist getTotal_BackgroundMFD(UCERF2 ucerf2)
          Get Background MFD
protected  IncrementalMagFreqDist getTotal_C_ZoneMFD(UCERF2 ucerf2)
          Get C-Zones MFD
protected  IncrementalMagFreqDist getTotal_NonCA_B_FaultsMFD(UCERF2 ucerf2)
          Get Non CA B_Faults MFD
protected  IncrementalMagFreqDist getTotalMFD(UCERF2 ucerf2)
          Get Total MFD
 double getUserMaxX()
           
 double getUserMaxY()
           
 double getUserMinX()
           
 double getUserMinY()
           
 java.lang.String getXAxisLabel()
           
 boolean getXLog()
           
 java.lang.String getYAxisLabel()
           
 boolean getYLog()
           
 boolean isCustomAxis()
           
static void main(java.lang.String[] args)
           
 void plotMFDs(java.lang.String path, boolean isCumulative)
          Plot MFDs using Jfreechart.
protected  void readMFDsFromFile(java.lang.String fileName, java.util.ArrayList<IncrementalMagFreqDist> mfdList, boolean isNSHMP02)
          Read MFDs from file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aFaultMFDsList

protected java.util.ArrayList<IncrementalMagFreqDist> aFaultMFDsList

bFaultCharMFDsList

protected java.util.ArrayList<IncrementalMagFreqDist> bFaultCharMFDsList

bFaultGRMFDsList

protected java.util.ArrayList<IncrementalMagFreqDist> bFaultGRMFDsList

totMFDsList

protected java.util.ArrayList<IncrementalMagFreqDist> totMFDsList

nonCA_B_FaultsMFDsList

protected java.util.ArrayList<IncrementalMagFreqDist> nonCA_B_FaultsMFDsList

A_FAULTS_MFD_FILENAME

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

B_FAULTS_CHAR_MFD_FILENAME

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

B_FAULTS_GR_MFD_FILENAME

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

NON_CA_B_FAULTS_MFD_FILENAME

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

TOT_MFD_FILENAME

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

PLOT_CHAR1

protected final PlotCurveCharacterstics PLOT_CHAR1

PLOT_CHAR2

protected final PlotCurveCharacterstics PLOT_CHAR2

PLOT_CHAR3

protected final PlotCurveCharacterstics PLOT_CHAR3

PLOT_CHAR10

protected final PlotCurveCharacterstics PLOT_CHAR10

PLOT_CHAR4

protected final PlotCurveCharacterstics PLOT_CHAR4

PLOT_CHAR5

protected final PlotCurveCharacterstics PLOT_CHAR5

PLOT_CHAR6

protected final PlotCurveCharacterstics PLOT_CHAR6

PLOT_CHAR7

protected final PlotCurveCharacterstics PLOT_CHAR7

PLOT_CHAR8

protected final PlotCurveCharacterstics PLOT_CHAR8

PLOT_CHAR9

protected final PlotCurveCharacterstics PLOT_CHAR9

funcs

protected java.util.ArrayList funcs

plottingFeaturesList

protected java.util.ArrayList<PlotCurveCharacterstics> plottingFeaturesList

ucerf2

protected UCERF2 ucerf2
Constructor Detail

LogicTreeMFDsPlotter

public LogicTreeMFDsPlotter()
Method Detail

generateMFDsData

public void generateMFDsData(java.lang.String path)
This method caclulates MFDs for all logic tree branches and saves them to files. It also generates a metadata excel sheet that contains information about parameter settings for each logic tree branch. If path is null, default path is used

Parameters:
path -

readMFDsFromFile

protected void readMFDsFromFile(java.lang.String fileName,
                                java.util.ArrayList<IncrementalMagFreqDist> mfdList,
                                boolean isNSHMP02)
Read MFDs from file

Parameters:
fileName -
mfdList -

getMinMag

protected double getMinMag()
Min Mag

Returns:

getMaxMag

protected double getMaxMag()
Max Mag

Returns:

getNumMags

protected int getNumMags()
Get num Mag

Returns:

getPlottingFeatures

public java.util.ArrayList getPlottingFeatures()

getCurveFunctionList

public java.util.ArrayList getCurveFunctionList()

getCumRateAt6_5

protected double getCumRateAt6_5(IncrementalMagFreqDist mfd)
Cum rate at 6.5

Parameters:
mfd -
Returns:

getObsCumMFD

protected java.util.ArrayList<EvenlyDiscretizedFunc> getObsCumMFD(UCERF2 ucerf2)
Get Observed Cum MFD

Parameters:
ucerf2 -
Returns:

getObsIncrMFD

protected java.util.ArrayList<ArbitrarilyDiscretizedFunc> getObsIncrMFD(UCERF2 ucerf2)
Get Observed Incr MFD

Parameters:
ucerf2 -
Returns:

getTotal_A_FaultsMFD

protected IncrementalMagFreqDist getTotal_A_FaultsMFD(UCERF2 ucerf2)
Get A_Faults MFD

Parameters:
ucerf2 -
Returns:

getTotal_C_ZoneMFD

protected IncrementalMagFreqDist getTotal_C_ZoneMFD(UCERF2 ucerf2)
Get C-Zones MFD

Parameters:
ucerf2 -
Returns:

getTotal_BackgroundMFD

protected IncrementalMagFreqDist getTotal_BackgroundMFD(UCERF2 ucerf2)
Get Background MFD

Parameters:
ucerf2 -
Returns:

getTotal_B_FaultsCharMFD

protected IncrementalMagFreqDist getTotal_B_FaultsCharMFD(UCERF2 ucerf2)
Get B_Faults Char MFD

Parameters:
ucerf2 -
Returns:

getTotal_B_FaultsGR_MFD

protected IncrementalMagFreqDist getTotal_B_FaultsGR_MFD(UCERF2 ucerf2)
Get B_Faults GR MFD

Parameters:
ucerf2 -
Returns:

getTotal_NonCA_B_FaultsMFD

protected IncrementalMagFreqDist getTotal_NonCA_B_FaultsMFD(UCERF2 ucerf2)
Get Non CA B_Faults MFD

Parameters:
ucerf2 -
Returns:

getTotalMFD

protected IncrementalMagFreqDist getTotalMFD(UCERF2 ucerf2)
Get Total MFD

Parameters:
ucerf2 -
Returns:

plotMFDs

public void plotMFDs(java.lang.String path,
                     boolean isCumulative)
Plot MFDs using Jfreechart. The boolean "isCumulative" decides whether to plot the incremental MFDs or the cumulative MFDs. If path is null, default path is used


doWeightedSum

protected void doWeightedSum(java.lang.String constantParamName,
                             java.lang.Object value,
                             SummedMagFreqDist aFaultTotMFD,
                             SummedMagFreqDist bFaultTotCharMFD,
                             SummedMagFreqDist bFaultTotGRMFD,
                             SummedMagFreqDist nonCA_B_FaultsTotMFD,
                             SummedMagFreqDist totMFD)
Do Weighted Sum

Parameters:
paramIndex -
paramName -
value -
weight -
aFaultMFD -
bFaultMFD -
totMFD -

getXLog

public boolean getXLog()

getYLog

public boolean getYLog()

getXAxisLabel

public java.lang.String getXAxisLabel()

getYAxisLabel

public java.lang.String getYAxisLabel()

isCustomAxis

public boolean isCustomAxis()

getUserMinX

public double getUserMinX()

getUserMaxX

public double getUserMaxX()

getUserMinY

public double getUserMinY()

getUserMaxY

public double getUserMaxY()

main

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