org.opensha.nshmp.sha.data
Class DataGenerator_UHS

java.lang.Object
  extended by org.opensha.nshmp.sha.data.DataGenerator_UHS
All Implemented Interfaces:
DataGeneratorAPI_UHS

public class DataGenerator_UHS
extends Object
implements DataGeneratorAPI_UHS

Title: DataGenerator_UHS

Description: This class acts as the data model for the Uniform Hazard Spectra Option.

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

Field Summary
protected  ArbitrarilyDiscretizedFunc approxUHSpectrumSaSdFunction
           
protected  ArbitrarilyDiscretizedFunc approxUHSpectrumSaTFunction
           
protected  String dataEdition
           
protected  String dataInfo
           
protected  float faVal
           
protected  float fvVal
           
protected  String geographicRegion
           
protected  String metadataForPlots
           
protected  ArbitrarilyDiscretizedFunc saFunction
           
protected  ArbitrarilyDiscretizedFunc saSdFunction
           
protected  ArbitrarilyDiscretizedFunc sdSpectrumSaSdFunction
           
protected  ArbitrarilyDiscretizedFunc sdSpectrumSaTFunction
           
protected  ArbitrarilyDiscretizedFunc sdTFunction
           
protected  String selectedSpectraType
           
protected  String siteClass
           
protected  ArbitrarilyDiscretizedFunc smSpectrumSaSdFunction
           
protected  ArbitrarilyDiscretizedFunc smSpectrumSaTFunction
           
 
Constructor Summary
DataGenerator_UHS()
           
 
Method Summary
protected  void addDataInfo(String data)
           
 void calculateApproxUHS()
           
 void calculateSDSpectrum()
           
 void calculateSMSpectrum()
           
 void calculateUHS(ArrayList<Location> locations, String outFile)
          Computes the UHS for an array of locations
 void calculateUHS(double lat, double lon)
          Gets the data for SsS1 in case region specified is not a Territory and user specifies Lat-Lon for the location.
 void calculateUHS(String zipCode)
          Gets the data for SsS1 in case region specified is not a Territory and user specifies zip code for the location.
 void clearData()
          Removes all the calculated data.
protected  void createMetadataForPlots(String location)
           
 String getDataInfo()
          Returns the Data and all the metadata associated with it in a String.
protected  void getFunctionsForApprox_UHSpectrum(XY_DataSetList mapSpectrumFunctions)
           
protected  void getFunctionsForSDSpectrum(XY_DataSetList sdSpectrumFunctions)
           
protected  void getFunctionsForSMSpectrum(XY_DataSetList smSpectrumFunctions)
           
 ArrayList getFunctionsToPlotForSA(boolean isUHSFunctionNeeded, boolean isApproxUHSFunctionNeeded, boolean isSDSpectrumFunctionNeeded, boolean isSMSpectrumFunctionNeeded)
          Returns the list of functions for plotting.
 double getSa()
          Returns the SA at 1 sec
 String getSelectedSiteClass()
          Returns the site class
 double getSs()
          Returns the SA at .2sec
 void setEdition(String edition)
          Sets the selected data edition.
 void setFa(float fa)
          Sets the Fa value.
 void setFv(float fv)
          Sets the Fv value.
 void setRegion(String region)
          Sets the selected geographic region.
 void setSiteClass(String siteClass)
          Sets the selected site class
 void setSpectraType(String spectraType)
          Sets the Spectra type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

geographicRegion

protected String geographicRegion

dataEdition

protected String dataEdition

saFunction

protected ArbitrarilyDiscretizedFunc saFunction

saSdFunction

protected ArbitrarilyDiscretizedFunc saSdFunction

sdTFunction

protected ArbitrarilyDiscretizedFunc sdTFunction

faVal

protected float faVal

fvVal

protected float fvVal

siteClass

protected String siteClass

sdSpectrumSaSdFunction

protected ArbitrarilyDiscretizedFunc sdSpectrumSaSdFunction

smSpectrumSaSdFunction

protected ArbitrarilyDiscretizedFunc smSpectrumSaSdFunction

sdSpectrumSaTFunction

protected ArbitrarilyDiscretizedFunc sdSpectrumSaTFunction

smSpectrumSaTFunction

protected ArbitrarilyDiscretizedFunc smSpectrumSaTFunction

approxUHSpectrumSaTFunction

protected ArbitrarilyDiscretizedFunc approxUHSpectrumSaTFunction

approxUHSpectrumSaSdFunction

protected ArbitrarilyDiscretizedFunc approxUHSpectrumSaSdFunction

dataInfo

protected String dataInfo

metadataForPlots

protected String metadataForPlots

selectedSpectraType

protected String selectedSpectraType
Constructor Detail

DataGenerator_UHS

public DataGenerator_UHS()
Method Detail

getSs

