org.opensha.sha.faultSurface
Class PointSurface

java.lang.Object
  extended by org.opensha.sha.faultSurface.PointSurface
All Implemented Interfaces:
RuptureSurface
Direct Known Subclasses:
PointSource13b.PointSurface13b

public class PointSurface
extends Object
implements RuptureSurface

Title: PointSurface

Description: This is a special case of RuptureSurface that is a point surface (has only one Location).

This class has been modified to have threadsafe distance methods that are not synchronized like those of the finite fault sources. A PointSurface should only be used with a threadsafe EqkRupture; users should ensure that new surfaces or parent ruptures are being created for each calculation loop and each calculator.

Version:
1.0
Author:
Ned Field (completely rewritten)

Field Summary
protected  double aveDip
          The average dip of this surface into the Earth.
protected  double aveStrike
          The average strike of this surface on the Earth.
protected  double aveWidth
          The average width of the surface.
protected  String name
          The name of this point source.
 
Constructor Summary
PointSurface(double lat, double lon, double depth)
          Constructor for the PointSurface object.
PointSurface(Location loc)
          Constructor for the PointSurface object.
 
Method Summary
 double getArea()
          This returns the surface area in km-sq
 double getAveDip()
          Returns the average dip of this surface into the Earth.
 double getAveDipDirection()
          Average dip direction (degrees) of rupture surface
 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.
 double getAveLength()
          This returns the average length of the surface in km
 double getAveRupTopDepth()
          Average depth (km) to top of rupture (always a positive number)
 double getAveStrike()
          Returns the average strike of this surface on the Earth.
 double getAveWidth()
          Average down-dip width (km) of rupture surface
 double getDepth()
           
 double getDistanceJB(Location siteLoc)
          This returns distance JB (shortest horz distance in km to surface projection of rupture), assuming the location has zero depth (for numerical expediency).
 double getDistanceRup(Location siteLoc)
          This sets the three propagation distances (distanceJB, distanceRup, & distanceSeis)
 double getDistanceSeis(Location siteLoc)
          This returns "distance seis" (shortest distance in km to point on rupture deeper than 3 km), assuming the location has zero depth (for numerical expediency).
 double getDistanceX(Location siteLoc)
          This returns distance X (the shortest distance in km to the rupture trace extended to infinity), where values >= 0 are on the hanging wall and values < 0 are on the foot wall.
 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()
          This returns a list of locations that are evenly spread (at least approximately) over the surface perimeter, with a spacing given by what's returned by the getGridSpacing() method.
 FaultTrace 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 the upper edge of the surface
 double getFractionOfSurfaceInRegion(Region region)
          The is returns the fraction of this rupture surface that's inside the given region.
 String getInfo()
          This is a string giving brief info about the surface (e.g., used in GUIs)
 Location getLastLocOnUpperEdge()
          This returns the last location on the upper edge of the surface
 Location getLocation()
          Gets the location for this point source.
 ListIterator<Location> getLocationsIterator()
          This returns what's given by getEvenlyDiscritizedListOfLocsOnSurface() as an interator
 double getMinDistance(RuptureSurface surface)
          This returns the minimum distance as the minimum among all location pairs between the two surfaces
 String getName()
          Gets the name of this PointSource.
 LocationList getPerimeter()
          Get a list of locations that constitutes the perimeter of the surface (not necessarily evenly spaced)
 String getSurfaceMetadata()
          Returns the Surface Metadata with the following info: AveDip Surface length Surface DownDipWidth GridSpacing NumRows NumCols Number of locations on surface
 FaultTrace getUpperEdge()
          This returns the upper edge of the rupture surface (where the locations are not necessarily equally spaced).
 boolean isPointSurface()
          This indicates whether this is a point surface
static void main(String[] args)
           
 void setAveDip(double aveDip)
          Sets the average dip of this surface into the Earth.
 void setAveStrike(double aveStrike)
          Sets the average strike of this surface on the Earth.
 void setAveWidth(double aveWidth)
           
 void setDepth(double depth)
           
 void setDistCorrMagAndType(double mag, PtSrcDistCorr.Type type)
          This sets the magnitude and type for the point-source distance corrections
 void setLocation(Location location)
          Since this is a point source, the single Location can be set without indexes.
 void setName(String name)
          Sets the name of this PointSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aveStrike

protected double aveStrike
The average strike of this surface on the Earth. Even though this is a point source, an average strike can be assigned to it to assist with particular scientific caculations. Initially set to NaN.


aveDip

protected double aveDip
The average dip of this surface into the Earth. Even though this is a point source, an average dip can be assigned to it to assist with particular scientific caculations. Initially set to NaN.


aveWidth

protected double aveWidth
The average width of the surface. Although most ground motion models are not concerned with rupture width, some newer models require a reasonable estimate to function properly (e.g. ASK_2014).


name

protected String name
The name of this point source.

Constructor Detail

PointSurface

public PointSurface(double lat,
                    double lon,
                    double depth)
Constructor for the PointSurface object. Sets all the fields for a Location object. Mirrors the Location constructor.

Parameters:
lat - latitude for the Location of this point source.
lon - longitude for the Location of this point source.
depth - depth below the earth for the Location of this point source.

PointSurface

public PointSurface(Location loc)
Constructor for the PointSurface object. Sets all the fields for a Location object.

Parameters:
loc - the Location object for this point source.
Method Detail

setAveStrike

public void setAveStrike(double aveStrike)
                  throws InvalidRangeException
Sets the average strike of this surface on the Earth. An InvalidRangeException is thrown if the ave strike is not a valid value, i.e. must be > 0, etc. Even though this is a point source, an average strike can be assigned to it to assist with particular scientific caculations.

Throws:
InvalidRangeException

getAveStrike

public double getAveStrike()
Returns the average strike of this surface on the Earth.

Specified by:
getAveStrike in interface RuptureSurface
Returns:

setAveDip

public void setAveDip(double aveDip)
               throws InvalidRangeException
Sets the average dip of this surface into the Earth. An InvalidRangeException is thrown if the ave strike is not a valid value, i.e. must be > 0, etc. Even though this is a point source, an average dip can be assigned to it to assist with particular scientific caculations.

Throws:
InvalidRangeException

getAveDip

public double getAveDip()
Returns the average dip of this surface into the Earth.

Specified by:
getAveDip in interface RuptureSurface
Returns:

setLocation

public void setLocation(Location location)
Since this is a point source, the single Location can be set without indexes. Does a clone copy.


getDepth

public double getDepth()

setDepth

public void setDepth(double depth)

getLocation

public Location getLocation()
Gets the location for this point source.

Returns:

setName

public void setName(String name)
Sets the name of this PointSource. Uesful for lookup in a list


getName

public String getName()
Gets the name of this PointSource. Uesful for lookup in a list


getSurfaceMetadata

public String getSurfaceMetadata()
Returns the Surface Metadata with the following info:

Returns:
String

getAveDipDirection

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

Specified by:
getAveDipDirection in interface RuptureSurface
Returns:

getAveRupTopDepth

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

Specified by:
getAveRupTopDepth in interface RuptureSurface
Returns:

getPerimeter

public LocationList getPerimeter()
Description copied from interface: RuptureSurface
Get a list of locations that constitutes the perimeter of the surface (not necessarily evenly spaced)

Specified by:
getPerimeter in interface RuptureSurface

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
Returns:

setDistCorrMagAndType

public void setDistCorrMagAndType(double mag,
                                  PtSrcDistCorr.Type type)
This sets the magnitude and type for the point-source distance corrections

Parameters:
mag -
type -

getDistanceRup

public double getDistanceRup(Location siteLoc)
This sets the three propagation distances (distanceJB, distanceRup, & distanceSeis)

Specified by:
getDistanceRup in interface RuptureSurface
Parameters:
siteLoc -
Returns:

getDistanceJB

public double getDistanceJB(Location siteLoc)
Description copied from interface: RuptureSurface
This returns distance JB (shortest horz distance in km to surface projection of rupture), assuming the location has zero depth (for numerical expediency).

Specified by:
getDistanceJB in interface RuptureSurface
Returns:

getDistanceSeis

public double getDistanceSeis(Location siteLoc)
Description copied from interface: RuptureSurface
This returns "distance seis" (shortest distance in km to point on rupture deeper than 3 km), assuming the location has zero depth (for numerical expediency).

Specified by:
getDistanceSeis in interface RuptureSurface
Returns:

getDistanceX

public double getDistanceX(Location siteLoc)
This returns distance X (the shortest distance in km to the rupture trace extended to infinity), where values >= 0 are on the hanging wall and values < 0 are on the foot wall. The given site location is assumed to be at zero depth (for numerical expediency). This always returns zero since this is a point surface.

