org.opensha.sha.mapping
Class GMT_MapGeneratorForShakeMaps

java.lang.Object
  extended by org.opensha.commons.mapping.gmt.GMT_MapGenerator
      extended by org.opensha.sha.mapping.GMT_MapGeneratorForShakeMaps
All Implemented Interfaces:
java.io.Serializable, SecureMapGenerator

public class GMT_MapGeneratorForShakeMaps
extends GMT_MapGenerator

Title: GMT_MapGeneratorForShakeMaps

Description: This class extends the GMT_MapGenerator to extend the GMT functionality for the shakeMaps.

Author:
: Edward (Ned) Field , Nitin Gupta
See Also:
Serialized Form

Field Summary
protected static java.lang.String C
          Name of the class
protected static boolean D
           
static java.lang.String HAZUS_SHAPE_PARAM_NAME
           
static java.lang.String OPENSHA_HAZUS_SERVLET_URL
           
static java.lang.String PGA
           
static java.lang.String PGV
           
static java.lang.String RUP_PLOT_PARAM_INFO
           
static java.lang.String RUP_PLOT_PARAM_NAME
           
static java.lang.String RUP_PLOT_PARAM_NOTHING
           
static java.lang.String RUP_PLOT_PARAM_PERIMETER
           
static java.lang.String RUP_PLOT_PARAM_POINTS
           
static java.lang.String SA_03
           
static java.lang.String SA_10
           
 
Fields inherited from class org.opensha.commons.mapping.gmt.GMT_MapGenerator
adjustableParams, BLACK_BACKGROUND_PARAM_DEFAULT, BLACK_BACKGROUND_PARAM_NAME, COAST_DEFAULT, COAST_DRAW, COAST_FILL, COAST_NONE, COAST_PARAM_NAME, COLOR_SCALE_MAX_PARAM_NAME, COLOR_SCALE_MIN_PARAM_NAME, COLOR_SCALE_MODE_DEFAULT, COLOR_SCALE_MODE_FROMDATA, COLOR_SCALE_MODE_INFO, COLOR_SCALE_MODE_MANUALLY, COLOR_SCALE_MODE_NAME, COMMAND_PATH, CONVERT_PATH, CPT_PARAM_DEFAULT, CPT_PARAM_NAME, CUSTOM_SCALE_LABEL_PARAM_CHECK_NAME, customScaleLabelCheckParam, DEFAULT_GMT_SCRIPT_NAME, DEFAULT_JPG_FILE_NAME, DEFAULT_METADATA_FILE_NAME, DEFAULT_PDF_FILE_NAME, DEFAULT_PNG_FILE_NAME, DEFAULT_PS_FILE_NAME, DEFAULT_XYZ_FILE_NAME, DPI_DEFAULT, DPI_PARAM_NAME, GMT_PATH, GMT_SCRIPT_NAME, GMT_SMOOTHING_DEFAULT, GMT_SMOOTHING_PARAM_NAME, GMT_WEBSERVICE_NAME, GRID_SPACING_PARAM_NAME, GS_PATH, IMAGE_WIDTH_DEFAULT, IMAGE_WIDTH_NAME, imgWebAddr, JPG_FILE_NAME, KML_PARAM_NAME, LOG_PLOT_NAME, LOG_PLOT_PARAM_DEFAULT, logPlotParam, MAX_LAT_PARAM_NAME, MAX_LON_PARAM_NAME, METADATA_FILE_NAME, MIN_LAT_PARAM_NAME, MIN_LON_PARAM_NAME, NETCDF_LIB_PATH, OPENSHA_CLASSPATH, OPENSHA_CONVERT_PATH, OPENSHA_GMT_DATA_PATH, OPENSHA_GMT_PATH, OPENSHA_GS_PATH, OPENSHA_JAVA_PATH, OPENSHA_NETCDF_LIB_PATH, OPENSHA_PS2PDF_PATH, OPENSHA_SERVLET_URL, PDF_FILE_NAME, PNG_FILE_NAME, projWdth, PS_FILE_NAME, PS2PDF_PATH, region, SCALE_LABEL, SCALE_LABEL_PARAM_NAME, scaleLabelParam, SCEC_GMT_DATA_PATH, SHOW_HIWYS_ALL, SHOW_HIWYS_MAIN, SHOW_HIWYS_NONE, SHOW_HIWYS_OTHER, SHOW_HIWYS_PARAM_DEFAULT, SHOW_HIWYS_PARAM_INFO, SHOW_HIWYS_PARAM_NAME, TOPO_RESOLUTION_03_CA, TOPO_RESOLUTION_06_US, TOPO_RESOLUTION_18_US, TOPO_RESOLUTION_30_GLOBAL, TOPO_RESOLUTION_30_US, TOPO_RESOLUTION_NONE, TOPO_RESOLUTION_PARAM_DEFAULT, TOPO_RESOLUTION_PARAM_NAME, xOff, XYZ_FILE_NAME, xyzDataSet, yOff
 
