org.opensha.sha.util
Class SiteTranslator

java.lang.Object
  extended by org.opensha.sha.util.SiteTranslator
All Implemented Interfaces:
java.io.Serializable

public class SiteTranslator
extends java.lang.Object
implements java.io.Serializable

Title: SiteTranslator

Description: This object sets the value of a site parameter from one or more of the following types of site data:

All of these translations were authorized by the attenuation-rlationship authors (except for Sadigh, who used a dataset similar to Abrahamson & Silve (1997) so that translation is applied). The main method tests the translations of all currently implemented attenuation-relationship site-related parameters.

If you would like to add a new site data type, or new site parameter, see javadocs for createMap and setParameterValue below for instructions.

Copyright: Copyright (c) 2002

Company:

Version:
1.0
See Also:
Serialized Form

Field Summary
static SiteDataTypeParameterNameMap DATA_TYPE_PARAM_NAME_MAP
           
static java.lang.String WILLS_B
           
static java.lang.String WILLS_BC
           
static java.lang.String WILLS_C
           
static java.lang.String WILLS_CD
           
static java.lang.String WILLS_D
           
static java.lang.String WILLS_DE
           
static java.lang.String WILLS_E
           
static java.util.HashMap<java.lang.String,java.lang.Double> wills_vs30_map
           
 
Constructor Summary
SiteTranslator()
          Constructor
 
Method Summary
static java.util.ArrayList<java.lang.String> getSortedWillsValues()
           
static double getVS30FromWillsClass(java.lang.String wills)
          Translates a Wills Site classification to a Vs30 value Vs30 = NA if E Vs30 = 180 if DE Vs30 = 270 if D Vs30 = 360 if CD Vs30 = 560 if C Vs30 = 760 if BC Vs30 = 1000 if B
static java.lang.String getWillsVs30TranslationString()
          Returns a String representation of the Wills Class -> Vs30 translation table
