{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Oxygen, Nutrient, T/S Evals in PugetSound (Becca's dataset)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "import xarray as xr\n", "import netCDF4 as nc\n", "import numpy as np\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "from pathlib import Path\n", "\n", "import cmocean.cm as cm\n", "import matplotlib.patches as mpatches\n", "import scipy.stats as stat\n", "from matplotlib.colors import LogNorm" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "mesh = nc.Dataset('/ocean/atall/MOAD/grid/mesh_mask202108.nc')\n", "bathy = nc.Dataset('/ocean/atall/MOAD/grid/bathymetry_202108.nc')\n", "\n", "meshb = nc.Dataset('/ocean/atall/MOAD/grid/mesh_mask_202310b.nc')\n", "bathyb = nc.Dataset('/ocean/atall/MOAD/grid/bathymetry_202310b.nc')\n", "grid = xr.open_dataset('/ocean/atall/MOAD/grid/bathymetry_202310b.nc', mask_and_scale=False)\n", "\n", "depthb = meshb.variables['gdept_0'][:]\n", "with xr.open_dataset('/ocean/atall/MOAD/grid/mesh_mask_202310b.nc') as mesh:\n", " tmask = mesh.tmask\n", " mbathy = mesh.mbathy\n", " long = mesh.nav_lon\n", " latg = mesh.nav_lat\n", "grid_dir = Path(\"/ocean/atall/MOAD/grid/\")\n", "grid_map = Path(\"grid_from_lat_lon_mask999.nc\")\n", "grid_lons_lats = xr.open_dataset(grid_dir / grid_map)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Unnamed: 0.1 | \n", "Unnamed: 0 | \n", "dtUTC | \n", "Lon | \n", "Lat | \n", "Z | \n", "pressure (dbar) | \n", "Temp | \n", "SA | \n", "Oxygen_Dissolved | \n", "... | \n", "i | \n", "mod_nitrate | \n", "mod_silicon | \n", "mod_ammonium | \n", "mod_diatoms | \n", "mod_flagellates | \n", "mod_vosaline | \n", "mod_votemper | \n", "mod_dissolved_oxygen | \n", "k | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "0 | \n", "2279452 | \n", "2012-01-01 00:00:00 | \n", "-125.15 | \n", "49.06 | \n", "34.0 | \n", "34.180250 | \n", "NaN | \n", "31.929129 | \n", "NaN | \n", "... | \n", "16 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "-1 | \n", "
1 | \n", "1 | \n", "2279453 | \n", "2012-01-01 00:00:00 | \n", "-125.15 | \n", "49.06 | \n", "73.0 | \n", "73.146438 | \n", "NaN | \n", "32.522497 | \n", "NaN | \n", "... | \n", "16 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "-1 | \n", "
2 | \n", "2 | \n", "2279454 | \n", "2012-01-01 00:00:00 | \n", "-125.15 | \n", "49.06 | \n", "103.0 | \n", "104.339000 | \n", "NaN | \n", "32.711620 | \n", "NaN | \n", "... | \n", "16 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "-1 | \n", "
3 | \n", "3 | \n", "2279461 | \n", "2012-01-02 00:00:00 | \n", "-125.15 | \n", "49.06 | \n", "34.0 | \n", "34.201833 | \n", "NaN | \n", "32.011920 | \n", "NaN | \n", "... | \n", "16 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "-1 | \n", "
4 | \n", "4 | \n", "2279462 | \n", "2012-01-02 00:00:00 | \n", "-125.15 | \n", "49.06 | \n", "73.0 | \n", "73.168688 | \n", "NaN | \n", "32.520879 | \n", "NaN | \n", "... | \n", "16 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "-1 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
104864 | \n", "29935 | \n", "2508057 | \n", "2014-12-28 00:00:00 | \n", "-124.75 | \n", "48.51 | \n", "227.0 | \n", "227.000000 | \n", "8.442034 | \n", "33.758188 | \n", "NaN | \n", "... | \n", "6 | \n", "28.582405 | \n", "39.949348 | \n", "0.040335 | \n", "0.000864 | \n", "0.004984 | \n", "33.649403 | \n", "9.002784 | \n", "125.620735 | \n", "31 | \n", "
104865 | \n", "29936 | \n", "2508106 | \n", "2014-12-29 00:00:00 | \n", "-125.15 | \n", "49.06 | \n", "48.0 | \n", "48.130917 | \n", "NaN | \n", "31.510587 | \n", "NaN | \n", "... | \n", "16 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "-1 | \n", "
104866 | \n", "29937 | \n", "2508108 | \n", "2014-12-29 00:00:00 | \n", "-124.75 | \n", "48.51 | \n", "227.0 | \n", "227.000000 | \n", "8.157951 | \n", "33.825394 | \n", "NaN | \n", "... | \n", "6 | \n", "29.575422 | \n", "42.073326 | \n", "0.040393 | \n", "0.000928 | \n", "0.005132 | \n", "33.738140 | \n", "8.635898 | \n", "115.241066 | \n", "31 | \n", "
104867 | \n", "29938 | \n", "2508157 | \n", "2014-12-30 00:00:00 | \n", "-125.15 | \n", "49.06 | \n", "48.0 | \n", "48.193958 | \n", "NaN | \n", "31.585243 | \n", "NaN | \n", "... | \n", "16 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "-1 | \n", "
104868 | \n", "29939 | \n", "2508159 | \n", "2014-12-30 00:00:00 | \n", "-124.75 | \n", "48.51 | \n", "227.0 | \n", "227.000000 | \n", "7.773931 | \n", "33.886840 | \n", "NaN | \n", "... | \n", "6 | \n", "30.400713 | \n", "44.037273 | \n", "0.039689 | \n", "0.000869 | \n", "0.005109 | \n", "33.807991 | \n", "8.262365 | \n", "105.611046 | \n", "31 | \n", "
104869 rows × 42 columns
\n", "