Constructor Summary
GMT_MapGeneratorForShakeMaps()
           
 
Method Summary
protected  void addFinalGMT_ScriptLines(java.util.ArrayList gmtCommandLines)
          Function adds script lines to generate Hazus Shape files if that option has been selected.
static void addHAZUS_Lines(java.util.ArrayList<java.lang.String> gmtCommandLines, GMT_Map map, java.lang.String imt, java.lang.String hazusPrefix)
           
protected  void addIntermediateGMT_ScriptLines(java.util.ArrayList gmtLines)
          This method adds intermediate script commands to plot the earthquake rupture and hypocenter.
static void addRupture(GMT_Map map, EvenlyGriddedSurface surface, Location hypo, java.lang.String rupPlot)
           
 GMT_Map getGMTMapSpecification(GeoDataSet xyzData)
           
 java.lang.String[] makeHazusFileSetLocally(GeoDataSet sa03DataSet, GeoDataSet sa10DataSet, GeoDataSet pgaDataSet, GeoDataSet pgvDataSet, EqkRupture eqkRupture, java.lang.String metadata, java.lang.String dirName)
           
 java.lang.String[] makeHazusFileSetUsingServlet(GeoDataSet sa03DataSet, GeoDataSet sa10DataSet, GeoDataSet pgaDataSet, GeoDataSet pgvDataSet, EqkRupture eqkRupture, java.lang.String metadata, java.lang.String dirName)
           
 java.lang.String makeMapLocally(GeoDataSet xyzDataSet, EqkRupture eqkRupture, java.lang.String imtString, java.lang.String metadata, java.lang.String directoryName)
          Makes scenarioshake maps locally using the GMT on the users own computer
 java.lang.String makeMapUsingServlet(GeoDataSet xyzDataSet, EqkRupture eqkRupture, java.lang.String imtString, java.lang.String metadata, java.lang.String dirName)
          Makes scenarioshake maps using the GMT on the gravity.usc.edu server(Linux server).
 java.lang.String makeMapUsingWebServer(GeoDataSet xyzDataSet, EqkRupture eqkRupture, java.lang.String imtString, java.lang.String metadata)
          Makes scenarioshake maps using the GMT on the gravity.usc.edu server(Linux server).
protected  java.lang.String openServletConnection(GeoDataSet sa03_xyzDataVals, GeoDataSet sa10_xyzDataVals, GeoDataSet pga_xyzDataVals, GeoDataSet pgv_xyzDataVals, GMT_Map[] maps, java.lang.String metadata, java.lang.String dirName)
          sets up the connection with the servlet on the server (gravity.usc.edu)
 
Methods inherited from class org.opensha.commons.mapping.gmt.GMT_MapGenerator
addCleanup, addCoastCommand, addColorbarCommand, addColorbarCommand, addHighwayCommand, addPolyCommands, addSpecialElements, addSymbolCommands, addSymbolSetCommands, createMapInfoFile, getAdjustableParamsIterator, getAdjustableParamsList, getEvenlyGriddedGeographicRegion, getGMT_ScriptLines, getGMT_ScriptLines, getGMTColorString, getGMTFilesWebAddress, getGMTPathEnvLines, getImageFileName, getMapInfoLines, makeFileFromLines, makeMapLocally, makeMapUsingServlet, makeMapUsingServlet, makeMapUsingWebServer, openServletConnection, setMetatdataFileName, setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C

protected static final java.lang.String C
Name of the class

See Also:
Constant Field Values

OPENSHA_HAZUS_SERVLET_URL

public static final java.lang.String OPENSHA_HAZUS_SERVLET_URL

D

protected static final boolean D
See Also:
Constant Field Values

SA_10

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

SA_03

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

PGA

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

PGV

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

RUP_PLOT_PARAM_NAME

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

RUP_PLOT_PARAM_PERIMETER

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

RUP_PLOT_PARAM_POINTS

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

RUP_PLOT_PARAM_NOTHING

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

RUP_PLOT_PARAM_INFO

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

HAZUS_SHAPE_PARAM_NAME

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

GMT_MapGeneratorForShakeMaps

public GMT_MapGeneratorForShakeMaps()
Method Detail

makeHazusFileSetLocally

public java.lang.String[] makeHazusFileSetLocally(GeoDataSet sa03DataSet,
                                                  GeoDataSet sa10DataSet,
                                                  GeoDataSet pgaDataSet,
                                                  GeoDataSet pgvDataSet,
                                                  EqkRupture eqkRupture,
                                                  java.lang.String metadata,
                                                  java.lang.String dirName)
                                           throws GMT_MapException
Parameters:
sa03DataSet -
sa10DataSet -
pgaDataSet -
pgvDataSet -
eqkRupture - returns the String[] of the image file names
Throws:
GMT_MapException

