org.opensha.nshmp.sha.calc
Class SsS1Calculator

java.lang.Object
  extended by org.opensha.nshmp.sha.calc.SsS1Calculator

public class SsS1Calculator
extends java.lang.Object

Title: SsS1Calculator

Description: Computes the values for the Ss and S1 for the given location or territory in USA.

Version:
1.0
Author:
Ned Field, Nitin Gupta , E.V.Leyendecker

Field Summary
protected static java.lang.String CENTROID_SA
           
protected  java.sql.Connection conn
           
protected static float Fa
           
protected static float Fv
           
protected  double gridSpacing
           
protected  java.text.DecimalFormat latLonFormat
           
protected static java.lang.String MAXIMUM_SA
           
protected static java.lang.String MINIMUM_SA
           
protected static int PGA_IDX
           
protected static java.lang.String PGADET_COL
           
protected static int PGADET_IDX
           
protected static java.lang.String PGAUH_COL
           
protected static int PGAUH_IDX
           
protected  java.sql.PreparedStatement query
           
protected static int S1_IDX
           
protected static java.lang.String S1_Text
           
protected static java.lang.String S1CR_COL
           
protected static int S1CR_IDX
           
protected static java.lang.String S1DET_COL
           
protected static int S1DET_IDX
           
protected static java.lang.String S1UH_COL
           
protected static int S1UH_IDX
           
protected static java.lang.String SA
           
protected static int SS_IDX
           
protected static java.lang.String Ss_Text
           
protected static java.lang.String SSCR_COL
           
protected static int SSCR_IDX
           
protected static java.lang.String SSDET_COL
           
protected static int SSDET_IDX
           
protected static java.lang.String SsS1_SubTitle
           
protected static java.lang.String SsS1_TITLE
          Some static String for the data printing
protected static java.lang.String SSUH_COL
           
protected static int SSUH_IDX
           
protected static java.lang.String STUB
           
protected static int TL_IDX
           
 
Constructor Summary
SsS1Calculator()
           
 
Method Summary
 void finalize()
           
 java.lang.String[] getColumnHeadersForBatch2009(java.lang.String edition)
           
 double getGridSpacing(java.lang.String selectedRegion)
          This applies only for the 2009 Design Data Editions.
 java.lang.String getRegionFromLocation(Location location)
           
 java.util.ArrayList<ArbitrarilyDiscretizedFunc> getSsS1(java.lang.String region, java.lang.String edition, java.util.ArrayList<Location> locations)
          For each location in the input argument, fetches and computes the design data from the database.
 ArbitrarilyDiscretizedFunc getSsS1(java.lang.String selectedRegion, java.lang.String selectedEdition, double latitude, double longitude)
           
 ArbitrarilyDiscretizedFunc getSsS1(java.lang.String selectedRegion, java.lang.String selectedEdition, double latitude, double longitude, java.lang.String spectraType)
           
 ArbitrarilyDiscretizedFunc getSsS1(java.lang.String selectedRegion, java.lang.String selectedEdition, java.lang.String zipCode)
           
 ArbitrarilyDiscretizedFunc getSsS1(java.lang.String selectedRegion, java.lang.String selectedEdition, java.lang.String zipCode, java.lang.String spectraType)
           
 ArbitrarilyDiscretizedFunc getSsS1ForTerritory(java.lang.String territory)
          returns the Ss and S1 for Territory
 XY_DataSetList getSsS1FuncList(java.lang.String edition, java.lang.String region, java.lang.String zipCode)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gridSpacing

protected double gridSpacing

conn

protected java.sql.Connection conn

query

protected java.sql.PreparedStatement query

STUB

protected static final java.lang.String STUB
See Also:
Constant Field Values

PGAUH_COL

protected static final java.lang.String PGAUH_COL
See Also:
Constant Field Values

SSUH_COL

protected static final java.lang.String SSUH_COL
See Also:
Constant Field Values

S1UH_COL

protected static final java.lang.String S1UH_COL
See Also:
Constant Field Values

PGADET_COL

protected static final java.lang.String PGADET_COL
See Also:
Constant Field Values

SSDET_COL

protected static final java.lang.String SSDET_COL
See Also:
Constant Field Values

S1DET_COL

protected static final java.lang.String S1DET_COL
See Also:
Constant Field Values

SSCR_COL

protected static final java.lang.String SSCR_COL
See Also:
Constant Field Values

S1CR_COL

protected static final java.lang.String S1CR_COL
See Also:
Constant Field Values

SS_IDX

protected static final int SS_IDX
See Also:
Constant Field Values

S1_IDX

protected static final int S1_IDX
See Also:
Constant Field Values

SSUH_IDX

