public class ApproxGriddedSurface extends Object
GriddedSurface defined by an upper and lower trace whose spacing is
scaled to the be as close to a desired target spacing as possible over the
entire surface. The fault traces supplied to this surface must adhere
to the right-hand-rule (dip of surface is to right of direction of travel
along trace).| Constructor and Description |
|---|
ApproxGriddedSurface(LocationList upperTrace,
LocationList lowerTrace,
double spacing)
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.
|
| Modifier and Type | Method and Description |
|---|---|
double |
area()
The surface area of this surface in km2.
|
Location |
centroid()
The centroid of this surface.
|
protected void |
checkBounds(int row,
int column)
Checks that the specified row and column are valid indices into the 2D
array.
|
void |
clear()
Deprecated.
Empties the list of all data.
|
void |
clear()
Removes all object reference stored in this container and resets all grid
metics back to 0.
|
double |
depth()
The average depth to the top of this surface in km (always positive)
|
double |
dip()
The average dip of this surface in degrees [0°, 90°].
|
double |
dipDirection()
The average dip direction of this surface in degrees [0°, 360°).
|
double |
dipRad()
The average dip of this surface in radians [0, π/2].
|
Distance |
distanceTo(Location loc)
Returns the distance metrics commonly required by PSHA ground motion models
(GMMs): rJB, rRup, and rX.
|
boolean |
exist(int row,
int column)
Deprecated.
Check if this grid cell has a java object stored in it.
|
boolean |
exist(int row,
int column)
check if this grid cell has a java object stored in it.
|
T |
get(int row,
int column)
Deprecated.
Returns the object stored in this two dimensional grid cell.
|
T |
get(int row,
int column)
Returns the object stored in this two dimensional cell.
|
ListIterator<T> |
getAllByColumnsIterator()
Deprecated.
This returns an iterator of all the Java objects stored in this two
dimensional matrix iterating over all rows within a column and then moving
to the next column until iteration has been done over all rows and all
columns.
|
ListIterator<T> |
getAllByColumnsIterator()
This returns an iterator of all the Java objects stored in this two
dimensional matrix iterating over all rows within a column and then moving
to the next column until iteration has been done over all rows and all
columns.
|
ListIterator<T> |
getAllByRowsIterator()
Deprecated.
This returns an iterator of all the Java objects stored in this two
dimensional matrix iterating over all columns within a rows and then moving
to the next column until iteration has been done over all columns and all
rows.
|
ListIterator<T> |
getAllByRowsIterator()
This returns an iterator of all the Java objects stored in this two
dimensional matrix iterating over all columns within a rows and then moving
to the next column until iteration has been done over all columns and all
rows.
|
double |
getAveGridSpacing()
This returns the average grid spacing used to define the discretization
used in what's returned by the methods here that contain "Discretized" in
their names.
|
ListIterator<T> |
getColumnIterator(int row)
Deprecated.
Returns an ordered list iterator over all columns associated with one row.
|
ListIterator<T> |
getColumnIterator(int row)
Returns an ordered list iterator over all columns associated with one row.
|
LocationList |
getEvenlyDiscritizedListOfLocsOnSurface()
This returns a list of locations that are evenly spread (at least
approximately) over the rupture surface, with a spacing given by what's
returned by the getGridSpacing() method.
|
LocationList |
getEvenlyDiscritizedLowerEdge()
This returns a list of locations that are evenly spread along the lower
edge of the surface.
|
LocationList |
getEvenlyDiscritizedPerimeter()
Deprecated.
|
LocationList |
getEvenlyDiscritizedUpperEdge()
This returns a list of locations that are evenly spread along the upper
edge of the surface.
|
Location |
getFirstLocOnUpperEdge()
This returns the first location on row zero (which should be the same as
the first loc of the FaultTrace)
|
double |
getGridSpacingAlongStrike()
Returns the grid spacing along strike
|
double |
getGridSpacingDownDip()
returns the grid spacing down dip
|
Location |
getLastLocOnUpperEdge()
This returns the last location on row zero (which may not be the same as
the last loc of the FaultTrace depending on the discretization)
|
Location |
getLocation(int row,
int column)
gets the location from the 2D container
|
int |
getNumCols()
Deprecated.
Returns the number of columns in this two dimensional container.
|
int |
getNumCols()
Returns the number of columns in this two dimensional container.
|
int |
getNumRows()
Deprecated.
Returns the number of rows int this two dimensional container.
|
int |
getNumRows()
Returns the number of rows int this two dimensional container.
|
LocationList |
getPerimeter()
Get a list of locations that constitutes the perimeter of the surface (not
necessarily evenly spaced)
|
LocationList |
getRow(int row) |
LocationList |
getRowAsTrace(int row)
Gets a specified row as a fault trace
|
ListIterator<T> |
getRowIterator(int column)
Deprecated.
Returns an ordered list iterator over all rows associated with one column.
|
ListIterator<T> |
getRowIterator(int column)
Returns an ordered list iterator over all rows associated with one column.
|
LocationList |
getUpperEdge()
This returns the upper edge of the rupture surface (where the locations are
not necessarily equally spaced).
|
Iterator<T> |
iterator() |
double |
length()
The average length of the upper edge or trace of this surface in km.
|
static void |
main(String[] args) |
String |
name()
Gets the name of this container
|
void |
set(int row,
int column,
T obj)
Deprecated.
Places a Java object into one cell in this two dimensional matrix specified
by the row and column indices.
|
void |
set(int row,
int column,
T obj)
Places a Java object into one cell in this two dimensional matrix specified
by the row and column indices.
|
void |
setName(String name)
Deprecated.
Every container has a name associated with it to distinguish it from other
container instances.
|
void |
setName(String name)
Sets the name of this container
|
protected void |
setNumRowsAndNumCols(int numRows,
int numCols)
Sets the number of Rows and Cols of the 2D container object.
|
long |
size()
Deprecated.
returns the number of cells in this two dimensional matrix, i.e.
|
long |
size()
returns the number of cells in this two dimensional matrix, i.e.
|
double |
strike()
The average strike of this surface in degrees [0°, 360°).
|
Object[][] |
toJava2D()
Converts our internal data structure to the Java 2 dimensional array.
|
String |
toString()
Prints out each location and fault information for debugging
|
double |
width()
The average down-dip width of this surface in km.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, iterator, spliteratorpublic ApproxGriddedSurface(LocationList upperTrace, LocationList lowerTrace, double spacing)
upperTrace - lowerTrace - spacing - public static void main(String[] args)
args - public double strike()
RuptureSurfacepublic double dip()
RuptureSurfacepublic double dipRad()
RuptureSurfacepublic double dipDirection()
RuptureSurfacepublic double depth()
RuptureSurfacepublic Location centroid()
RuptureSurfacepublic LocationList getRow(int row)
public LocationList getPerimeter()
GriddedSurfacegetPerimeter in interface GriddedSurfacepublic LocationList getEvenlyDiscritizedListOfLocsOnSurface()
GriddedSurfacegetEvenlyDiscritizedListOfLocsOnSurface in interface GriddedSurfacepublic double getGridSpacingAlongStrike()
getGridSpacingAlongStrike in interface GriddedSurfacepublic double getGridSpacingDownDip()
getGridSpacingDownDip in interface GriddedSurface@Deprecated public LocationList getEvenlyDiscritizedPerimeter()
GriddedSurfacegetEvenlyDiscritizedPerimeter in interface GriddedSurfacepublic Location getLocation(int row, int column)
getLocation in interface GriddedSurfacerow - column - public LocationList getRowAsTrace(int row)
row - public Distance distanceTo(Location loc)
RuptureSurfacedistanceTo in interface RuptureSurfaceloc - Location to compute distances toDistancepublic LocationList getEvenlyDiscritizedUpperEdge()
GriddedSurfacegetEvenlyDiscritizedUpperEdge in interface GriddedSurfacepublic LocationList getEvenlyDiscritizedLowerEdge()
GriddedSurfacegetEvenlyDiscritizedLowerEdge in interface GriddedSurfacepublic LocationList getUpperEdge()
GriddedSurfacegetUpperEdge in interface GriddedSurfacepublic Location getFirstLocOnUpperEdge()
getFirstLocOnUpperEdge in interface GriddedSurfacepublic Location getLastLocOnUpperEdge()
getLastLocOnUpperEdge in interface GriddedSurfacepublic double length()
RuptureSurfacelength in interface RuptureSurfacepublic double width()
RuptureSurfacewidth in interface RuptureSurfacepublic double area()
RuptureSurfacearea in interface RuptureSurfacepublic double getAveGridSpacing()
GriddedSurfacegetAveGridSpacing in interface GriddedSurfacepublic String toString()
public int getNumRows()
public void setName(String name)
name - public int getNumCols()
public void clear()
public boolean exist(int row,
int column)
row - The x coordinate of the cell.column - The y coordinate of the cell.public long size()
public void set(int row,
int column,
T obj)
throws ArrayIndexOutOfBoundsException,
ClassCastException
row - The x coordinate of the cell.column - The y coordinate of the cell.obj - The Java object to place in the cell.ArrayIndexOutOfBoundsException - Thrown if the row and column are
beyond the two dimensional matrix range.ClassCastException - Thrown by subclasses that expect a particular
type of Java object.public T get(int row,
int column)
row - The x coordinate of the cell.column - The y coordinate of the cell.public ListIterator<T> getColumnIterator(int row) throws ArrayIndexOutOfBoundsException
row - The x coordinate of the cell.ArrayIndexOutOfBoundsException - Thrown if the row is beyond the
two dimensional matrix range.public ListIterator<T> getRowIterator(int column) throws ArrayIndexOutOfBoundsException
column - The y coordinate of the cell.ArrayIndexOutOfBoundsException - Thrown if the column is beyond
the two dimensional matrix range.public ListIterator<T> getAllByColumnsIterator()
public ListIterator<T> getAllByRowsIterator()
public void setName(String name)
public String name()
public void set(int row,
int column,
T obj)
throws ArrayIndexOutOfBoundsException
row - The x coordinate of the cell.column - The y coordinate of the cell.obj - The Java object to place in the cell.ArrayIndexOutOfBoundsException - Thrown if the row and column are
beyond the two dimensional matrix range.protected void setNumRowsAndNumCols(int numRows,
int numCols)
numRows - int number of rowsnumCols - int number of colspublic int getNumRows()
public int getNumCols()
public T get(int row,
int column)
row - The x coordinate of the cell.column - The y coordinate of the cell.public ListIterator<T> getColumnIterator(int row) throws ArrayIndexOutOfBoundsException
row - The x coordinate of the cell.ArrayIndexOutOfBoundsException - Thrown if the row is beyond the
two dimensional matrix range.public ListIterator<T> getRowIterator(int column) throws ArrayIndexOutOfBoundsException
column - The y coordinate of the cell.ArrayIndexOutOfBoundsException - Thrown if the column is beyond
the two dimensional matrix range.public ListIterator<T> getAllByColumnsIterator()
public ListIterator<T> getAllByRowsIterator()
protected void checkBounds(int row,
int column)
throws ArrayIndexOutOfBoundsException
row - check row value less that max row indexcolumn - check col value less that max col indexArrayIndexOutOfBoundsException - Thrown if row or column < 0 or >
max row or max col.public void clear()
public boolean exist(int row,
int column)
row - The x coordinate of the cell.column - The y coordinate of the cell.public long size()
public Object[][] toJava2D()
public Iterator<T> iterator()