makeHazusFileSetUsingServlet

public java.lang.String[] makeHazusFileSetUsingServlet(GeoDataSet sa03DataSet,
                                                       GeoDataSet sa10DataSet,
                                                       GeoDataSet pgaDataSet,
                                                       GeoDataSet pgvDataSet,
                                                       EqkRupture eqkRupture,
                                                       java.lang.String metadata,
                                                       java.lang.String dirName)
                                                throws GMT_MapException
Parameters:
sa03DataSet -
sa10DataSet -
pgaDataSet -
pgvDataSet -
eqkRupture -
Returns:
- the String[] of web addresses(URL) where the images files are located
Throws:
GMT_MapException

openServletConnection

protected java.lang.String openServletConnection(GeoDataSet sa03_xyzDataVals,
                                                 GeoDataSet sa10_xyzDataVals,
                                                 GeoDataSet pga_xyzDataVals,
                                                 GeoDataSet pgv_xyzDataVals,
                                                 GMT_Map[] maps,
                                                 java.lang.String metadata,
                                                 java.lang.String dirName)
                                          throws java.lang.RuntimeException
sets up the connection with the servlet on the server (gravity.usc.edu)

Parameters:
sa03_xyzDataVals - : XYZ data for the SA-0.3sec
sa10_xyzDataVals - : XYZ data for the SA-1.0sec
pga_xyzDataVals - : XYZ data for the PGA
pgv_xyzDataVals - : XYZ data for the PGV
gmtFileLines - : Script lines to be executed on the server
metadataLines - : MetadataLines
Returns:
the webaddress of the Directory as the link to where all the output files are generated
Throws:
java.lang.RuntimeException

makeMapLocally

public java.lang.String makeMapLocally(GeoDataSet xyzDataSet,
                                       EqkRupture eqkRupture,
                                       java.lang.String imtString,
                                       java.lang.String metadata,
                                       java.lang.String directoryName)
                                throws GMT_MapException
Makes scenarioshake maps locally using the GMT on the users own computer

Parameters:
xyzDataSet: - XYZ Data
eqkRup - : EarthRupture Object
hypLoc - :Hypocenter Location
imtString - - the IMT string for labeling and filenames
Returns:
Throws:
GMT_MapException

makeMapUsingServlet

public java.lang.String makeMapUsingServlet(GeoDataSet xyzDataSet,
                                            EqkRupture eqkRupture,
                                            java.lang.String imtString,
                                            java.lang.String metadata,
                                            java.lang.String dirName)
                                     throws GMT_MapException,
                                            java.lang.RuntimeException
Makes scenarioshake maps using the GMT on the gravity.usc.edu server(Linux server). Implemented as the servlet, using which we can actual java serialized object.

Parameters:
xyzDataSet: - XYZ Data
eqkRup - : EarthRupture Object
hypLoc - : Hypocenter Location
imtString - - the IMT string for labeling and filenames
Throws:
GMT_MapException
java.lang.RuntimeException

makeMapUsingWebServer

public java.lang.String makeMapUsingWebServer(GeoDataSet xyzDataSet,
                                              EqkRupture eqkRupture,
                                              java.lang.String imtString,
                                              java.lang.String metadata)
                                       throws GMT_MapException
Makes scenarioshake maps using the GMT on the gravity.usc.edu server(Linux server). Implemented as the webservice, using which we can send files as the attachment.

Parameters:
xyzDataSet: - XYZ Data
eqkRup - : EarthRupture Object
hypLoc - :Hypocenter Location
imtString - - the IMT string for labeling and filenames
Throws:
GMT_MapException

addHAZUS_Lines

public static void addHAZUS_Lines(java.util.ArrayList<java.lang.String> gmtCommandLines,
                                  GMT_Map map,
                                  java.lang.String imt,
                                  java.lang.String hazusPrefix)

addFinalGMT_ScriptLines

protected void addFinalGMT_ScriptLines(java.util.ArrayList gmtCommandLines)
Function adds script lines to generate Hazus Shape files if that option has been selected.

Overrides:
addFinalGMT_ScriptLines in class GMT_MapGenerator
Parameters:
gmtCommandLines - : ArrayList to store the command line

addRupture

public static final void addRupture(GMT_Map map,
                                    EvenlyGriddedSurface surface,
                                    Location hypo,
                                    java.lang.String rupPlot)

getGMTMapSpecification

public GMT_Map getGMTMapSpecification(GeoDataSet xyzData)
Overrides:
getGMTMapSpecification in class GMT_MapGenerator

addIntermediateGMT_ScriptLines

protected void addIntermediateGMT_ScriptLines(java.util.ArrayList gmtLines)
This method adds intermediate script commands to plot the earthquake rupture and hypocenter.

Overrides:
addIntermediateGMT_ScriptLines in class GMT_MapGenerator