Skip to content

Instantly share code, notes, and snippets.

@ctuguinay
Created June 13, 2024 16:57
Show Gist options
  • Save ctuguinay/8dbf6b89d9a58adbdefc90a63c112cb6 to your computer and use it in GitHub Desktop.
Save ctuguinay/8dbf6b89d9a58adbdefc90a63c112cb6 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"# Import packages\n",
"from pathlib import Path\n",
"\n",
"from tqdm import tqdm\n",
"import fsspec\n",
"from dask.distributed import Client\n",
"\n",
"import echopype as ep"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'http://127.0.0.1:8787/status'"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Set 32 workers with ~8 GiB RAM each\n",
"client = Client(n_workers=64)\n",
"client.dashboard_link"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# Grab all URLs of RAW Files in the month 2017-08\n",
"fs = fsspec.filesystem('https')\n",
"ooi_raw_url = (\n",
" \"https://rawdata.oceanobservatories.org/files/\"\n",
" \"CE04OSPS/PC01B/ZPLSCB102_10.33.10.143/2017/\"\n",
")\n",
"desired_raw_file_urls = fs.glob(f\"{ooi_raw_url}/08/*/*.raw\")"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Number of OOI Raw Files: 326\n"
]
}
],
"source": [
"print(\"Number of OOI Raw Files:\", len(desired_raw_file_urls))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Save Echodata objects locally\n",
"def open_and_save(raw_file, sonar_model, use_swap, save_path, open_kwargs={}):\n",
" try:\n",
" ed = ep.open_raw(raw_file=raw_file, sonar_model=sonar_model, use_swap=use_swap, **open_kwargs)\n",
" ed.to_zarr(save_path, overwrite=True, compute=True)\n",
" except Exception as e:\n",
" print(\"Error with Exception: \", e)\n",
"\n",
"futures = []\n",
"for raw_file_url in tqdm(desired_raw_file_urls):\n",
" future = client.submit(\n",
" open_and_save,\n",
" retries=3,\n",
" raw_file=raw_file_url,\n",
" sonar_model='ek60',\n",
" use_swap=True,\n",
" save_path=Path('convertallfiles')\n",
" )\n",
" futures.append(future)\n",
"client.gather(futures)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 326/326 [00:00<00:00, 4851.62it/s]\n"
]
}
],
"source": [
"# Combine Echodata Objects\n",
"ed_future_list = []\n",
"for converted_file in tqdm(sorted(Path('convertallfiles').glob(\"*.zarr\"))):\n",
" ed_future = client.submit( \n",
" ep.open_converted,\n",
" retries=2,\n",
" converted_raw_path=converted_file,\n",
" chunks={}\n",
" )\n",
" ed_future_list.append(ed_future)\n",
"ed_list = client.gather(ed_future_list)\n",
"ed_combined = ep.combine_echodata(ed_list)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/exouser/miniforge3/envs/echopype/lib/python3.9/site-packages/distributed/client.py:3164: UserWarning: Sending large graph of size 16.19 MiB.\n",
"This may cause some slowdown.\n",
"Consider scattering data ahead of time and using futures.\n",
" warnings.warn(\n"
]
}
],
"source": [
"# Save combined Echodata object to Zarr\n",
"ed_combined.to_zarr(\"ed_combined.zarr\", overwrite=True, compute=True)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"# Read Combined Echodata object from Zarr: Will be loaded as Lazy-Loaded\n",
"ed_combined = ep.open_converted(\"ed_combined.zarr\", chunks={})"
]
},
{
"cell_type": "code",
"execution_count": 9,
"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",
"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 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\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: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.DataArray &#x27;backscatter_r&#x27; (channel: 3, ping_time: 2047332,\n",
" range_sample: 1072)&gt; Size: 53GB\n",
"dask.array&lt;open_dataset-backscatter_r, shape=(3, 2047332, 1072), dtype=float64, chunksize=(3, 3983, 1046), chunktype=numpy.ndarray&gt;\n",
"Coordinates:\n",
" * channel (channel) &lt;U39 468B &#x27;GPT 38 kHz 00907208dd13 5-1 OOI.38|20...\n",
" * ping_time (ping_time) datetime64[ns] 16MB 2017-08-01T00:00:00.061951 ...\n",
" * range_sample (range_sample) int64 9kB 0 1 2 3 4 ... 1068 1069 1070 1071\n",
"Attributes:\n",
" long_name: Raw backscatter measurements (real part)\n",
" units: dB</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'backscatter_r'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>channel</span>: 3</li><li><span class='xr-has-index'>ping_time</span>: 2047332</li><li><span class='xr-has-index'>range_sample</span>: 1072</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-22f7298a-1a2c-4569-8c9e-df3ca2a12852' class='xr-array-in' type='checkbox' checked><label for='section-22f7298a-1a2c-4569-8c9e-df3ca2a12852' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>dask.array&lt;chunksize=(3, 3983, 1046), meta=np.ndarray&gt;</span></div><div class='xr-array-data'><table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 49.06 GiB </td>\n",
" <td> 95.36 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (3, 2047332, 1072) </td>\n",
" <td> (3, 3983, 1046) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 1030 chunks in 2 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> float64 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"100\" height=\"184\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"6\" x2=\"24\" y2=\"21\" />\n",
" <line x1=\"10\" y1=\"12\" x2=\"24\" y2=\"27\" />\n",
" <line x1=\"10\" y1=\"18\" x2=\"24\" y2=\"33\" />\n",
" <line x1=\"10\" y1=\"25\" x2=\"24\" y2=\"40\" />\n",
" <line x1=\"10\" y1=\"31\" x2=\"24\" y2=\"46\" />\n",
" <line x1=\"10\" y1=\"37\" x2=\"24\" y2=\"52\" />\n",
" <line x1=\"10\" y1=\"44\" x2=\"24\" y2=\"59\" />\n",
" <line x1=\"10\" y1=\"50\" x2=\"24\" y2=\"65\" />\n",
" <line x1=\"10\" y1=\"56\" x2=\"24\" y2=\"71\" />\n",
" <line x1=\"10\" y1=\"63\" x2=\"24\" y2=\"78\" />\n",
" <line x1=\"10\" y1=\"69\" x2=\"24\" y2=\"84\" />\n",
" <line x1=\"10\" y1=\"75\" x2=\"24\" y2=\"90\" />\n",
" <line x1=\"10\" y1=\"82\" x2=\"24\" y2=\"97\" />\n",
" <line x1=\"10\" y1=\"88\" x2=\"24\" y2=\"103\" />\n",
" <line x1=\"10\" y1=\"94\" x2=\"24\" y2=\"109\" />\n",
" <line x1=\"10\" y1=\"101\" x2=\"24\" y2=\"116\" />\n",
" <line x1=\"10\" y1=\"107\" x2=\"24\" y2=\"122\" />\n",
" <line x1=\"10\" y1=\"113\" x2=\"24\" y2=\"128\" />\n",
" <line x1=\"10\" y1=\"120\" x2=\"24\" y2=\"134\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"120\" style=\"stroke-width:2\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"134\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 24.9485979497544,14.948597949754403 24.9485979497544,134.9485979497544 10.0,120.0\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"50\" y2=\"14\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"34\" y1=\"0\" x2=\"49\" y2=\"14\" />\n",
" <line x1=\"35\" y1=\"0\" x2=\"50\" y2=\"14\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 35.41261651458248,0.0 50.36121446433688,14.948597949754403 24.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"24\" y1=\"14\" x2=\"50\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"24\" y1=\"21\" x2=\"50\" y2=\"21\" />\n",
" <line x1=\"24\" y1=\"27\" x2=\"50\" y2=\"27\" />\n",
" <line x1=\"24\" y1=\"33\" x2=\"50\" y2=\"33\" />\n",
" <line x1=\"24\" y1=\"40\" x2=\"50\" y2=\"40\" />\n",
" <line x1=\"24\" y1=\"46\" x2=\"50\" y2=\"46\" />\n",
" <line x1=\"24\" y1=\"52\" x2=\"50\" y2=\"52\" />\n",
" <line x1=\"24\" y1=\"59\" x2=\"50\" y2=\"59\" />\n",
" <line x1=\"24\" y1=\"65\" x2=\"50\" y2=\"65\" />\n",
" <line x1=\"24\" y1=\"71\" x2=\"50\" y2=\"71\" />\n",
" <line x1=\"24\" y1=\"78\" x2=\"50\" y2=\"78\" />\n",
" <line x1=\"24\" y1=\"84\" x2=\"50\" y2=\"84\" />\n",
" <line x1=\"24\" y1=\"90\" x2=\"50\" y2=\"90\" />\n",
" <line x1=\"24\" y1=\"97\" x2=\"50\" y2=\"97\" />\n",
" <line x1=\"24\" y1=\"103\" x2=\"50\" y2=\"103\" />\n",
" <line x1=\"24\" y1=\"109\" x2=\"50\" y2=\"109\" />\n",
" <line x1=\"24\" y1=\"116\" x2=\"50\" y2=\"116\" />\n",
" <line x1=\"24\" y1=\"122\" x2=\"50\" y2=\"122\" />\n",
" <line x1=\"24\" y1=\"128\" x2=\"50\" y2=\"128\" />\n",
" <line x1=\"24\" y1=\"134\" x2=\"50\" y2=\"134\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"134\" style=\"stroke-width:2\" />\n",
" <line x1=\"49\" y1=\"14\" x2=\"49\" y2=\"134\" />\n",
" <line x1=\"50\" y1=\"14\" x2=\"50\" y2=\"134\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"24.9485979497544,14.948597949754403 50.36121446433688,14.948597949754403 50.36121446433688,134.9485979497544 24.9485979497544,134.9485979497544\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"37.654906\" y=\"154.948598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1072</text>\n",
" <text x=\"70.361214\" y=\"74.948598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,70.361214,74.948598)\">2047332</text>\n",
" <text x=\"7.474299\" y=\"147.474299\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,7.474299,147.474299)\">3</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table></div></div></li><li class='xr-section-item'><input id='section-c8293283-bd81-40a8-a08b-9726bb83c77b' class='xr-section-summary-in' type='checkbox' checked><label for='section-c8293283-bd81-40a8-a08b-9726bb83c77b' class='xr-section-summary' >Coordinates: <span>(3)</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'>channel</span></div><div class='xr-var-dims'>(channel)</div><div class='xr-var-dtype'>&lt;U39</div><div class='xr-var-preview xr-preview'>&#x27;GPT 38 kHz 00907208dd13 5-1 OO...</div><input id='attrs-9186c50d-7fcc-43f0-aeb6-a3b66bf9440a' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-9186c50d-7fcc-43f0-aeb6-a3b66bf9440a' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6edf2211-b4d1-4a1c-8eee-3f64839f8d3d' class='xr-var-data-in' type='checkbox'><label for='data-6edf2211-b4d1-4a1c-8eee-3f64839f8d3d' 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>long_name :</span></dt><dd>Vendor channel ID</dd></dl></div><div class='xr-var-data'><pre>array([&#x27;GPT 38 kHz 00907208dd13 5-1 OOI.38|200&#x27;,\n",
" &#x27;GPT 120 kHz 00907208a0b1 3-1 ES120-7CD&#x27;,\n",
" &#x27;GPT 200 kHz 00907208dd13 5-2 OOI38|200&#x27;], dtype=&#x27;&lt;U39&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>ping_time</span></div><div class='xr-var-dims'>(ping_time)</div><div class='xr-var-dtype'>datetime64[ns]</div><div class='xr-var-preview xr-preview'>2017-08-01T00:00:00.061951 ... 2...</div><input id='attrs-4a6ca042-5562-4a1b-9b8d-974a135b6122' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-4a6ca042-5562-4a1b-9b8d-974a135b6122' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-5a91d8e1-abd3-44c2-b48e-9771c32d9ad5' class='xr-var-data-in' type='checkbox'><label for='data-5a91d8e1-abd3-44c2-b48e-9771c32d9ad5' 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>axis :</span></dt><dd>T</dd><dt><span>long_name :</span></dt><dd>Timestamp of each ping</dd><dt><span>standard_name :</span></dt><dd>time</dd></dl></div><div class='xr-var-data'><pre>array([&#x27;2017-08-01T00:00:00.061951000&#x27;, &#x27;2017-08-01T00:00:02.072065000&#x27;,\n",
" &#x27;2017-08-01T00:00:03.075123000&#x27;, ..., &#x27;2017-08-31T23:54:57.333338000&#x27;,\n",
" &#x27;2017-08-31T23:54:58.336395000&#x27;, &#x27;2017-08-31T23:54:59.339453000&#x27;],\n",
" dtype=&#x27;datetime64[ns]&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>range_sample</span></div><div class='xr-var-dims'>(range_sample)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 ... 1068 1069 1070 1071</div><input id='attrs-6b8355ba-1a27-421a-a617-28344d59719d' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-6b8355ba-1a27-421a-a617-28344d59719d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-306a151a-7318-477d-b5fb-4d47446f968a' class='xr-var-data-in' type='checkbox'><label for='data-306a151a-7318-477d-b5fb-4d47446f968a' 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>long_name :</span></dt><dd>Along-range sample number, base 0</dd></dl></div><div class='xr-var-data'><pre>array([ 0, 1, 2, ..., 1069, 1070, 1071])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-92743e87-23f6-4788-b9f6-a99a4f8c8261' class='xr-section-summary-in' type='checkbox' ><label for='section-92743e87-23f6-4788-b9f6-a99a4f8c8261' class='xr-section-summary' >Indexes: <span>(3)</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>channel</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-bbd73bb8-14fb-46ac-b245-aefa9f56743e' class='xr-index-data-in' type='checkbox'/><label for='index-bbd73bb8-14fb-46ac-b245-aefa9f56743e' 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([&#x27;GPT 38 kHz 00907208dd13 5-1 OOI.38|200&#x27;,\n",
" &#x27;GPT 120 kHz 00907208a0b1 3-1 ES120-7CD&#x27;,\n",
" &#x27;GPT 200 kHz 00907208dd13 5-2 OOI38|200&#x27;],\n",
" dtype=&#x27;object&#x27;, name=&#x27;channel&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>ping_time</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-38e5ffbe-586d-4cd7-b033-36a064ca6972' class='xr-index-data-in' type='checkbox'/><label for='index-38e5ffbe-586d-4cd7-b033-36a064ca6972' 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(DatetimeIndex([&#x27;2017-08-01 00:00:00.061951&#x27;, &#x27;2017-08-01 00:00:02.072065&#x27;,\n",
" &#x27;2017-08-01 00:00:03.075123&#x27;, &#x27;2017-08-01 00:00:04.078180&#x27;,\n",
" &#x27;2017-08-01 00:00:05.081238&#x27;, &#x27;2017-08-01 00:00:06.084293&#x27;,\n",
" &#x27;2017-08-01 00:00:07.087351&#x27;, &#x27;2017-08-01 00:00:08.090408&#x27;,\n",
" &#x27;2017-08-01 00:00:09.093466&#x27;, &#x27;2017-08-01 00:00:10.096523&#x27;,\n",
" ...\n",
" &#x27;2017-08-31 23:54:50.311937&#x27;, &#x27;2017-08-31 23:54:51.314995&#x27;,\n",
" &#x27;2017-08-31 23:54:52.318050&#x27;, &#x27;2017-08-31 23:54:53.321108&#x27;,\n",
" &#x27;2017-08-31 23:54:54.324165&#x27;, &#x27;2017-08-31 23:54:55.327223&#x27;,\n",
" &#x27;2017-08-31 23:54:56.330280&#x27;, &#x27;2017-08-31 23:54:57.333338&#x27;,\n",
" &#x27;2017-08-31 23:54:58.336395&#x27;, &#x27;2017-08-31 23:54:59.339453&#x27;],\n",
" dtype=&#x27;datetime64[ns]&#x27;, name=&#x27;ping_time&#x27;, length=2047332, freq=None))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>range_sample</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-b3c498a5-6a17-4dba-9095-d56c674bb2b7' class='xr-index-data-in' type='checkbox'/><label for='index-b3c498a5-6a17-4dba-9095-d56c674bb2b7' 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,\n",
" ...\n",
" 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071],\n",
" dtype=&#x27;int64&#x27;, name=&#x27;range_sample&#x27;, length=1072))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-1a41c278-38b2-4982-a51a-f737f1c18352' class='xr-section-summary-in' type='checkbox' checked><label for='section-1a41c278-38b2-4982-a51a-f737f1c18352' class='xr-section-summary' >Attributes: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Raw backscatter measurements (real part)</dd><dt><span>units :</span></dt><dd>dB</dd></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.DataArray 'backscatter_r' (channel: 3, ping_time: 2047332,\n",
" range_sample: 1072)> Size: 53GB\n",
"dask.array<open_dataset-backscatter_r, shape=(3, 2047332, 1072), dtype=float64, chunksize=(3, 3983, 1046), chunktype=numpy.ndarray>\n",
"Coordinates:\n",
" * channel (channel) <U39 468B 'GPT 38 kHz 00907208dd13 5-1 OOI.38|20...\n",
" * ping_time (ping_time) datetime64[ns] 16MB 2017-08-01T00:00:00.061951 ...\n",
" * range_sample (range_sample) int64 9kB 0 1 2 3 4 ... 1068 1069 1070 1071\n",
"Attributes:\n",
" long_name: Raw backscatter measurements (real part)\n",
" units: dB"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ed_combined[\"Sonar/Beam_group1\"][\"backscatter_r\"]"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/exouser/miniforge3/envs/echopype/lib/python3.9/site-packages/distributed/client.py:3164: UserWarning: Sending large graph of size 111.73 MiB.\n",
"This may cause some slowdown.\n",
"Consider scattering data ahead of time and using futures.\n",
" warnings.warn(\n"
]
}
],
"source": [
"# Compute Volume Backscattering using a Swap Zarr files and chunking every 1000th ping\n",
"# time index\n",
"ds_Sv_combined = ep.calibrate.compute_Sv(\n",
" ed_combined,\n",
" use_swap=True,\n",
" chunk_dict={\"ping_time\": 1000}\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"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",
"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 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\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: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.DataArray &#x27;Sv&#x27; (channel: 3, ping_time: 2047332, range_sample: 1072)&gt; Size: 53GB\n",
"dask.array&lt;open_dataset-Sv, shape=(3, 2047332, 1072), dtype=float64, chunksize=(3, 1000, 1046), chunktype=numpy.ndarray&gt;\n",
"Coordinates:\n",
" * channel (channel) &lt;U39 468B &#x27;GPT 38 kHz 00907208dd13 5-1 OOI.38|20...\n",
" * ping_time (ping_time) datetime64[ns] 16MB 2017-08-01T00:00:00.061951 ...\n",
" * range_sample (range_sample) int64 9kB 0 1 2 3 4 ... 1068 1069 1070 1071\n",
"Attributes:\n",
" long_name: Volume backscattering strength (Sv re 1 m-1)\n",
" units: dB</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'Sv'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>channel</span>: 3</li><li><span class='xr-has-index'>ping_time</span>: 2047332</li><li><span class='xr-has-index'>range_sample</span>: 1072</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-25f3e8b3-f01f-4ed8-b2d2-b10b69184af6' class='xr-array-in' type='checkbox' checked><label for='section-25f3e8b3-f01f-4ed8-b2d2-b10b69184af6' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>dask.array&lt;chunksize=(3, 1000, 1046), meta=np.ndarray&gt;</span></div><div class='xr-array-data'><table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 49.06 GiB </td>\n",
" <td> 23.94 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (3, 2047332, 1072) </td>\n",
" <td> (3, 1000, 1046) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 4096 chunks in 2 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> float64 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"100\" height=\"184\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"6\" x2=\"24\" y2=\"21\" />\n",
" <line x1=\"10\" y1=\"12\" x2=\"24\" y2=\"27\" />\n",
" <line x1=\"10\" y1=\"18\" x2=\"24\" y2=\"33\" />\n",
" <line x1=\"10\" y1=\"25\" x2=\"24\" y2=\"40\" />\n",
" <line x1=\"10\" y1=\"31\" x2=\"24\" y2=\"46\" />\n",
" <line x1=\"10\" y1=\"37\" x2=\"24\" y2=\"52\" />\n",
" <line x1=\"10\" y1=\"44\" x2=\"24\" y2=\"59\" />\n",
" <line x1=\"10\" y1=\"50\" x2=\"24\" y2=\"65\" />\n",
" <line x1=\"10\" y1=\"56\" x2=\"24\" y2=\"71\" />\n",
" <line x1=\"10\" y1=\"63\" x2=\"24\" y2=\"78\" />\n",
" <line x1=\"10\" y1=\"69\" x2=\"24\" y2=\"84\" />\n",
" <line x1=\"10\" y1=\"75\" x2=\"24\" y2=\"90\" />\n",
" <line x1=\"10\" y1=\"82\" x2=\"24\" y2=\"97\" />\n",
" <line x1=\"10\" y1=\"88\" x2=\"24\" y2=\"103\" />\n",
" <line x1=\"10\" y1=\"94\" x2=\"24\" y2=\"109\" />\n",
" <line x1=\"10\" y1=\"101\" x2=\"24\" y2=\"115\" />\n",
" <line x1=\"10\" y1=\"107\" x2=\"24\" y2=\"122\" />\n",
" <line x1=\"10\" y1=\"113\" x2=\"24\" y2=\"128\" />\n",
" <line x1=\"10\" y1=\"120\" x2=\"24\" y2=\"134\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"120\" style=\"stroke-width:2\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"134\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 24.9485979497544,14.948597949754403 24.9485979497544,134.9485979497544 10.0,120.0\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"50\" y2=\"14\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"34\" y1=\"0\" x2=\"49\" y2=\"14\" />\n",
" <line x1=\"35\" y1=\"0\" x2=\"50\" y2=\"14\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 35.41261651458248,0.0 50.36121446433688,14.948597949754403 24.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"24\" y1=\"14\" x2=\"50\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"24\" y1=\"21\" x2=\"50\" y2=\"21\" />\n",
" <line x1=\"24\" y1=\"27\" x2=\"50\" y2=\"27\" />\n",
" <line x1=\"24\" y1=\"33\" x2=\"50\" y2=\"33\" />\n",
" <line x1=\"24\" y1=\"40\" x2=\"50\" y2=\"40\" />\n",
" <line x1=\"24\" y1=\"46\" x2=\"50\" y2=\"46\" />\n",
" <line x1=\"24\" y1=\"52\" x2=\"50\" y2=\"52\" />\n",
" <line x1=\"24\" y1=\"59\" x2=\"50\" y2=\"59\" />\n",
" <line x1=\"24\" y1=\"65\" x2=\"50\" y2=\"65\" />\n",
" <line x1=\"24\" y1=\"71\" x2=\"50\" y2=\"71\" />\n",
" <line x1=\"24\" y1=\"78\" x2=\"50\" y2=\"78\" />\n",
" <line x1=\"24\" y1=\"84\" x2=\"50\" y2=\"84\" />\n",
" <line x1=\"24\" y1=\"90\" x2=\"50\" y2=\"90\" />\n",
" <line x1=\"24\" y1=\"97\" x2=\"50\" y2=\"97\" />\n",
" <line x1=\"24\" y1=\"103\" x2=\"50\" y2=\"103\" />\n",
" <line x1=\"24\" y1=\"109\" x2=\"50\" y2=\"109\" />\n",
" <line x1=\"24\" y1=\"115\" x2=\"50\" y2=\"115\" />\n",
" <line x1=\"24\" y1=\"122\" x2=\"50\" y2=\"122\" />\n",
" <line x1=\"24\" y1=\"128\" x2=\"50\" y2=\"128\" />\n",
" <line x1=\"24\" y1=\"134\" x2=\"50\" y2=\"134\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"134\" style=\"stroke-width:2\" />\n",
" <line x1=\"49\" y1=\"14\" x2=\"49\" y2=\"134\" />\n",
" <line x1=\"50\" y1=\"14\" x2=\"50\" y2=\"134\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"24.9485979497544,14.948597949754403 50.36121446433688,14.948597949754403 50.36121446433688,134.9485979497544 24.9485979497544,134.9485979497544\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"37.654906\" y=\"154.948598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1072</text>\n",
" <text x=\"70.361214\" y=\"74.948598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,70.361214,74.948598)\">2047332</text>\n",
" <text x=\"7.474299\" y=\"147.474299\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,7.474299,147.474299)\">3</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table></div></div></li><li class='xr-section-item'><input id='section-15b7fb26-de9b-4f51-af95-e19382adb025' class='xr-section-summary-in' type='checkbox' checked><label for='section-15b7fb26-de9b-4f51-af95-e19382adb025' class='xr-section-summary' >Coordinates: <span>(3)</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'>channel</span></div><div class='xr-var-dims'>(channel)</div><div class='xr-var-dtype'>&lt;U39</div><div class='xr-var-preview xr-preview'>&#x27;GPT 38 kHz 00907208dd13 5-1 OO...</div><input id='attrs-5c71f1ac-e806-4adb-ba0a-1bd6226a6d46' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-5c71f1ac-e806-4adb-ba0a-1bd6226a6d46' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-30cd9c05-4d38-4924-9f4f-25291f9ec58f' class='xr-var-data-in' type='checkbox'><label for='data-30cd9c05-4d38-4924-9f4f-25291f9ec58f' 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>long_name :</span></dt><dd>Vendor channel ID</dd></dl></div><div class='xr-var-data'><pre>array([&#x27;GPT 38 kHz 00907208dd13 5-1 OOI.38|200&#x27;,\n",
" &#x27;GPT 120 kHz 00907208a0b1 3-1 ES120-7CD&#x27;,\n",
" &#x27;GPT 200 kHz 00907208dd13 5-2 OOI38|200&#x27;], dtype=&#x27;&lt;U39&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>ping_time</span></div><div class='xr-var-dims'>(ping_time)</div><div class='xr-var-dtype'>datetime64[ns]</div><div class='xr-var-preview xr-preview'>2017-08-01T00:00:00.061951 ... 2...</div><input id='attrs-631185b6-ccd0-4549-be7a-5b4ef1a290fe' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-631185b6-ccd0-4549-be7a-5b4ef1a290fe' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-15423b55-598e-4a8f-8c09-e730c31c78ae' class='xr-var-data-in' type='checkbox'><label for='data-15423b55-598e-4a8f-8c09-e730c31c78ae' 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>axis :</span></dt><dd>T</dd><dt><span>long_name :</span></dt><dd>Timestamp of each ping</dd><dt><span>standard_name :</span></dt><dd>time</dd></dl></div><div class='xr-var-data'><pre>array([&#x27;2017-08-01T00:00:00.061951000&#x27;, &#x27;2017-08-01T00:00:02.072065000&#x27;,\n",
" &#x27;2017-08-01T00:00:03.075123000&#x27;, ..., &#x27;2017-08-31T23:54:57.333338000&#x27;,\n",
" &#x27;2017-08-31T23:54:58.336395000&#x27;, &#x27;2017-08-31T23:54:59.339453000&#x27;],\n",
" dtype=&#x27;datetime64[ns]&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>range_sample</span></div><div class='xr-var-dims'>(range_sample)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 ... 1068 1069 1070 1071</div><input id='attrs-b8ae214f-4d4a-4e8b-a0ec-7b2c6dd925f9' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-b8ae214f-4d4a-4e8b-a0ec-7b2c6dd925f9' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6795d5b0-5c94-45d3-870b-f89500298685' class='xr-var-data-in' type='checkbox'><label for='data-6795d5b0-5c94-45d3-870b-f89500298685' 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>long_name :</span></dt><dd>Along-range sample number, base 0</dd></dl></div><div class='xr-var-data'><pre>array([ 0, 1, 2, ..., 1069, 1070, 1071])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-5b5d4d27-fb2d-4eba-a573-3daebefa5cbc' class='xr-section-summary-in' type='checkbox' ><label for='section-5b5d4d27-fb2d-4eba-a573-3daebefa5cbc' class='xr-section-summary' >Indexes: <span>(3)</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>channel</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-4b993f0c-6d9a-419d-af99-3a97ccf2a046' class='xr-index-data-in' type='checkbox'/><label for='index-4b993f0c-6d9a-419d-af99-3a97ccf2a046' 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([&#x27;GPT 38 kHz 00907208dd13 5-1 OOI.38|200&#x27;,\n",
" &#x27;GPT 120 kHz 00907208a0b1 3-1 ES120-7CD&#x27;,\n",
" &#x27;GPT 200 kHz 00907208dd13 5-2 OOI38|200&#x27;],\n",
" dtype=&#x27;object&#x27;, name=&#x27;channel&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>ping_time</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-0896ac98-119a-4cf9-963a-85ac1a31ac69' class='xr-index-data-in' type='checkbox'/><label for='index-0896ac98-119a-4cf9-963a-85ac1a31ac69' 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(DatetimeIndex([&#x27;2017-08-01 00:00:00.061951&#x27;, &#x27;2017-08-01 00:00:02.072065&#x27;,\n",
" &#x27;2017-08-01 00:00:03.075123&#x27;, &#x27;2017-08-01 00:00:04.078180&#x27;,\n",
" &#x27;2017-08-01 00:00:05.081238&#x27;, &#x27;2017-08-01 00:00:06.084293&#x27;,\n",
" &#x27;2017-08-01 00:00:07.087351&#x27;, &#x27;2017-08-01 00:00:08.090408&#x27;,\n",
" &#x27;2017-08-01 00:00:09.093466&#x27;, &#x27;2017-08-01 00:00:10.096523&#x27;,\n",
" ...\n",
" &#x27;2017-08-31 23:54:50.311937&#x27;, &#x27;2017-08-31 23:54:51.314995&#x27;,\n",
" &#x27;2017-08-31 23:54:52.318050&#x27;, &#x27;2017-08-31 23:54:53.321108&#x27;,\n",
" &#x27;2017-08-31 23:54:54.324165&#x27;, &#x27;2017-08-31 23:54:55.327223&#x27;,\n",
" &#x27;2017-08-31 23:54:56.330280&#x27;, &#x27;2017-08-31 23:54:57.333338&#x27;,\n",
" &#x27;2017-08-31 23:54:58.336395&#x27;, &#x27;2017-08-31 23:54:59.339453&#x27;],\n",
" dtype=&#x27;datetime64[ns]&#x27;, name=&#x27;ping_time&#x27;, length=2047332, freq=None))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>range_sample</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-73291add-60c8-442d-9bc0-9d90f1c92b36' class='xr-index-data-in' type='checkbox'/><label for='index-73291add-60c8-442d-9bc0-9d90f1c92b36' 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,\n",
" ...\n",
" 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071],\n",
" dtype=&#x27;int64&#x27;, name=&#x27;range_sample&#x27;, length=1072))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-92f70b6b-321b-4867-9379-76400e40f966' class='xr-section-summary-in' type='checkbox' checked><label for='section-92f70b6b-321b-4867-9379-76400e40f966' class='xr-section-summary' >Attributes: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>Volume backscattering strength (Sv re 1 m-1)</dd><dt><span>units :</span></dt><dd>dB</dd></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.DataArray 'Sv' (channel: 3, ping_time: 2047332, range_sample: 1072)> Size: 53GB\n",
"dask.array<open_dataset-Sv, shape=(3, 2047332, 1072), dtype=float64, chunksize=(3, 1000, 1046), chunktype=numpy.ndarray>\n",
"Coordinates:\n",
" * channel (channel) <U39 468B 'GPT 38 kHz 00907208dd13 5-1 OOI.38|20...\n",
" * ping_time (ping_time) datetime64[ns] 16MB 2017-08-01T00:00:00.061951 ...\n",
" * range_sample (range_sample) int64 9kB 0 1 2 3 4 ... 1068 1069 1070 1071\n",
"Attributes:\n",
" long_name: Volume backscattering strength (Sv re 1 m-1)\n",
" units: dB"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Sv should be a Dask Array with a tiny tiny task graph\n",
"# (the tasks should entail opening a Zarr store)\n",
"ds_Sv_combined[\"Sv\"]"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
" <div>\n",
" <div style=\"width: 52px; height: 52px; position: absolute;\">\n",
" <svg width=\"76\" height=\"71\" viewBox=\"0 0 76 71\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n",
" <circle cx=\"61.5\" cy=\"36.5\" r=\"13.5\" style=\"stroke: var(--jp-ui-font-color2, #1D1D1D); fill: var(--jp-layout-color1, #F2F2F2);\" stroke-width=\"2\"/>\n",
" <circle cx=\"14.5\" cy=\"14.5\" r=\"13.5\" style=\"stroke: var(--jp-ui-font-color2, #1D1D1D); fill: var(--jp-layout-color1, #F2F2F2);\" stroke-width=\"2\"/>\n",
" <circle cx=\"14.5\" cy=\"56.5\" r=\"13.5\" style=\"stroke: var(--jp-ui-font-color2, #1D1D1D); fill: var(--jp-layout-color1, #F2F2F2);\" stroke-width=\"2\"/>\n",
" <path d=\"M28 16L30.5 16C33.2614 16 35.5 18.2386 35.5 21L35.5 32.0001C35.5 34.7615 37.7386 37.0001 40.5 37.0001L43 37.0001\" style=\"stroke: var(--jp-ui-font-color2, #1D1D1D);\" stroke-width=\"1.5\"/>\n",
" <path d=\"M40.5 37L40.5 37.75L40.5 37.75L40.5 37ZM35.5 42L36.25 42L35.5 42ZM35.5 52L34.75 52L35.5 52ZM30.5 57L30.5 57.75L30.5 57ZM41.5001 36.25L40.5 36.25L40.5 37.75L41.5001 37.75L41.5001 36.25ZM34.75 42L34.75 52L36.25 52L36.25 42L34.75 42ZM30.5 56.25L28.0001 56.25L28.0001 57.75L30.5 57.75L30.5 56.25ZM34.75 52C34.75 54.3472 32.8472 56.25 30.5 56.25L30.5 57.75C33.6756 57.75 36.25 55.1756 36.25 52L34.75 52ZM40.5 36.25C37.3244 36.25 34.75 38.8243 34.75 42L36.25 42C36.25 39.6528 38.1528 37.75 40.5 37.75L40.5 36.25Z\" style=\"fill: var(--jp-ui-font-color2, #1D1D1D);\"/>\n",
" <circle cx=\"28\" cy=\"16\" r=\"2.25\" fill=\"#E5E5E5\" style=\"stroke: var(--jp-ui-font-color2, #1D1D1D);\" stroke-width=\"1.5\"/>\n",
" <circle cx=\"28\" cy=\"57\" r=\"2.25\" fill=\"#E5E5E5\" style=\"stroke: var(--jp-ui-font-color2, #1D1D1D);\" stroke-width=\"1.5\"/>\n",
" <path d=\"M45.25 36.567C45.5833 36.7594 45.5833 37.2406 45.25 37.433L42.25 39.1651C41.9167 39.3575 41.5 39.117 41.5 38.7321V35.2679C41.5 34.883 41.9167 34.6425 42.25 34.8349L45.25 36.567Z\" style=\"fill: var(--jp-ui-font-color2, #1D1D1D);\"/>\n",
" </svg>\n",
" </div>\n",
" <div style=\"margin-left: 64px;\">\n",
" <h3 style=\"margin-bottom: 0px;\">HighLevelGraph</h3>\n",
" <p style=\"color: var(--jp-ui-font-color2, #5D5851); margin-bottom:0px;\">\n",
" HighLevelGraph with 2 layers and 4097 keys from all layers.\n",
" </p>\n",
" \n",
" <div style=\"\">\n",
" <svg width=\"24\" height=\"24\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" style=\"position: absolute;\">\n",
" \n",
" <circle cx=\"16\" cy=\"16\" r=\"14\" fill=\"#8F8F8F\" style=\"stroke: var(--jp-ui-font-color2, #1D1D1D);\" stroke-width=\"2\"/>\n",
" \n",
" </svg>\n",
"\n",
" <details style=\"margin-left: 32px;\">\n",
" <summary style=\"margin-bottom: 10px; margin-top: 10px;\">\n",
" <h4 style=\"display: inline;\">Layer1: original</h4>\n",
" </summary>\n",
" <p style=\"color: var(--jp-ui-font-color2, #5D5851); margin: -0.25em 0px 0px 0px;\">\n",
" original-open_dataset-Sv-31a2da23558141428be0435eee0f0bcc\n",
" </p>\n",
"\n",
" <table>\n",
" <tr>\n",
" <td>\n",
" <table>\n",
" \n",
" <tr>\n",
" <th style=\"text-align: left; width: 150px;\">layer_type</th>\n",
" <td style=\"text-align: left;\">MaterializedLayer</td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th style=\"text-align: left; width: 150px;\">is_materialized</th>\n",
" <td style=\"text-align: left;\">True</td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th style=\"text-align: left; width: 150px;\">number of outputs</th>\n",
" <td style=\"text-align: left;\">1</td>\n",
" </tr>\n",
" \n",
" \n",
" </table>\n",
" </td>\n",
" <td>\n",
" \n",
" </td>\n",
" </tr>\n",
" </table>\n",
"\n",
" </details>\n",
"</div>\n",
" \n",
" <div style=\"\">\n",
" <svg width=\"24\" height=\"24\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" style=\"position: absolute;\">\n",
" \n",
" <circle cx=\"16\" cy=\"16\" r=\"14\" style=\"stroke: var(--jp-ui-font-color2, #1D1D1D); fill: var(--jp-layout-color1, #F2F2F2);\" stroke-width=\"2\" />\n",
" \n",
" </svg>\n",
"\n",
" <details style=\"margin-left: 32px;\">\n",
" <summary style=\"margin-bottom: 10px; margin-top: 10px;\">\n",
" <h4 style=\"display: inline;\">Layer2: open_dataset-Sv</h4>\n",
" </summary>\n",
" <p style=\"color: var(--jp-ui-font-color2, #5D5851); margin: -0.25em 0px 0px 0px;\">\n",
" open_dataset-Sv-31a2da23558141428be0435eee0f0bcc\n",
" </p>\n",
"\n",
" <table>\n",
" <tr>\n",
" <td>\n",
" <table>\n",
" \n",
" <tr>\n",
" <th style=\"text-align: left; width: 150px;\">layer_type</th>\n",
" <td style=\"text-align: left;\">Blockwise</td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th style=\"text-align: left; width: 150px;\">is_materialized</th>\n",
" <td style=\"text-align: left;\">False</td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th style=\"text-align: left; width: 150px;\">number of outputs</th>\n",
" <td style=\"text-align: left;\">4096</td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th style=\"text-align: left; width: 150px;\">shape</th>\n",
" <td style=\"text-align: left;\">(3, 2047332, 1072)</td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th style=\"text-align: left; width: 150px;\">dtype</th>\n",
" <td style=\"text-align: left;\">float64</td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th style=\"text-align: left; width: 150px;\">chunksize</th>\n",
" <td style=\"text-align: left;\">(3, 1000, 1046)</td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th style=\"text-align: left; width: 150px;\">type</th>\n",
" <td style=\"text-align: left;\">dask.array.core.Array</td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th style=\"text-align: left; width: 150px;\">chunk_type</th>\n",
" <td style=\"text-align: left;\">numpy.ndarray</td>\n",
" </tr>\n",
" \n",
" \n",
" \n",
" <tr>\n",
" <th style=\"text-align: left; width: 150px;\"> depends on </th>\n",
" <td style=\"text-align: left;\">original-open_dataset-Sv-31a2da23558141428be0435eee0f0bcc</td>\n",
" </tr>\n",
" \n",
" \n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"127\" height=\"274\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"34\" y2=\"24\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"6\" x2=\"34\" y2=\"31\" />\n",
" <line x1=\"10\" y1=\"12\" x2=\"34\" y2=\"37\" />\n",
" <line x1=\"10\" y1=\"18\" x2=\"34\" y2=\"43\" />\n",
" <line x1=\"10\" y1=\"25\" x2=\"34\" y2=\"49\" />\n",
" <line x1=\"10\" y1=\"31\" x2=\"34\" y2=\"56\" />\n",
" <line x1=\"10\" y1=\"37\" x2=\"34\" y2=\"62\" />\n",
" <line x1=\"10\" y1=\"43\" x2=\"34\" y2=\"68\" />\n",
" <line x1=\"10\" y1=\"50\" x2=\"34\" y2=\"74\" />\n",
" <line x1=\"10\" y1=\"56\" x2=\"34\" y2=\"81\" />\n",
" <line x1=\"10\" y1=\"62\" x2=\"34\" y2=\"87\" />\n",
" <line x1=\"10\" y1=\"68\" x2=\"34\" y2=\"93\" />\n",
" <line x1=\"10\" y1=\"75\" x2=\"34\" y2=\"99\" />\n",
" <line x1=\"10\" y1=\"81\" x2=\"34\" y2=\"106\" />\n",
" <line x1=\"10\" y1=\"87\" x2=\"34\" y2=\"112\" />\n",
" <line x1=\"10\" y1=\"93\" x2=\"34\" y2=\"118\" />\n",
" <line x1=\"10\" y1=\"100\" x2=\"34\" y2=\"124\" />\n",
" <line x1=\"10\" y1=\"106\" x2=\"34\" y2=\"131\" />\n",
" <line x1=\"10\" y1=\"112\" x2=\"34\" y2=\"137\" />\n",
" <line x1=\"10\" y1=\"118\" x2=\"34\" y2=\"143\" />\n",
" <line x1=\"10\" y1=\"125\" x2=\"34\" y2=\"149\" />\n",
" <line x1=\"10\" y1=\"131\" x2=\"34\" y2=\"156\" />\n",
" <line x1=\"10\" y1=\"137\" x2=\"34\" y2=\"162\" />\n",
" <line x1=\"10\" y1=\"143\" x2=\"34\" y2=\"168\" />\n",
" <line x1=\"10\" y1=\"150\" x2=\"34\" y2=\"174\" />\n",
" <line x1=\"10\" y1=\"156\" x2=\"34\" y2=\"181\" />\n",
" <line x1=\"10\" y1=\"162\" x2=\"34\" y2=\"187\" />\n",
" <line x1=\"10\" y1=\"168\" x2=\"34\" y2=\"193\" />\n",
" <line x1=\"10\" y1=\"175\" x2=\"34\" y2=\"199\" />\n",
" <line x1=\"10\" y1=\"181\" x2=\"34\" y2=\"206\" />\n",
" <line x1=\"10\" y1=\"187\" x2=\"34\" y2=\"212\" />\n",
" <line x1=\"10\" y1=\"193\" x2=\"34\" y2=\"218\" />\n",
" <line x1=\"10\" y1=\"200\" x2=\"34\" y2=\"224\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"200\" style=\"stroke-width:2\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"34\" y2=\"224\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 34.91432991625734,24.914329916257337 34.91432991625734,224.91432991625734 10.0,200.0\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"52\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"77\" y2=\"24\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"34\" y2=\"24\" style=\"stroke-width:2\" />\n",
" <line x1=\"51\" y1=\"0\" x2=\"76\" y2=\"24\" />\n",
" <line x1=\"52\" y1=\"0\" x2=\"77\" y2=\"24\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 52.354360857637474,0.0 77.2686907738948,24.914329916257337 34.91432991625734,24.914329916257337\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"34\" y1=\"24\" x2=\"77\" y2=\"24\" style=\"stroke-width:2\" />\n",
" <line x1=\"34\" y1=\"31\" x2=\"77\" y2=\"31\" />\n",
" <line x1=\"34\" y1=\"37\" x2=\"77\" y2=\"37\" />\n",
" <line x1=\"34\" y1=\"43\" x2=\"77\" y2=\"43\" />\n",
" <line x1=\"34\" y1=\"49\" x2=\"77\" y2=\"49\" />\n",
" <line x1=\"34\" y1=\"56\" x2=\"77\" y2=\"56\" />\n",
" <line x1=\"34\" y1=\"62\" x2=\"77\" y2=\"62\" />\n",
" <line x1=\"34\" y1=\"68\" x2=\"77\" y2=\"68\" />\n",
" <line x1=\"34\" y1=\"74\" x2=\"77\" y2=\"74\" />\n",
" <line x1=\"34\" y1=\"81\" x2=\"77\" y2=\"81\" />\n",
" <line x1=\"34\" y1=\"87\" x2=\"77\" y2=\"87\" />\n",
" <line x1=\"34\" y1=\"93\" x2=\"77\" y2=\"93\" />\n",
" <line x1=\"34\" y1=\"99\" x2=\"77\" y2=\"99\" />\n",
" <line x1=\"34\" y1=\"106\" x2=\"77\" y2=\"106\" />\n",
" <line x1=\"34\" y1=\"112\" x2=\"77\" y2=\"112\" />\n",
" <line x1=\"34\" y1=\"118\" x2=\"77\" y2=\"118\" />\n",
" <line x1=\"34\" y1=\"124\" x2=\"77\" y2=\"124\" />\n",
" <line x1=\"34\" y1=\"131\" x2=\"77\" y2=\"131\" />\n",
" <line x1=\"34\" y1=\"137\" x2=\"77\" y2=\"137\" />\n",
" <line x1=\"34\" y1=\"143\" x2=\"77\" y2=\"143\" />\n",
" <line x1=\"34\" y1=\"149\" x2=\"77\" y2=\"149\" />\n",
" <line x1=\"34\" y1=\"156\" x2=\"77\" y2=\"156\" />\n",
" <line x1=\"34\" y1=\"162\" x2=\"77\" y2=\"162\" />\n",
" <line x1=\"34\" y1=\"168\" x2=\"77\" y2=\"168\" />\n",
" <line x1=\"34\" y1=\"174\" x2=\"77\" y2=\"174\" />\n",
" <line x1=\"34\" y1=\"181\" x2=\"77\" y2=\"181\" />\n",
" <line x1=\"34\" y1=\"187\" x2=\"77\" y2=\"187\" />\n",
" <line x1=\"34\" y1=\"193\" x2=\"77\" y2=\"193\" />\n",
" <line x1=\"34\" y1=\"199\" x2=\"77\" y2=\"199\" />\n",
" <line x1=\"34\" y1=\"206\" x2=\"77\" y2=\"206\" />\n",
" <line x1=\"34\" y1=\"212\" x2=\"77\" y2=\"212\" />\n",
" <line x1=\"34\" y1=\"218\" x2=\"77\" y2=\"218\" />\n",
" <line x1=\"34\" y1=\"224\" x2=\"77\" y2=\"224\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"34\" y1=\"24\" x2=\"34\" y2=\"224\" style=\"stroke-width:2\" />\n",
" <line x1=\"76\" y1=\"24\" x2=\"76\" y2=\"224\" />\n",
" <line x1=\"77\" y1=\"24\" x2=\"77\" y2=\"224\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"34.91432991625734,24.914329916257337 77.2686907738948,24.914329916257337 77.2686907738948,224.91432991625734 34.91432991625734,224.91432991625734\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"56.091510\" y=\"244.914330\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1072</text>\n",
" <text x=\"97.268691\" y=\"124.914330\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,97.268691,124.914330)\">2047332</text>\n",
" <text x=\"12.457165\" y=\"232.457165\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,12.457165,232.457165)\">3</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
" </table>\n",
"\n",
" </details>\n",
"</div>\n",
" \n",
" </div>\n",
" </div>\n",
"</div>"
],
"text/plain": [
"HighLevelGraph with 2 layers.\n",
"<dask.highlevelgraph.HighLevelGraph object at 0x70145c8120a0>\n",
" 0. original-open_dataset-Sv-31a2da23558141428be0435eee0f0bcc\n",
" 1. open_dataset-Sv-31a2da23558141428be0435eee0f0bcc"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ds_Sv_combined[\"Sv\"].data.dask"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "echopype",
"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.9.19"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment