{ "cells": [ { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "from hakai_api import Client\n", "import mercury as mr\n", "import pandas as pd \n", "import plotly.express as px\n", "import folium\n", "from folium.plugins import FastMarkerCluster" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [], "source": [ "\n", "def get_hakai_ctd_data(crendentials, station, start_time,end_time, fields=['depth','start_dt']):\n", " client = Client(credentials=crendentials or None)\n", " url = ''.join(\n", " f\"{client.api_root}/ctd/views/file/cast/data?\"\n", " + f\"station={station}\"\n", " + f\"&start_dt>{start_time}\"\n", " + f\"&start_dt<{end_time}\"\n", " + \"&direction_flag=d\"\n", " + f\"&fields={','.join(fields)}\"\n", " + \"&limit=-1\"\n", " )\n", " response = client.get(url)\n", " return pd.DataFrame(response.json())" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "application/mercury+json": { "allow_download": true, "code_uid": "App.0.40.24.1-rand86bf7fb9", "continuous_update": true, "description": "Generate CTD plot", "full_screen": true, "model_id": "mercury-app", "notify": "{}", "output": "app", "schedule": "", "show_code": false, "show_prompt": false, "show_sidebar": true, "static_notebook": false, "title": "Hakai CTD", "widget": "App" }, "text/html": [ "