MOM6/CESM Ocean Model AnalysisΒΆ
This notebook shows how to load and analyze ocean data from an out-of-the-box MOM6/CESM G-case simulation (coupled ocean ocean/sea ice).
NOTE: MOM6/CESM is not ready to be used for research.
[1]:
%matplotlib inline
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
import holoviews as hv
import datashader
from holoviews.operation.datashader import regrid, shade, datashade
hv.extension('bokeh', width=100)
Load MOM6/CESM DataΒΆ
This data is stored in xarray-zarr format in Google Cloud Storage. This format is optimized for parallel distributed reads from within the cloud environment.
The full data catalog is located here: https://pangeo-data.github.io/pangeo-datastore/master/ocean.html
[2]:
import intake
cat = intake.open_catalog("https://raw.githubusercontent.com/pangeo-data/pangeo-datastore/master/intake-catalogs/ocean.yaml")
ds = cat["cesm_mom6_example"].to_dask()
ds
/srv/conda/envs/notebook/lib/python3.9/site-packages/xarray/coding/times.py:527: SerializationWarning: Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range
dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime)
[2]:
<xarray.Dataset> Dimensions: (time: 24, z_l: 34, yh: 458, xh: 540, yq: 458, xq: 540, lath: 458, latq: 458, lonh: 540, lonq: 540, nv: 2, scalar_axis: 1, z_i: 35) Coordinates: (12/17) geolat (yh, xh) float64 dask.array<chunksize=(458, 540), meta=np.ndarray> geolatb (yq, xq) float64 dask.array<chunksize=(458, 540), meta=np.ndarray> geolon (yh, xh) float64 dask.array<chunksize=(458, 540), meta=np.ndarray> geolonb (yq, xq) float64 dask.array<chunksize=(458, 540), meta=np.ndarray> * lath (lath) float64 -79.2 -79.08 -78.95 ... 87.64 87.71 87.74 * latq (latq) float64 -79.14 -79.01 -78.89 ... 87.68 87.73 87.74 ... ... * xh (xh) float64 -286.7 -286.0 -285.3 -284.7 ... 71.33 72.0 72.67 * xq (xq) float64 -286.3 -285.7 -285.0 -284.3 ... 71.67 72.33 73.0 * yh (yh) float64 -79.2 -79.08 -78.95 -78.82 ... 87.64 87.71 87.74 * yq (yq) float64 -79.14 -79.01 -78.89 -78.76 ... 87.68 87.73 87.74 * z_i (z_i) float64 0.0 5.0 15.0 25.0 ... 5.25e+03 5.75e+03 6.25e+03 * z_l (z_l) float64 2.5 10.0 20.0 32.5 ... 5e+03 5.5e+03 6e+03 Data variables: (12/23) KE (time, z_l, yh, xh) float64 dask.array<chunksize=(1, 34, 458, 540), meta=np.ndarray> KPP_OBLdepth (time, yh, xh) float64 dask.array<chunksize=(1, 458, 540), meta=np.ndarray> MLD_0125 (time, yh, xh) float64 dask.array<chunksize=(1, 458, 540), meta=np.ndarray> SSH (time, yh, xh) float64 dask.array<chunksize=(1, 458, 540), meta=np.ndarray> SSS (time, yh, xh) float64 dask.array<chunksize=(1, 458, 540), meta=np.ndarray> SST (time, yh, xh) float64 dask.array<chunksize=(1, 458, 540), meta=np.ndarray> ... ... tauy (time, yq, xh) float64 dask.array<chunksize=(1, 458, 540), meta=np.ndarray> temp (time, z_l, yh, xh) float64 dask.array<chunksize=(1, 34, 458, 540), meta=np.ndarray> thetaoga (time, scalar_axis) float64 dask.array<chunksize=(1, 1), meta=np.ndarray> time_bnds (time, nv) timedelta64[ns] dask.array<chunksize=(1, 2), meta=np.ndarray> u (time, z_l, yh, xq) float64 dask.array<chunksize=(1, 34, 458, 540), meta=np.ndarray> v (time, z_l, yq, xh) float64 dask.array<chunksize=(1, 34, 458, 540), meta=np.ndarray> Attributes: associated_files: area_t: g.c2b6.GNYF.T62_t061.melt_potential.003.mom6.s... filename: g.c2b6.GNYF.T62_t061.melt_potential.003.mom6.h_0001_01.nc grid_tile: N/A grid_type: regular title: MOM6 g.c2b6.GNYF.T62_t061.melt_potential.003 Experiment
- time: 24
- z_l: 34
- yh: 458
- xh: 540
- yq: 458
- xq: 540
- lath: 458
- latq: 458
- lonh: 540
- lonq: 540
- nv: 2
- scalar_axis: 1
- z_i: 35
- geolat(yh, xh)float64dask.array<chunksize=(458, 540), meta=np.ndarray>
- long_name :
- latitude at tracer (T) points
- units :
- degree
Array Chunk Bytes 1.89 MiB 1.89 MiB Shape (458, 540) (458, 540) Count 2 Tasks 1 Chunks Type float64 numpy.ndarray - geolatb(yq, xq)float64dask.array<chunksize=(458, 540), meta=np.ndarray>
- long_name :
- latitude at corner (Bu) points
- units :
- degree
Array Chunk Bytes 1.89 MiB 1.89 MiB Shape (458, 540) (458, 540) Count 2 Tasks 1 Chunks Type float64 numpy.ndarray - geolon(yh, xh)float64dask.array<chunksize=(458, 540), meta=np.ndarray>
- long_name :
- longitude at tracer (T) points
- units :
- degree
Array Chunk Bytes 1.89 MiB 1.89 MiB Shape (458, 540) (458, 540) Count 2 Tasks 1 Chunks Type float64 numpy.ndarray - geolonb(yq, xq)float64dask.array<chunksize=(458, 540), meta=np.ndarray>
- long_name :
- longitude at corner (Bu) points
- units :
- degree
Array Chunk Bytes 1.89 MiB 1.89 MiB Shape (458, 540) (458, 540) Count 2 Tasks 1 Chunks Type float64 numpy.ndarray - lath(lath)float64-79.2 -79.08 -78.95 ... 87.71 87.74
- cartesian_axis :
- Y
- long_name :
- Latitude
- units :
- degrees_north
array([-79.202602, -79.076995, -78.949944, ..., 87.641507, 87.706191, 87.738663])
- latq(latq)float64-79.14 -79.01 ... 87.73 87.74
- cartesian_axis :
- Y
- long_name :
- Latitude
- units :
- degrees_north
array([-79.139978, -79.013651, -78.885872, ..., 87.67781 , 87.726499, 87.7427 ])
- lonh(lonh)float64-286.7 -286.0 -285.3 ... 72.0 72.67
- cartesian_axis :
- X
- long_name :
- Longitude
- units :
- degrees_east
array([-286.666667, -286. , -285.333333, ..., 71.333333, 72. , 72.666667])
- lonq(lonq)float64-286.3 -285.7 -285.0 ... 72.33 73.0
- cartesian_axis :
- X
- long_name :
- Longitude
- units :
- degrees_east
array([-286.333333, -285.666667, -285. , ..., 71.666667, 72.333333, 73. ])
- nv(nv)float641.0 2.0
- cartesian_axis :
- N
- long_name :
- vertex number
- units :
- none
array([1., 2.])
- scalar_axis(scalar_axis)float640.0
- cartesian_axis :
- N
- long_name :
- none
- units :
- none
array([0.])
- time(time)object0001-01-16 12:00:00 ... 0002-12-...
- bounds :
- time_bnds
- calendar_type :
- NOLEAP
- cartesian_axis :
- T
- long_name :
- time
array([cftime.DatetimeNoLeap(1, 1, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1, 2, 15, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1, 3, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1, 4, 16, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1, 5, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1, 6, 16, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1, 7, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1, 8, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1, 9, 16, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1, 10, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1, 11, 16, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(1, 12, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2, 1, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2, 2, 15, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2, 3, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2, 4, 16, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2, 5, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2, 6, 16, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2, 7, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2, 8, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2, 9, 16, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2, 10, 16, 12, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2, 11, 16, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeNoLeap(2, 12, 16, 12, 0, 0, 0, has_year_zero=True)], dtype=object)
- xh(xh)float64-286.7 -286.0 -285.3 ... 72.0 72.67
- cartesian_axis :
- X
- long_name :
- h point nominal longitude
- units :
- degrees_east
array([-286.666667, -286. , -285.333333, ..., 71.333333, 72. , 72.666667])
- xq(xq)float64-286.3 -285.7 -285.0 ... 72.33 73.0
- cartesian_axis :
- X
- long_name :
- q point nominal longitude
- units :
- degrees_east
array([-286.333333, -285.666667, -285. , ..., 71.666667, 72.333333, 73. ])
- yh(yh)float64-79.2 -79.08 -78.95 ... 87.71 87.74
- cartesian_axis :
- Y
- long_name :
- h point nominal latitude
- units :
- degrees_north
array([-79.202602, -79.076995, -78.949944, ..., 87.641507, 87.706191, 87.738663])
- yq(yq)float64-79.14 -79.01 ... 87.73 87.74
- cartesian_axis :
- Y
- long_name :
- q point nominal latitude
- units :
- degrees_north
array([-79.139978, -79.013651, -78.885872, ..., 87.67781 , 87.726499, 87.7427 ])
- z_i(z_i)float640.0 5.0 15.0 ... 5.75e+03 6.25e+03
- cartesian_axis :
- Z
- long_name :
- Depth at interface
- positive :
- down
- units :
- meters
array([0.000e+00, 5.000e+00, 1.500e+01, 2.500e+01, 4.000e+01, 6.250e+01, 8.750e+01, 1.125e+02, 1.375e+02, 1.750e+02, 2.250e+02, 2.750e+02, 3.500e+02, 4.500e+02, 5.500e+02, 6.500e+02, 7.500e+02, 8.500e+02, 9.500e+02, 1.050e+03, 1.150e+03, 1.250e+03, 1.350e+03, 1.450e+03, 1.625e+03, 1.875e+03, 2.250e+03, 2.750e+03, 3.250e+03, 3.750e+03, 4.250e+03, 4.750e+03, 5.250e+03, 5.750e+03, 6.250e+03])
- z_l(z_l)float642.5 10.0 20.0 ... 5.5e+03 6e+03
- cartesian_axis :
- Z
- edges :
- z_i
- long_name :
- Depth at cell center
- positive :
- down
- units :
- meters
array([2.5000e+00, 1.0000e+01, 2.0000e+01, 3.2500e+01, 5.1250e+01, 7.5000e+01, 1.0000e+02, 1.2500e+02, 1.5625e+02, 2.0000e+02, 2.5000e+02, 3.1250e+02, 4.0000e+02, 5.0000e+02, 6.0000e+02, 7.0000e+02, 8.0000e+02, 9.0000e+02, 1.0000e+03, 1.1000e+03, 1.2000e+03, 1.3000e+03, 1.4000e+03, 1.5375e+03, 1.7500e+03, 2.0625e+03, 2.5000e+03, 3.0000e+03, 3.5000e+03, 4.0000e+03, 4.5000e+03, 5.0000e+03, 5.5000e+03, 6.0000e+03])
- KE(time, z_l, yh, xh)float64dask.array<chunksize=(1, 34, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean z_l:mean yh:mean xh:mean time: mean
- long_name :
- Layer kinetic energy per unit mass
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- m2 s-2
Array Chunk Bytes 1.50 GiB 64.15 MiB Shape (24, 34, 458, 540) (1, 34, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - KPP_OBLdepth(time, yh, xh)float64dask.array<chunksize=(1, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean yh:mean xh:mean time: mean
- long_name :
- Thickness of the surface Ocean Boundary Layer calculated by [CVMix] KPP
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- meter
Array Chunk Bytes 45.29 MiB 1.89 MiB Shape (24, 458, 540) (1, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - MLD_0125(time, yh, xh)float64dask.array<chunksize=(1, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean yh:mean xh:mean time: mean
- long_name :
- Mixed layer depth (delta rho = 0.125)
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- m
Array Chunk Bytes 45.29 MiB 1.89 MiB Shape (24, 458, 540) (1, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - SSH(time, yh, xh)float64dask.array<chunksize=(1, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean yh:mean xh:mean time: mean
- long_name :
- Sea Surface Height
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- m
Array Chunk Bytes 45.29 MiB 1.89 MiB Shape (24, 458, 540) (1, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - SSS(time, yh, xh)float64dask.array<chunksize=(1, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean yh:mean xh:mean time: mean
- long_name :
- Sea Surface Salinity
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- psu
Array Chunk Bytes 45.29 MiB 1.89 MiB Shape (24, 458, 540) (1, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - SST(time, yh, xh)float64dask.array<chunksize=(1, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean yh:mean xh:mean time: mean
- long_name :
- Sea Surface Temperature
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- degC
Array Chunk Bytes 45.29 MiB 1.89 MiB Shape (24, 458, 540) (1, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - average_DT(time)timedelta64[ns]dask.array<chunksize=(1,), meta=np.ndarray>
- long_name :
- Length of average period
Array Chunk Bytes 192 B 8 B Shape (24,) (1,) Count 25 Tasks 24 Chunks Type timedelta64[ns] numpy.ndarray - average_T1(time)objectdask.array<chunksize=(1,), meta=np.ndarray>
- long_name :
- Start time for average period
Array Chunk Bytes 192 B 8 B Shape (24,) (1,) Count 25 Tasks 24 Chunks Type object numpy.ndarray - average_T2(time)objectdask.array<chunksize=(1,), meta=np.ndarray>
- long_name :
- End time for average period
Array Chunk Bytes 192 B 8 B Shape (24,) (1,) Count 25 Tasks 24 Chunks Type object numpy.ndarray - friver(time, yh, xh)float64dask.array<chunksize=(1, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean yh:mean xh:mean time: mean
- long_name :
- Water Flux into Sea Water From Rivers
- standard_name :
- water_flux_into_sea_water_from_rivers
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- kg m-2 s-1
Array Chunk Bytes 45.29 MiB 1.89 MiB Shape (24, 458, 540) (1, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - h(time, z_l, yh, xh)float64dask.array<chunksize=(1, 34, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean z_l:sum yh:mean xh:mean time: mean
- long_name :
- Layer Thickness
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- m
Array Chunk Bytes 1.50 GiB 64.15 MiB Shape (24, 34, 458, 540) (1, 34, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - hfds(time, yh, xh)float64dask.array<chunksize=(1, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean yh:mean xh:mean time: mean
- long_name :
- Surface ocean heat flux from SW+LW+latent+sensible+masstransfer+frazil
- standard_name :
- surface_downward_heat_flux_in_sea_water
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- W m-2
Array Chunk Bytes 45.29 MiB 1.89 MiB Shape (24, 458, 540) (1, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - hfsnthermds(time, yh, xh)float64dask.array<chunksize=(1, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean yh:mean xh:mean time: mean
- long_name :
- Latent Heat to Melt Frozen Precipitation
- standard_name :
- heat_flux_into_sea_water_due_to_snow_thermodynamics
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- W m-2
Array Chunk Bytes 45.29 MiB 1.89 MiB Shape (24, 458, 540) (1, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - rhoinsitu(time, z_l, yh, xh)float64dask.array<chunksize=(1, 34, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean z_l:mean yh:mean xh:mean time: mean
- long_name :
- In situ density
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- kg m-3
Array Chunk Bytes 1.50 GiB 64.15 MiB Shape (24, 34, 458, 540) (1, 34, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - salt(time, z_l, yh, xh)float64dask.array<chunksize=(1, 34, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean z_l:mean yh:mean xh:mean time: mean
- long_name :
- Salinity
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- psu
Array Chunk Bytes 1.50 GiB 64.15 MiB Shape (24, 34, 458, 540) (1, 34, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - soga(time, scalar_axis)float64dask.array<chunksize=(1, 1), meta=np.ndarray>
- cell_methods :
- time: mean
- long_name :
- Global Mean Ocean Salinity
- standard_name :
- sea_water_salinity
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- psu
Array Chunk Bytes 192 B 8 B Shape (24, 1) (1, 1) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - taux(time, yh, xq)float64dask.array<chunksize=(1, 458, 540), meta=np.ndarray>
- cell_methods :
- yh:mean xq:point time: mean
- interp_method :
- none
- long_name :
- Zonal surface stress from ocean interactions with atmos and ice
- standard_name :
- surface_downward_x_stress
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- Pa
Array Chunk Bytes 45.29 MiB 1.89 MiB Shape (24, 458, 540) (1, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - tauy(time, yq, xh)float64dask.array<chunksize=(1, 458, 540), meta=np.ndarray>
- cell_methods :
- yq:point xh:mean time: mean
- interp_method :
- none
- long_name :
- Meridional surface stress ocean interactions with atmos and ice
- standard_name :
- surface_downward_y_stress
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- Pa
Array Chunk Bytes 45.29 MiB 1.89 MiB Shape (24, 458, 540) (1, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - temp(time, z_l, yh, xh)float64dask.array<chunksize=(1, 34, 458, 540), meta=np.ndarray>
- cell_measures :
- area: area_t
- cell_methods :
- area:mean z_l:mean yh:mean xh:mean time: mean
- long_name :
- Potential Temperature
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- degC
Array Chunk Bytes 1.50 GiB 64.15 MiB Shape (24, 34, 458, 540) (1, 34, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - thetaoga(time, scalar_axis)float64dask.array<chunksize=(1, 1), meta=np.ndarray>
- cell_methods :
- time: mean
- long_name :
- Global Mean Ocean Potential Temperature
- standard_name :
- sea_water_potential_temperature
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- degC
Array Chunk Bytes 192 B 8 B Shape (24, 1) (1, 1) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - time_bnds(time, nv)timedelta64[ns]dask.array<chunksize=(1, 2), meta=np.ndarray>
- long_name :
- time axis boundaries
- calendar :
- NOLEAP
Array Chunk Bytes 384 B 16 B Shape (24, 2) (1, 2) Count 25 Tasks 24 Chunks Type timedelta64[ns] numpy.ndarray - u(time, z_l, yh, xq)float64dask.array<chunksize=(1, 34, 458, 540), meta=np.ndarray>
- cell_methods :
- z_l:mean yh:mean xq:point time: mean
- interp_method :
- none
- long_name :
- Zonal velocity
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- m s-1
Array Chunk Bytes 1.50 GiB 64.15 MiB Shape (24, 34, 458, 540) (1, 34, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray - v(time, z_l, yq, xh)float64dask.array<chunksize=(1, 34, 458, 540), meta=np.ndarray>
- cell_methods :
- z_l:mean yq:point xh:mean time: mean
- interp_method :
- none
- long_name :
- Meridional velocity
- time_avg_info :
- average_T1,average_T2,average_DT
- units :
- m s-1
Array Chunk Bytes 1.50 GiB 64.15 MiB Shape (24, 34, 458, 540) (1, 34, 458, 540) Count 25 Tasks 24 Chunks Type float64 numpy.ndarray
- associated_files :
- area_t: g.c2b6.GNYF.T62_t061.melt_potential.003.mom6.static.nc
- filename :
- g.c2b6.GNYF.T62_t061.melt_potential.003.mom6.h_0001_01.nc
- grid_tile :
- N/A
- grid_type :
- regular
- title :
- MOM6 g.c2b6.GNYF.T62_t061.melt_potential.003 Experiment
Visualize SST Data with Holoviews and DatashaderΒΆ
The cells below show how to interactively explore the dataset.
[3]:
sst_ds = hv.Dataset(ds['SST'], kdims=['time', 'geolon', 'geolat'])
sst = sst_ds.to(hv.QuadMesh, kdims=["geolon", "geolat"], dynamic=True)
%opts RGB [width=900 height=600]
datashade(sst, precompute=True, cmap=plt.cm.RdBu_r)
[3]:
Visualize SSS Data with Holoviews and DatashaderΒΆ
[4]:
sss_ds = hv.Dataset(ds['SSS'], kdims=['time', 'geolon', 'geolat'])
sss = sst_ds.to(hv.QuadMesh, kdims=["geolon", "geolat"], dynamic=True)
%opts RGB [width=900 height=600]
datashade(sss, precompute=True, cmap=plt.cm.Spectral_r)
[4]:
Create and Connect to Dask Distributed ClusterΒΆ
This will launch a cluster of virtual machines in the cloud.
[5]:
from dask.distributed import Client
from dask_gateway import GatewayCluster
cluster = GatewayCluster()
cluster.adapt(minimum=1, maximum=10)
cluster
/srv/conda/envs/notebook/lib/python3.9/site-packages/dask_gateway/client.py:21: FutureWarning: format_bytes is deprecated and will be removed in a future release. Please use dask.utils.format_bytes instead.
from distributed.utils import LoopRunner, format_bytes
π Donβt forget to click this link to get the cluster dashboard
[6]:
client = Client(cluster)
client
[6]:
Client
Client-6754ce0c-3289-11ec-81c4-c90a8b0f0827
Connection method: Cluster object | Cluster type: dask_gateway.GatewayCluster |
Dashboard: https://hub.binder.pangeo.io/services/dask-gateway/clusters/prod.94141fd55bf241a9859a77e0989273b3/status |
Cluster Info
GatewayCluster
- Name: prod.94141fd55bf241a9859a77e0989273b3
- Dashboard: https://hub.binder.pangeo.io/services/dask-gateway/clusters/prod.94141fd55bf241a9859a77e0989273b3/status
Data reductionΒΆ
Here we make a data reduction by taking the time of SST and SSS. This demonstrates how the cluster distributes the reads from storage.
[7]:
SST_mean = ds.SST.mean(dim=('time'))
SST_mean
[7]:
<xarray.DataArray 'SST' (yh: 458, xh: 540)> dask.array<mean_agg-aggregate, shape=(458, 540), dtype=float64, chunksize=(458, 540), chunktype=numpy.ndarray> Coordinates: geolat (yh, xh) float64 dask.array<chunksize=(458, 540), meta=np.ndarray> geolon (yh, xh) float64 dask.array<chunksize=(458, 540), meta=np.ndarray> * xh (xh) float64 -286.7 -286.0 -285.3 -284.7 ... 70.67 71.33 72.0 72.67 * yh (yh) float64 -79.2 -79.08 -78.95 -78.82 ... 87.55 87.64 87.71 87.74
- yh: 458
- xh: 540
- dask.array<chunksize=(458, 540), meta=np.ndarray>
Array Chunk Bytes 1.89 MiB 1.89 MiB Shape (458, 540) (458, 540) Count 58 Tasks 1 Chunks Type float64 numpy.ndarray - geolat(yh, xh)float64dask.array<chunksize=(458, 540), meta=np.ndarray>
- long_name :
- latitude at tracer (T) points
- units :
- degree
Array Chunk Bytes 1.89 MiB 1.89 MiB Shape (458, 540) (458, 540) Count 2 Tasks 1 Chunks Type float64 numpy.ndarray - geolon(yh, xh)float64dask.array<chunksize=(458, 540), meta=np.ndarray>
- long_name :
- longitude at tracer (T) points
- units :
- degree
Array Chunk Bytes 1.89 MiB 1.89 MiB Shape (458, 540) (458, 540) Count 2 Tasks 1 Chunks Type float64 numpy.ndarray - xh(xh)float64-286.7 -286.0 -285.3 ... 72.0 72.67
- cartesian_axis :
- X
- long_name :
- h point nominal longitude
- units :
- degrees_east
array([-286.666667, -286. , -285.333333, ..., 71.333333, 72. , 72.666667])
- yh(yh)float64-79.2 -79.08 -78.95 ... 87.71 87.74
- cartesian_axis :
- Y
- long_name :
- h point nominal latitude
- units :
- degrees_north
array([-79.202602, -79.076995, -78.949944, ..., 87.641507, 87.706191, 87.738663])
[8]:
SSS_mean = ds.SSS.mean(dim=('time'))
SSS_mean
[8]:
<xarray.DataArray 'SSS' (yh: 458, xh: 540)> dask.array<mean_agg-aggregate, shape=(458, 540), dtype=float64, chunksize=(458, 540), chunktype=numpy.ndarray> Coordinates: geolat (yh, xh) float64 dask.array<chunksize=(458, 540), meta=np.ndarray> geolon (yh, xh) float64 dask.array<chunksize=(458, 540), meta=np.ndarray> * xh (xh) float64 -286.7 -286.0 -285.3 -284.7 ... 70.67 71.33 72.0 72.67 * yh (yh) float64 -79.2 -79.08 -78.95 -78.82 ... 87.55 87.64 87.71 87.74
- yh: 458
- xh: 540
- dask.array<chunksize=(458, 540), meta=np.ndarray>
Array Chunk Bytes 1.89 MiB 1.89 MiB Shape (458, 540) (458, 540) Count 58 Tasks 1 Chunks Type float64 numpy.ndarray - geolat(yh, xh)float64dask.array<chunksize=(458, 540), meta=np.ndarray>
- long_name :
- latitude at tracer (T) points
- units :
- degree
Array Chunk Bytes 1.89 MiB 1.89 MiB Shape (458, 540) (458, 540) Count 2 Tasks 1 Chunks Type float64 numpy.ndarray - geolon(yh, xh)float64dask.array<chunksize=(458, 540), meta=np.ndarray>
- long_name :
- longitude at tracer (T) points
- units :
- degree
Array Chunk Bytes 1.89 MiB 1.89 MiB Shape (458, 540) (458, 540) Count 2 Tasks 1 Chunks Type float64 numpy.ndarray - xh(xh)float64-286.7 -286.0 -285.3 ... 72.0 72.67
- cartesian_axis :
- X
- long_name :
- h point nominal longitude
- units :
- degrees_east
array([-286.666667, -286. , -285.333333, ..., 71.333333, 72. , 72.666667])
- yh(yh)float64-79.2 -79.08 -78.95 ... 87.71 87.74
- cartesian_axis :
- Y
- long_name :
- h point nominal latitude
- units :
- degrees_north
array([-79.202602, -79.076995, -78.949944, ..., 87.641507, 87.706191, 87.738663])
[9]:
%time SST_mean.load()
CPU times: user 270 ms, sys: 126 ms, total: 395 ms
Wall time: 10.2 s
[9]:
<xarray.DataArray 'SST' (yh: 458, xh: 540)> array([[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], ..., [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]]) Coordinates: geolat (yh, xh) float64 -79.2 -79.2 -79.2 -79.2 ... 50.27 50.11 49.99 geolon (yh, xh) float64 -286.7 -286.0 -285.3 -284.7 ... 72.97 72.98 73.0 * xh (xh) float64 -286.7 -286.0 -285.3 -284.7 ... 70.67 71.33 72.0 72.67 * yh (yh) float64 -79.2 -79.08 -78.95 -78.82 ... 87.55 87.64 87.71 87.74
- yh: 458
- xh: 540
- nan nan nan nan nan nan nan nan ... nan nan nan nan nan nan nan nan
array([[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], ..., [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]])
- geolat(yh, xh)float64-79.2 -79.2 -79.2 ... 50.11 49.99
- long_name :
- latitude at tracer (T) points
- units :
- degree
array([[-79.20260207, -79.20260207, -79.20260207, ..., -79.20260207, -79.20260207, -79.20260207], [-79.07699459, -79.07699459, -79.07699459, ..., -79.07699459, -79.07699459, -79.07699459], [-78.94994384, -78.94994384, -78.94994384, ..., -78.94994384, -78.94994384, -78.94994384], ..., [ 49.98156424, 50.10109229, 50.26652732, ..., 50.26652732, 50.10109229, 49.98156424], [ 49.98821 , 50.10559858, 50.2708983 , ..., 50.2708983 , 50.10559858, 49.98821 ], [ 49.99358843, 50.10777804, 50.27303167, ..., 50.27303167, 50.10777804, 49.99358843]])
- geolon(yh, xh)float64-286.7 -286.0 -285.3 ... 72.98 73.0
- long_name :
- longitude at tracer (T) points
- units :
- degree
array([[-286.66666667, -286. , -285.33333333, ..., 71.33333333, 72. , 72.66666667], [-286.66666667, -286. , -285.33333333, ..., 71.33333333, 72. , 72.66666667], [-286.66666667, -286. , -285.33333333, ..., 71.33333333, 72. , 72.66666667], ..., [-286.97001476, -286.9077867 , -286.86168531, ..., 72.86168531, 72.9077867 , 72.97001476], [-286.98685533, -286.94675664, -286.91863793, ..., 72.91863793, 72.94675664, 72.98685533], [-286.99975591, -286.98312106, -286.9735224 , ..., 72.9735224 , 72.98312106, 72.99975591]])
- xh(xh)float64-286.7 -286.0 -285.3 ... 72.0 72.67
- cartesian_axis :
- X
- long_name :
- h point nominal longitude
- units :
- degrees_east
array([-286.666667, -286. , -285.333333, ..., 71.333333, 72. , 72.666667])
- yh(yh)float64-79.2 -79.08 -78.95 ... 87.71 87.74
- cartesian_axis :
- Y
- long_name :
- h point nominal latitude
- units :
- degrees_north
array([-79.202602, -79.076995, -78.949944, ..., 87.641507, 87.706191, 87.738663])
[10]:
# plot mean SST
qm = hv.QuadMesh((ds.geolon.values, ds.geolat.values, SST_mean))
datashade(qm, precompute=True, cmap=plt.cm.RdBu_r)
[10]:
[11]:
%time SSS_mean.load()
CPU times: user 19.9 ms, sys: 6.11 ms, total: 26 ms
Wall time: 1.37 s
[11]:
<xarray.DataArray 'SSS' (yh: 458, xh: 540)> array([[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], ..., [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]]) Coordinates: geolat (yh, xh) float64 -79.2 -79.2 -79.2 -79.2 ... 50.27 50.11 49.99 geolon (yh, xh) float64 -286.7 -286.0 -285.3 -284.7 ... 72.97 72.98 73.0 * xh (xh) float64 -286.7 -286.0 -285.3 -284.7 ... 70.67 71.33 72.0 72.67 * yh (yh) float64 -79.2 -79.08 -78.95 -78.82 ... 87.55 87.64 87.71 87.74
- yh: 458
- xh: 540
- nan nan nan nan nan nan nan nan ... nan nan nan nan nan nan nan nan
array([[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], ..., [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]])
- geolat(yh, xh)float64-79.2 -79.2 -79.2 ... 50.11 49.99
- long_name :
- latitude at tracer (T) points
- units :
- degree
array([[-79.20260207, -79.20260207, -79.20260207, ..., -79.20260207, -79.20260207, -79.20260207], [-79.07699459, -79.07699459, -79.07699459, ..., -79.07699459, -79.07699459, -79.07699459], [-78.94994384, -78.94994384, -78.94994384, ..., -78.94994384, -78.94994384, -78.94994384], ..., [ 49.98156424, 50.10109229, 50.26652732, ..., 50.26652732, 50.10109229, 49.98156424], [ 49.98821 , 50.10559858, 50.2708983 , ..., 50.2708983 , 50.10559858, 49.98821 ], [ 49.99358843, 50.10777804, 50.27303167, ..., 50.27303167, 50.10777804, 49.99358843]])
- geolon(yh, xh)float64-286.7 -286.0 -285.3 ... 72.98 73.0
- long_name :
- longitude at tracer (T) points
- units :
- degree
array([[-286.66666667, -286. , -285.33333333, ..., 71.33333333, 72. , 72.66666667], [-286.66666667, -286. , -285.33333333, ..., 71.33333333, 72. , 72.66666667], [-286.66666667, -286. , -285.33333333, ..., 71.33333333, 72. , 72.66666667], ..., [-286.97001476, -286.9077867 , -286.86168531, ..., 72.86168531, 72.9077867 , 72.97001476], [-286.98685533, -286.94675664, -286.91863793, ..., 72.91863793, 72.94675664, 72.98685533], [-286.99975591, -286.98312106, -286.9735224 , ..., 72.9735224 , 72.98312106, 72.99975591]])
- xh(xh)float64-286.7 -286.0 -285.3 ... 72.0 72.67
- cartesian_axis :
- X
- long_name :
- h point nominal longitude
- units :
- degrees_east
array([-286.666667, -286. , -285.333333, ..., 71.333333, 72. , 72.666667])
- yh(yh)float64-79.2 -79.08 -78.95 ... 87.71 87.74
- cartesian_axis :
- Y
- long_name :
- h point nominal latitude
- units :
- degrees_north
array([-79.202602, -79.076995, -78.949944, ..., 87.641507, 87.706191, 87.738663])
[12]:
# plot mean SSS
qm = hv.QuadMesh((ds.geolon.values, ds.geolat.values, SSS_mean))
datashade(qm, precompute=True, cmap=plt.cm.Spectral_r)
[12]:
[ ]: