org.opensha.sha.cybershake
Class ERF2RuptureForSTF_Generator

java.lang.Object
  extended by org.opensha.sha.cybershake.ERF2RuptureForSTF_Generator

public class ERF2RuptureForSTF_Generator
extends java.lang.Object

Title: ERF2RuptureForSTF_Generator

Description: This class provides with the capability of dumping the String represenation of a ProbEqkRupture in a file. It creates a directory as specified by the user and puts all the ruptures file in it. It also creates a Site file that specifies which source and rupture were in its radius of cuttoff-distance.

This class also provides the user with the functionality of computing region bounds around a given site which will let user which sources and rupture can affect a given Site.

Version:
1.0
Author:
Nitin Gupta and Ned Field

Constructor Summary
ERF2RuptureForSTF_Generator(AbstractERF eqkRupForecast, Site site, double cuttOffDistance)
           
 
Method Summary
 void getEqkRupturesAsStringNearSite(java.lang.String directoryName)
          This function creates ruptures files in the specified directory, if it already does not exists.
 java.util.ArrayList getEqkRupturesNearSite()
          Returns the list of the EqkRupture for a Site.
 double getMaxDepthForRuptureInRegionBounds()
          Returns the maximum depth for which any given rupture in a given geographic region extends.
 java.util.HashMap getProbEqkRuptureIdentifiersNearSite()
          Returns the Hashmap for the EqkRuptures with key being the SourceIndex and values being the ArrayList of the rupture indicies.
 Region getSiteRegionBounds()
          Returns the regional bounds of the largest rectangular region around the site that include all the ruptures surface locations within the range of provided distance.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERF2RuptureForSTF_Generator

public ERF2RuptureForSTF_Generator(AbstractERF eqkRupForecast,
                                   Site site,
                                   double cuttOffDistance)
Method Detail

getEqkRupturesNearSite

public java.util.ArrayList getEqkRupturesNearSite()
Returns the list of the EqkRupture for a Site. Only those ruptures are included which are with in the cut-off distance.

Returns:
ArrayList List of ProbEqkRupRuptures

getEqkRupturesAsStringNearSite

public void getEqkRupturesAsStringNearSite(java.lang.String directoryName)
This function creates ruptures files in the specified directory, if it already does not exists. It creates a single rupture file for a given rupture. If the directory in which files are to be created already exists then it assumes that will contain the "EqkRupForecast_Params.txt" metadata file. This function allows the user with the flexibility of creating rupture files for multiple sites keeping the ERf parameters same for all sites. Also it will also generate a file for for each site which will tell the source and rupture index which were within the cutt-off distance of the site. It generates rupture file with following naming convention: sourceIndex+"_"+ruptureIndex+".txt". It generates a new rupture file only if it does not exists.

Parameters:
directoryName - String Name of the directory in which rupture files are to be created

getProbEqkRuptureIdentifiersNearSite

public java.util.HashMap getProbEqkRuptureIdentifiersNearSite()
Returns the Hashmap for the EqkRuptures with key being the SourceIndex and values being the ArrayList of the rupture indicies.

Parameters:
eqkRupForecast - EqkRupForecastAPI
site - Site
distance - double
Returns:
HashMap

getSiteRegionBounds

public Region getSiteRegionBounds()
Returns the regional bounds of the largest rectangular region around the site that include all the ruptures surface locations within the range of provided distance.

Returns:
RectangularGeographicRegion

getMaxDepthForRuptureInRegionBounds

public double getMaxDepthForRuptureInRegionBounds()
Returns the maximum depth for which any given rupture in a given geographic region extends.

Returns:
double

main

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