Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions docs/source/version_0.1.0/develop_region_browser.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
Copy link
Copy Markdown
Collaborator

@LOCEANlloydizard LOCEANlloydizard Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • add more markdown text?
  • remove icon?

Reply via ReviewNB

Copy link
Copy Markdown
Collaborator

@LOCEANlloydizard LOCEANlloydizard Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #4.    # Create sample hake school regions in Echoregions standard format
  • Put this as Markdown?
  • remove icons

Reply via ReviewNB

Copy link
Copy Markdown
Collaborator

@LOCEANlloydizard LOCEANlloydizard Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #9.    print("✅ Browser ready!")

maybe this is not useful? if the "Launching server at.." anyways comes up?


Reply via ReviewNB

"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "4c500ef8",
"metadata": {},
"outputs": [],
"source": [
"import xarray as xr\n",
"import fsspec\n",
"import pandas as pd\n",
"import numpy as np\n",
"import echoshader\n",
"\n",
"# S3 Connection\n",
"S3_URL = \"s3://agr230002-bucket01/hake_data/data_zarr/MVBS/2017/x0062_8_wt_20170731_180848_f0002.zarr\"\n",
"storage_options = {\"endpoint_url\": \"https://sdsc.osn.xsede.org\"}\n",
"fs = fsspec.filesystem(\"s3\", anon=True, client_kwargs=storage_options)\n",
"\n",
"# Load data\n",
"ds_ooi = xr.open_zarr(fs.get_mapper(S3_URL), consolidated=False)\n",
"\n",
"print(\"\u2705 Data loaded successfully\")\n",
"print(f\" Echoshader version: {echoshader.__version__}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cec7ced9",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"\n",
"# Create sample hake school regions in Echoregions standard format\n",
"# Format: region_id (int), time (datetime64[ns] array), depth (float array)\n",
"\n",
"sample_df = pd.DataFrame({\n",
" 'region_id': [1, 2, 3, 4],\n",
" 'time': [\n",
" # Region 1: 18:10 - 18:15\n",
" np.array([\n",
" '2017-07-31T18:10:00',\n",
" '2017-07-31T18:15:00',\n",
" '2017-07-31T18:15:00',\n",
" '2017-07-31T18:10:00'\n",
" ], dtype='datetime64[ns]'),\n",
" \n",
" # Region 2: 18:20 - 18:25\n",
" np.array([\n",
" '2017-07-31T18:20:00',\n",
" '2017-07-31T18:25:00',\n",
" '2017-07-31T18:25:00',\n",
" '2017-07-31T18:20:00'\n",
" ], dtype='datetime64[ns]'),\n",
" \n",
" # Region 3: 18:30 - 18:35\n",
" np.array([\n",
" '2017-07-31T18:30:00',\n",
" '2017-07-31T18:35:00',\n",
" '2017-07-31T18:35:00',\n",
" '2017-07-31T18:30:00'\n",
" ], dtype='datetime64[ns]'),\n",
" \n",
" # Region 4: 18:12 - 18:17\n",
" np.array([\n",
" '2017-07-31T18:12:00',\n",
" '2017-07-31T18:17:00',\n",
" '2017-07-31T18:17:00',\n",
" '2017-07-31T18:12:00'\n",
" ], dtype='datetime64[ns]')\n",
" ],\n",
" 'depth': [\n",
" np.array([40.0, 40.0, 80.0, 80.0]), # Region 1 depth bounds\n",
" np.array([100.0, 100.0, 150.0, 150.0]), # Region 2 depth bounds\n",
" np.array([50.0, 50.0, 90.0, 90.0]), # Region 3 depth bounds\n",
" np.array([60.0, 60.0, 100.0, 100.0]) # Region 4 depth bounds\n",
" ]\n",
"})\n",
"\n",
"print(f\"\u2705 Loaded {len(sample_df)} hake school regions (Echoregions format)\")\n",
"print(f\" Region IDs: {list(sample_df['region_id'].values)}\")\n",
"print(\"\\nDataFrame structure:\")\n",
"print(sample_df)\n",
"print(\"\\nData types:\")\n",
"print(f\" region_id: {sample_df['region_id'].dtype}\")\n",
"print(f\" time: {type(sample_df['time'].iloc[0])}, dtype={sample_df['time'].iloc[0].dtype}\")\n",
"print(f\" depth: {type(sample_df['depth'].iloc[0])}, dtype={sample_df['depth'].iloc[0].dtype}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "33b74475",
"metadata": {},
"outputs": [],
"source": [
"browser = echoshader.region_browser(\n",
" ds=ds_ooi,\n",
" regions_df=sample_df,\n",
" cache_backgrounds=True\n",
")\n",
"\n",
"browser.show()\n",
"\n",
"print(\"\u2705 Browser ready!\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "echoshader-dev",
"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.11.14"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
6 changes: 4 additions & 2 deletions echoshader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from .core import Echoshader
from .region_browser import region_browser

__all__ = ["Echoshader"]
__all__ = ["Echoshader", "region_browser"]


from ._echoshader_version import version as __version__ # noqa
# from .echoshader_version import version as __version__ # noqa
__version__ = "0.1.0" # Temporary version
Loading
Loading