org.opensha.sha.earthquake.rupForecastImpl.NSHMP_CEUS08
Class NSHMP_CEUS_SourceGenerator

java.lang.Object
  extended by org.opensha.commons.geo.Region
      extended by org.opensha.commons.geo.GriddedRegion
          extended by org.opensha.sha.earthquake.rupForecastImpl.NSHMP_CEUS08.NSHMP_CEUS_SourceGenerator
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<Location>, Named, XMLSaveable

public class NSHMP_CEUS_SourceGenerator
extends GriddedRegion

Read NSHMP backgroud seismicity files for CEUS.

Author:
Ned Field
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.opensha.commons.geo.GriddedRegion
ANCHOR_0_0, XML_METADATA_ANCHOR_NAME, XML_METADATA_GRID_SPACING_NAME, XML_METADATA_NAME, XML_METADATA_NUM_POINTS_NAME
 
Fields inherited from class org.opensha.commons.geo.Region
XML_METADATA_OUTLINE_NAME
 
Constructor Summary
NSHMP_CEUS_SourceGenerator()
           
 
Method Summary
 double convertMbToMw(double mb, int typeConversion)
          This converts Mb to Mw, using either the Johnson method (typeConversion=3) or the Boore Atkinson method (typeConversion=4).
 java.util.ArrayList<ProbEqkSource> getCharlestonSourceList(double duration, int type)
           
 ProbEqkSource getCrosshairGriddedSource(int srcIndex, double duration)
          Get Crosshair gridded source at a specified index
 double getMaxMagAtLoc(int locIndex)
           
 GutenbergRichterMagFreqDist getMFD(double minMag, double maxMag, double aValue, double bValue, double weight)
          This creates an NSHMP mag-freq distribution from their a-value etc,
 int getNumSources()
          This returns the total number of sources (different from the number of locs because some locs have zero a-values).
 ProbEqkSource getPointGriddedSource(int srcIndex, double duration)
          Get the the point source at a specified index
 ProbEqkSource getRandomStrikeGriddedSource(int srcIndex, double duration)
          Get the random strike gridded source at a specified index
 ArbIncrementalMagFreqDist getTotCharl_MFD_atLoc(int locIndex)
           
 ArbDiscrEmpiricalDistFunc getTotMFD_atLoc(int locIndex)
           
static void main(java.lang.String[] args)
           
 double[] readGridFile(java.lang.String fileName)
          this reads an NSHMP grid file.
 void test()
           
 
Methods inherited from class org.opensha.commons.geo.GriddedRegion
addInterior, areaForIndex, clone, equals, equalsRegion, fromXMLMetadata, getLatSpacing, getLocation, getLonSpacing, getMaxGridLat, getMaxGridLon, getMinGridLat, getMinGridLon, getNodeCount, getNodeList, getNumLocations, getSpacing, hashCode, indexForLocation, indicesForBounds, isEmpty, isSpacingUniform, iterator, locationForIndex, move, subRegion, toXMLMetadata
 
Methods inherited from class org.opensha.commons.geo.Region
contains, contains, distanceToLocation, equalsRegion, getBorder, getExtent, getGlobalRegion, getInteriors, getMaxLat, getMaxLon, getMinLat, getMinLon, getName, getShape, intersect, isRectangular, setName, toString, toXMLMetadata, union
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NSHMP_CEUS_SourceGenerator

public NSHMP_CEUS_SourceGenerator()
Method Detail

getNumSources

public int getNumSources()
This returns the total number of sources (different from the number of locs because some locs have zero a-values). This does not include the Charleston sources

Returns:

readGridFile

public double[] readGridFile(java.lang.String fileName)
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:

getMaxMagAtLoc

public double getMaxMagAtLoc(int locIndex)

convertMbToMw

public double convertMbToMw(double mb,
                            int typeConversion)
This converts Mb to Mw, using either the Johnson method (typeConversion=3) or the Boore Atkinson method (typeConversion=4). Johnson mags are always greater than Boore Atkinson mags


getTotMFD_atLoc

public ArbDiscrEmpiricalDistFunc getTotMFD_atLoc(int locIndex)

getTotCharl_MFD_atLoc

public ArbIncrementalMagFreqDist getTotCharl_MFD_atLoc(int locIndex)

getMFD

public GutenbergRichterMagFreqDist getMFD(double minMag,
                                          double maxMag,
                                          double aValue,
                                          double bValue,
                                          double weight)
This creates an NSHMP mag-freq distribution from their a-value etc,

Parameters:
minMag -
maxMag -
aValue -
bValue -
weight - - rates get multiplied by this number
Returns:

getCharlestonSourceList

public java.util.ArrayList<ProbEqkSource> getCharlestonSourceList(double duration,
                                                                  int type)

test

public void test()

getRandomStrikeGriddedSource

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

Parameters:
srcIndex -
Returns:

getPointGriddedSource

public ProbEqkSource getPointGriddedSource(int srcIndex,
                                           double duration)
Get the the point source at a specified index

Parameters:
srcIndex -
Returns:

getCrosshairGriddedSource

public ProbEqkSource getCrosshairGriddedSource(int srcIndex,
                                               double duration)
Get Crosshair gridded source at a specified index

Parameters:
srcIndex -
Returns:

main

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