org.opensha.sha.earthquake.rupForecastImpl.WGCEP_UCERF_2_Final.griddedSeis
Class NSHMP_GridSourceGenerator

java.lang.Object
  extended by org.opensha.sha.earthquake.rupForecastImpl.WGCEP_UCERF_2_Final.griddedSeis.NSHMP_GridSourceGenerator
All Implemented Interfaces:
Serializable

public class NSHMP_GridSourceGenerator
extends Object
implements Serializable

Read NSHMP backgroud seismicity files. This trims the western edge of the RELM region so there are no zero rate bins (i.e., the number of locationis is the same as the number of non-zero rate cells). The number of locations in the result is numLocs=7654. I verified sumOfAllAvals against my hand sum using Igor.

Author:
Ned Field & Vipin Gupta
See Also:
Serialized Form

Field Summary
protected  double[] agrd_brawly_out
           
protected  double[] agrd_creeps_out
           
protected  double[] agrd_cstcal_out
           
protected  double[] agrd_deeps_out
           
protected  double[] agrd_impext_out
           
protected  double[] agrd_mendos_out
           
protected  double[] agrd_wuscmp_out
           
protected  double[] agrd_wusext_out
           
protected  double[] area1new_agrid
           
protected  double[] area2new_agrid
           
protected  double[] area3new_agrid
           
protected  double[] area4new_agrid
           
protected static double B_VAL
           
protected static double B_VAL_CREEPING
           
protected  double C_ZONES_MAX_MAG
           
protected  double DEFAULT_MAX_MAG
           
protected static double DELTA_MAG
           
protected  double[] fltmmaxAll21ch_out6
           
protected  double[] fltmmaxAll21gr_out6
           
protected  double[] fltmmaxAll24ch_out6
           
protected  double[] fltmmaxAll24gr_out6
           
protected  double[] mojave_agrid
           
protected  double[] sangreg_agrid
           
 
Constructor Summary
NSHMP_GridSourceGenerator()
           
 
Method Summary
 ArrayList<ProbEqkSource> getAllCrosshairGriddedSources(double duration)
          Get all cross hair gridded sources
 ArrayList<ProbEqkSource> getAllFixedStrikeSources(double duration)
          Get all fixed-strike gridded sources
 List<ProbEqkSource> getAllNSHMP13_GriddedSources(double duration)
          Get all NSHMP 2013 styled grid sources.
 ArrayList<ProbEqkSource> getAllRandomStrikeGriddedSources(double duration)
          Get all random strike gridded sources
 ArrayList<Point2Vert_FaultPoisSource> getArea1FixedStrikeSources(double duration)
           
 ArrayList<Point2Vert_FaultPoisSource> getArea2FixedStrikeSources(double duration)
           
 ArrayList<Point2Vert_FaultPoisSource> getArea3FixedStrikeSources(double duration)
           
 ArrayList<Point2Vert_FaultPoisSource> getArea4FixedStrikeSources(double duration)
           
 ArrayList<Point2Vert_FaultPoisSource> getBrawleyFixedStrikeSources(double duration)
           
 ArrayList<Point2Vert_FaultPoisSource> getCreepsFixedStrikeSources(double duration)
           
 ProbEqkSource getCrosshairGriddedSource(int srcIndex, double duration)
          Get Crosshair gridded source at a specified index (this ignores the fixed-strike contribution)
 GriddedRegion getGriddedRegion()
           
 ArrayList<Point2Vert_FaultPoisSource> getMendosFixedStrikeSources(double duration)
           
 GutenbergRichterMagFreqDist getMFD(double minMag, double maxMag, double aValue, double bValue, boolean applyBulgeReduction)
          This creates an NSHMP mag-freq distribution from their a-value, with an option to reduce rates at & above M 6.5 by a factor of three.
 ArrayList<Point2Vert_FaultPoisSource> getMojaveFixedStrikeSources(double duration)
           
 ProbEqkSource getNSHMP13_GriddedSource(int srcIndex, double duration)
          Returns a NSHMP 2013 style gridded source that is compatible with all NGAW2 relationships.
 int getNumSources()
          Get the number of Random Strike gridded sources
 ProbEqkSource getRandomStrikeGriddedSource(int srcIndex, double duration)
          Get the random strike gridded source at a specified index (this ignores the fixed-strike contribution)
 ArrayList<Point2Vert_FaultPoisSource> getSangregFixedStrikeSources(double duration)
           
 IncrementalMagFreqDist getTotalC_ZoneMFD_InRegion(Region region)
           
 IncrementalMagFreqDist getTotalC_ZoneMFD()
           
 SummedMagFreqDist getTotMFD_atLoc(int locIndex, boolean includeC_zones, boolean applyBulgeReduction, boolean applyMaxMagGrid, boolean includeFixedRakeSources, boolean include_agrd_deeps_out)
          Note that applyBulgeReduction only applies to agrd_cstcal_out
 SummedMagFreqDist getTotMFDForRegion(Region region, boolean includeC_zones, boolean applyBulgeReduction, boolean applyMaxMagGrid, boolean includeFixedRakeSources)
          Note that applyBulgeReduction only applies to agrd_cstcal_out Get Total MFD for Region.
