plot.xsec¶
xsec(grid, lon, lat, az, clip, length=2000)
Generates cross-section of a grid surface.
Arguments:¶
grid (xarray.DataArray or str): grid object to plot
lon (float): longitude of the starting point for the projection (on trench)
lat (float): latitude of the starting point for the projection (on trench)
az (float): azimuth of the cross-section line
clip (pandas.DataFrame): clipping mask in ascii format
length (int, optional): length of the projection. Defaults to 2000.
Returns:¶
(pandas.DataFrame): data for cross-section line and track
Example¶
import plot
# load in the synthetic test model as a slab_model instance
model = plot.slab_model("../output/exp_slab2_04-18","surface") # synthetic test slab made with the 04-18 database
# make a cross-section line and save to variable
line = plot.xsec(
model.dep_grid, # run line through the depth grid
128, # setting the line reference point to 128 degrees longitude
1, # setting the line reference point to 1 degree latitude
110, # setting the line orientation to 110 degrees
model.clp, # using the model clipping mask
)