.. _sec-m_to_km: plot.m_to_km ============ ``m_to_km(grid, coords="xy")`` Converts units of depth grid values from meters to kilometers. 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 ------- .. code-block:: python 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.m_to_km(model.dep_grid)