{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import numpy as np\n", "import dask\n", "import xarray as xr\n", "import matplotlib.pyplot as plt\n", "import os\n", "from os.path import isfile\n", "import datetime as dt\n", "from salishsea_tools import evaltools as et, viz_tools\n", "import glob\n", "import dask\n", "import netCDF4 as nc\n", "from dask.distributed import Client, progress\n", "import dask.array as da\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "meshPath='/ocean/eolson/MEOPAR/NEMO-forcing/grid/mesh_mask201702_noLPE.nc'\n", "maskName='tmask'" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [], "source": [ "j0=230;j1=470;i0=0;i1=200;\n", "#ct=240;cz=40;cy=50;cx=200;" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n",
"Client\n", "
| \n",
"\n",
"Cluster\n", "
| \n",
"
<xarray.Dataset>\n", "Dimensions: (axis_nbounds: 2, deptht: 40, nvertex: 4, time_counter: 2400, x: 398, y: 898)\n", "Coordinates:\n", " nav_lat (y, x) float32 dask.array<chunksize=(898, 398), meta=np.ndarray>\n", " nav_lon (y, x) float32 dask.array<chunksize=(898, 398), meta=np.ndarray>\n", " * deptht (deptht) float32 0.5000003 1.5000031 ... 441.4661\n", " time_centered (time_counter) datetime64[ns] dask.array<chunksize=(3,), meta=np.ndarray>\n", " * time_counter (time_counter) datetime64[ns] 2015-05-31T00:30:00 ... 2015-09-07T23:30:00\n", "Dimensions without coordinates: axis_nbounds, nvertex, x, y\n", "Data variables:\n", " bounds_lon (y, x, nvertex) float32 dask.array<chunksize=(898, 398, 4), meta=np.ndarray>\n", " deptht_bounds (deptht, axis_nbounds) float32 dask.array<chunksize=(40, 2), meta=np.ndarray>\n", " bounds_lat (y, x, nvertex) float32 dask.array<chunksize=(898, 398, 4), meta=np.ndarray>\n", " area (y, x) float32 dask.array<chunksize=(898, 398), meta=np.ndarray>\n", " time_centered_bounds (time_counter, axis_nbounds) datetime64[ns] dask.array<chunksize=(3, 2), meta=np.ndarray>\n", " time_counter_bounds (time_counter, axis_nbounds) datetime64[ns] dask.array<chunksize=(3, 2), meta=np.ndarray>\n", " diatoms (time_counter, deptht, y, x) float32 dask.array<chunksize=(3, 40, 898, 398), meta=np.ndarray>\n", " microzooplankton (time_counter, deptht, y, x) float32 dask.array<chunksize=(3, 40, 898, 398), meta=np.ndarray>\n", "Attributes:\n", " name: SalishSea_1h_20150526_20150531\n", " description: biogeochemical variables\n", " title: biogeochemical variables\n", " Conventions: CF-1.6\n", " timeStamp: 2019-Sep-25 01:38:45 GMT\n", " uuid: 7abb4fe2-2cf5-475e-b3c2-b5200adfd953" ], "text/plain": [ "
<xarray.DataArray 'diatoms' (t: 2400, z: 40, y: 240, x: 200)>\n", "dask.array<getitem, shape=(2400, 40, 240, 200), dtype=float32, chunksize=(3, 40, 240, 200), chunktype=numpy.ndarray>\n", "Coordinates:\n", " nav_lat (y, x) float32 dask.array<chunksize=(240, 200), meta=np.ndarray>\n", " nav_lon (y, x) float32 dask.array<chunksize=(240, 200), meta=np.ndarray>\n", " * z (z) float32 0.5000003 1.5000031 ... 414.5341 441.4661\n", " time_centered (t) datetime64[ns] dask.array<chunksize=(3,), meta=np.ndarray>\n", " * t (t) datetime64[ns] 2015-05-31T00:30:00 ... 2015-09-07T23:30:00\n", "Dimensions without coordinates: y, x\n", "Attributes:\n", " standard_name: mole_concentration_of_diatoms_expressed_as_nitrogen_...\n", " long_name: Diatoms Concentration\n", " units: mmol m-3\n", " online_operation: average\n", " interval_operation: 40 s\n", " interval_write: 1 h\n", " cell_methods: time: mean (interval: 40 s)\n", " cell_measures: area: area" ], "text/plain": [ "