static void main(String[] args)
           
 double[] readGridFile(String fileName, boolean addToSumOfAllAvals)
          this reads an NSHMP grid file.
 void setAsPointSources(boolean areAllPointSources)
          Whether all sources should just be treated as point sources
 void writeMomentRateOfFixedStrikeSources()
           
 void writeNumSources()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

agrd_brawly_out

protected double[] agrd_brawly_out

agrd_creeps_out

protected double[] agrd_creeps_out

agrd_cstcal_out

protected double[] agrd_cstcal_out

agrd_deeps_out

protected double[] agrd_deeps_out

agrd_mendos_out

protected double[] agrd_mendos_out

agrd_wuscmp_out

protected double[] agrd_wuscmp_out

agrd_wusext_out

protected double[] agrd_wusext_out

agrd_impext_out

protected double[] agrd_impext_out

area1new_agrid

protected double[] area1new_agrid

area2new_agrid

protected double[] area2new_agrid

area3new_agrid

protected double[] area3new_agrid

area4new_agrid

protected double[] area4new_agrid

mojave_agrid

protected double[] mojave_agrid

sangreg_agrid

protected double[] sangreg_agrid

fltmmaxAll21ch_out6

protected double[] fltmmaxAll21ch_out6

fltmmaxAll21gr_out6

protected double[] fltmmaxAll21gr_out6

fltmmaxAll24ch_out6

protected double[] fltmmaxAll24ch_out6

fltmmaxAll24gr_out6

protected double[] fltmmaxAll24gr_out6

B_VAL

protected static final double B_VAL
See Also:
Constant Field Values

B_VAL_CREEPING

protected static final double B_VAL_CREEPING
See Also:
Constant Field Values

DELTA_MAG

protected static final double DELTA_MAG
See Also:
Constant Field Values

C_ZONES_MAX_MAG

protected final double C_ZONES_MAX_MAG
See Also:
Constant Field Values

DEFAULT_MAX_MAG

protected final double DEFAULT_MAX_MAG
See Also:
Constant Field Values
Constructor Detail

NSHMP_GridSourceGenerator

public NSHMP_GridSourceGenerator()
Method Detail

getGriddedRegion

public GriddedRegion getGriddedRegion()

setAsPointSources

public void setAsPointSources(boolean areAllPointSources)
Whether all sources should just be treated as point sources

Parameters:
areAllPointSources -

getAllFixedStrikeSources

public ArrayList<ProbEqkSource> getAllFixedStrikeSources(double duration)
Get all fixed-strike gridded sources

Parameters:
includeC_Zones -
duration -
applyBulgeReduction -
applyMaxMagGrid -
Returns:

getBrawleyFixedStrikeSources

public ArrayList<Point2Vert_FaultPoisSource> getBrawleyFixedStrikeSources(double duration)

getMendosFixedStrikeSources

public ArrayList<Point2Vert_FaultPoisSource> getMendosFixedStrikeSources(double duration)

getCreepsFixedStrikeSources

public ArrayList<Point2Vert_FaultPoisSource> getCreepsFixedStrikeSources(double duration)

getArea1FixedStrikeSources

public ArrayList<Point2Vert_FaultPoisSource> getArea1FixedStrikeSources(double duration)

getArea2FixedStrikeSources

public ArrayList<Point2Vert_FaultPoisSource> getArea2FixedStrikeSources(double duration)

getArea3FixedStrikeSources