Specified by:
getDistanceX in interface RuptureSurface
Returns:

getInfo

public String getInfo()
Description copied from interface: RuptureSurface
This is a string giving brief info about the surface (e.g., used in GUIs)

Specified by:
getInfo in interface RuptureSurface

isPointSurface

public boolean isPointSurface()
Description copied from interface: RuptureSurface
This indicates whether this is a point surface

Specified by:
isPointSurface in interface RuptureSurface
Returns:

getArea

public double getArea()
Description copied from interface: RuptureSurface
This returns the surface area in km-sq

Specified by:
getArea in interface RuptureSurface
Returns:
double

getAveGridSpacing

public double getAveGridSpacing()
Description copied from interface: RuptureSurface
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.

Specified by:
getAveGridSpacing in interface RuptureSurface
Returns:

getAveLength

public double getAveLength()
Description copied from interface: RuptureSurface
This returns the average length of the surface in km

Specified by:
getAveLength in interface RuptureSurface
Returns:
double

setAveWidth

public void setAveWidth(double aveWidth)

getAveWidth

public double getAveWidth()
Description copied from interface: RuptureSurface
Average down-dip width (km) of rupture surface

Specified by:
getAveWidth in interface RuptureSurface
Returns:

getEvenlyDiscritizedListOfLocsOnSurface

public LocationList getEvenlyDiscritizedListOfLocsOnSurface()
Description copied from interface: RuptureSurface
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. Further details are specified by the implementing class. Don't assume the locations are ordered as one reads the words on a page in a book (not the case for CompoundGriddedSurface).

Specified by:
getEvenlyDiscritizedListOfLocsOnSurface in interface RuptureSurface
Returns:

getEvenlyDiscritizedPerimeter

public LocationList getEvenlyDiscritizedPerimeter()
Description copied from interface: RuptureSurface
This returns a list of locations that are evenly spread (at least approximately) over the surface perimeter, with a spacing given by what's returned by the getGridSpacing() method. Further details are specified by the implementing class. These locations should be ordered starting along the top and moving along following the Aki and Richards convention.

Specified by:
getEvenlyDiscritizedPerimeter in interface RuptureSurface
Returns:

getEvenlyDiscritizedUpperEdge

public FaultTrace getEvenlyDiscritizedUpperEdge()
Description copied from interface: RuptureSurface
This returns a list of locations that are evenly spread along the upper edge of the surface. Further details are specified by the implementing class. These locations should be ordered along the fault following the Aki and Richards convention.

Specified by:
getEvenlyDiscritizedUpperEdge in interface RuptureSurface
Returns:

getEvenlyDiscritizedLowerEdge

public LocationList getEvenlyDiscritizedLowerEdge()
Description copied from interface: RuptureSurface
This returns a list of locations that are evenly spread along the lower edge of the surface. Further details are specified by the implementing class. These locations should be ordered along the fault following the Aki and Richards convention.

Specified by:
getEvenlyDiscritizedLowerEdge in interface RuptureSurface
Returns:

getFirstLocOnUpperEdge

public Location getFirstLocOnUpperEdge()
Description copied from interface: RuptureSurface
This returns the first location on the upper edge of the surface

Specified by:
getFirstLocOnUpperEdge in interface RuptureSurface
Returns:

getLastLocOnUpperEdge

public Location getLastLocOnUpperEdge()
Description copied from interface: RuptureSurface
This returns the last location on the upper edge of the surface

Specified by:
getLastLocOnUpperEdge in interface RuptureSurface
Returns:

getFractionOfSurfaceInRegion

public double getFractionOfSurfaceInRegion(Region region)
Description copied from interface: RuptureSurface
The is returns the fraction of this rupture surface that's inside the given region.

Specified by:
getFractionOfSurfaceInRegion in interface RuptureSurface
Returns:

getLocationsIterator

public ListIterator<Location> getLocationsIterator()
Description copied from interface: RuptureSurface
This returns what's given by getEvenlyDiscritizedListOfLocsOnSurface() as an interator

Specified by:
getLocationsIterator in interface RuptureSurface
Returns:

getMinDistance

public double getMinDistance(RuptureSurface surface)
This returns the minimum distance as the minimum among all location pairs between the two surfaces

Specified by:
getMinDistance in interface RuptureSurface
Parameters:
surface - RuptureSurface
Returns:
distance in km

main

public static void main(String[] args)