org.opensha.commons.data.siteData.impl
Class WaldAllenGlobalVs30

java.lang.Object
  extended by org.opensha.commons.data.siteData.AbstractSiteData<java.lang.Double>
      extended by org.opensha.commons.data.siteData.impl.WaldAllenGlobalVs30
All Implemented Interfaces:
java.util.EventListener, Named, ServletEnabledSiteData<java.lang.Double>, SiteData<java.lang.Double>, XMLSaveable, ParameterChangeListener

public class WaldAllenGlobalVs30
extends AbstractSiteData<java.lang.Double>
implements ParameterChangeListener


Field Summary
static double arcSecondSpacing
           
static java.lang.String COEFF_ACTIVE_NAME
           
static java.lang.String COEFF_CUSTOM_NAME
           
static java.lang.String COEFF_FUNC_PARAM_NAME
           
static java.lang.String COEFF_SELECT_PARAM_NAME
           
static java.lang.String COEFF_STABLE_NAME
           
static java.lang.String DEM_SELECT_DEFAULT
           
static java.lang.String DEM_SELECT_PARAM_NAME
           
static java.lang.String DEM_SRTM30
           
static java.lang.String DEM_SRTM30_PLUS
           
static java.lang.Boolean INTERPOLATE_PARAM_DEFAULT
           
static java.lang.String INTERPOLATE_PARAM_NAME
           
static java.lang.String NAME
           
static java.lang.String SHORT_NAME
           
static double spacing
           
 
Fields inherited from class org.opensha.commons.data.siteData.AbstractSiteData
maxBasinDoubleParam, maxVs30Param, minBasinDoubleParam, minVs30Param, PARAM_MAX_BASIN_DEPTH_DOUBLE_DEFAULT, PARAM_MAX_BASIN_DEPTH_DOUBLE_MAX, PARAM_MAX_BASIN_DEPTH_DOUBLE_MIN, PARAM_MAX_BASIN_DEPTH_DOUBLE_NAME, PARAM_MAX_BASIN_INFO, PARAM_MAX_VS30_DEFAULT, PARAM_MAX_VS30_INFO, PARAM_MAX_VS30_MAX, PARAM_MAX_VS30_MIN, PARAM_MAX_VS30_NAME, PARAM_MIN_BASIN_DEPTH_DOUBLE_DEFAULT, PARAM_MIN_BASIN_DEPTH_DOUBLE_MAX, PARAM_MIN_BASIN_DEPTH_DOUBLE_MIN, PARAM_MIN_BASIN_DEPTH_DOUBLE_NAME, PARAM_MIN_BASIN_INFO, PARAM_MIN_VS30_DEFAULT, PARAM_MIN_VS30_INFO, PARAM_MIN_VS30_MAX, PARAM_MIN_VS30_MIN, PARAM_MIN_VS30_NAME, paramEdit, paramList, serverParamsList
 
Fields inherited from interface org.opensha.commons.data.siteData.SiteData
TYPE_DEPTH_TO_1_0, TYPE_DEPTH_TO_2_5, TYPE_ELEVATION, TYPE_FLAG_INFERRED, TYPE_FLAG_MEASURED, TYPE_TOPOGRAPHIC_SLOPE, TYPE_VS30, TYPE_WILLS_CLASS, XML_METADATA_NAME
 
Constructor Summary
WaldAllenGlobalVs30()
           
 
Method Summary
static ArbitrarilyDiscretizedFunc createActiveCoefficients()
          Creates function for active tectonic regions from Allen & Wald 2008
static ArbitrarilyDiscretizedFunc createStableCoefficients()
          Creates function for stable tectonic regions from Wald & Allen 2007
static WaldAllenGlobalVs30 fromXMLParams(Element paramsElem)
           
 Region getApplicableRegion()
          This gives the applicable region for this data set.
 Location getClosestDataLocation(Location loc)
          Get the location of the closest data point
 ArbitrarilyDiscretizedFunc getCoeffFunctionClone()
           
 java.lang.String getDataMeasurementType()
          Get the measurement type for this data, such as "Measured" or "Inferred"
 java.lang.String getDataType()
          Get the data type of this dataset
 java.lang.String getMetadata()
          Returns the metadata for this dataset.
 java.lang.String getName()
          Returns the name of this object
 double getResolution()
          This gives the resolution of the dataset in degrees, or 0 for infinite resolution.
 java.lang.String getShortName()
          Get the short name of this dataset
 java.lang.Double getValue(Location loc)
          Get the value at the closest location
 java.util.ArrayList<java.lang.Double> getValues(LocationList locs)
          Returns a list of the values at each location.
protected  void initParamListEditor()
           
 boolean isValueValid(java.lang.Double el)
          Returns true if the value is valid, and not NaN, N/A, or equivelant for the data type
static void main(java.lang.String[] args)
           
 void parameterChange(ParameterChangeEvent event)
          Function that must be implemented by all Listeners for ParameterChangeEvents.
static void printMapping(ArbitrarilyDiscretizedFunc func)
           
 void setActiveCoefficients()
          Helper method for setting active coefficients
 void setCoeffFunction(ArbitrarilyDiscretizedFunc func)
           
 void setInterpolateValues(boolean interpolate)
          Helper method for setting interpolation.
 void setStableCoefficients()
          Helper method for setting stable coefficients
 
Methods inherited from class org.opensha.commons.data.siteData.AbstractSiteData
addXMLParameters, certifyMinMaxBasinDepth, certifyMinMaxVs30, fromXMLMetadata, getAdjustableParameterList, getAnnotatedValue, getAnnotatedValues, getParameterListEditor, getServerSideParams, hasDataForLocation, initDefaultBasinParams, initDefaultVS30Params, toXMLMetadata, toXMLMetadata
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

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