public ArrayList<Point2Vert_FaultPoisSource> getArea3FixedStrikeSources(double duration)

getArea4FixedStrikeSources

public ArrayList<Point2Vert_FaultPoisSource> getArea4FixedStrikeSources(double duration)

getMojaveFixedStrikeSources

public ArrayList<Point2Vert_FaultPoisSource> getMojaveFixedStrikeSources(double duration)

getSangregFixedStrikeSources

public ArrayList<Point2Vert_FaultPoisSource> getSangregFixedStrikeSources(double duration)

getAllRandomStrikeGriddedSources

public ArrayList<ProbEqkSource> getAllRandomStrikeGriddedSources(double duration)
Get all random strike gridded sources

Parameters:
duration -
Returns:

getAllCrosshairGriddedSources

public ArrayList<ProbEqkSource> getAllCrosshairGriddedSources(double duration)
Get all cross hair gridded sources

Parameters:
duration -
Returns:

getAllNSHMP13_GriddedSources

public List<ProbEqkSource> getAllNSHMP13_GriddedSources(double duration)
Get all NSHMP 2013 styled grid sources.

Parameters:
duration -
Returns:

getRandomStrikeGriddedSource

public ProbEqkSource getRandomStrikeGriddedSource(int srcIndex,
                                                  double duration)
Get the random strike gridded source at a specified index (this ignores the fixed-strike contribution)

Parameters:
srcIndex -
Returns:

getCrosshairGriddedSource

public ProbEqkSource getCrosshairGriddedSource(int srcIndex,
                                               double duration)
Get Crosshair gridded source at a specified index (this ignores the fixed-strike contribution)

Parameters:
srcIndex -
Returns:

getNSHMP13_GriddedSource

public ProbEqkSource getNSHMP13_GriddedSource(int srcIndex,
                                              double duration)
Returns a NSHMP 2013 style gridded source that is compatible with all NGAW2 relationships.

Parameters:
srcIndex -
duration -
Returns:
the source

getNumSources

public int getNumSources()
Get the number of Random Strike gridded sources

Returns:

readGridFile

public double[] readGridFile(String fileName,
                             boolean addToSumOfAllAvals)
this reads an NSHMP grid file. The boolean specifies whether to add this to a running total (sumOfAllAvals[i]). This could be modified to read binary files

Parameters:
fileName -
Returns:

getMFD

public GutenbergRichterMagFreqDist getMFD(double minMag,
                                          double maxMag,
                                          double aValue,
                                          double bValue,
                                          boolean applyBulgeReduction)
This creates an NSHMP mag-freq distribution from their a-value, with an option to reduce rates at & above M 6.5 by a factor of three.

Parameters:
minMag -
maxMag -
aValue -
bValue -
applyBulgeReduction -
Returns:

getTotalC_ZoneMFD

public IncrementalMagFreqDist getTotalC_ZoneMFD()

getTotalC_ZoneMFD_InRegion

public IncrementalMagFreqDist getTotalC_ZoneMFD_InRegion(Region region)

getTotMFDForRegion

public SummedMagFreqDist getTotMFDForRegion(Region region,
                                            boolean includeC_zones,
                                            boolean applyBulgeReduction,
                                            boolean applyMaxMagGrid,
                                            boolean includeFixedRakeSources)
Note that applyBulgeReduction only applies to agrd_cstcal_out Get Total MFD for Region. Set region to null if you want the entire region. Note that this includes the agrd_deeps_out contribution (which are excluded from the sources)

Parameters:
region -
includeC_zones -
applyBulgeReduction -
applyMaxMagGrid -
Returns:

getTotMFD_atLoc

public SummedMagFreqDist getTotMFD_atLoc(int locIndex,
                                         boolean includeC_zones,
                                         boolean applyBulgeReduction,
                                         boolean applyMaxMagGrid,
                                         boolean includeFixedRakeSources,
                                         boolean include_agrd_deeps_out)
Note that applyBulgeReduction only applies to agrd_cstcal_out

Parameters:
locIndex -
includeC_zones -
applyBulgeReduction -
applyMmaxGrid -
includeFixedRakeSources -
include_agrd_deeps_out -
Returns:

writeNumSources

public void writeNumSources()

writeMomentRateOfFixedStrikeSources

public void writeMomentRateOfFixedStrikeSources()

main

public static void main(String[] args)