Plotting Functions¶
There are several options for visualizing slab geometry models included in this repository. Users may choose to make maps of slab depth, dip, strike, thickess, and uncertainty. There are also options for plotting slab model cross-sections and comparing slab models to one another.
Slab Model Class Overview¶
class slab_model(path=None, slab_loc=None)
Making figures of slab models is best handled through the plot.slab_model
class.
the slab_model
class is used to load and organize slab model data for ease of access when making plots. To
initialize a slab_model
instance, simply input the optional arguments path
and slab_loc
. The path
argument specifies the path to the folder containing the model data. The slab_loc
instance specifies the slab
model location, being either surface or center. An example usage loading in the synthetic test model as an
instance named model
would be:
import plot
model = plot.slab_model(path="../output/exp_slab2_04-18", slab_loc="surface")
Attributes¶
The slab_model
class contains the following attributes:
slab_model.slab
(str) 3-letter slab model code
slab_model.date
(str) date associated with model output
slab_model.database
(str) input database used to make the slab model
slab_model.slab_loc
(str) ‘surface’ or ‘center’
slab_model.path
(str) path to directory containing model files
slab_model.input
(pandas.DataFrame) dataframe containing input data
slab_model.region
(list) list containing region boundaries for the model
slab_model.dep_grid
(xarray.DataArray) model depth grid object
slab_model.dip_grid
(xarray.DataArray) model dip grid object
slab_model.str_grid
(xarray.DataArray) model strike grid object
slab_model.thk_grid
(xarray.DataArray) model thickness grid object
slab_model.unc_grid
(xarray.DataArray) model uncertainty grid object
slab_model.clp
(pandas.DataFrame) dataframe containing clipping data
slab_model.dat
(pandas.DataFrame) filtered input dataset
slab_model.nod
(pandas.DataFrame) info for all grid nodes constraining final surface
slab_model.par
(pandas.DataFrame) parameters used to make model
slab_model.rem
(pandas.DataFrame) dataframe of points to remove when generating a model
slab_model.res
(pandas.DataFrame) ascii format of output grids listed below
slab_model.szt
(pandas.DataFrame) file listing events used to determine seismogenic width
Methods¶
slab_model.load_model(self, path=None)
Loads data to a
slab_model
instance given the path to the directory containing model outputs.
slab_model.reset_region(self, grid=None)
Manually resets region boundaries using desired grid type.
plot(self, dtype="depth")
Makes a basic plot of the model depth, dip, strike, thickness, or uncertainty
m_to_km(self)
Converts model depth values from units of meters to kilometers
reverse(self)
Reverses the sign of model depth values (e.g. converting negative depth to positive)