plot.reverse

reverse(grid, coords="xy")

Reverses sign of grid values.

Arguments:

  • grid (xarray.DataArray): input grid object with depth values in meters.

  • coords (str, optional): specify if grid object coordinates are in “xy” or “lonlat”. Defaults to “xy”.

Returns:

(xarray.DataArray): output grid object with depth values in km.

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
# convert the depth units and update the model
model.dep_grid = plot.reverse(model.dep_grid)