org.opensha.sha.faultSurface
Class ApproxEvenlyGriddedSurface

java.lang.Object
  extended by org.opensha.commons.data.Container2DImpl<Location>
      extended by org.opensha.sha.faultSurface.AbstractEvenlyGriddedSurface
          extended by org.opensha.sha.faultSurface.AbstractEvenlyGriddedSurfaceWithSubsets
              extended by org.opensha.sha.faultSurface.ApproxEvenlyGriddedSurface
All Implemented Interfaces:
Serializable, Iterable<Location>, Container2D<Location>, Named, CacheEnabledSurface, EvenlyGriddedSurface, RuptureSurface

public class ApproxEvenlyGriddedSurface
extends AbstractEvenlyGriddedSurfaceWithSubsets

This classe represents and approximately evenly gridded surface, where the gridSpacing represents some average value. We could add methods here like: getMinGridSpacing(), getMaxGridSpacing(), etc.

Author:
field
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.opensha.sha.faultSurface.AbstractEvenlyGriddedSurface
C, gridSpacingAlong, gridSpacingDown, sameGridSpacing
 
Fields inherited from class org.opensha.commons.data.Container2DImpl
data, name, numCols, numRows, size, TAB
 
Constructor Summary
ApproxEvenlyGriddedSurface(FaultTrace upperFaultTrace, FaultTrace lowerFaultTrace, double aveGridSpacing)
          This constructor takes an upper and lower fault trace, re-samples these according the the given aveGridSpacing to represent the first and last rows of the surface, and then fills in the intermediate rows by evenly sampling a straight line between the top and bottom point of each column.
ApproxEvenlyGriddedSurface(int numRows, int numCols, double aveGridSpacing)
          This constructor creates a blank surface enabling the user to populate the surface any way they want
 
Method Summary
 double computeAveGridSpacingAlongStrike()
          This computes the average grid spacing for adjacent locations along strike (averaged over all rows as well)
 double computeAveGridSpacingDownDip()
          This computes the average grid spacing for adjacent locations down dip (averaged over all cols as well)
 double getAveDip()
          Average dip (degrees) of rupture surface
 double getAveDipDirection()
          Average dip direction (degrees) of rupture surface
 double getAveRupTopDepth()
          Average depth (km) to top of rupture (always a positive number)
 double getAveStrike()
          Average strike (degrees) of rupture surface
protected  AbstractEvenlyGriddedSurface getNewInstance()
          Creates a new instance with the correct sub-class type, used for copying methods
 FaultTrace getUpperEdge()
          This returns the upper edge of the rupture surface (where the locations are not necessarily equally spaced).
static void main(String[] args)
           
 void setLocation(int row, int column, Location location)
          Add a Location to the grid - does the same thing as set except that it ensures the object is a Location object.
static void test1(Location l1, Location l2)
          This explores an accuracy issue (final depth is right be lats and lons are more off)
static void test2(Location l1, Location l2)
           
 void writeXYZ_toFile(String fileName)
           
 
Methods inherited from class org.opensha.sha.faultSurface.AbstractEvenlyGriddedSurfaceWithSubsets
getNthSubsetSurface, getNthSubsetSurface, getNthSubsetSurfaceCenteredDownDip, getNumSubsetSurfaces, getNumSubsetSurfacesAlongLength, getSubsetSurfacesIterator, getSubsetSurfacesIterator
 
Methods inherited from class org.opensha.sha.faultSurface.AbstractEvenlyGriddedSurface
calcDistances, calcDistanceX, copyShallow, getArea, getAveGridSpacing, getAveLength, getAveWidth, getDistanceJB, getDistanceRup, getDistanceSeis, getDistanceX, getEvenlyDiscritizedListOfLocsOnSurface, getEvenlyDiscritizedLowerEdge, getEvenlyDiscritizedPerimeter, getEvenlyDiscritizedUpperEdge, getFirstLocOnUpperEdge, getFractionOfSurfaceInRegion, getGridSpacingAlongStrike, getGridSpacingDownDip, getInfo, getLastLocOnUpperEdge, getLocation, getLocationsIterator, getMinDistance, getMoved, getPerimeter, getRowAsTrace, isGridSpacingSame, isPointSurface
 