public double getSs()
Returns the SA at .2sec

Specified by:
getSs in interface DataGeneratorAPI_UHS
Returns:
double

getSa

public double getSa()
Returns the SA at 1 sec

Specified by:
getSa in interface DataGeneratorAPI_UHS
Returns:
double

calculateApproxUHS

public void calculateApproxUHS()
                        throws RemoteException
Specified by:
calculateApproxUHS in interface DataGeneratorAPI_UHS
Throws:
RemoteException

getFunctionsForApprox_UHSpectrum

protected void getFunctionsForApprox_UHSpectrum(XY_DataSetList mapSpectrumFunctions)
Parameters:
mapSpectrumFunctions - DiscretizedFuncList

getFunctionsForSMSpectrum

protected void getFunctionsForSMSpectrum(XY_DataSetList smSpectrumFunctions)
Parameters:
smSpectrumFunctions - DiscretizedFuncList

getFunctionsForSDSpectrum

protected void getFunctionsForSDSpectrum(XY_DataSetList sdSpectrumFunctions)
Parameters:
sdSpectrumFunctions - DiscretizedFuncList

calculateSMSpectrum

public void calculateSMSpectrum()
                         throws RemoteException
Specified by:
calculateSMSpectrum in interface DataGeneratorAPI_UHS
Throws:
RemoteException

calculateSDSpectrum

public void calculateSDSpectrum()
                         throws RemoteException
Specified by:
calculateSDSpectrum in interface DataGeneratorAPI_UHS
Throws:
RemoteException

calculateUHS

public void calculateUHS(String zipCode)
                  throws ZipCodeErrorException,
                         RemoteException
Gets the data for SsS1 in case region specified is not a Territory and user specifies zip code for the location.

Specified by:
calculateUHS in interface DataGeneratorAPI_UHS
Parameters:
zipCode - String
Throws:
ZipCodeErrorException
RemoteException

calculateUHS

public void calculateUHS(double lat,
                         double lon)
                  throws RemoteException
Gets the data for SsS1 in case region specified is not a Territory and user specifies Lat-Lon for the location.

Specified by:
calculateUHS in interface DataGeneratorAPI_UHS
Parameters:
lat - double
lon - double
Throws:
RemoteException

calculateUHS

public void calculateUHS(ArrayList<Location> locations,
                         String outFile)
Description copied from interface: DataGeneratorAPI_UHS
Computes the UHS for an array of locations

Specified by:
calculateUHS in interface DataGeneratorAPI_UHS

createMetadataForPlots

protected void createMetadataForPlots(String location)

clearData

public void clearData()
Removes all the calculated data.

Specified by:
clearData in interface DataGeneratorAPI_UHS

getDataInfo

public String getDataInfo()
Returns the Data and all the metadata associated with it in a String.

Specified by:
getDataInfo in interface DataGeneratorAPI_UHS
Returns:
String

addDataInfo

protected void addDataInfo(String data)

getFunctionsToPlotForSA

public ArrayList getFunctionsToPlotForSA(boolean isUHSFunctionNeeded,
                                         boolean isApproxUHSFunctionNeeded,
                                         boolean isSDSpectrumFunctionNeeded,
                                         boolean isSMSpectrumFunctionNeeded)
Returns the list of functions for plotting.

Specified by:
getFunctionsToPlotForSA in interface DataGeneratorAPI_UHS
Parameters:
isUHSFunctionNeeded - boolean
isApproxUHSFunctionNeeded - boolean
isSDSpectrumFunctionNeeded - boolean
isSMSpectrumFunctionNeeded - boolean
Returns:
ArrayList

setRegion

public void setRegion(String region)
Sets the selected geographic region.

Specified by:
setRegion in interface DataGeneratorAPI_UHS
Parameters:
region - String

setEdition

public void setEdition(String edition)
Sets the selected data edition.

Specified by:
setEdition in interface DataGeneratorAPI_UHS
Parameters:
edition - String

setFa

public void setFa(float fa)
Sets the Fa value.

Specified by:
setFa in interface DataGeneratorAPI_UHS
Parameters:
fa - double

setFv

public void setFv(float fv)
Sets the Fv value.

Specified by:
setFv in interface DataGeneratorAPI_UHS
Parameters:
fv - double

setSiteClass

public void setSiteClass(String siteClass)
Sets the selected site class

Specified by:
setSiteClass in interface DataGeneratorAPI_UHS
Parameters:
siteClass - String

getSelectedSiteClass

public String getSelectedSiteClass()
Returns the site class

Specified by:
getSelectedSiteClass in interface DataGeneratorAPI_UHS
Returns:
String

setSpectraType

public void setSpectraType(String spectraType)
Sets the Spectra type

Specified by:
setSpectraType in interface DataGeneratorAPI_UHS
Parameters:
spectraType - String