{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "a1a8767d-cb22-4d7a-aaa9-7047ba8011df",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import xarray as xr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "071ca2c0-2bf7-417a-9866-8c87c979d73b",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/folders/kx/4c3bx_w92t31pqyvg6ws03200000gn/T/ipykernel_16704/212808774.py:1: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.\n",
      "  df = pd.read_excel('311-2024_CTD_meta.xlsx', skiprows=1, parse_dates=[['Date', 'Time (UTC)']])\n"
     ]
    }
   ],
   "source": [
    "df = pd.read_excel('311-2024_CTD_meta.xlsx', skiprows=1, parse_dates=[['Date', 'Time (UTC)']])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "906aa10e-9606-4d50-bd13-f7cade7d7a6f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[48.69141667 48.67216667 48.63825    48.63285    48.67971667 48.71566667\n",
      " 48.70536667 48.7425     48.71635    48.51585    48.55138333 48.59221667\n",
      " 48.7531     48.75366667 48.71611667 48.69015    48.67115    48.6378\n",
      " 48.59185    48.55211667 48.6378    ]\n",
      "[-123.50003333 -123.50538333 -123.50161667 -123.26155    -123.27298333\n",
      " -123.2423     -123.26833333 -123.39266667 -123.45971667 -123.53896667\n",
      " -123.53531667 -123.50038333 -123.30726667 -123.30391667 -123.45888333\n",
      " -123.50156667 -123.50838333 -123.502      -123.49858333 -123.53435\n",
      " -123.502     ]\n"
     ]
    }
   ],
   "source": [
    "lat = np.zeros(len(df.Latitude))\n",
    "lon = np.zeros(len(df.Longitude))\n",
    "for nn in range(len(df.Latitude)):\n",
    "    lat[nn] = float(df['Latitude'][nn].split(\"°\")[0])\n",
    "    lat[nn] = lat[nn] + float(df['Latitude'][nn].split(\"°\")[1][:-1]) / 60\n",
    "    lon[nn] = float(df['Longitude'][nn].split(\"°\")[0])\n",
    "    lon[nn] = lon[nn] + float(df['Longitude'][nn].split(\"°\")[1][:-1]) / 60\n",
    "lon = -lon\n",
    "print(lat)\n",
    "print(lon)\n",
    "df['lon'] = lon\n",
    "df['lat'] = lat\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "fa718309-5eda-461c-b8d3-f6c82ecccead",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "tuple indices must be integers or slices, not str",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[52], line 2\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m row \u001b[38;5;129;01min\u001b[39;00m df\u001b[38;5;241m.\u001b[39miterrows():\n\u001b[0;32m----> 2\u001b[0m     \u001b[38;5;28mprint\u001b[39m(\u001b[43mrow\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mfname\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m)\n",
      "\u001b[0;31mTypeError\u001b[0m: tuple indices must be integers or slices, not str"
     ]
    }
   ],
   "source": [
    "for row in df.iterrows():\n",
    "    print(row['fname'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "9f5977f9-f248-41e7-95f2-d5996af5a790",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.time(16, 40)"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['Time (UTC)'][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "43c3c66c-5117-4c85-8b4b-aa7cf8094699",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "28"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "row[1]['Cast number']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "723548ae-dd2c-46da-8857-7fabd0a27ec9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Date_Time (UTC)</th>\n",
       "      <th>Time (local)</th>\n",
       "      <th>Event number</th>\n",
       "      <th>CTD</th>\n",
       "      <th>Cast number</th>\n",
       "      <th>Station</th>\n",
       "      <th>Latitude</th>\n",
       "      <th>Longitude</th>\n",
       "      <th>fname</th>\n",
       "      <th>Notes</th>\n",
       "      <th>lon</th>\n",
       "      <th>lat</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2024-09-19 16:40:00</td>\n",
       "      <td>09:40:00</td>\n",
       "      <td>1</td>\n",
       "      <td>A</td>\n",
       "      <td>28</td>\n",
       "      <td>S12</td>\n",
       "      <td>48° 41.485'</td>\n",
       "      <td>123° 30.002'</td>\n",
       "      <td>20663_20240926_1157</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.500033</td>\n",
       "      <td>48.691417</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2024-09-19 18:45:00</td>\n",
       "      <td>11:45:00</td>\n",
       "      <td>6</td>\n",
       "      <td>A</td>\n",
       "      <td>30</td>\n",
       "      <td>S4.5</td>\n",
       "      <td>48° 40.330'</td>\n",
       "      <td>123° 30.323'</td>\n",
       "      <td>20663_20240926_1157</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.505383</td>\n",
       "      <td>48.672167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2024-09-19 20:04:00</td>\n",
       "      <td>13:04:00</td>\n",
       "      <td>9</td>\n",
       "      <td>A</td>\n",
       "      <td>32</td>\n",
       "      <td>S4</td>\n",
       "      <td>48° 38.295'</td>\n",
       "      <td>123° 30.097'</td>\n",
       "      <td>20663_20240926_1157</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.501617</td>\n",
       "      <td>48.638250</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2024-09-20 17:41:00</td>\n",
       "      <td>10:41:00</td>\n",
       "      <td>13</td>\n",
       "      <td>A</td>\n",
       "      <td>34</td>\n",
       "      <td>H3</td>\n",
       "      <td>48° 37.971'</td>\n",
       "      <td>123° 15.693'</td>\n",
       "      <td>20663_20240926_1157</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.261550</td>\n",
       "      <td>48.632850</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2024-09-20 20:02:00</td>\n",
       "      <td>13:02:00</td>\n",
       "      <td>17</td>\n",
       "      <td>A</td>\n",
       "      <td>36</td>\n",
       "      <td>H2</td>\n",
       "      <td>48° 40.783'</td>\n",
       "      <td>123° 16.379'</td>\n",
       "      <td>20663_20240926_1157</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.272983</td>\n",
       "      <td>48.679717</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2024-09-20 22:24:00</td>\n",
       "      <td>15:24:00</td>\n",
       "      <td>21</td>\n",
       "      <td>B</td>\n",
       "      <td>89</td>\n",
       "      <td>H1</td>\n",
       "      <td>48° 42.940'</td>\n",
       "      <td>123° 14.538'</td>\n",
       "      <td>20664_20240922_1047</td>\n",
       "      <td>Oxy sensor o-ring did not get moved into deplo...</td>\n",
       "      <td>-123.242300</td>\n",
       "      <td>48.715667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2024-09-21 17:22:00</td>\n",
       "      <td>10:22:00</td>\n",
       "      <td>25</td>\n",
       "      <td>B</td>\n",
       "      <td>91</td>\n",
       "      <td>S6</td>\n",
       "      <td>48° 42.322'</td>\n",
       "      <td>123° 16.100'</td>\n",
       "      <td>20664_20240922_1047</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.268333</td>\n",
       "      <td>48.705367</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2024-09-21 19:15:00</td>\n",
       "      <td>12:15:00</td>\n",
       "      <td>29</td>\n",
       "      <td>B</td>\n",
       "      <td>93</td>\n",
       "      <td>S8</td>\n",
       "      <td>48° 44.55'</td>\n",
       "      <td>123° 23.56'</td>\n",
       "      <td>20664_20240922_1047</td>\n",
       "      <td>Recorded lat/long were copied from the last st...</td>\n",
       "      <td>-123.392667</td>\n",
       "      <td>48.742500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2024-09-21 20:30:00</td>\n",
       "      <td>13:30:00</td>\n",
       "      <td>32</td>\n",
       "      <td>B</td>\n",
       "      <td>95</td>\n",
       "      <td>S5</td>\n",
       "      <td>48° 42.981'</td>\n",
       "      <td>123° 27.583'</td>\n",
       "      <td>20664_20240922_1047</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.459717</td>\n",
       "      <td>48.716350</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2024-09-22 16:54:00</td>\n",
       "      <td>09:54:00</td>\n",
       "      <td>37</td>\n",
       "      <td>B</td>\n",
       "      <td>97</td>\n",
       "      <td>S1</td>\n",
       "      <td>48° 30.951'</td>\n",
       "      <td>123° 32.338'</td>\n",
       "      <td>20664_20240922_1047</td>\n",
       "      <td>After this deployment, CTD B deployment was st...</td>\n",
       "      <td>-123.538967</td>\n",
       "      <td>48.515850</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2024-09-22 18:38:00</td>\n",
       "      <td>11:38:00</td>\n",
       "      <td>41</td>\n",
       "      <td>B</td>\n",
       "      <td>2</td>\n",
       "      <td>S2</td>\n",
       "      <td>48° 33.083'</td>\n",
       "      <td>123° 32.119'</td>\n",
       "      <td>20664_20240922_1134</td>\n",
       "      <td>20664_20240922_1134.rsk</td>\n",
       "      <td>-123.535317</td>\n",
       "      <td>48.551383</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2024-09-22 21:15:00</td>\n",
       "      <td>14:15:00</td>\n",
       "      <td>46</td>\n",
       "      <td>B</td>\n",
       "      <td>4</td>\n",
       "      <td>S3</td>\n",
       "      <td>48° 35.533'</td>\n",
       "      <td>123° 30.023'</td>\n",
       "      <td>20664_20240922_1134</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.500383</td>\n",
       "      <td>48.592217</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2024-09-26 17:26:00</td>\n",
       "      <td>10:26:00</td>\n",
       "      <td>49</td>\n",
       "      <td>A</td>\n",
       "      <td>66</td>\n",
       "      <td>S6</td>\n",
       "      <td>48° 45.186'</td>\n",
       "      <td>123° 18.436'</td>\n",
       "      <td>20663_20240926_1157_2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.307267</td>\n",
       "      <td>48.753100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2024-09-26 19:27:00</td>\n",
       "      <td>12:27:00</td>\n",
       "      <td>53</td>\n",
       "      <td>A</td>\n",
       "      <td>68</td>\n",
       "      <td>S8</td>\n",
       "      <td>48° 45.220'</td>\n",
       "      <td>123° 18.235'</td>\n",
       "      <td>20663_20240926_1157_2</td>\n",
       "      <td>Eva thinks maybe the GPS did not update from l...</td>\n",
       "      <td>-123.303917</td>\n",
       "      <td>48.753667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2024-09-26 21:38:00</td>\n",
       "      <td>14:38:00</td>\n",
       "      <td>58</td>\n",
       "      <td>A</td>\n",
       "      <td>70</td>\n",
       "      <td>S5</td>\n",
       "      <td>48° 42.967'</td>\n",
       "      <td>123° 27.533'</td>\n",
       "      <td>20663_20240926_1157_2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.458883</td>\n",
       "      <td>48.716117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2024-09-27 17:09:00</td>\n",
       "      <td>10:09:00</td>\n",
       "      <td>63</td>\n",
       "      <td>A</td>\n",
       "      <td>72</td>\n",
       "      <td>S12</td>\n",
       "      <td>48° 41.409'</td>\n",
       "      <td>123° 30.094'</td>\n",
       "      <td>20663_20240926_1157_2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.501567</td>\n",
       "      <td>48.690150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2024-09-27 18:39:00</td>\n",
       "      <td>11:39:00</td>\n",
       "      <td>66</td>\n",
       "      <td>A</td>\n",
       "      <td>74</td>\n",
       "      <td>S4.5</td>\n",
       "      <td>48° 40.269'</td>\n",
       "      <td>123° 30.503'</td>\n",
       "      <td>20663_20240926_1157_2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.508383</td>\n",
       "      <td>48.671150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2024-09-27 21:12:00</td>\n",
       "      <td>14:12:00</td>\n",
       "      <td>71</td>\n",
       "      <td>A</td>\n",
       "      <td>76</td>\n",
       "      <td>S4</td>\n",
       "      <td>48° 38.268'</td>\n",
       "      <td>123° 30.120'</td>\n",
       "      <td>20663_20240926_1157_2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.502000</td>\n",
       "      <td>48.637800</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2024-09-28 16:32:00</td>\n",
       "      <td>09:32:00</td>\n",
       "      <td>75</td>\n",
       "      <td>A</td>\n",
       "      <td>78</td>\n",
       "      <td>S3</td>\n",
       "      <td>48° 35.511'</td>\n",
       "      <td>123° 29.915'</td>\n",
       "      <td>20663_20240926_1157_2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.498583</td>\n",
       "      <td>48.591850</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>2024-09-28 20:22:00</td>\n",
       "      <td>13:22:00</td>\n",
       "      <td>82</td>\n",
       "      <td>A</td>\n",
       "      <td>80</td>\n",
       "      <td>S2</td>\n",
       "      <td>48° 33.127'</td>\n",
       "      <td>123° 32.061'</td>\n",
       "      <td>20663_20240926_1157_2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.534350</td>\n",
       "      <td>48.552117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>2024-09-28 21:52:00</td>\n",
       "      <td>14:52:00</td>\n",
       "      <td>85</td>\n",
       "      <td>A</td>\n",
       "      <td>82</td>\n",
       "      <td>S1</td>\n",
       "      <td>48° 38.268'</td>\n",
       "      <td>123° 30.120'</td>\n",
       "      <td>20663_20240926_1157_2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-123.502000</td>\n",
       "      <td>48.637800</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Date_Time (UTC) Time (local)  Event number CTD  Cast number Station  \\\n",
       "0  2024-09-19 16:40:00     09:40:00             1   A           28     S12   \n",
       "1  2024-09-19 18:45:00     11:45:00             6   A           30    S4.5   \n",
       "2  2024-09-19 20:04:00     13:04:00             9   A           32      S4   \n",
       "3  2024-09-20 17:41:00     10:41:00            13   A           34      H3   \n",
       "4  2024-09-20 20:02:00     13:02:00            17   A           36      H2   \n",
       "5  2024-09-20 22:24:00     15:24:00            21   B           89      H1   \n",
       "6  2024-09-21 17:22:00     10:22:00            25   B           91      S6   \n",
       "7  2024-09-21 19:15:00     12:15:00            29   B           93      S8   \n",
       "8  2024-09-21 20:30:00     13:30:00            32   B           95      S5   \n",
       "9  2024-09-22 16:54:00     09:54:00            37   B           97      S1   \n",
       "10 2024-09-22 18:38:00     11:38:00            41   B            2      S2   \n",
       "11 2024-09-22 21:15:00     14:15:00            46   B            4      S3   \n",
       "12 2024-09-26 17:26:00     10:26:00            49   A           66      S6   \n",
       "13 2024-09-26 19:27:00     12:27:00            53   A           68      S8   \n",
       "14 2024-09-26 21:38:00     14:38:00            58   A           70      S5   \n",
       "15 2024-09-27 17:09:00     10:09:00            63   A           72     S12   \n",
       "16 2024-09-27 18:39:00     11:39:00            66   A           74    S4.5   \n",
       "17 2024-09-27 21:12:00     14:12:00            71   A           76      S4   \n",
       "18 2024-09-28 16:32:00     09:32:00            75   A           78      S3   \n",
       "19 2024-09-28 20:22:00     13:22:00            82   A           80      S2   \n",
       "20 2024-09-28 21:52:00     14:52:00            85   A           82      S1   \n",
       "\n",
       "       Latitude     Longitude                  fname  \\\n",
       "0   48° 41.485'  123° 30.002'    20663_20240926_1157   \n",
       "1   48° 40.330'  123° 30.323'    20663_20240926_1157   \n",
       "2   48° 38.295'  123° 30.097'    20663_20240926_1157   \n",
       "3   48° 37.971'  123° 15.693'    20663_20240926_1157   \n",
       "4   48° 40.783'  123° 16.379'    20663_20240926_1157   \n",
       "5   48° 42.940'  123° 14.538'    20664_20240922_1047   \n",
       "6   48° 42.322'  123° 16.100'    20664_20240922_1047   \n",
       "7    48° 44.55'   123° 23.56'    20664_20240922_1047   \n",
       "8   48° 42.981'  123° 27.583'    20664_20240922_1047   \n",
       "9   48° 30.951'  123° 32.338'    20664_20240922_1047   \n",
       "10  48° 33.083'  123° 32.119'    20664_20240922_1134   \n",
       "11  48° 35.533'  123° 30.023'    20664_20240922_1134   \n",
       "12  48° 45.186'  123° 18.436'  20663_20240926_1157_2   \n",
       "13  48° 45.220'  123° 18.235'  20663_20240926_1157_2   \n",
       "14  48° 42.967'  123° 27.533'  20663_20240926_1157_2   \n",
       "15  48° 41.409'  123° 30.094'  20663_20240926_1157_2   \n",
       "16  48° 40.269'  123° 30.503'  20663_20240926_1157_2   \n",
       "17  48° 38.268'  123° 30.120'  20663_20240926_1157_2   \n",
       "18  48° 35.511'  123° 29.915'  20663_20240926_1157_2   \n",
       "19  48° 33.127'  123° 32.061'  20663_20240926_1157_2   \n",
       "20  48° 38.268'  123° 30.120'  20663_20240926_1157_2   \n",
       "\n",
       "                                                Notes         lon        lat  \n",
       "0                                                 NaN -123.500033  48.691417  \n",
       "1                                                 NaN -123.505383  48.672167  \n",
       "2                                                 NaN -123.501617  48.638250  \n",
       "3                                                 NaN -123.261550  48.632850  \n",
       "4                                                 NaN -123.272983  48.679717  \n",
       "5   Oxy sensor o-ring did not get moved into deplo... -123.242300  48.715667  \n",
       "6                                                 NaN -123.268333  48.705367  \n",
       "7   Recorded lat/long were copied from the last st... -123.392667  48.742500  \n",
       "8                                                 NaN -123.459717  48.716350  \n",
       "9   After this deployment, CTD B deployment was st... -123.538967  48.515850  \n",
       "10                            20664_20240922_1134.rsk -123.535317  48.551383  \n",
       "11                                                NaN -123.500383  48.592217  \n",
       "12                                                NaN -123.307267  48.753100  \n",
       "13  Eva thinks maybe the GPS did not update from l... -123.303917  48.753667  \n",
       "14                                                NaN -123.458883  48.716117  \n",
       "15                                                NaN -123.501567  48.690150  \n",
       "16                                                NaN -123.508383  48.671150  \n",
       "17                                                NaN -123.502000  48.637800  \n",
       "18                                                NaN -123.498583  48.591850  \n",
       "19                                                NaN -123.534350  48.552117  \n",
       "20                                                NaN -123.502000  48.637800  "
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "0e15a22d-0988-4bb9-b2ea-2c05d4530d78",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "html[data-theme=dark],\n",
       "body[data-theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block !important;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 0 20px 0 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: inline-block;\n",
       "  opacity: 0;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:focus + label {\n",
       "  border: 2px solid var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-index-preview {\n",
       "  grid-column: 2 / 5;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data,\n",
       ".xr-index-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data,\n",
       ".xr-index-data-in:checked ~ .xr-index-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-index-name div,\n",
       ".xr-index-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data,\n",
       ".xr-index-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2,\n",
       ".xr-no-icon {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt; Size: 440kB\n",
       "Dimensions:            (depths: 324, cast: 21)\n",
       "Coordinates:\n",
       "  * depths             (depths) float64 3kB 0.5 1.5 2.5 ... 321.5 322.5 323.5\n",
       "  * cast               (cast) int64 168B 0 1 2 3 4 5 6 ... 14 15 16 17 18 19 20\n",
       "Data variables: (12/15)\n",
       "    time               (cast) datetime64[ns] 168B ...\n",
       "    pressure           (depths, cast) float64 54kB ...\n",
       "    temperature        (depths, cast) float64 54kB ...\n",
       "    conductivity       (depths, cast) float64 54kB ...\n",
       "    chlorophyll        (depths, cast) float64 54kB ...\n",
       "    oxygensaturation   (depths, cast) float64 54kB ...\n",
       "    ...                 ...\n",
       "    station_name       (cast) &lt;U4 336B ...\n",
       "    water_depth        (cast) float64 168B ...\n",
       "    serial             (cast) &lt;U6 504B ...\n",
       "    Event              (cast) &lt;U2 168B ...\n",
       "    longitude          (cast) float64 168B ...\n",
       "    latitude           (cast) float64 168B ...</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-48e497a3-7646-450a-9d25-87c10dd61697' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-48e497a3-7646-450a-9d25-87c10dd61697' class='xr-section-summary'  title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span class='xr-has-index'>depths</span>: 324</li><li><span class='xr-has-index'>cast</span>: 21</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-80ee941e-deb3-421a-9a56-60f72130a8a5' class='xr-section-summary-in' type='checkbox'  checked><label for='section-80ee941e-deb3-421a-9a56-60f72130a8a5' class='xr-section-summary' >Coordinates: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>depths</span></div><div class='xr-var-dims'>(depths)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.5 1.5 2.5 ... 321.5 322.5 323.5</div><input id='attrs-dde961f6-efc1-45a1-9406-100f75e208c5' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-dde961f6-efc1-45a1-9406-100f75e208c5' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-9baa2b36-8daf-4d07-b4ff-66ea0b3e3d30' class='xr-var-data-in' type='checkbox'><label for='data-9baa2b36-8daf-4d07-b4ff-66ea0b3e3d30' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([  0.5,   1.5,   2.5, ..., 321.5, 322.5, 323.5])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>cast</span></div><div class='xr-var-dims'>(cast)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6 ... 15 16 17 18 19 20</div><input id='attrs-b2fa7798-94c1-49f9-99c1-d426a306142a' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-b2fa7798-94c1-49f9-99c1-d426a306142a' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-35dfaef9-f1c1-424c-9a0b-c1a0ef327bb7' class='xr-var-data-in' type='checkbox'><label for='data-35dfaef9-f1c1-424c-9a0b-c1a0ef327bb7' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
       "       18, 19, 20])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-8ceb9af1-caf6-4766-bdf1-c2ae173c070d' class='xr-section-summary-in' type='checkbox'  ><label for='section-8ceb9af1-caf6-4766-bdf1-c2ae173c070d' class='xr-section-summary' >Data variables: <span>(15)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>time</span></div><div class='xr-var-dims'>(cast)</div><div class='xr-var-dtype'>datetime64[ns]</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-e7e1bd4e-37c1-45fb-9334-5e83c70b760c' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-e7e1bd4e-37c1-45fb-9334-5e83c70b760c' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-bc044290-7aeb-4b8d-ab60-73ce97905077' class='xr-var-data-in' type='checkbox'><label for='data-bc044290-7aeb-4b8d-ab60-73ce97905077' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[21 values with dtype=datetime64[ns]]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>pressure</span></div><div class='xr-var-dims'>(depths, cast)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-bc1554e7-04e4-499d-ac3a-c4341234faca' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-bc1554e7-04e4-499d-ac3a-c4341234faca' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-a330a549-edb1-41a2-8ddf-51065e12a052' class='xr-var-data-in' type='checkbox'><label for='data-a330a549-edb1-41a2-8ddf-51065e12a052' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>dbar</dd><dt><span>derived :</span></dt><dd>True</dd><dt><span>long_name :</span></dt><dd>Sea pressure</dd></dl></div><div class='xr-var-data'><pre>[6804 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>temperature</span></div><div class='xr-var-dims'>(depths, cast)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-41bde10f-37ce-44f0-a140-116bb2c8d079' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-41bde10f-37ce-44f0-a140-116bb2c8d079' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-accb91fd-e429-4c0e-a16a-2115311e84d1' class='xr-var-data-in' type='checkbox'><label for='data-accb91fd-e429-4c0e-a16a-2115311e84d1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>°C</dd><dt><span>derived :</span></dt><dd>False</dd><dt><span>long_name :</span></dt><dd>Temperature</dd></dl></div><div class='xr-var-data'><pre>[6804 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>conductivity</span></div><div class='xr-var-dims'>(depths, cast)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-e67a2cea-f25c-4ded-876a-8bf1f00727b9' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-e67a2cea-f25c-4ded-876a-8bf1f00727b9' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-88cf5c68-3cf0-42c2-9985-023822417504' class='xr-var-data-in' type='checkbox'><label for='data-88cf5c68-3cf0-42c2-9985-023822417504' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>mS/cm</dd><dt><span>derived :</span></dt><dd>False</dd><dt><span>long_name :</span></dt><dd>Conductivity</dd></dl></div><div class='xr-var-data'><pre>[6804 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>chlorophyll</span></div><div class='xr-var-dims'>(depths, cast)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-52dddef6-4a71-41ec-8890-6b722f607318' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-52dddef6-4a71-41ec-8890-6b722f607318' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6020574f-803a-4f9d-834a-a55e6812aaed' class='xr-var-data-in' type='checkbox'><label for='data-6020574f-803a-4f9d-834a-a55e6812aaed' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>µg/l</dd><dt><span>derived :</span></dt><dd>False</dd><dt><span>long_name :</span></dt><dd>Chlorophyll a</dd></dl></div><div class='xr-var-data'><pre>[6804 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>oxygensaturation</span></div><div class='xr-var-dims'>(depths, cast)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-7a7423c1-66de-41a8-ba93-50419cc3c701' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-7a7423c1-66de-41a8-ba93-50419cc3c701' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-99ea8cfa-3215-407a-b213-3245e077b689' class='xr-var-data-in' type='checkbox'><label for='data-99ea8cfa-3215-407a-b213-3245e077b689' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>%</dd><dt><span>derived :</span></dt><dd>False</dd><dt><span>long_name :</span></dt><dd>Dissolved O₂ saturation</dd></dl></div><div class='xr-var-data'><pre>[6804 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>salinity</span></div><div class='xr-var-dims'>(depths, cast)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-e24f53a1-7b7f-4158-b695-97ea0246f9fd' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-e24f53a1-7b7f-4158-b695-97ea0246f9fd' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-cae6355d-c2c9-40d2-9b9b-05d85c358953' class='xr-var-data-in' type='checkbox'><label for='data-cae6355d-c2c9-40d2-9b9b-05d85c358953' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>PSU</dd><dt><span>derived :</span></dt><dd>True</dd><dt><span>long_name :</span></dt><dd>Salinity</dd></dl></div><div class='xr-var-data'><pre>[6804 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>par</span></div><div class='xr-var-dims'>(depths, cast)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-419c0e29-40d1-41f3-bed8-32918b284c6d' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-419c0e29-40d1-41f3-bed8-32918b284c6d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-1c400ce7-66ac-4128-86fb-8e186211b4f7' class='xr-var-data-in' type='checkbox'><label for='data-1c400ce7-66ac-4128-86fb-8e186211b4f7' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>units :</span></dt><dd>µMol/m²/s</dd><dt><span>derived :</span></dt><dd>False</dd><dt><span>long_name :</span></dt><dd>PAR</dd></dl></div><div class='xr-var-data'><pre>[6804 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>potential_density</span></div><div class='xr-var-dims'>(depths, cast)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-d0261ad2-2855-4496-9f45-ec4075757bad' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-d0261ad2-2855-4496-9f45-ec4075757bad' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-a05ba91c-5a0c-4c9e-b5c9-bf33abfb750d' class='xr-var-data-in' type='checkbox'><label for='data-a05ba91c-5a0c-4c9e-b5c9-bf33abfb750d' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[6804 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>station_name</span></div><div class='xr-var-dims'>(cast)</div><div class='xr-var-dtype'>&lt;U4</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-ca659cfc-61c5-4bbf-a93f-08776583d787' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-ca659cfc-61c5-4bbf-a93f-08776583d787' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-25da9a7a-b882-4fc3-a9d9-0d66655ba81e' class='xr-var-data-in' type='checkbox'><label for='data-25da9a7a-b882-4fc3-a9d9-0d66655ba81e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[21 values with dtype=&lt;U4]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>water_depth</span></div><div class='xr-var-dims'>(cast)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-5f8fb8f2-9555-463b-a227-ed2113da22d6' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-5f8fb8f2-9555-463b-a227-ed2113da22d6' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-9d183174-0e8f-4c08-bf71-36433d113a74' class='xr-var-data-in' type='checkbox'><label for='data-9d183174-0e8f-4c08-bf71-36433d113a74' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[21 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>serial</span></div><div class='xr-var-dims'>(cast)</div><div class='xr-var-dtype'>&lt;U6</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-1a2a9263-7f58-4ed8-b84f-54c6b28bca15' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-1a2a9263-7f58-4ed8-b84f-54c6b28bca15' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-af14abe8-dabc-446a-aa9e-9bc3f8833308' class='xr-var-data-in' type='checkbox'><label for='data-af14abe8-dabc-446a-aa9e-9bc3f8833308' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[21 values with dtype=&lt;U6]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Event</span></div><div class='xr-var-dims'>(cast)</div><div class='xr-var-dtype'>&lt;U2</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-66713f3b-7d1f-43e8-a6dc-d430d12192a7' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-66713f3b-7d1f-43e8-a6dc-d430d12192a7' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-07cf14d3-b110-4150-86a6-749e396fffdc' class='xr-var-data-in' type='checkbox'><label for='data-07cf14d3-b110-4150-86a6-749e396fffdc' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[21 values with dtype=&lt;U2]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>longitude</span></div><div class='xr-var-dims'>(cast)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-e86f13c6-6d98-42ff-925b-cf8d1e9643d1' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-e86f13c6-6d98-42ff-925b-cf8d1e9643d1' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-32e55015-0518-411a-a50f-421c200d6bbb' class='xr-var-data-in' type='checkbox'><label for='data-32e55015-0518-411a-a50f-421c200d6bbb' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[21 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>latitude</span></div><div class='xr-var-dims'>(cast)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-abb1b736-ec2b-420e-a50d-255544a3eff7' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-abb1b736-ec2b-420e-a50d-255544a3eff7' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-7c88e696-0a13-411d-b271-e17067984ec8' class='xr-var-data-in' type='checkbox'><label for='data-7c88e696-0a13-411d-b271-e17067984ec8' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[21 values with dtype=float64]</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-dfb26d91-bb03-4a54-91bf-691a48451862' class='xr-section-summary-in' type='checkbox'  ><label for='section-dfb26d91-bb03-4a54-91bf-691a48451862' class='xr-section-summary' >Indexes: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>depths</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-a8a6c0a7-0bbf-48df-86c5-4b0455bb7a86' class='xr-index-data-in' type='checkbox'/><label for='index-a8a6c0a7-0bbf-48df-86c5-4b0455bb7a86' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([  0.5,   1.5,   2.5,   3.5,   4.5,   5.5,   6.5,   7.5,   8.5,   9.5,\n",
       "       ...\n",
       "       314.5, 315.5, 316.5, 317.5, 318.5, 319.5, 320.5, 321.5, 322.5, 323.5],\n",
       "      dtype=&#x27;float64&#x27;, name=&#x27;depths&#x27;, length=324))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>cast</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-1838c862-0123-47d3-bf06-85c16e83a15e' class='xr-index-data-in' type='checkbox'/><label for='index-1838c862-0123-47d3-bf06-85c16e83a15e' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,\n",
       "       20],\n",
       "      dtype=&#x27;int64&#x27;, name=&#x27;cast&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-0a4ba5a6-d2d0-449c-bfb1-b22295ceb0fd' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-0a4ba5a6-d2d0-449c-bfb1-b22295ceb0fd' class='xr-section-summary'  title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.Dataset> Size: 440kB\n",
       "Dimensions:            (depths: 324, cast: 21)\n",
       "Coordinates:\n",
       "  * depths             (depths) float64 3kB 0.5 1.5 2.5 ... 321.5 322.5 323.5\n",
       "  * cast               (cast) int64 168B 0 1 2 3 4 5 6 ... 14 15 16 17 18 19 20\n",
       "Data variables: (12/15)\n",
       "    time               (cast) datetime64[ns] 168B ...\n",
       "    pressure           (depths, cast) float64 54kB ...\n",
       "    temperature        (depths, cast) float64 54kB ...\n",
       "    conductivity       (depths, cast) float64 54kB ...\n",
       "    chlorophyll        (depths, cast) float64 54kB ...\n",
       "    oxygensaturation   (depths, cast) float64 54kB ...\n",
       "    ...                 ...\n",
       "    station_name       (cast) <U4 336B ...\n",
       "    water_depth        (cast) float64 168B ...\n",
       "    serial             (cast) <U6 504B ...\n",
       "    Event              (cast) <U2 168B ...\n",
       "    longitude          (cast) float64 168B ...\n",
       "    latitude           (cast) float64 168B ..."
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "with xr.open_dataset('CTDGridRuskin.nc') as ds:\n",
    "    display(ds)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "06d29548-a1e9-40d0-9b9e-98e9a59468e3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 90., 153., 200., 168., 216., 142.,  83., 121.,  82., 156., 202.,\n",
       "       226., 215., 148., 339., 123.,  78., 115., 216., 129., 150.])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ds.water_depth.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "770f80c6-d011-4997-8178-6170b6345617",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.2"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {},
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