Methods inherited from class org.opensha.commons.data.Container2DImpl
checkBounds, clear, clone, exist, get, getAllByColumnsIterator, getAllByRowsIterator, getColumnIterator, getName, getNumCols, getNumRows, getRowIterator, iterator, listIterator, set, setName, setNumRowsAndNumCols, size, toJava2D, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opensha.commons.data.Container2D
clear, exist, get, getAllByColumnsIterator, getAllByRowsIterator, getColumnIterator, getNumCols, getNumRows, getRowIterator, listIterator, set, setName, size, toString
 
Methods inherited from interface org.opensha.commons.data.Named
getName
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

ApproxEvenlyGriddedSurface

public ApproxEvenlyGriddedSurface(int numRows,
                                  int numCols,
                                  double aveGridSpacing)
This constructor creates a blank surface enabling the user to populate the surface any way they want

Parameters:
numRows -
numCols -
aveGridSpacing -

ApproxEvenlyGriddedSurface

public ApproxEvenlyGriddedSurface(FaultTrace upperFaultTrace,
                                  FaultTrace lowerFaultTrace,
                                  double aveGridSpacing)
This constructor takes an upper and lower fault trace, re-samples these according the the given aveGridSpacing to represent the first and last rows of the surface, and then fills in the intermediate rows by evenly sampling a straight line between the top and bottom point of each column. The number of columns is the average length the top and bottom trace divided by the aveGridSpacing (plus 1), and the number of rows is the average distance between the top and bottom points in each column divided by the aveGridSpacing (plus 1). and then

Parameters:
numRows -
numCols -
aveGridSpacing -
Method Detail

test1

public static void test1(Location l1,
                         Location l2)
This explores an accuracy issue (final depth is right be lats and lons are more off)


test2

public static void test2(Location l1,
                         Location l2)

setLocation

public void setLocation(int row,
                        int column,
                        Location location)
Add a Location to the grid - does the same thing as set except that it ensures the object is a Location object.

Parameters:
row - The row to set this Location at.
column - The column to set this Location at.
location - The new location value.
Throws:
ArrayIndexOutOfBoundsException - Thrown if the row or column lies beyond the grid space indexes.

writeXYZ_toFile

public void writeXYZ_toFile(String fileName)

computeAveGridSpacingAlongStrike

public double computeAveGridSpacingAlongStrike()
This computes the average grid spacing for adjacent locations along strike (averaged over all rows as well)

Returns:

computeAveGridSpacingDownDip

public double computeAveGridSpacingDownDip()
This computes the average grid spacing for adjacent locations down dip (averaged over all cols as well)

Returns:

main

public static void main(String[] args)
Parameters:
args -

getAveDip

public double getAveDip()
Description copied from interface: RuptureSurface
Average dip (degrees) of rupture surface

Returns:

getAveDipDirection

public double getAveDipDirection()
Description copied from interface: RuptureSurface
Average dip direction (degrees) of rupture surface

Returns:

getAveRupTopDepth

public double getAveRupTopDepth()
Description copied from interface: RuptureSurface
Average depth (km) to top of rupture (always a positive number)

Returns:

getAveStrike

public double getAveStrike()
Description copied from interface: RuptureSurface
Average strike (degrees) of rupture surface

Returns:

getUpperEdge

public FaultTrace getUpperEdge()
Description copied from interface: RuptureSurface
This returns the upper edge of the rupture surface (where the locations are not necessarily equally spaced). This may be the original Fault Trace used to define the surface, but not necessarily.

Specified by:
getUpperEdge in interface RuptureSurface
Overrides:
getUpperEdge in class AbstractEvenlyGriddedSurface
Returns:

getNewInstance

protected AbstractEvenlyGriddedSurface getNewInstance()
Description copied from class: AbstractEvenlyGriddedSurface
Creates a new instance with the correct sub-class type, used for copying methods

Specified by:
getNewInstance in class AbstractEvenlyGriddedSurface
Returns: