import xarray as xr
import xroms
import matplotlib.pyplot as plt
import cartopy
import numpy as np
# import hvplot.xarray
# import geoviews as gv
import cmocean.cm as cmo
import xcmocean
How to plot¶
This notebook demonstrates how to plot ROMS model output from a planview ($x$-$y$) and an $x$-$z$ cross-section. Static and interactive approaches are shown. The cartopy package is used for managing projections for mapview plots, which also gives many options for input (some shown below).
Note you need version 0.11 of Datashader for rasterizing to work in the interactive plots. (https://github.com/holoviz/hvplot/issues/434)
Load in data¶
Load in example dataset. More information at in input/output page
ds = xroms.datasets.fetch_ROMS_example_full_grid()
ds, xgrid = xroms.roms_dataset(ds, include_cell_volume=True, include_Z0=True)
ds.xroms.set_grid(xgrid)
ds
<xarray.Dataset> Size: 957MB
Dimensions: (eta_rho: 191, xi_rho: 300, s_rho: 30, ocean_time: 2, s_w: 31,
xi_u: 299, eta_v: 190)
Coordinates: (12/29)
lon_rho (eta_rho, xi_rho) float64 458kB dask.array<chunksize=(191, 300), meta=np.ndarray>
lat_rho (eta_rho, xi_rho) float64 458kB dask.array<chunksize=(191, 300), meta=np.ndarray>
* s_rho (s_rho) float64 240B -0.9833 -0.95 -0.9167 ... -0.05 -0.01667
* s_w (s_w) float64 248B -1.0 -0.9667 -0.9333 ... -0.03333 0.0
* ocean_time (ocean_time) datetime64[ns] 16B 2009-11-19T12:00:00 2009-11-1...
lon_u (eta_rho, xi_u) float64 457kB dask.array<chunksize=(191, 299), meta=np.ndarray>
... ...
z_rho_v0 (s_rho, eta_v, xi_rho) float64 14MB dask.array<chunksize=(30, 190, 300), meta=np.ndarray>
z_rho_psi0 (s_rho, eta_v, xi_u) float64 14MB dask.array<chunksize=(30, 190, 299), meta=np.ndarray>
z_w0 (s_w, eta_rho, xi_rho) float64 14MB dask.array<chunksize=(31, 191, 300), meta=np.ndarray>
z_w_u0 (s_w, eta_rho, xi_u) float64 14MB dask.array<chunksize=(31, 191, 299), meta=np.ndarray>
z_w_v0 (s_w, eta_v, xi_rho) float64 14MB dask.array<chunksize=(31, 190, 300), meta=np.ndarray>
z_w_psi0 (s_w, eta_v, xi_u) float64 14MB dask.array<chunksize=(31, 190, 299), meta=np.ndarray>
Data variables: (12/53)
angle (eta_rho, xi_rho) float64 458kB dask.array<chunksize=(191, 300), meta=np.ndarray>
hc float64 8B ...
Cs_r (s_rho) float64 240B dask.array<chunksize=(30,), meta=np.ndarray>
zeta (ocean_time, eta_rho, xi_rho) float32 458kB dask.array<chunksize=(2, 191, 300), meta=np.ndarray>
h (eta_rho, xi_rho) float64 458kB dask.array<chunksize=(191, 300), meta=np.ndarray>
Cs_w (s_w) float64 248B dask.array<chunksize=(31,), meta=np.ndarray>
... ...
dV_w_u (ocean_time, s_w, eta_rho, xi_u) float64 28MB dask.array<chunksize=(2, 31, 191, 299), meta=np.ndarray>
dV_v (ocean_time, s_rho, eta_v, xi_rho) float64 27MB dask.array<chunksize=(2, 30, 190, 300), meta=np.ndarray>
dV_w_v (ocean_time, s_w, eta_v, xi_rho) float64 28MB dask.array<chunksize=(2, 31, 190, 300), meta=np.ndarray>
dV_psi (ocean_time, s_rho, eta_v, xi_u) float64 27MB dask.array<chunksize=(2, 30, 190, 299), meta=np.ndarray>
dV_w_psi (ocean_time, s_w, eta_v, xi_u) float64 28MB dask.array<chunksize=(2, 31, 190, 299), meta=np.ndarray>
rho0 int64 8B 1025
Attributes: (12/29)
file: ocean_his_0150.nc
format: netCDF-3 classic file
Conventions: CF-1.4
type: ROMS/TOMS history file
title: Texas and Louisiana Shelf case (Nesting)
rst_file: ocean_rst.nc
... ...
compiler_command: /g/software/openmpi/1.4.3/intel/bin/mpif90
compiler_flags: -heap-arrays -fp-model precise -assume 2underscores -c...
tiling: 016x032
history: ROMS/TOMS, Version 3.4, Sunday - December 4, 2011 - 7...
ana_file: /scratch/zhangxq/projects/txla_nesting6/Functionals/an...
CPP_options: TXLA, ANA_BSFLUX, ANA_BTFLUX, ASSUMED_SHAPE, BULK_FLUX...- eta_rho: 191
- xi_rho: 300
- s_rho: 30
- ocean_time: 2
- s_w: 31
- xi_u: 299
- eta_v: 190
- lon_rho(eta_rho, xi_rho)float64dask.array<chunksize=(191, 300), meta=np.ndarray>
- units :
- meters
- standard_name :
- longitude
Array Chunk Bytes 447.66 kiB 447.66 kiB Shape (191, 300) (191, 300) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 300 191 - lat_rho(eta_rho, xi_rho)float64dask.array<chunksize=(191, 300), meta=np.ndarray>
- units :
- meters
- standard_name :
- latitude
Array Chunk Bytes 447.66 kiB 447.66 kiB Shape (191, 300) (191, 300) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 300 191 - s_rho(s_rho)float64-0.9833 -0.95 ... -0.05 -0.01667
- long_name :
- S-coordinate at RHO-points
- valid_min :
- -1.0
- valid_max :
- 0.0
- standard_name :
- ocean_s_coordinate_g1
- formula_terms :
- s: s_rho C: Cs_r eta: zeta depth: h depth_c: hc
- field :
- s_rho, scalar
- axis :
- Z
array([-0.983333, -0.95 , -0.916667, -0.883333, -0.85 , -0.816667, -0.783333, -0.75 , -0.716667, -0.683333, -0.65 , -0.616667, -0.583333, -0.55 , -0.516667, -0.483333, -0.45 , -0.416667, -0.383333, -0.35 , -0.316667, -0.283333, -0.25 , -0.216667, -0.183333, -0.15 , -0.116667, -0.083333, -0.05 , -0.016667]) - s_w(s_w)float64-1.0 -0.9667 ... -0.03333 0.0
- long_name :
- S-coordinate at W-points
- valid_min :
- -1.0
- valid_max :
- 0.0
- standard_name :
- ocean_s_coordinate_g1
- formula_terms :
- s: s_w C: Cs_w eta: zeta depth: h depth_c: hc
- field :
- s_w, scalar
- axis :
- Z
array([-1. , -0.966667, -0.933333, -0.9 , -0.866667, -0.833333, -0.8 , -0.766667, -0.733333, -0.7 , -0.666667, -0.633333, -0.6 , -0.566667, -0.533333, -0.5 , -0.466667, -0.433333, -0.4 , -0.366667, -0.333333, -0.3 , -0.266667, -0.233333, -0.2 , -0.166667, -0.133333, -0.1 , -0.066667, -0.033333, 0. ]) - ocean_time(ocean_time)datetime64[ns]2009-11-19T12:00:00 2009-11-19T1...
- long_name :
- time since initialization
- field :
- time, scalar, series
- axis :
- T
- standard_name :
- time
array(['2009-11-19T12:00:00.000000000', '2009-11-19T16:00:00.000000000'], dtype='datetime64[ns]') - lon_u(eta_rho, xi_u)float64dask.array<chunksize=(191, 299), meta=np.ndarray>
- units :
- meters
- standard_name :
- longitude
Array Chunk Bytes 446.16 kiB 446.16 kiB Shape (191, 299) (191, 299) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 299 191 - lat_u(eta_rho, xi_u)float64dask.array<chunksize=(191, 299), meta=np.ndarray>
- units :
- meters
- standard_name :
- latitude
Array Chunk Bytes 446.16 kiB 446.16 kiB Shape (191, 299) (191, 299) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 299 191 - lon_v(eta_v, xi_rho)float64dask.array<chunksize=(190, 300), meta=np.ndarray>
- units :
- meters
- standard_name :
- longitude
Array Chunk Bytes 445.31 kiB 445.31 kiB Shape (190, 300) (190, 300) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 300 190 - lat_v(eta_v, xi_rho)float64dask.array<chunksize=(190, 300), meta=np.ndarray>
- units :
- meters
- standard_name :
- latitude
Array Chunk Bytes 445.31 kiB 445.31 kiB Shape (190, 300) (190, 300) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 300 190 - xi_rho(xi_rho)int640 1 2 3 4 5 ... 295 296 297 298 299
- axis :
- X
array([ 0, 1, 2, ..., 297, 298, 299], shape=(300,))
- xi_u(xi_u)int640 1 2 3 4 5 ... 294 295 296 297 298
- axis :
- X
array([ 0, 1, 2, ..., 296, 297, 298], shape=(299,))
- eta_rho(eta_rho)int640 1 2 3 4 5 ... 186 187 188 189 190
- axis :
- Y
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190]) - eta_v(eta_v)int640 1 2 3 4 5 ... 185 186 187 188 189
- axis :
- Y
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189]) - z_w(ocean_time, s_w, eta_rho, xi_rho)float64dask.array<chunksize=(2, 31, 191, 300), meta=np.ndarray>
- long_name :
- depth of W-points
- time :
- ocean_time
- field :
- z_w, scalar, series
- units :
- m
- positive :
- up
- standard_name :
- depth
Array Chunk Bytes 27.10 MiB 27.10 MiB Shape (2, 31, 191, 300) (2, 31, 191, 300) Dask graph 1 chunks in 29 graph layers Data type float64 numpy.ndarray 2 1 300 191 31 - z_w_u(ocean_time, s_w, eta_rho, xi_u)float64dask.array<chunksize=(2, 31, 191, 299), meta=np.ndarray>
- long_name :
- depth of U-points on vertical W grid
- time :
- ocean_time
- field :
- z_w_u, scalar, series
- units :
- m
- positive :
- up
- standard_name :
- depth
Array Chunk Bytes 27.01 MiB 27.01 MiB Shape (2, 31, 191, 299) (2, 31, 191, 299) Dask graph 1 chunks in 32 graph layers Data type float64 numpy.ndarray 2 1 299 191 31 - z_w_v(ocean_time, s_w, eta_v, xi_rho)float64dask.array<chunksize=(2, 31, 190, 300), meta=np.ndarray>
- long_name :
- depth of V-points on vertical W grid
- time :
- ocean_time
- field :
- z_w_v, scalar, series
- units :
- m
- positive :
- up
- standard_name :
- depth
Array Chunk Bytes 26.96 MiB 26.96 MiB Shape (2, 31, 190, 300) (2, 31, 190, 300) Dask graph 1 chunks in 34 graph layers Data type float64 numpy.ndarray 2 1 300 190 31 - z_w_psi(ocean_time, s_w, eta_v, xi_u)float64dask.array<chunksize=(2, 31, 190, 299), meta=np.ndarray>
- long_name :
- depth of PSI-points on vertical W grid
- time :
- ocean_time
- field :
- z_w_psi, scalar, series
- units :
- m
- positive :
- up
- standard_name :
- depth
Array Chunk Bytes 26.87 MiB 26.87 MiB Shape (2, 31, 190, 299) (2, 31, 190, 299) Dask graph 1 chunks in 37 graph layers Data type float64 numpy.ndarray 2 1 299 190 31 - z_rho(ocean_time, s_rho, eta_rho, xi_rho)float64dask.array<chunksize=(2, 30, 191, 300), meta=np.ndarray>
- long_name :
- depth of RHO-points
- time :
- ocean_time
- field :
- z_rho, scalar, series
- units :
- m
- positive :
- up
- standard_name :
- depth
Array Chunk Bytes 26.23 MiB 26.23 MiB Shape (2, 30, 191, 300) (2, 30, 191, 300) Dask graph 1 chunks in 29 graph layers Data type float64 numpy.ndarray 2 1 300 191 30 - z_rho_u(ocean_time, s_rho, eta_rho, xi_u)float64dask.array<chunksize=(2, 30, 191, 299), meta=np.ndarray>
- long_name :
- depth of U-points on vertical RHO grid
- time :
- ocean_time
- field :
- z_rho_u, scalar, series
- units :
- m
- positive :
- up
- standard_name :
- depth
Array Chunk Bytes 26.14 MiB 26.14 MiB Shape (2, 30, 191, 299) (2, 30, 191, 299) Dask graph 1 chunks in 32 graph layers Data type float64 numpy.ndarray 2 1 299 191 30 - z_rho_v(ocean_time, s_rho, eta_v, xi_rho)float64dask.array<chunksize=(2, 30, 190, 300), meta=np.ndarray>
- long_name :
- depth of V-points on vertical RHO grid
- time :
- ocean_time
- field :
- z_rho_v, scalar, series
- units :
- m
- positive :
- up
- standard_name :
- depth
Array Chunk Bytes 26.09 MiB 26.09 MiB Shape (2, 30, 190, 300) (2, 30, 190, 300) Dask graph 1 chunks in 34 graph layers Data type float64 numpy.ndarray 2 1 300 190 30 - z_rho_psi(ocean_time, s_rho, eta_v, xi_u)float64dask.array<chunksize=(2, 30, 190, 299), meta=np.ndarray>
- long_name :
- depth of PSI-points on vertical RHO grid
- time :
- ocean_time
- field :
- z_rho_psi, scalar, series
- units :
- m
- positive :
- up
- standard_name :
- depth
Array Chunk Bytes 26.01 MiB 26.01 MiB Shape (2, 30, 190, 299) (2, 30, 190, 299) Dask graph 1 chunks in 37 graph layers Data type float64 numpy.ndarray 2 1 299 190 30 - z_rho0(s_rho, eta_rho, xi_rho)float64dask.array<chunksize=(30, 191, 300), meta=np.ndarray>
- long_name :
- depth of RHO-points
- field :
- z_rho0, scalar
- units :
- m
Array Chunk Bytes 13.11 MiB 13.11 MiB Shape (30, 191, 300) (30, 191, 300) Dask graph 1 chunks in 15 graph layers Data type float64 numpy.ndarray 300 191 30 - z_rho_u0(s_rho, eta_rho, xi_u)float64dask.array<chunksize=(30, 191, 299), meta=np.ndarray>
- long_name :
- depth of U-points on vertical RHO grid
- field :
- z_rho_u0, scalar
- units :
- m
Array Chunk Bytes 13.07 MiB 13.07 MiB Shape (30, 191, 299) (30, 191, 299) Dask graph 1 chunks in 18 graph layers Data type float64 numpy.ndarray 299 191 30 - z_rho_v0(s_rho, eta_v, xi_rho)float64dask.array<chunksize=(30, 190, 300), meta=np.ndarray>
- long_name :
- depth of V-points on vertical RHO grid
- field :
- z_rho_v0, scalar
- units :
- m
Array Chunk Bytes 13.05 MiB 13.05 MiB Shape (30, 190, 300) (30, 190, 300) Dask graph 1 chunks in 20 graph layers Data type float64 numpy.ndarray 300 190 30 - z_rho_psi0(s_rho, eta_v, xi_u)float64dask.array<chunksize=(30, 190, 299), meta=np.ndarray>
- long_name :
- depth of PSI-points on vertical RHO grid
- field :
- z_rho_psi0, scalar
- units :
- m
Array Chunk Bytes 13.00 MiB 13.00 MiB Shape (30, 190, 299) (30, 190, 299) Dask graph 1 chunks in 23 graph layers Data type float64 numpy.ndarray 299 190 30 - z_w0(s_w, eta_rho, xi_rho)float64dask.array<chunksize=(31, 191, 300), meta=np.ndarray>
- long_name :
- depth of W-points
- field :
- z_w0, scalar
- units :
- m
Array Chunk Bytes 13.55 MiB 13.55 MiB Shape (31, 191, 300) (31, 191, 300) Dask graph 1 chunks in 15 graph layers Data type float64 numpy.ndarray 300 191 31 - z_w_u0(s_w, eta_rho, xi_u)float64dask.array<chunksize=(31, 191, 299), meta=np.ndarray>
- long_name :
- depth of U-points on vertical W grid
- field :
- z_w_u0, scalar
- units :
- m
Array Chunk Bytes 13.51 MiB 13.51 MiB Shape (31, 191, 299) (31, 191, 299) Dask graph 1 chunks in 18 graph layers Data type float64 numpy.ndarray 299 191 31 - z_w_v0(s_w, eta_v, xi_rho)float64dask.array<chunksize=(31, 190, 300), meta=np.ndarray>
- long_name :
- depth of V-points on vertical W grid
- field :
- z_w_v0, scalar
- units :
- m
Array Chunk Bytes 13.48 MiB 13.48 MiB Shape (31, 190, 300) (31, 190, 300) Dask graph 1 chunks in 20 graph layers Data type float64 numpy.ndarray 300 190 31 - z_w_psi0(s_w, eta_v, xi_u)float64dask.array<chunksize=(31, 190, 299), meta=np.ndarray>
- long_name :
- depth of PSI-points on vertical W grid
- field :
- z_w_psi0, scalar
- units :
- m
Array Chunk Bytes 13.44 MiB 13.44 MiB Shape (31, 190, 299) (31, 190, 299) Dask graph 1 chunks in 23 graph layers Data type float64 numpy.ndarray 299 190 31
- angle(eta_rho, xi_rho)float64dask.array<chunksize=(191, 300), meta=np.ndarray>
- long_name :
- angle between XI-axis and EAST
- units :
- radians
- field :
- angle, scalar
Array Chunk Bytes 447.66 kiB 447.66 kiB Shape (191, 300) (191, 300) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 300 191 - hc()float64...
- long_name :
- S-coordinate parameter, critical depth
- units :
- meter
[1 values with dtype=float64]
- Cs_r(s_rho)float64dask.array<chunksize=(30,), meta=np.ndarray>
- long_name :
- S-coordinate stretching curves at RHO-points
- valid_min :
- -1.0
- valid_max :
- 0.0
- field :
- Cs_r, scalar
Array Chunk Bytes 240 B 240 B Shape (30,) (30,) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 30 1 - zeta(ocean_time, eta_rho, xi_rho)float32dask.array<chunksize=(2, 191, 300), meta=np.ndarray>
- long_name :
- free-surface
- units :
- meter
- time :
- ocean_time
- field :
- free-surface, scalar, series
Array Chunk Bytes 447.66 kiB 447.66 kiB Shape (2, 191, 300) (2, 191, 300) Dask graph 1 chunks in 2 graph layers Data type float32 numpy.ndarray 300 191 2 - h(eta_rho, xi_rho)float64dask.array<chunksize=(191, 300), meta=np.ndarray>
- long_name :
- bathymetry at RHO-points
- units :
- meter
- field :
- bath, scalar
Array Chunk Bytes 447.66 kiB 447.66 kiB Shape (191, 300) (191, 300) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 300 191 - Cs_w(s_w)float64dask.array<chunksize=(31,), meta=np.ndarray>
- long_name :
- S-coordinate stretching curves at W-points
- valid_min :
- -1.0
- valid_max :
- 0.0
- field :
- Cs_w, scalar
Array Chunk Bytes 248 B 248 B Shape (31,) (31,) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 31 1 - mask_rho(eta_rho, xi_rho)float64dask.array<chunksize=(191, 300), meta=np.ndarray>
- long_name :
- mask on RHO-points
- flag_values :
- [0. 1.]
- flag_meanings :
- land water
Array Chunk Bytes 447.66 kiB 447.66 kiB Shape (191, 300) (191, 300) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 300 191 - mask_u(eta_rho, xi_u)float64dask.array<chunksize=(191, 299), meta=np.ndarray>
- long_name :
- mask on U-points
- flag_values :
- [0. 1.]
- flag_meanings :
- land water
Array Chunk Bytes 446.16 kiB 446.16 kiB Shape (191, 299) (191, 299) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 299 191 - mask_v(eta_v, xi_rho)float64dask.array<chunksize=(190, 300), meta=np.ndarray>
- long_name :
- mask on V-points
- flag_values :
- [0. 1.]
- flag_meanings :
- land water
Array Chunk Bytes 445.31 kiB 445.31 kiB Shape (190, 300) (190, 300) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 300 190 - u(ocean_time, s_rho, eta_rho, xi_u)float32dask.array<chunksize=(2, 30, 191, 299), meta=np.ndarray>
- long_name :
- u-momentum component
- units :
- meter second-1
- time :
- ocean_time
- field :
- u-velocity, scalar, series
Array Chunk Bytes 13.07 MiB 13.07 MiB Shape (2, 30, 191, 299) (2, 30, 191, 299) Dask graph 1 chunks in 2 graph layers Data type float32 numpy.ndarray 2 1 299 191 30 - v(ocean_time, s_rho, eta_v, xi_rho)float32dask.array<chunksize=(2, 30, 190, 300), meta=np.ndarray>
- long_name :
- v-momentum component
- units :
- meter second-1
- time :
- ocean_time
- field :
- v-velocity, scalar, series
Array Chunk Bytes 13.05 MiB 13.05 MiB Shape (2, 30, 190, 300) (2, 30, 190, 300) Dask graph 1 chunks in 2 graph layers Data type float32 numpy.ndarray 2 1 300 190 30 - temp(ocean_time, s_rho, eta_rho, xi_rho)float32dask.array<chunksize=(2, 30, 191, 300), meta=np.ndarray>
- long_name :
- potential temperature
- units :
- Celsius
- time :
- ocean_time
- field :
- temperature, scalar, series
Array Chunk Bytes 13.11 MiB 13.11 MiB Shape (2, 30, 191, 300) (2, 30, 191, 300) Dask graph 1 chunks in 2 graph layers Data type float32 numpy.ndarray 2 1 300 191 30 - salt(ocean_time, s_rho, eta_rho, xi_rho)float32dask.array<chunksize=(2, 30, 191, 300), meta=np.ndarray>
- long_name :
- salinity
- time :
- ocean_time
- field :
- salinity, scalar, series
Array Chunk Bytes 13.11 MiB 13.11 MiB Shape (2, 30, 191, 300) (2, 30, 191, 300) Dask graph 1 chunks in 2 graph layers Data type float32 numpy.ndarray 2 1 300 191 30 - Vtransform()int32...
- long_name :
- vertical terrain-following transformation equation
[1 values with dtype=int32]
- pm(eta_rho, xi_rho)float64dask.array<chunksize=(191, 300), meta=np.ndarray>
- long_name :
- curvilinear coordinate metric in XI
- units :
- meter-1
- field :
- pm, scalar
Array Chunk Bytes 447.66 kiB 447.66 kiB Shape (191, 300) (191, 300) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 300 191 - pn(eta_rho, xi_rho)float64dask.array<chunksize=(191, 300), meta=np.ndarray>
- long_name :
- curvilinear coordinate metric in ETA
- units :
- meter-1
- field :
- pn, scalar
Array Chunk Bytes 447.66 kiB 447.66 kiB Shape (191, 300) (191, 300) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 300 191 - f(eta_rho, xi_rho)float64dask.array<chunksize=(191, 300), meta=np.ndarray>
- long_name :
- Coriolis parameter at RHO-points
- units :
- second-1
- field :
- coriolis, scalar
Array Chunk Bytes 447.66 kiB 447.66 kiB Shape (191, 300) (191, 300) Dask graph 1 chunks in 2 graph layers Data type float64 numpy.ndarray 300 191 - spherical()int641
array(1)
- 3d()boolTrue
array(True)
- dx(eta_rho, xi_rho)float64dask.array<chunksize=(191, 300), meta=np.ndarray>
- long_name :
- inverse curvilinear coordinate metric in XI
- units :
- meter
- field :
- dx, scalar
Array Chunk Bytes 447.66 kiB 447.66 kiB Shape (191, 300) (191, 300) Dask graph 1 chunks in 3 graph layers Data type float64 numpy.ndarray 300 191 - dx_u(eta_rho, xi_u)float64dask.array<chunksize=(191, 299), meta=np.ndarray>
- long_name :
- inverse curvilinear coordinate metric in XI on U grid
- units :
- meter
- field :
- dx_u, scalar
Array Chunk Bytes 446.16 kiB 446.16 kiB Shape (191, 299) (191, 299) Dask graph 1 chunks in 6 graph layers Data type float64 numpy.ndarray 299 191 - dx_v(eta_v, xi_rho)float64dask.array<chunksize=(190, 300), meta=np.ndarray>
- long_name :
- inverse curvilinear coordinate metric in XI on V grid
- units :
- meter
- field :
- dx_v, scalar
Array Chunk Bytes 445.31 kiB 445.31 kiB Shape (190, 300) (190, 300) Dask graph 1 chunks in 8 graph layers Data type float64 numpy.ndarray 300 190 - dx_psi(eta_v, xi_u)float64dask.array<chunksize=(190, 299), meta=np.ndarray>
- long_name :
- inverse curvilinear coordinate metric in XI on PSI grid
- units :
- meter
- field :
- dx_psi, scalar
Array Chunk Bytes 443.83 kiB 443.83 kiB Shape (190, 299) (190, 299) Dask graph 1 chunks in 11 graph layers Data type float64 numpy.ndarray 299 190 - dy(eta_rho, xi_rho)float64dask.array<chunksize=(191, 300), meta=np.ndarray>
- long_name :
- inverse curvilinear coordinate metric in ETA
- units :
- meter
- field :
- dy, scalar
Array Chunk Bytes 447.66 kiB 447.66 kiB Shape (191, 300) (191, 300) Dask graph 1 chunks in 3 graph layers Data type float64 numpy.ndarray 300 191 - dy_u(eta_rho, xi_u)float64dask.array<chunksize=(191, 299), meta=np.ndarray>
- long_name :
- inverse curvilinear coordinate metric in ETA on U grid
- units :
- meter
- field :
- dy_u, scalar
Array Chunk Bytes 446.16 kiB 446.16 kiB Shape (191, 299) (191, 299) Dask graph 1 chunks in 6 graph layers Data type float64 numpy.ndarray 299 191 - dy_v(eta_v, xi_rho)float64dask.array<chunksize=(190, 300), meta=np.ndarray>
- long_name :
- inverse curvilinear coordinate metric in ETA on V grid
- units :
- meter
- field :
- dy_v, scalar
Array Chunk Bytes 445.31 kiB 445.31 kiB Shape (190, 300) (190, 300) Dask graph 1 chunks in 8 graph layers Data type float64 numpy.ndarray 300 190 - dy_psi(eta_v, xi_u)float64dask.array<chunksize=(190, 299), meta=np.ndarray>
- long_name :
- inverse curvilinear coordinate metric in ETA on PSI grid
- units :
- meter
- field :
- dy_psi, scalar
Array Chunk Bytes 443.83 kiB 443.83 kiB Shape (190, 299) (190, 299) Dask graph 1 chunks in 11 graph layers Data type float64 numpy.ndarray 299 190 - dz(ocean_time, s_rho, eta_rho, xi_rho)float64dask.array<chunksize=(2, 30, 191, 300), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical RHO grid
- time :
- ocean_time
- field :
- dz, scalar, series
- units :
- m
Array Chunk Bytes 26.23 MiB 26.23 MiB Shape (2, 30, 191, 300) (2, 30, 191, 300) Dask graph 1 chunks in 34 graph layers Data type float64 numpy.ndarray 2 1 300 191 30 - dz_w(ocean_time, s_w, eta_rho, xi_rho)float64dask.array<chunksize=(2, 31, 191, 300), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical W grid
- time :
- ocean_time
- field :
- dz_w, scalar, series
- units :
- m
Array Chunk Bytes 27.10 MiB 27.10 MiB Shape (2, 31, 191, 300) (2, 31, 191, 300) Dask graph 1 chunks in 38 graph layers Data type float64 numpy.ndarray 2 1 300 191 31 - dz_u(ocean_time, s_rho, eta_rho, xi_u)float64dask.array<chunksize=(2, 30, 191, 299), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical RHO grid on U grid
- time :
- ocean_time
- field :
- dz_u, scalar, series
- units :
- m
Array Chunk Bytes 26.14 MiB 26.14 MiB Shape (2, 30, 191, 299) (2, 30, 191, 299) Dask graph 1 chunks in 37 graph layers Data type float64 numpy.ndarray 2 1 299 191 30 - dz_w_u(ocean_time, s_w, eta_rho, xi_u)float64dask.array<chunksize=(2, 31, 191, 299), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical W grid on U grid
- time :
- ocean_time
- field :
- dz_w_u, scalar, series
- units :
- m
Array Chunk Bytes 27.01 MiB 27.01 MiB Shape (2, 31, 191, 299) (2, 31, 191, 299) Dask graph 1 chunks in 41 graph layers Data type float64 numpy.ndarray 2 1 299 191 31 - dz_v(ocean_time, s_rho, eta_v, xi_rho)float64dask.array<chunksize=(2, 30, 190, 300), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical RHO grid on V grid
- time :
- ocean_time
- field :
- dz_v, scalar, series
- units :
- m
Array Chunk Bytes 26.09 MiB 26.09 MiB Shape (2, 30, 190, 300) (2, 30, 190, 300) Dask graph 1 chunks in 39 graph layers Data type float64 numpy.ndarray 2 1 300 190 30 - dz_w_v(ocean_time, s_w, eta_v, xi_rho)float64dask.array<chunksize=(2, 31, 190, 300), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical W grid on V grid
- time :
- ocean_time
- field :
- dz_w_v, scalar, series
- units :
- m
Array Chunk Bytes 26.96 MiB 26.96 MiB Shape (2, 31, 190, 300) (2, 31, 190, 300) Dask graph 1 chunks in 43 graph layers Data type float64 numpy.ndarray 2 1 300 190 31 - dz_psi(ocean_time, s_rho, eta_v, xi_u)float64dask.array<chunksize=(2, 30, 190, 299), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical RHO grid on PSI grid
- time :
- ocean_time
- field :
- dz_psi, scalar, series
- units :
- m
Array Chunk Bytes 26.01 MiB 26.01 MiB Shape (2, 30, 190, 299) (2, 30, 190, 299) Dask graph 1 chunks in 42 graph layers Data type float64 numpy.ndarray 2 1 299 190 30 - dz_w_psi(ocean_time, s_w, eta_v, xi_u)float64dask.array<chunksize=(2, 31, 190, 299), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical W grid on PSI grid
- time :
- ocean_time
- field :
- dz_w_psi, scalar, series
- units :
- m
Array Chunk Bytes 26.87 MiB 26.87 MiB Shape (2, 31, 190, 299) (2, 31, 190, 299) Dask graph 1 chunks in 46 graph layers Data type float64 numpy.ndarray 2 1 299 190 31 - dz0(s_rho, eta_rho, xi_rho)float64dask.array<chunksize=(30, 191, 300), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical RHO grid
- field :
- dz0, scalar
- units :
- m
Array Chunk Bytes 13.11 MiB 13.11 MiB Shape (30, 191, 300) (30, 191, 300) Dask graph 1 chunks in 20 graph layers Data type float64 numpy.ndarray 300 191 30 - dz_w0(s_w, eta_rho, xi_rho)float64dask.array<chunksize=(31, 191, 300), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical W grid
- field :
- dz_w0, scalar
- units :
- m
Array Chunk Bytes 13.55 MiB 13.55 MiB Shape (31, 191, 300) (31, 191, 300) Dask graph 1 chunks in 24 graph layers Data type float64 numpy.ndarray 300 191 31 - dz_u0(s_rho, eta_rho, xi_u)float64dask.array<chunksize=(30, 191, 299), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical RHO grid on U grid
- field :
- dz_u0, scalar
- units :
- m
Array Chunk Bytes 13.07 MiB 13.07 MiB Shape (30, 191, 299) (30, 191, 299) Dask graph 1 chunks in 23 graph layers Data type float64 numpy.ndarray 299 191 30 - dz_w_u0(s_w, eta_rho, xi_u)float64dask.array<chunksize=(31, 191, 299), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical W grid on U grid
- field :
- dz_w_u0, scalar
- units :
- m
Array Chunk Bytes 13.51 MiB 13.51 MiB Shape (31, 191, 299) (31, 191, 299) Dask graph 1 chunks in 27 graph layers Data type float64 numpy.ndarray 299 191 31 - dz_v0(s_rho, eta_v, xi_rho)float64dask.array<chunksize=(30, 190, 300), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical RHO grid on V grid
- field :
- dz_v0, scalar
- units :
- m
Array Chunk Bytes 13.05 MiB 13.05 MiB Shape (30, 190, 300) (30, 190, 300) Dask graph 1 chunks in 25 graph layers Data type float64 numpy.ndarray 300 190 30 - dz_w_v0(s_w, eta_v, xi_rho)float64dask.array<chunksize=(31, 190, 300), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical W grid on V grid
- field :
- dz_w_v0, scalar
- units :
- m
Array Chunk Bytes 13.48 MiB 13.48 MiB Shape (31, 190, 300) (31, 190, 300) Dask graph 1 chunks in 29 graph layers Data type float64 numpy.ndarray 300 190 31 - dz_psi0(s_rho, eta_v, xi_u)float64dask.array<chunksize=(30, 190, 299), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical RHO grid on PSI grid
- field :
- dz_psi0, scalar
- units :
- m
Array Chunk Bytes 13.00 MiB 13.00 MiB Shape (30, 190, 299) (30, 190, 299) Dask graph 1 chunks in 28 graph layers Data type float64 numpy.ndarray 299 190 30 - dz_w_psi0(s_w, eta_v, xi_u)float64dask.array<chunksize=(31, 190, 299), meta=np.ndarray>
- long_name :
- vertical layer thickness on vertical W grid on PSI grid
- field :
- dz_w_psi0, scalar
- units :
- m
Array Chunk Bytes 13.44 MiB 13.44 MiB Shape (31, 190, 299) (31, 190, 299) Dask graph 1 chunks in 32 graph layers Data type float64 numpy.ndarray 299 190 31 - dA(eta_rho, xi_rho)float64dask.array<chunksize=(191, 300), meta=np.ndarray>
- long_name :
- area metric in XI and ETA on RHO grid
- units :
- meter2
- field :
- dA, scalar
Array Chunk Bytes 447.66 kiB 447.66 kiB Shape (191, 300) (191, 300) Dask graph 1 chunks in 7 graph layers Data type float64 numpy.ndarray 300 191 - dV(ocean_time, s_rho, eta_rho, xi_rho)float64dask.array<chunksize=(2, 30, 191, 300), meta=np.ndarray>
- long_name :
- volume metric in XI and ETA and S on RHO/RHO grids
- units :
- meter3
- field :
- dV, scalar
Array Chunk Bytes 26.23 MiB 26.23 MiB Shape (2, 30, 191, 300) (2, 30, 191, 300) Dask graph 1 chunks in 44 graph layers Data type float64 numpy.ndarray 2 1 300 191 30 - dV_w(ocean_time, s_w, eta_rho, xi_rho)float64dask.array<chunksize=(2, 31, 191, 300), meta=np.ndarray>
- long_name :
- volume metric in XI and ETA and S on RHO/W grids
- units :
- meter3
- field :
- dV_w, scalar
Array Chunk Bytes 27.10 MiB 27.10 MiB Shape (2, 31, 191, 300) (2, 31, 191, 300) Dask graph 1 chunks in 48 graph layers Data type float64 numpy.ndarray 2 1 300 191 31 - dV_u(ocean_time, s_rho, eta_rho, xi_u)float64dask.array<chunksize=(2, 30, 191, 299), meta=np.ndarray>
- long_name :
- volume metric in XI and ETA and S on U/RHO grids
- units :
- meter3
- field :
- dV_u, scalar
Array Chunk Bytes 26.14 MiB 26.14 MiB Shape (2, 30, 191, 299) (2, 30, 191, 299) Dask graph 1 chunks in 53 graph layers Data type float64 numpy.ndarray 2 1 299 191 30 - dV_w_u(ocean_time, s_w, eta_rho, xi_u)float64dask.array<chunksize=(2, 31, 191, 299), meta=np.ndarray>
- long_name :
- volume metric in XI and ETA and S on U/W grids
- units :
- meter3
- field :
- dV_w_u, scalar
Array Chunk Bytes 27.01 MiB 27.01 MiB Shape (2, 31, 191, 299) (2, 31, 191, 299) Dask graph 1 chunks in 57 graph layers Data type float64 numpy.ndarray 2 1 299 191 31 - dV_v(ocean_time, s_rho, eta_v, xi_rho)float64dask.array<chunksize=(2, 30, 190, 300), meta=np.ndarray>
- long_name :
- volume metric in XI and ETA and S on V/RHO grids
- units :
- meter3
- field :
- dV_v, scalar
Array Chunk Bytes 26.09 MiB 26.09 MiB Shape (2, 30, 190, 300) (2, 30, 190, 300) Dask graph 1 chunks in 59 graph layers Data type float64 numpy.ndarray 2 1 300 190 30 - dV_w_v(ocean_time, s_w, eta_v, xi_rho)float64dask.array<chunksize=(2, 31, 190, 300), meta=np.ndarray>
- long_name :
- volume metric in XI and ETA and S on V/W grids
- units :
- meter3
- field :
- dV_w_v, scalar
Array Chunk Bytes 26.96 MiB 26.96 MiB Shape (2, 31, 190, 300) (2, 31, 190, 300) Dask graph 1 chunks in 63 graph layers Data type float64 numpy.ndarray 2 1 300 190 31 - dV_psi(ocean_time, s_rho, eta_v, xi_u)float64dask.array<chunksize=(2, 30, 190, 299), meta=np.ndarray>
- long_name :
- volume metric in XI and ETA and S on PSI/RHO grids
- units :
- meter3
- field :
- dV_psi, scalar
Array Chunk Bytes 26.01 MiB 26.01 MiB Shape (2, 30, 190, 299) (2, 30, 190, 299) Dask graph 1 chunks in 68 graph layers Data type float64 numpy.ndarray 2 1 299 190 30 - dV_w_psi(ocean_time, s_w, eta_v, xi_u)float64dask.array<chunksize=(2, 31, 190, 299), meta=np.ndarray>
- long_name :
- volume metric in XI and ETA and S on PSI/W grids
- units :
- meter3
- field :
- dV_w_psi, scalar
Array Chunk Bytes 26.87 MiB 26.87 MiB Shape (2, 31, 190, 299) (2, 31, 190, 299) Dask graph 1 chunks in 72 graph layers Data type float64 numpy.ndarray 2 1 299 190 31 - rho0()int641025
array(1025)
- s_rhoPandasIndex
PandasIndex(Index([ -0.9833333333333333, -0.95, -0.9166666666666666, -0.8833333333333333, -0.85, -0.8166666666666667, -0.7833333333333333, -0.75, -0.7166666666666667, -0.6833333333333333, -0.65, -0.6166666666666667, -0.5833333333333334, -0.55, -0.5166666666666666, -0.48333333333333334, -0.45, -0.4166666666666667, -0.3833333333333333, -0.35, -0.31666666666666665, -0.2833333333333333, -0.25, -0.21666666666666667, -0.18333333333333332, -0.15, -0.11666666666666667, -0.08333333333333333, -0.05, -0.016666666666666666], dtype='float64', name='s_rho')) - s_wPandasIndex
PandasIndex(Index([ -1.0, -0.9666666666666667, -0.9333333333333333, -0.9, -0.8666666666666667, -0.8333333333333334, -0.8, -0.7666666666666666, -0.7333333333333333, -0.7, -0.6666666666666666, -0.6333333333333333, -0.6, -0.5666666666666667, -0.5333333333333333, -0.5, -0.4666666666666667, -0.43333333333333335, -0.4, -0.36666666666666664, -0.3333333333333333, -0.3, -0.26666666666666666, -0.23333333333333334, -0.2, -0.16666666666666666, -0.13333333333333333, -0.1, -0.06666666666666667, -0.03333333333333333, 0.0], dtype='float64', name='s_w')) - ocean_timePandasIndex
PandasIndex(DatetimeIndex(['2009-11-19 12:00:00', '2009-11-19 16:00:00'], dtype='datetime64[ns]', name='ocean_time', freq=None))
- xi_rhoPandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 290, 291, 292, 293, 294, 295, 296, 297, 298, 299], dtype='int64', name='xi_rho', length=300)) - xi_uPandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 289, 290, 291, 292, 293, 294, 295, 296, 297, 298], dtype='int64', name='xi_u', length=299)) - eta_rhoPandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 181, 182, 183, 184, 185, 186, 187, 188, 189, 190], dtype='int64', name='eta_rho', length=191)) - eta_vPandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 180, 181, 182, 183, 184, 185, 186, 187, 188, 189], dtype='int64', name='eta_v', length=190))
- file :
- ocean_his_0150.nc
- format :
- netCDF-3 classic file
- Conventions :
- CF-1.4
- type :
- ROMS/TOMS history file
- title :
- Texas and Louisiana Shelf case (Nesting)
- rst_file :
- ocean_rst.nc
- his_base :
- ocean_his
- grd_file :
- txla_grd_v4_new.nc
- ini_file :
- ocean_rst.nc
- frc_file_01 :
- txla_blk_narr_2009.nc
- frc_file_02 :
- TXLA_river_4dyes_2011.nc
- frc_file_03 :
- txla_flx_frc_9911.nc
- bry_file :
- txla_bry_2009_new.nc
- clm_file :
- txla_clm_2009_new.nc
- script_file :
- External/ocean_txla.in
- svn_url :
- https://www.myroms.org/svn/src/trunk
- svn_rev :
- exported
- code_dir :
- /scratch/zhangxq/ROMS
- header_dir :
- /scratch/zhangxq/projects/txla_nesting6
- header_file :
- txla.h
- os :
- Linux
- cpu :
- x86_64
- compiler_system :
- ifort
- compiler_command :
- /g/software/openmpi/1.4.3/intel/bin/mpif90
- compiler_flags :
- -heap-arrays -fp-model precise -assume 2underscores -convert big_endian -ip -O3 -free
- tiling :
- 016x032
- history :
- ROMS/TOMS, Version 3.4, Sunday - December 4, 2011 - 7:17:45 AM
- ana_file :
- /scratch/zhangxq/projects/txla_nesting6/Functionals/ana_btflux.h, /scratch/zhangxq/projects/txla_nesting6/Functionals/ana_hmixcoef.h, /scratch/zhangxq/projects/txla_nesting6/Functionals/ana_nudgcoef.h, /scratch/zhangxq/projects/txla_nesting6/Functionals/ana_stflux.h
- CPP_options :
- TXLA, ANA_BSFLUX, ANA_BTFLUX, ASSUMED_SHAPE, BULK_FLUXES, CURVGRID, DIFF_GRID, DJ_GRADPS, DOUBLE_PRECISION, EAST_FSCHAPMAN, EAST_M2FLATHER, EAST_M3NUDGING, EAST_M3RADIATION, EAST_TNUDGING, EAST_TRADIATION, EMINUSP, LONGWAVE, M3CLIMATOLOGY, M3CLM_NUDGING, MASKING, MIX_GEO_TS, MIX_S_UV, MPI, MY25_MIXING, NONLINEAR, NONLIN_EOS, NORTHERN_WALL, N2S2_HORAVG, POWER_LAW, PROFILE, QCORRECTION, K_GSCHEME, !RST_SINGLE, SALINITY, SOLAR_SOURCE, SOLVE3D, SOUTH_FSCHAPMAN, SOUTH_M2FLATHER, SOUTH_M3NUDGING, SOUTH_M3RADIATION, SOUTH_TNUDGING, SOUTH_TRADIATION, SPLINES, TCLIMATOLOGY, TCLM_NUDGING, THREE_GHOST, T_PASSIVE, TS_MPDATA, TS_DIF2, TS_PSOURCE, UV_ADV, UV_COR, UV_U3HADVECTION, UV_C4VADVECTION, UV_LOGDRAG, UV_PSOURCE, UV_VIS2, VAR_RHO_2D, VISC_GRID, WEST_FSCHAPMAN, WEST_M2FLATHER, WEST_M3NUDGING, WEST_M3RADIATION, WEST_TNUDGING, WEST_TRADIATION
Setup for plotting¶
Use cartopy when plotting with a projection and/or wanting to add context like coastline.
proj = cartopy.crs.LambertConformal(central_longitude=-98, central_latitude=30)
pc = cartopy.crs.PlateCarree()
Using cf-xarray with plots¶
As described in the select data page, xroms is built to use the cf-xarray accessor to make working with dimensions easier.
See description of a DataArray with
ds.salt.cf.describe()
which returns
ds.salt.cf.describe()
Coordinates:
CF Axes: * X: ['xi_rho']
* Y: ['eta_rho']
* Z: ['s_rho']
* T: ['ocean_time']
CF Coordinates: longitude: ['lon_rho']
latitude: ['lat_rho']
vertical: ['z_rho']
* time: ['ocean_time']
Cell Measures: area, volume: n/a
Standard Names: depth: ['z_rho']
latitude: ['lat_rho']
longitude: ['lon_rho']
* ocean_s_coordinate_g1: ['s_rho']
* time: ['ocean_time']
Bounds: n/a
Grid Mappings: n/a
/tmp/ipykernel_3046/990108105.py:1: DeprecationWarning: 'obj.cf.describe()' will be removed in a future version. Use instead 'repr(obj.cf)' or 'obj.cf' in a Jupyter environment.
ds.salt.cf.describe()
From this you know that you can use the cf-xarray accessor to call many typical xarray functions from your Dataset or DataArray by substituting the generic Axes names (X, Y, Z, or T) in place of the specific dimension name on the right side of the Axes description. For example:
ds.salt.cf.sel(X=20, T='2010-1-1')
instead of
ds.salt.sel(xi_rho=20, ocean_time='2010-1-1')
A similar syntax works for isel commands.
You also know from this description that calls that take in coordinates for xarray can be used with their generic coordinate name listed above (longitude, latitude, vertical, time). For example:
ds.salt.cf.plot(x='longitude', y='latitude')
instead of
ds.salt.plot(x='lon_rho', y='lat_rho')
We use these shorter generalized Axes and Coordinates below.
xcmocean for choosing colormaps¶
The xcmocean accessor can be used when plotting with xarray to automatically choose a “good” colormap for the plot based on the DataArray name and attributes and colormaps from the cmocean colormaps package.
To use the colormap accessor, add .cmo before the plot call from xarray (but skip the plot if specifying the type of plot subsequently, like pcolormesh). These are the call options:
cmo.plot()cmo.pcolormesh()to specifypcolormeshcmo.contourf()to specifycontourfcmo.contour()to specifycontour
ds.v.cf.isel(T=0, Z=-1).cmo.pcolormesh()
<matplotlib.collections.QuadMesh at 0x7478a4c20890>
xcmocean can also be used in conjunction with cf-xarray but with slightly different syntax. You can access the same plot options while using cf-xarray in the plot call with the following:
cmo.cfplot()cmo.cfpcolormesh()cmo.cfcontourf()cmo.cfcontour()
ds.temp.cf.isel(T=0, Z=-1).cmo.cfpcolormesh(x='longitude', y='latitude')
<matplotlib.collections.QuadMesh at 0x7478a4cadb20>
Static: xarray¶
Can plot directly in xarray since it has wrapped many Matplotlib plotting routines. This is great for quick plots and continues to improve, but if you need more control then try the next section of plotting directly in Matplotlib.
map view¶
Overview¶
Plotted with dimension indices instead of coordinates:
ds.v.cf.isel(T=0, Z=-1).plot(cmap=cmo.delta)
<matplotlib.collections.QuadMesh at 0x74789cf604d0>
Plotted with coordinates lon/lat:
ds.v.cf.isel(T=0, Z=-1).cf.plot(x='longitude', y='latitude', cmap=cmo.delta)
<matplotlib.collections.QuadMesh at 0x74789cf76840>
magnified¶
ds.salt.cf.isel(T=0, Z=-1, X=slice(100,300), Y=slice(75,100)).plot()
<matplotlib.collections.QuadMesh at 0x74789c4d6f00>
ds.salt.cf.isel(T=0, Z=-1, X=slice(100,300), Y=slice(75,100)).cf.plot(x='longitude', y='latitude')
<matplotlib.collections.QuadMesh at 0x74789c5b04d0>
cross-section¶
dss = ds.u.cf.isel(X=200, T=0)
dss.where(~dss.isnull().compute(), drop=True).cf.plot(x='latitude', y='vertical', cmap=cmo.delta, figsize=(10,6))
<matplotlib.collections.QuadMesh at 0x74789c408260>
Static: Matplotlib¶
map view¶
Overview¶
Here is a basic plan-view map, using cartopy for projection handling. You can add many different types of natural data for context. Shown here are coastline, land, rivers, and state borders. You can control the resolution of the data by changing the input to with_scale (options are ‘10m’, ‘50m’, or ‘110m’, corresponding to 1:10,000,000, 1:50,000,000, and 1:110,000,000 scale). More cartopy feature information available here: https://scitools.org.uk/cartopy/docs/v0.16/matplotlib/feature_interface.html.
fig = plt.figure(figsize=(12,8))
ax = plt.axes(projection=proj)
# Add natural features
ax.add_feature(cartopy.feature.LAND.with_scale('110m'), facecolor='0.8')
ax.add_feature(cartopy.feature.COASTLINE.with_scale('10m'), edgecolor='0.2')
ax.add_feature(cartopy.feature.RIVERS.with_scale('110m'), edgecolor='b')
ax.add_feature(cartopy.feature.STATES.with_scale('110m'), edgecolor='k')
gl = ax.gridlines(draw_labels=True, x_inline=False, y_inline=False, xlocs=np.arange(-104,-80,2))
# manipulate `gridliner` object to change locations of labels
gl.top_labels = False
gl.right_labels = False
ds.salt.cf.isel(T=0, Z=-1).cf.plot(ax=ax, x='longitude', y='latitude', transform=pc)
<cartopy.mpl.geocollection.GeoQuadMesh at 0x74789c3404d0>
/home/docs/checkouts/readthedocs.org/user_builds/xroms/conda/stable/lib/python3.12/site-packages/cartopy/io/__init__.py:242: DownloadWarning: Downloading: https://naturalearth.s3.amazonaws.com/110m_physical/ne_110m_land.zip
warnings.warn(f'Downloading: {url}', DownloadWarning)
/home/docs/checkouts/readthedocs.org/user_builds/xroms/conda/stable/lib/python3.12/site-packages/cartopy/io/__init__.py:242: DownloadWarning: Downloading: https://naturalearth.s3.amazonaws.com/10m_physical/ne_10m_coastline.zip
warnings.warn(f'Downloading: {url}', DownloadWarning)
/home/docs/checkouts/readthedocs.org/user_builds/xroms/conda/stable/lib/python3.12/site-packages/cartopy/io/__init__.py:242: DownloadWarning: Downloading: https://naturalearth.s3.amazonaws.com/110m_physical/ne_110m_rivers_lake_centerlines.zip
warnings.warn(f'Downloading: {url}', DownloadWarning)
/home/docs/checkouts/readthedocs.org/user_builds/xroms/conda/stable/lib/python3.12/site-packages/cartopy/io/__init__.py:242: DownloadWarning: Downloading: https://naturalearth.s3.amazonaws.com/110m_cultural/ne_110m_admin_1_states_provinces_lakes.zip
warnings.warn(f'Downloading: {url}', DownloadWarning)
Magnified¶
Use set_extent to narrow the view to magnify a subregion.
fig = plt.figure(figsize=(12,8))
ax = plt.axes(projection=proj)
ax.set_extent([-94, -90, 27.5, 30], crs=pc)
ax.add_feature(cartopy.feature.LAND.with_scale('110m'), facecolor='0.8')
gl = ax.gridlines(draw_labels=True, x_inline=False, y_inline=False, xlocs=np.arange(-104,-80,2))
# manipulate `gridliner` object to change locations of labels
gl.top_labels = False
gl.right_labels = False
ds.salt.cf.isel(T=0, Z=-1).cf.plot(ax=ax, x='longitude', y='latitude', transform=pc)
<cartopy.mpl.geocollection.GeoQuadMesh at 0x74789c5955e0>
cross-section¶
This is the same as the example above for plotting directly from xarray since projections on plan-view maps make most of the difference.
dss = ds.u.cf.isel(X=200, T=0)
dss.where(~dss.isnull().compute(), drop=True).cf.plot(x='latitude', y='vertical', cmap=cmo.delta, figsize=(10,6))
<matplotlib.collections.QuadMesh at 0x7478a4e227e0>
Interactive¶
In these interactive plots, you can zoom, pan, and save plots using the menu on the right-hand side. There is a mouse hover option to display specific values; this can also be turned off. The plot automatically makes a widget to the right of the plot to easily vary over that variable. Currently the plots below are set to vary over time.
These plots aren’t working interactively in the docs, but are left here as examples for your own use.
map view¶
The tiles allow for different basemap options. The rasterize option is really important here by allowing a lower resolution presentation when zoomed out and increasing resolution with magnification, potentially saving a lot of time.
Vary over time (for surface)¶
tiles = gv.tile_sources.ESRI # optional, for a basemap
ds.salt.cf.isel(s_rho=-1).hvplot.quadmesh(x='lon_rho', y='lat_rho', width=650, height=500,
cmap="cmo.haline", rasterize=True, crs=pc) * tiles
Vary over sigma level and time¶
tiles = gv.tile_sources.ESRI # optional, for a basemap
ds.salt.hvplot.quadmesh(x='lon_rho', y='lat_rho', width=650, height=500,
cmap=cmo.haline, rasterize=True, crs=pc) * tiles
Vary over depth and time¶
Since the vertical dimension is in sigma coordinates instead of fixed depths, it is not immediate to be able to use a widget to vary depth in these plots. However, it is still possible to do using xroms code. First set up the calculation for several depths you want to examine using xroms.isoslice, then send that xarray object to hvplot for plotting. It is slow because it has to calculate everything, but it is nevertheless interactive. Having these files locally would speed it up.
In the following example, we use the accessor version of the isoslice interpolation to find slices of salinity at fixed depths. To save some time, we use the time-constant depths (z_rho0) associated with salinity instead of the time-varying version (z_rho).
zsalt = ds.salt.xroms.isoslice([-10, -20, -30], iso_array=ds.salt.z_rho0, axis='Z')
tiles = gv.tile_sources.ESRI # optional, for a basemap
zsalt.hvplot.quadmesh(x='lon_rho', y='lat_rho', width=650, height=500,
cmap=cmo.haline, rasterize=True, crs=pc) * tiles
cross-section¶
In this case, the plots are similar whether rasterize=True is used or not.
ds.temp.isel(xi_rho=300).hvplot.quadmesh(x='lat_rho', y='z_rho0', width=750, height=400,
cmap=cmo.thermal)