{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "4cd43153-8c1d-4ee5-8044-2d1692486ef8", "metadata": {}, "outputs": [], "source": [ "# Play with Beaching #" ] }, { "cell_type": "code", "execution_count": 164, "id": "666a35ff-9c31-4911-b8c0-10bb11e0d843", "metadata": {}, "outputs": [], "source": [ "import datetime as dt\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from pathlib import Path\n", "import xarray as xr\n", "\n", "from salishsea_tools import viz_tools" ] }, { "cell_type": "code", "execution_count": 44, "id": "6fc916ab-235e-4641-a41d-d595a0668098", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset>\n",
"Dimensions: (t: 1, x: 398, y: 898, z: 40)\n",
"Dimensions without coordinates: t, x, y, z\n",
"Data variables: (12/43)\n",
" nav_lon (y, x) float32 ...\n",
" nav_lat (y, x) float32 ...\n",
" time_counter (t) datetime64[ns] 1900-01-01\n",
" tmask (t, z, y, x) int8 ...\n",
" umask (t, z, y, x) int8 ...\n",
" vmask (t, z, y, x) int8 ...\n",
" ... ...\n",
" gdepv (t, z, y, x) float32 ...\n",
" gdepw_0 (t, z, y, x) float32 ...\n",
" gdept_1d (t, z) float64 0.5 1.5 2.5 3.5 4.5 ... 360.7 387.6 414.5 441.5\n",
" gdepw_1d (t, z) float64 0.0 1.0 2.0 3.0 4.0 ... 347.2 374.1 401.1 428.0\n",
" e3t_1d (t, z) float64 1.0 1.0 1.0 1.0 1.0 ... 26.93 26.93 26.93 26.93\n",
" e3w_1d (t, z) float64 1.0 1.0 1.0 1.0 1.0 ... 26.92 26.93 26.93 26.93\n",
"Attributes: (12/18)\n",
" DOMAIN_number_total: 1\n",
" DOMAIN_number: 0\n",
" DOMAIN_dimensions_ids: [1 2]\n",
" DOMAIN_size_global: [398 898]\n",
" DOMAIN_size_local: [398 898]\n",
" DOMAIN_position_first: [1 1]\n",
" ... ...\n",
" Conventions: CF-1.6\n",
" title: Salish Sea NEMO bathymetry_201702 Bathymetry Mes...\n",
" institution: Dept of Earth, Ocean & Atmospheric Sciences, Uni...\n",
" source: NEMO-3.6 Salish Sea configuration\n",
" references: https://salishsea.eos.ubc.ca/erddap/info/\\nhttps...\n",
" history: [2019-03-14 15:00] ncks -4 -L4 -O mesh_mask.nc m...[357404 values with dtype=float32]
[357404 values with dtype=float32]
array(['1900-01-01T00:00:00.000000000'], dtype='datetime64[ns]')
[14296160 values with dtype=int8]
[14296160 values with dtype=int8]
[14296160 values with dtype=int8]
[14296160 values with dtype=int8]
[357404 values with dtype=int8]
[357404 values with dtype=int8]
[357404 values with dtype=int8]
[357404 values with dtype=int8]
[357404 values with dtype=float32]
[357404 values with dtype=float32]
[357404 values with dtype=float32]
[357404 values with dtype=float32]
[357404 values with dtype=float32]
[357404 values with dtype=float32]
[357404 values with dtype=float32]
[357404 values with dtype=float32]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=int16]
[357404 values with dtype=int16]
[357404 values with dtype=float32]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float32]
[14296160 values with dtype=float32]
[14296160 values with dtype=float32]
[14296160 values with dtype=float32]
array([[ 0.5 , 1.500003, 2.500012, 3.500031, 4.50007 ,\n",
" 5.500151, 6.50031 , 7.500623, 8.501236, 9.502433,\n",
" 10.504765, 11.509311, 12.518167, 13.535412, 14.568982,\n",
" 15.634287, 16.761173, 18.007135, 19.481785, 21.389979,\n",
" 24.100257, 28.229915, 34.685758, 44.517725, 58.484334,\n",
" 76.585584, 98.062959, 121.866518, 147.089458, 173.114482,\n",
" 199.573049, 226.260306, 253.066637, 279.93455 , 306.834197,\n",
" 333.75017 , 360.674532, 387.603203, 414.534088, 441.46611 ]])array([[ 0. , 1.000001, 2.000006, 3.000019, 4.000047,\n",
" 5.000104, 6.000217, 7.000441, 8.000879, 9.001735,\n",
" 10.003406, 11.006663, 12.013008, 13.025366, 14.049429,\n",
" 15.096256, 16.187303, 17.364034, 18.705972, 20.363473,\n",
" 22.613064, 25.937413, 31.101035, 39.118857, 50.963237,\n",
" 67.052074, 86.96747 , 109.737066, 134.345934, 160.029562,\n",
" 186.305278, 212.896557, 239.653045, 266.495214, 293.381605,\n",
" 320.29076 , 347.21162 , 374.138492, 401.068453, 428. ]])array([[ 1.000001, 1.000005, 1.000013, 1.000027, 1.000056, 1.000111,\n",
" 1.000219, 1.00043 , 1.000841, 1.00164 , 1.003197, 1.006229,\n",
" 1.012133, 1.023624, 1.045976, 1.089401, 1.173564, 1.335929,\n",
" 1.646368, 2.229903, 3.292486, 5.119985, 7.974515, 11.825297,\n",
" 16.10792 , 19.958703, 22.813233, 24.640732, 25.703315, 26.28685 ,\n",
" 26.597289, 26.759653, 26.843817, 26.887242, 26.909594, 26.921085,\n",
" 26.926989, 26.930021, 26.931578, 26.932377]])array([[ 1. , 1.000003, 1.000008, 1.000019, 1.000039, 1.000079,\n",
" 1.000156, 1.000307, 1.000602, 1.001174, 1.00229 , 1.004463,\n",
" 1.008694, 1.016931, 1.032959, 1.06412 , 1.1246 , 1.24159 ,\n",
" 1.466437, 1.893272, 2.684857, 4.091313, 6.409889, 9.797678,\n",
" 13.966609, 18.13554 , 21.523329, 23.841905, 25.248361, 26.039946,\n",
" 26.46678 , 26.691628, 26.808618, 26.869097, 26.900259, 26.916287,\n",
" 26.924524, 26.928755, 26.930928, 26.932043]])<xarray.Dataset>\n",
"Dimensions: (grid_x: 396, grid_y: 896)\n",
"Coordinates:\n",
" * grid_y (grid_y) int16 0 1 2 3 4 5 6 ... 890 891 892 893 894 895\n",
" * grid_x (grid_x) int16 0 1 2 3 4 5 6 ... 390 391 392 393 394 395\n",
"Data variables:\n",
" Beaching_Volume (grid_y, grid_x) float64 ...\n",
" Beaching_Time (grid_y, grid_x) datetime64[ns] ...\n",
" OilType <U1 ''\n",
" SpillVolume float64 6.89e+03\n",
" SpillLon float64 -122.8\n",
" SpillLat float64 48.75\n",
" Spilldatetime datetime64[ns] 2017-06-13T05:30:00\n",
"Attributes:\n",
" acknowledgements: MOHID output\n",
" creator_email: sallen@eoas.ubc.ca\n",
" creator_name: Salish Sea MEOPAR Project Contributors\n",
" creator_url: https://ubc-moad-docs.readthedocs.org/\n",
" institution: UBC EOAS\n",
" institution_fullname: Earth, Ocean & Atmospheric Sciences, University of...\n",
" summary: Beaching Time and Volume from a Specific Run\n",
" source: analysis-susan/notebooks/MOHID/SaveBeaching.py\n",
" history: [2022-04-21] File creation.array([ 0, 1, 2, ..., 893, 894, 895], dtype=int16)
array([ 0, 1, 2, ..., 393, 394, 395], dtype=int16)
[354816 values with dtype=float64]
[354816 values with dtype=datetime64[ns]]
array('', dtype='<U1')array(6890.)
array(-122.750926)
array(48.754464)
array('2017-06-13T05:30:00.000000000', dtype='datetime64[ns]')