SHORT_NAME

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

arcSecondSpacing

public static final double arcSecondSpacing
See Also:
Constant Field Values

spacing

public static final double spacing

COEFF_SELECT_PARAM_NAME

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

COEFF_ACTIVE_NAME

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

COEFF_STABLE_NAME

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

COEFF_CUSTOM_NAME

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

COEFF_FUNC_PARAM_NAME

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

INTERPOLATE_PARAM_NAME

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

INTERPOLATE_PARAM_DEFAULT

public static final java.lang.Boolean INTERPOLATE_PARAM_DEFAULT

DEM_SELECT_PARAM_NAME

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

DEM_SRTM30

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

DEM_SRTM30_PLUS

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

DEM_SELECT_DEFAULT

public static final java.lang.String DEM_SELECT_DEFAULT
See Also:
Constant Field Values
Constructor Detail

WaldAllenGlobalVs30

public WaldAllenGlobalVs30()
                    throws java.io.IOException
Throws:
java.io.IOException
Method Detail

createActiveCoefficients

public static ArbitrarilyDiscretizedFunc createActiveCoefficients()
Creates function for active tectonic regions from Allen & Wald 2008

Returns:

createStableCoefficients

public static ArbitrarilyDiscretizedFunc createStableCoefficients()
Creates function for stable tectonic regions from Wald & Allen 2007

Returns:

getApplicableRegion

public Region getApplicableRegion()
Description copied from interface: SiteData
This gives the applicable region for this data set.

Specified by:
getApplicableRegion in interface SiteData<java.lang.Double>
Returns:
Region

getClosestDataLocation

public Location getClosestDataLocation(Location loc)
                                throws java.io.IOException
Description copied from interface: SiteData
Get the location of the closest data point

Specified by:
getClosestDataLocation in interface SiteData<java.lang.Double>
Returns:
Throws:
java.io.IOException

getMetadata

public java.lang.String getMetadata()
Description copied from interface: SiteData
Returns the metadata for this dataset.

Specified by:
getMetadata in interface SiteData<java.lang.Double>
Returns:

getName

public java.lang.String getName()
Description copied from interface: Named
Returns the name of this object

Specified by:
getName in interface Named
Specified by:
getName in interface SiteData<java.lang.Double>

getResolution

public double getResolution()
Description copied from interface: SiteData
This gives the resolution of the dataset in degrees, or 0 for infinite resolution. We could possibly add a 'units' field to allow for resolution in KM

Specified by:
getResolution in interface SiteData<java.lang.Double>
Returns:

getShortName

public java.lang.String getShortName()
Description copied from interface: SiteData
Get the short name of this dataset

Specified by:
getShortName in interface SiteData<java.lang.Double>
Returns:

getDataType

public java.lang.String getDataType()
Description copied from interface: SiteData
Get the data type of this dataset

Specified by:
getDataType in interface SiteData<java.lang.Double>
Returns:

getDataMeasurementType

public java.lang.String getDataMeasurementType()
Description copied from interface: SiteData
Get the measurement type for this data, such as "Measured" or "Inferred"

Specified by:
getDataMeasurementType in interface SiteData<java.lang.Double>
Returns:

getValue

public java.lang.Double getValue(Location loc)
                          throws java.io.IOException
Description copied from interface: SiteData
Get the value at the closest location

Specified by:
getValue in interface SiteData<java.lang.Double>
Returns:
Throws:
java.io.IOException

getValues

public java.util.ArrayList<java.lang.Double> getValues(LocationList locs)
                                                throws java.io.IOException
Description copied from class: AbstractSiteData
Returns a list of the values at each location. This should be overridden if there is a more efficient way of accessing the data, like through a servlet where you can request all of the values at once.

Specified by:
getValues in interface SiteData<java.lang.Double>
Overrides:
getValues in class AbstractSiteData<java.lang.Double>
Returns:
Throws:
java.io.IOException

setInterpolateValues

public void setInterpolateValues(boolean interpolate)
Helper method for setting interpolation.

Parameters:
interpolate - - if true, linearly interpolate vs30 values

setActiveCoefficients

public void setActiveCoefficients()
Helper method for setting active coefficients


setStableCoefficients

public void setStableCoefficients()
Helper method for setting stable coefficients


isValueValid

public boolean isValueValid(java.lang.Double el)
Description copied from interface: SiteData
Returns true if the value is valid, and not NaN, N/A, or equivelant for the data type

Specified by:
isValueValid in interface SiteData<java.lang.Double>
Returns:

parameterChange

public void parameterChange(ParameterChangeEvent event)
Description copied from interface: ParameterChangeListener
Function that must be implemented by all Listeners for ParameterChangeEvents.

Specified by:
parameterChange in interface ParameterChangeListener
Parameters:
event - The Event which triggered this function call

setCoeffFunction

public void setCoeffFunction(ArbitrarilyDiscretizedFunc func)

getCoeffFunctionClone

public ArbitrarilyDiscretizedFunc getCoeffFunctionClone()

printMapping

public static void printMapping(ArbitrarilyDiscretizedFunc func)

initParamListEditor

protected void initParamListEditor()
Overrides:
initParamListEditor in class AbstractSiteData<java.lang.Double>

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException

fromXMLParams

public static WaldAllenGlobalVs30 fromXMLParams(Element paramsElem)
                                         throws java.io.IOException
Throws:
java.io.IOException