protected static final int SSUH_IDX
See Also:
Constant Field Values

S1UH_IDX

protected static final int S1UH_IDX
See Also:
Constant Field Values

SSDET_IDX

protected static final int SSDET_IDX
See Also:
Constant Field Values

S1DET_IDX

protected static final int S1DET_IDX
See Also:
Constant Field Values

SSCR_IDX

protected static final int SSCR_IDX
See Also:
Constant Field Values

S1CR_IDX

protected static final int S1CR_IDX
See Also:
Constant Field Values

PGA_IDX

protected static final int PGA_IDX
See Also:
Constant Field Values

PGAUH_IDX

protected static final int PGAUH_IDX
See Also:
Constant Field Values

PGADET_IDX

protected static final int PGADET_IDX
See Also:
Constant Field Values

TL_IDX

protected static final int TL_IDX
See Also:
Constant Field Values

SsS1_TITLE

protected static final java.lang.String SsS1_TITLE
Some static String for the data printing

See Also:
Constant Field Values

SsS1_SubTitle

protected static final java.lang.String SsS1_SubTitle
See Also:
Constant Field Values

Ss_Text

protected static final java.lang.String Ss_Text
See Also:
Constant Field Values

S1_Text

protected static final java.lang.String S1_Text
See Also:
Constant Field Values

SA

protected static final java.lang.String SA
See Also:
Constant Field Values

CENTROID_SA

protected static final java.lang.String CENTROID_SA
See Also:
Constant Field Values

MINIMUM_SA

protected static final java.lang.String MINIMUM_SA
See Also:
Constant Field Values

MAXIMUM_SA

protected static final java.lang.String MAXIMUM_SA
See Also:
Constant Field Values

Fa

protected static final float Fa
See Also:
Constant Field Values

Fv

protected static final float Fv
See Also:
Constant Field Values

latLonFormat

protected java.text.DecimalFormat latLonFormat
Constructor Detail

SsS1Calculator

public SsS1Calculator()
Method Detail

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

getGridSpacing

public double getGridSpacing(java.lang.String selectedRegion)
This applies only for the 2009 Design Data Editions. Some data sets were done with different grid spacings. The grid spacings are known for the flat file versions of the code.

Parameters:
selectedRegion - The geographic region of the requested location.
Returns:
The grid spacing (decimal degrees) between grid points.

getSsS1

public ArbitrarilyDiscretizedFunc getSsS1(java.lang.String selectedRegion,
                                          java.lang.String selectedEdition,
                                          double latitude,
                                          double longitude)
Parameters:
latitude - double
longitude - double
Returns:
ArbitrarilyDiscretizedFunc

getSsS1

public ArbitrarilyDiscretizedFunc getSsS1(java.lang.String selectedRegion,
                                          java.lang.String selectedEdition,
                                          double latitude,
                                          double longitude,
                                          java.lang.String spectraType)
Parameters:
latitude - double
longitude - double
Returns:
ArbitrarilyDiscretizedFunc

getSsS1ForTerritory

public ArbitrarilyDiscretizedFunc getSsS1ForTerritory(java.lang.String territory)
returns the Ss and S1 for Territory

Parameters:
territory - String
Returns:
DiscretizedFuncList

getSsS1FuncList

public XY_DataSetList getSsS1FuncList(java.lang.String edition,
                                      java.lang.String region,
                                      java.lang.String zipCode)

getSsS1

public ArbitrarilyDiscretizedFunc getSsS1(java.lang.String selectedRegion,
                                          java.lang.String selectedEdition,
                                          java.lang.String zipCode)
                                   throws ZipCodeErrorException
Parameters:
zipCode -
Returns:
Throws:
ZipCodeErrorException

getSsS1

public ArbitrarilyDiscretizedFunc getSsS1(java.lang.String selectedRegion,
                                          java.lang.String selectedEdition,
                                          java.lang.String zipCode,
                                          java.lang.String spectraType)
                                   throws ZipCodeErrorException
Parameters:
zipCode -
Returns:
Throws:
ZipCodeErrorException

getSsS1

public java.util.ArrayList<ArbitrarilyDiscretizedFunc> getSsS1(java.lang.String region,
                                                               java.lang.String edition,
                                                               java.util.ArrayList<Location> locations)
For each location in the input argument, fetches and computes the design data from the database. This method is only implemented for the 2009 NEHRP (and similar) design specifications.

Parameters:
locations - A list of locations of interest.
Returns:
A list of resulting design data.

getColumnHeadersForBatch2009

public java.lang.String[] getColumnHeadersForBatch2009(java.lang.String edition)

getRegionFromLocation

public java.lang.String getRegionFromLocation(Location location)