static void main(java.lang.String[] args)
          This main method tests the translation of all currently implemented attenuation relationship site-dependent parameters.
 boolean setAllSiteParams(java.util.Collection<? extends ScalarIMR> imrs, java.util.Collection<SiteDataValue<?>> datas)
          Convenience method to set all site params in the given collection of IMRs from the given set of data.
 boolean setAllSiteParams(java.util.Collection<? extends ScalarIMR> imrs, SiteDataValue<?> data)
          Convenience method to set all site params in the given collection of IMRs from a single site data value.
 boolean setAllSiteParams(ScalarIMR imr, java.util.Collection<SiteDataValue<?>> datas)
          Convenience method to set all site params in the given IMR instance from the given set of data.
 boolean setAllSiteParams(ScalarIMR imr, SiteDataValue<?> data)
          Convenience method to set all site params in the given attenuation relationship instance from a single site data value.
 boolean setAS_SiteType(Parameter param, java.util.Collection<SiteDataValue<?>> datas)
          Sets the AS Site Type param as follows: If using a Wills Site Classification: NA if E Deep-Soil if DE, D, or CD Rock/Shallow-Soil if C, BC, or B Else if using a Vs30 value: NA if NaN Deep-Soil if (Vs30 <= 400 AND no depth data) OR (Vs30 <= 400 AND Depth to 2.5 KM/sec > 100 m) Rock/Shallow-Soil if Vs30 > 400 OR Depth to 2.5 KM/sec <= 100 m
 boolean setCampbellBasinDepth(Parameter param, java.util.Collection<SiteDataValue<?>> datas)
          If using a Wills class is available, sets Campbell-Basin-Depth as follows: Campbell-Basin-Depth = NaN if E Campbell-Basin-Depth = 0.0 if B or BC Campbell-Basin-Depth = 1.0 if C Campbell-Basin-Depth = 5.0 if CD, D, or DE Otherwise, if using Depth to Vs=2.5 KM/sec, use that value as an approximate (even though Campbell-Basin-Depth is for Depth to Vs=3.0 KM/sec)
 boolean setCampbellSiteType(Parameter param, java.util.Collection<SiteDataValue<?>> datas)
          Campbell_1997_AttenRel.SITE_TYPE_NAME (Campbell (1997))
 boolean setCB03SiteType(Parameter param, java.util.Collection<SiteDataValue<?>> datas)
          Set Campbell & Bozorgnia 2003 Site Type parameter.
 boolean setCS05SoftSoil(Parameter param, java.util.Collection<SiteDataValue<?>> datas)
          Set the CS 2005 Soft Soil parameter If a Wills Site Class is available: True if E False otherwise Otherwise if we have a Vs30 value: True if Vs30 < 180 False if 180 >= Vs30
 boolean setDepthTo1p0Param(Parameter param, java.util.Collection<SiteDataValue<?>> datas)
          Sets the Depth to Vs = 1.0 KM/sec param if appropriate data is available.
 boolean setDepthTo2p5Param(Parameter param, java.util.Collection<SiteDataValue<?>> datas)
          Sets the Depth to Vs = 2.5 KM/sec param if appropriate data is available.
 boolean setParameterValue(Parameter param, java.util.Collection<SiteDataValue<?>> datas)
          Method to set a site parameter from a given set of site data.
 boolean setParameterValue(Parameter param, SiteDataValue<?> data)
          Method to set a site parameter from a single site data value
 boolean setParameterValue(Parameter param, java.lang.String willsClass, double basinDepth)
          Deprecated. - This is from the old site translator which was hardcoded to only accept wills classes and depth to Vs=2.5 KM/sec. It is included for compatibility, but modified to use the new structure.
 boolean setSCEMY_SiteType(Parameter param, java.util.Collection<SiteDataValue<?>> datas)
          Sets the SCEMY Site Type param as follows: If using a Wills Site Classification: NA if E Deep-Soil if DE, D, or CD Rock/Shallow-Soil if C, BC, or B Else if using a Vs30 value: NA if NaN Deep-Soil if (Vs30 <= 400 AND no depth data) OR (Vs30 <= 400 AND Depth to 2.5 KM/sec > 100 m) Rock if Vs30 > 400 OR Depth to 2.5 KM/sec <= 100 m
 boolean setVS30FlagParam(Parameter param, java.util.Collection<SiteDataValue<?>> datas)
          Sets the Vs30 flag parameter.
 boolean setVS30Param(Parameter param, java.util.Collection<SiteDataValue<?>> datas)
          Set the Vs30 param for the given set to site data.
 boolean setWillsSiteTypeName(Parameter param, java.util.Collection<SiteDataValue<?>> datas)
          Set Wills Site Type Name parameter (e.g.
 void test(Parameter param)
          This will test the translation from all wills categories for the parameter given
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WILLS_B

public static final java.lang.String WILLS_B
See Also:
Constant Field Values

WILLS_BC

public static final java.lang.String WILLS_BC
See Also:
Constant Field Values

WILLS_C

public static final java.lang.String WILLS_C
See Also:
Constant Field Values

WILLS_CD

public static final java.lang.String WILLS_CD
See Also:
Constant Field Values

WILLS_D

public static final java.lang.String WILLS_D
See Also:
Constant Field Values

WILLS_DE

public static final java.lang.String WILLS_DE
See Also:
Constant Field Values

WILLS_E

public static final java.lang.String WILLS_E
See Also:
Constant Field Values

wills_vs30_map

public static final java.util.HashMap<java.lang.String,java.lang.Double> wills_vs30_map

DATA_TYPE_PARAM_NAME_MAP

public static SiteDataTypeParameterNameMap DATA_TYPE_PARAM_NAME_MAP
Constructor Detail

SiteTranslator

public SiteTranslator()
Constructor

Method Detail

getSortedWillsValues

public static java.util.ArrayList<java.lang.String> getSortedWillsValues()

getVS30FromWillsClass

public static double getVS30FromWillsClass(java.lang.String wills)
Translates a Wills Site classification to a Vs30 value
    • Vs30 = NA if E
    • Vs30 = 180 if DE
    • Vs30 = 270 if D
    • Vs30 = 360 if CD
    • Vs30 = 560 if C
    • Vs30 = 760 if BC
    • Vs30 = 1000 if B

    Parameters:
    wills -
    Returns:

  • getWillsVs30TranslationString

    public static java.lang.String getWillsVs30TranslationString()
    Returns a String representation of the Wills Class -> Vs30 translation table

    Returns:

    setParameterValue

    public boolean setParameterValue(Parameter param,
                                     SiteDataValue<?> data)
    Method to set a site parameter from a single site data value

    Parameters:
    param -
    datas -
    Returns:
    true if the parameter was set, false otherwise

    setParameterValue

    public boolean setParameterValue(Parameter param,
                                     java.util.Collection<SiteDataValue<?>> datas)
    Method to set a site parameter from a given set of site data. The first site data value in the set that can be used to set the parameter will be used. If adding a new site data type, first update the mapping above in the createMap function. Then modify all of set[PARAM_NAME]Param functions that can be set by the new data type. If adding a new site parameter, first update the mapping above in the createMap function. Then add a new clause to the if/else statement below to handle your new parameter name. In doing so you will also have to create a new method, something like set[PARAM_NAME]Param, which will actually set the parameter for the given site data values. This new method should return true if the parameter was set successfully, false otherwise.

    Parameters:
    param -
    datas -
    Returns:
    true if the parameter was set, false otherwise

    setAllSiteParams

    public boolean setAllSiteParams(ScalarIMR imr,
                                    SiteDataValue<?> data)
    Convenience method to set all site params in the given attenuation relationship instance from a single site data value. Returns true if at least one parameter was set.

    Parameters:
    imr - IMR for which to set params
    data - data value used to set IMR params
    Returns:
    true if at least one parameter was set.

    setAllSiteParams

    public boolean setAllSiteParams(java.util.Collection<? extends ScalarIMR> imrs,
                                    SiteDataValue<?> data)
    Convenience method to set all site params in the given collection of IMRs from a single site data value. Returns true if at least one parameter was set.

    Parameters:
    imrs - collection of IMRs for which to set params
    data - data value used to set IMR params
    Returns:
    true if at least one parameter was set.

    setAllSiteParams

    public boolean setAllSiteParams(ScalarIMR imr,
                                    java.util.Collection<SiteDataValue<?>> datas)
    Convenience method to set all site params in the given IMR instance from the given set of data. Returns true if at least one parameter was set.

    Parameters:
    imr - IMR for which to set params
    datas - collection of data values used to set IMR params
    Returns:
    true if at least one parameter was set.

    setAllSiteParams

    public boolean setAllSiteParams(java.util.Collection<? extends ScalarIMR> imrs,
                                    java.util.Collection<SiteDataValue<?>> datas)
    Convenience method to set all site params in the given collection of IMRs from the given set of data. Returns true if at least one parameter was set.

    Parameters:
    imrs - collection of IMRs for which to set params
    datas - collection of data values used to set IMR params
    Returns:
    true if at least one parameter was set.

    setVS30Param

    public boolean setVS30Param(Parameter param,
                                java.util.Collection<SiteDataValue<?>> datas)
    Set the Vs30 param for the given set to site data. If a Vs30 value is available in the data, and is highest priority,that is used. Otherwise if a Wills Site Classification is available, it is translated into Vs30 and used. See getVS30FromWillsClass for Wills translation values.

    Parameters:
    param -
    datas -
    Returns:

    setVS30FlagParam

    public boolean setVS30FlagParam(Parameter param,
                                    java.util.Collection<SiteDataValue<?>> datas)
    Sets the Vs30 flag parameter. It figures out what was used to set the Vs30 parameter, and then uses the measured/inferred flag from that data source.

    Parameters:
    param -
    datas -
    Returns:

    setDepthTo2p5Param

    public boolean setDepthTo2p5Param(Parameter param,
                                      java.util.Collection<SiteDataValue<?>> datas)
    Sets the Depth to Vs = 2.5 KM/sec param if appropriate data is available.

    Parameters:
    param -
    datas -
    Returns:

    setDepthTo1p0Param

    public boolean setDepthTo1p0Param(Parameter param,
                                      java.util.Collection<SiteDataValue<?>> datas)
    Sets the Depth to Vs = 1.0 KM/sec param if appropriate data is available.

    Parameters:
    param -
    datas -
    Returns:

    setAS_SiteType

    public boolean setAS_SiteType(Parameter param,
                                  java.util.Collection<SiteDataValue<?>> datas)
    Sets the AS Site Type param as follows: If using a Wills Site Classification: Else if using a Vs30 value:

    Parameters:
    param -
    datas -
    Returns:

    setSCEMY_SiteType

    public boolean setSCEMY_SiteType(Parameter param,
                                     java.util.Collection<SiteDataValue<?>> datas)
    Sets the SCEMY Site Type param as follows: If using a Wills Site Classification: Else if using a Vs30 value:

    Parameters:
    param -
    datas -
    Returns:

    setCampbellBasinDepth

    public boolean setCampbellBasinDepth(Parameter param,
                                         java.util.Collection<SiteDataValue<?>> datas)
    If using a Wills class is available, sets Campbell-Basin-Depth as follows: Otherwise, if using Depth to Vs=2.5 KM/sec, use that value as an approximate (even though Campbell-Basin-Depth is for Depth to Vs=3.0 KM/sec)

    Parameters:
    param -
    datas -
    Returns:

    setCampbellSiteType

    public boolean setCampbellSiteType(Parameter param,
                                       java.util.Collection<SiteDataValue<?>> datas)
    Campbell_1997_AttenRel.SITE_TYPE_NAME (Campbell (1997))

    If using a Wills class, set it as follows:

    Otherwise if using a Vs30 value:

    Parameters:
    param -
    datas -
    Returns:

    setCB03SiteType

    public boolean setCB03SiteType(Parameter param,
                                   java.util.Collection<SiteDataValue<?>> datas)
    Set Campbell & Bozorgnia 2003 Site Type parameter. If using a Wills class, set it as follows: Otherwise if using a Vs30 value:

    Parameters:
    param -
    datas -
    Returns:

    setWillsSiteTypeName

    public boolean setWillsSiteTypeName(Parameter param,
                                        java.util.Collection<SiteDataValue<?>> datas)
    Set Wills Site Type Name parameter (e.g. ShakeMap 2003) If we have a wills value, set the parameter.

    Parameters:
    param -
    datas -
    Returns:

    setCS05SoftSoil

    public boolean setCS05SoftSoil(Parameter param,
                                   java.util.Collection<SiteDataValue<?>> datas)
    Set the CS 2005 Soft Soil parameter If a Wills Site Class is available: Otherwise if we have a Vs30 value:

    Parameters:
    param -
    datas -
    Returns:

    setParameterValue

    @Deprecated
    public boolean setParameterValue(Parameter param,
                                                java.lang.String willsClass,
                                                double basinDepth)
    Deprecated. - This is from the old site translator which was hardcoded to only accept wills classes and depth to Vs=2.5 KM/sec. It is included for compatibility, but modified to use the new structure.

    Parameters:
    parameter: - the parameter object to be set
    willsClass - - a String with one of the folowing ("E", "DE", "D", "CD", "C", "BC", or "B")
    basinDepth - - Depth (in meters) to where Vs = 2.5-km/sec
    Returns:
    a boolean to tell if setting the value was successful (if false it means the parameter value was not changed). A basinDepth value of NaN is allowed (it will not cause the returned value to be false). ***NOTE: THIS NEEDS TO FIXED TO HANDLE THE SOFT SOIL CASE FOR CHOI AND STEWART MODEL

    test

    public void test(Parameter param)
    This will test the translation from all wills categories for the parameter given

    Parameters:
    param -

    main

    public static void main(java.lang.String[] args)
                     throws java.io.IOException
    This main method tests the translation of all currently implemented attenuation relationship site-dependent parameters.

    Parameters:
    args -
    Throws:
    java.io.IOException