Last active
April 5, 2024 23:17
-
-
Save ctuguinay/202141a9c263d6e3d2e7a0e8ff748508 to your computer and use it in GitHub Desktop.
investigate_harmonize_env_param_time_failure.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"# Import Packages\n", | |
"import echopype as ep\n", | |
"import xarray as xr" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"I started from the error and worked my way back to the merging of EK80 complex datasets.\n", | |
"\n", | |
"In Echopype Code I set print statements in `merge_save` function of `echopype/convert/set_groups_ek80.py`. This is to show where exactly I am capturing the output I will show below:\n", | |
"```\n", | |
"@staticmethod\n", | |
"def merge_save(ds_combine: List[xr.Dataset], ds_invariant: xr.Dataset) -> xr.Dataset:\n", | |
" \"\"\"Merge data from all complex or all power/angle channels\"\"\"\n", | |
" # Combine all channels into one Dataset\n", | |
" print(\"Transmit Frequency Channel 1 Pre Combine:\", ds_combine[0][\"transmit_frequency_start\"])\n", | |
" print(\"Transmit Frequency Channel 1 Ping Time Pre Combine:\", ds_combine[0][\"transmit_frequency_start\"][\"ping_time\"])\n", | |
" print(\"Transmit Frequency Channel 2 Pre Combine:\",ds_combine[1][\"transmit_frequency_start\"])\n", | |
" print(\"Transmit Frequency Channel 2 Ping Time Pre Combine:\", ds_combine[1][\"transmit_frequency_start\"][\"ping_time\"])\n", | |
" ds_combine = xr.concat(ds_combine, dim=\"channel\")\n", | |
" print(\"Transmit Frequency Combined:\", ds_combine[\"transmit_frequency_start\"])\n", | |
" ds_combine = xr.merge(\n", | |
" [ds_invariant, ds_combine], combine_attrs=\"override\"\n", | |
" ) # override keeps the Dataset attributes\n", | |
" return set_time_encodings(ds_combine)\n", | |
"```" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"The ping time values for both arrays are inconsistent with each other:\n", | |
"\n", | |
"(Also, note that these ping time values come from the `parser_obj` in `SetGroupsEK80`)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Transmit Frequency Channel 1 Pre Combine: <xarray.DataArray 'transmit_frequency_start' (channel: 1, ping_time: 31)>\n", | |
"array([[160000., 160000., 160000., 160000., 160000., 160000., 160000.,\n", | |
" 160000., 160000., 160000., 160000., 160000., 160000., 160000.,\n", | |
" 160000., 160000., 160000., 160000., 160000., 160000., 160000.,\n", | |
" 160000., 160000., 160000., 160000., 160000., 160000., 160000.,\n", | |
" 160000., 160000., 160000.]])\n", | |
"Coordinates:\n", | |
" * channel (channel) object 'WBT Mini 274021-15-1 ES200-7C_ES'\n", | |
" * ping_time (ping_time) datetime64[ns] 2023-10-03T12:00:53.559627776 ... 2...\n", | |
"Attributes:\n", | |
" long_name: Start frequency in transmitted pulse\n", | |
" units: Hz\n", | |
" standard_name: sound_frequency\n", | |
" valid_min: 0.0\n", | |
"Transmit Frequency Channel 1 Ping Time Pre Combine: <xarray.DataArray 'ping_time' (ping_time: 31)>\n", | |
"array(['2023-10-03T12:00:53.559627776', '2023-10-03T12:00:55.562006016',\n", | |
" '2023-10-03T12:00:57.569653248', '2023-10-03T12:00:59.553221120',\n", | |
" '2023-10-03T12:01:01.922873856', '2023-10-03T12:01:03.949699072',\n", | |
" '2023-10-03T12:01:05.950732800', '2023-10-03T12:01:07.965466112',\n", | |
" '2023-10-03T12:01:09.937934848', '2023-10-03T12:01:12.291490816',\n", | |
" '2023-10-03T12:01:14.304367104', '2023-10-03T12:01:16.317727744',\n", | |
" '2023-10-03T12:01:18.330081792', '2023-10-03T12:01:20.304416768',\n", | |
" '2023-10-03T12:01:22.737865216', '2023-10-03T12:01:24.772293120',\n", | |
" '2023-10-03T12:01:26.794712064', '2023-10-03T12:01:28.811527168',\n", | |
" '2023-10-03T12:01:30.821850112', '2023-10-03T12:01:33.201689088',\n", | |
" '2023-10-03T12:01:35.215869952', '2023-10-03T12:01:37.228828160',\n", | |
" '2023-10-03T12:01:39.242184192', '2023-10-03T12:01:41.244993024',\n", | |
" '2023-10-03T12:01:43.603165184', '2023-10-03T12:01:45.620483072',\n", | |
" '2023-10-03T12:01:47.643970048', '2023-10-03T12:01:49.635296256',\n", | |
" '2023-10-03T12:01:51.644869120', '2023-10-03T12:01:54.007105024',\n", | |
" '2023-10-03T12:01:56.051064832'], dtype='datetime64[ns]')\n", | |
"Coordinates:\n", | |
" * ping_time (ping_time) datetime64[ns] 2023-10-03T12:00:53.559627776 ... 2...\n", | |
"Attributes:\n", | |
" long_name: Timestamp of each ping\n", | |
" standard_name: time\n", | |
" axis: T\n", | |
"Transmit Frequency Channel 2 Pre Combine: <xarray.DataArray 'transmit_frequency_start' (channel: 1, ping_time: 32)>\n", | |
"array([[55000., 55000., 55000., 55000., 55000., 55000., 55000., 55000.,\n", | |
" 55000., 55000., 55000., 55000., 55000., 55000., 55000., 55000.,\n", | |
" 55000., 55000., 55000., 55000., 55000., 55000., 55000., 55000.,\n", | |
" 55000., 55000., 55000., 55000., 55000., 55000., 55000., 55000.]])\n", | |
"Coordinates:\n", | |
" * channel (channel) object 'WBT Mini 274021-15-2 ES70-18CD_ES'\n", | |
" * ping_time (ping_time) datetime64[ns] 2023-10-03T12:00:51.976906240 ... 2...\n", | |
"Attributes:\n", | |
" long_name: Start frequency in transmitted pulse\n", | |
" units: Hz\n", | |
" standard_name: sound_frequency\n", | |
" valid_min: 0.0\n", | |
"Transmit Frequency Channel 2 Ping Time Pre Combine: <xarray.DataArray 'ping_time' (ping_time: 32)>\n", | |
"array(['2023-10-03T12:00:51.976906240', '2023-10-03T12:00:54.005223936',\n", | |
" '2023-10-03T12:00:56.009693184', '2023-10-03T12:00:57.993319936',\n", | |
" '2023-10-03T12:01:00.363073024', '2023-10-03T12:01:02.371548160',\n", | |
" '2023-10-03T12:01:04.401380864', '2023-10-03T12:01:06.407278080',\n", | |
" '2023-10-03T12:01:08.388156928', '2023-10-03T12:01:10.748850176',\n", | |
" '2023-10-03T12:01:12.745195008', '2023-10-03T12:01:14.748951040',\n", | |
" '2023-10-03T12:01:16.772888064', '2023-10-03T12:01:18.751777792',\n", | |
" '2023-10-03T12:01:21.177158144', '2023-10-03T12:01:23.196512256',\n", | |
" '2023-10-03T12:01:25.233106944', '2023-10-03T12:01:27.250378240',\n", | |
" '2023-10-03T12:01:29.245244928', '2023-10-03T12:01:31.646898176',\n", | |
" '2023-10-03T12:01:33.640371200', '2023-10-03T12:01:35.653824000',\n", | |
" '2023-10-03T12:01:37.674447872', '2023-10-03T12:01:39.659781120',\n", | |
" '2023-10-03T12:01:42.054491136', '2023-10-03T12:01:44.049811968',\n", | |
" '2023-10-03T12:01:46.073785856', '2023-10-03T12:01:48.087618048',\n", | |
" '2023-10-03T12:01:50.058952192', '2023-10-03T12:01:52.455427072',\n", | |
" '2023-10-03T12:01:54.474840064', '2023-10-03T12:01:56.517842944'],\n", | |
" dtype='datetime64[ns]')\n", | |
"Coordinates:\n", | |
" * ping_time (ping_time) datetime64[ns] 2023-10-03T12:00:51.976906240 ... 2...\n", | |
"Attributes:\n", | |
" long_name: Timestamp of each ping\n", | |
" standard_name: time\n", | |
" axis: T\n", | |
"Transmit Frequency Combined: <xarray.DataArray 'transmit_frequency_start' (channel: 2, ping_time: 63)>\n", | |
"array([[ nan, 160000., nan, 160000., nan, 160000., nan,\n", | |
" 160000., nan, 160000., nan, 160000., nan, 160000.,\n", | |
" nan, 160000., nan, 160000., nan, 160000., nan,\n", | |
" 160000., nan, 160000., nan, 160000., nan, 160000.,\n", | |
" nan, 160000., nan, 160000., nan, 160000., nan,\n", | |
" 160000., nan, 160000., nan, 160000., nan, 160000.,\n", | |
" nan, 160000., nan, 160000., nan, 160000., nan,\n", | |
" 160000., nan, 160000., nan, 160000., nan, 160000.,\n", | |
" nan, 160000., nan, 160000., nan, 160000., nan],\n", | |
" [ 55000., nan, 55000., nan, 55000., nan, 55000.,\n", | |
" nan, 55000., nan, 55000., nan, 55000., nan,\n", | |
" 55000., nan, 55000., nan, 55000., nan, 55000.,\n", | |
" nan, 55000., nan, 55000., nan, 55000., nan,\n", | |
" 55000., nan, 55000., nan, 55000., nan, 55000.,\n", | |
" nan, 55000., nan, 55000., nan, 55000., nan,\n", | |
" 55000., nan, 55000., nan, 55000., nan, 55000.,\n", | |
" nan, 55000., nan, 55000., nan, 55000., nan,\n", | |
" 55000., nan, 55000., nan, 55000., nan, 55000.]])\n", | |
"Coordinates:\n", | |
" * ping_time (ping_time) datetime64[ns] 2023-10-03T12:00:51.976906240 ... 2...\n", | |
" * channel (channel) object 'WBT Mini 274021-15-1 ES200-7C_ES' 'WBT Mini ...\n", | |
"Attributes:\n", | |
" long_name: Start frequency in transmitted pulse\n", | |
" units: Hz\n", | |
" standard_name: sound_frequency\n", | |
" valid_min: 0.0\n" | |
] | |
}, | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"/home/exouser/miniforge3/envs/echopype/lib/python3.9/site-packages/xarray/core/duck_array_ops.py:187: RuntimeWarning: invalid value encountered in cast\n", | |
" return data.astype(dtype, **kwargs)\n" | |
] | |
} | |
], | |
"source": [ | |
"# Read Raw\n", | |
"ed = ep.open_raw(\"DRIX08-D20231003-T120051.raw\", sonar_model=\"EK80\")" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"The inconsistent ping times in both channels prior to combining leads us to the alternating NaN pattern post combining." | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Now why does this matter? Later on, when we calculate sound absorption, we use the `transmit_frequency_start` and `transmit_frequency_end` variables in elementwise operations, thus leaving us with the same alternating NaN values." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"sound_absorption_da = xr.open_dataset(\"sound_absorption.zarr\", engine=\"zarr\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"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'><xarray.DataArray 'sound_absorption' (time1: 1, channel: 2, ping_time: 63)>\n", | |
"array([[[ nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan],\n", | |
" [0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539]]])\n", | |
"Coordinates:\n", | |
" * channel (channel) <U33 'WBT Mini 274021-15-1 ES200-7C_ES' 'WBT Mini 27...\n", | |
" * ping_time (ping_time) datetime64[ns] 2023-10-03T12:00:51.976906240 ... 2...\n", | |
" * time1 (time1) datetime64[ns] 2023-10-03T12:00:51.976906240</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'>'sound_absorption'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>time1</span>: 1</li><li><span class='xr-has-index'>channel</span>: 2</li><li><span class='xr-has-index'>ping_time</span>: 63</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-827fc27c-1199-460b-b4ad-a54efe739070' class='xr-array-in' type='checkbox' checked><label for='section-827fc27c-1199-460b-b4ad-a54efe739070' 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>nan 0.05424 nan 0.05424 nan ... 0.02357 nan 0.02357 nan 0.02357</span></div><div class='xr-array-data'><pre>array([[[ nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan],\n", | |
" [0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539]]])</pre></div></div></li><li class='xr-section-item'><input id='section-111875e0-9142-4aad-8496-228d305bbb07' class='xr-section-summary-in' type='checkbox' checked><label for='section-111875e0-9142-4aad-8496-228d305bbb07' 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'><U33</div><div class='xr-var-preview xr-preview'>'WBT Mini 274021-15-1 ES200-7C_E...</div><input id='attrs-0de4b3df-5edb-4342-abc0-1153f7c66b35' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-0de4b3df-5edb-4342-abc0-1153f7c66b35' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c3414cde-199b-4b96-ba76-33ddcb367470' class='xr-var-data-in' type='checkbox'><label for='data-c3414cde-199b-4b96-ba76-33ddcb367470' 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(['WBT Mini 274021-15-1 ES200-7C_ES', 'WBT Mini 274021-15-2 ES70-18CD_ES'],\n", | |
" dtype='<U33')</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'>2023-10-03T12:00:51.976906240 .....</div><input id='attrs-707e9c6c-176b-47ed-9bff-166f5f6703f6' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-707e9c6c-176b-47ed-9bff-166f5f6703f6' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6404ec14-e517-46ce-9709-9bd200cbee73' class='xr-var-data-in' type='checkbox'><label for='data-6404ec14-e517-46ce-9709-9bd200cbee73' 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(['2023-10-03T12:00:51.976906240', '2023-10-03T12:00:53.559627776',\n", | |
" '2023-10-03T12:00:54.005223936', '2023-10-03T12:00:55.562006016',\n", | |
" '2023-10-03T12:00:56.009693184', '2023-10-03T12:00:57.569653248',\n", | |
" '2023-10-03T12:00:57.993319936', '2023-10-03T12:00:59.553221120',\n", | |
" '2023-10-03T12:01:00.363073024', '2023-10-03T12:01:01.922873856',\n", | |
" '2023-10-03T12:01:02.371548160', '2023-10-03T12:01:03.949699072',\n", | |
" '2023-10-03T12:01:04.401380864', '2023-10-03T12:01:05.950732800',\n", | |
" '2023-10-03T12:01:06.407278080', '2023-10-03T12:01:07.965466112',\n", | |
" '2023-10-03T12:01:08.388156928', '2023-10-03T12:01:09.937934848',\n", | |
" '2023-10-03T12:01:10.748850176', '2023-10-03T12:01:12.291490816',\n", | |
" '2023-10-03T12:01:12.745195008', '2023-10-03T12:01:14.304367104',\n", | |
" '2023-10-03T12:01:14.748951040', '2023-10-03T12:01:16.317727744',\n", | |
" '2023-10-03T12:01:16.772888064', '2023-10-03T12:01:18.330081792',\n", | |
" '2023-10-03T12:01:18.751777792', '2023-10-03T12:01:20.304416768',\n", | |
" '2023-10-03T12:01:21.177158144', '2023-10-03T12:01:22.737865216',\n", | |
" '2023-10-03T12:01:23.196512256', '2023-10-03T12:01:24.772293120',\n", | |
" '2023-10-03T12:01:25.233106944', '2023-10-03T12:01:26.794712064',\n", | |
" '2023-10-03T12:01:27.250378240', '2023-10-03T12:01:28.811527168',\n", | |
" '2023-10-03T12:01:29.245244928', '2023-10-03T12:01:30.821850112',\n", | |
" '2023-10-03T12:01:31.646898176', '2023-10-03T12:01:33.201689088',\n", | |
" '2023-10-03T12:01:33.640371200', '2023-10-03T12:01:35.215869952',\n", | |
" '2023-10-03T12:01:35.653824000', '2023-10-03T12:01:37.228828160',\n", | |
" '2023-10-03T12:01:37.674447872', '2023-10-03T12:01:39.242184192',\n", | |
" '2023-10-03T12:01:39.659781120', '2023-10-03T12:01:41.244993024',\n", | |
" '2023-10-03T12:01:42.054491136', '2023-10-03T12:01:43.603165184',\n", | |
" '2023-10-03T12:01:44.049811968', '2023-10-03T12:01:45.620483072',\n", | |
" '2023-10-03T12:01:46.073785856', '2023-10-03T12:01:47.643970048',\n", | |
" '2023-10-03T12:01:48.087618048', '2023-10-03T12:01:49.635296256',\n", | |
" '2023-10-03T12:01:50.058952192', '2023-10-03T12:01:51.644869120',\n", | |
" '2023-10-03T12:01:52.455427072', '2023-10-03T12:01:54.007105024',\n", | |
" '2023-10-03T12:01:54.474840064', '2023-10-03T12:01:56.051064832',\n", | |
" '2023-10-03T12:01:56.517842944'], dtype='datetime64[ns]')</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>time1</span></div><div class='xr-var-dims'>(time1)</div><div class='xr-var-dtype'>datetime64[ns]</div><div class='xr-var-preview xr-preview'>2023-10-03T12:00:51.976906240</div><input id='attrs-c3f6b524-7d8b-49ad-b14c-eac0caa550a8' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-c3f6b524-7d8b-49ad-b14c-eac0caa550a8' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3b38d8d7-7475-4fd9-ab81-6c08e2fa5cf0' class='xr-var-data-in' type='checkbox'><label for='data-3b38d8d7-7475-4fd9-ab81-6c08e2fa5cf0' 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>comment :</span></dt><dd>Time coordinate corresponding to environmental variables. Note that Platform.time3 is the same as Environment.time1.</dd><dt><span>long_name :</span></dt><dd>Timestamps for NMEA position datagrams</dd><dt><span>standard_name :</span></dt><dd>time</dd></dl></div><div class='xr-var-data'><pre>array(['2023-10-03T12:00:51.976906240'], dtype='datetime64[ns]')</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-a7db52e0-3c83-40dc-b161-a582ca40ebfd' class='xr-section-summary-in' type='checkbox' ><label for='section-a7db52e0-3c83-40dc-b161-a582ca40ebfd' 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-5ebe2d0d-ee81-4c41-8ec2-eb1735a0b645' class='xr-index-data-in' type='checkbox'/><label for='index-5ebe2d0d-ee81-4c41-8ec2-eb1735a0b645' 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(['WBT Mini 274021-15-1 ES200-7C_ES', 'WBT Mini 274021-15-2 ES70-18CD_ES'], dtype='object', name='channel'))</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-73bdc4af-1894-406e-a16f-c6e2ec7da8e2' class='xr-index-data-in' type='checkbox'/><label for='index-73bdc4af-1894-406e-a16f-c6e2ec7da8e2' 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(['2023-10-03 12:00:51.976906240',\n", | |
" '2023-10-03 12:00:53.559627776',\n", | |
" '2023-10-03 12:00:54.005223936',\n", | |
" '2023-10-03 12:00:55.562006016',\n", | |
" '2023-10-03 12:00:56.009693184',\n", | |
" '2023-10-03 12:00:57.569653248',\n", | |
" '2023-10-03 12:00:57.993319936',\n", | |
" '2023-10-03 12:00:59.553221120',\n", | |
" '2023-10-03 12:01:00.363073024',\n", | |
" '2023-10-03 12:01:01.922873856',\n", | |
" '2023-10-03 12:01:02.371548160',\n", | |
" '2023-10-03 12:01:03.949699072',\n", | |
" '2023-10-03 12:01:04.401380864',\n", | |
" '2023-10-03 12:01:05.950732800',\n", | |
" '2023-10-03 12:01:06.407278080',\n", | |
" '2023-10-03 12:01:07.965466112',\n", | |
" '2023-10-03 12:01:08.388156928',\n", | |
" '2023-10-03 12:01:09.937934848',\n", | |
" '2023-10-03 12:01:10.748850176',\n", | |
" '2023-10-03 12:01:12.291490816',\n", | |
" '2023-10-03 12:01:12.745195008',\n", | |
" '2023-10-03 12:01:14.304367104',\n", | |
" '2023-10-03 12:01:14.748951040',\n", | |
" '2023-10-03 12:01:16.317727744',\n", | |
" '2023-10-03 12:01:16.772888064',\n", | |
" '2023-10-03 12:01:18.330081792',\n", | |
" '2023-10-03 12:01:18.751777792',\n", | |
" '2023-10-03 12:01:20.304416768',\n", | |
" '2023-10-03 12:01:21.177158144',\n", | |
" '2023-10-03 12:01:22.737865216',\n", | |
" '2023-10-03 12:01:23.196512256',\n", | |
" '2023-10-03 12:01:24.772293120',\n", | |
" '2023-10-03 12:01:25.233106944',\n", | |
" '2023-10-03 12:01:26.794712064',\n", | |
" '2023-10-03 12:01:27.250378240',\n", | |
" '2023-10-03 12:01:28.811527168',\n", | |
" '2023-10-03 12:01:29.245244928',\n", | |
" '2023-10-03 12:01:30.821850112',\n", | |
" '2023-10-03 12:01:31.646898176',\n", | |
" '2023-10-03 12:01:33.201689088',\n", | |
" '2023-10-03 12:01:33.640371200',\n", | |
" '2023-10-03 12:01:35.215869952',\n", | |
" '2023-10-03 12:01:35.653824',\n", | |
" '2023-10-03 12:01:37.228828160',\n", | |
" '2023-10-03 12:01:37.674447872',\n", | |
" '2023-10-03 12:01:39.242184192',\n", | |
" '2023-10-03 12:01:39.659781120',\n", | |
" '2023-10-03 12:01:41.244993024',\n", | |
" '2023-10-03 12:01:42.054491136',\n", | |
" '2023-10-03 12:01:43.603165184',\n", | |
" '2023-10-03 12:01:44.049811968',\n", | |
" '2023-10-03 12:01:45.620483072',\n", | |
" '2023-10-03 12:01:46.073785856',\n", | |
" '2023-10-03 12:01:47.643970048',\n", | |
" '2023-10-03 12:01:48.087618048',\n", | |
" '2023-10-03 12:01:49.635296256',\n", | |
" '2023-10-03 12:01:50.058952192',\n", | |
" '2023-10-03 12:01:51.644869120',\n", | |
" '2023-10-03 12:01:52.455427072',\n", | |
" '2023-10-03 12:01:54.007105024',\n", | |
" '2023-10-03 12:01:54.474840064',\n", | |
" '2023-10-03 12:01:56.051064832',\n", | |
" '2023-10-03 12:01:56.517842944'],\n", | |
" dtype='datetime64[ns]', name='ping_time', freq=None))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>time1</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-78fc8049-1104-4d11-a857-a4a6fd68080a' class='xr-index-data-in' type='checkbox'/><label for='index-78fc8049-1104-4d11-a857-a4a6fd68080a' 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(['2023-10-03 12:00:51.976906240'], dtype='datetime64[ns]', name='time1', freq=None))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-48457c30-52f4-41ee-9c94-1934bfc258de' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-48457c30-52f4-41ee-9c94-1934bfc258de' 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.DataArray 'sound_absorption' (time1: 1, channel: 2, ping_time: 63)>\n", | |
"array([[[ nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan, 0.05424102, nan,\n", | |
" 0.05424102, nan, 0.05424102, nan, 0.05424102,\n", | |
" nan, 0.05424102, nan],\n", | |
" [0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539, nan, 0.02356539,\n", | |
" nan, 0.02356539, nan, 0.02356539, nan,\n", | |
" 0.02356539, nan, 0.02356539]]])\n", | |
"Coordinates:\n", | |
" * channel (channel) <U33 'WBT Mini 274021-15-1 ES200-7C_ES' 'WBT Mini 27...\n", | |
" * ping_time (ping_time) datetime64[ns] 2023-10-03T12:00:51.976906240 ... 2...\n", | |
" * time1 (time1) datetime64[ns] 2023-10-03T12:00:51.976906240" | |
] | |
}, | |
"execution_count": 4, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"sound_absorption_da[\"sound_absorption\"].compute()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"And now when we call the line in `harmonize_env_param_time` that caused the error, we end up with the following error in our attempt to squeeze:" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"ename": "IndexError", | |
"evalue": "index 0 is out of bounds for axis 0 with size 0", | |
"output_type": "error", | |
"traceback": [ | |
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | |
"\u001b[0;31mIndexError\u001b[0m Traceback (most recent call last)", | |
"Cell \u001b[0;32mIn[5], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43msound_absorption_da\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdropna\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdim\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtime1\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msqueeze\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdim\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtime1\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39mdrop(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtime1\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", | |
"File \u001b[0;32m~/miniforge3/envs/echopype/lib/python3.9/site-packages/xarray/core/common.py:417\u001b[0m, in \u001b[0;36mDataWithCoords.squeeze\u001b[0;34m(self, dim, drop, axis)\u001b[0m\n\u001b[1;32m 392\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Return a new object with squeezed data.\u001b[39;00m\n\u001b[1;32m 393\u001b[0m \n\u001b[1;32m 394\u001b[0m \u001b[38;5;124;03mParameters\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 414\u001b[0m \u001b[38;5;124;03mnumpy.squeeze\u001b[39;00m\n\u001b[1;32m 415\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 416\u001b[0m dims \u001b[38;5;241m=\u001b[39m get_squeeze_dims(\u001b[38;5;28mself\u001b[39m, dim, axis)\n\u001b[0;32m--> 417\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43misel\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdrop\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdrop\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m{\u001b[49m\u001b[43md\u001b[49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43md\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mdims\u001b[49m\u001b[43m}\u001b[49m\u001b[43m)\u001b[49m\n", | |
"File \u001b[0;32m~/miniforge3/envs/echopype/lib/python3.9/site-packages/xarray/core/dataset.py:2438\u001b[0m, in \u001b[0;36mDataset.isel\u001b[0;34m(self, indexers, drop, missing_dims, **indexers_kwargs)\u001b[0m\n\u001b[1;32m 2436\u001b[0m var_indexers \u001b[38;5;241m=\u001b[39m {k: v \u001b[38;5;28;01mfor\u001b[39;00m k, v \u001b[38;5;129;01min\u001b[39;00m indexers\u001b[38;5;241m.\u001b[39mitems() \u001b[38;5;28;01mif\u001b[39;00m k \u001b[38;5;129;01min\u001b[39;00m var\u001b[38;5;241m.\u001b[39mdims}\n\u001b[1;32m 2437\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m var_indexers:\n\u001b[0;32m-> 2438\u001b[0m var \u001b[38;5;241m=\u001b[39m \u001b[43mvar\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43misel\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvar_indexers\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2439\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m drop \u001b[38;5;129;01mand\u001b[39;00m var\u001b[38;5;241m.\u001b[39mndim \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m name \u001b[38;5;129;01min\u001b[39;00m coord_names:\n\u001b[1;32m 2440\u001b[0m coord_names\u001b[38;5;241m.\u001b[39mremove(name)\n", | |
"File \u001b[0;32m~/miniforge3/envs/echopype/lib/python3.9/site-packages/xarray/core/variable.py:1322\u001b[0m, in \u001b[0;36mVariable.isel\u001b[0;34m(self, indexers, missing_dims, **indexers_kwargs)\u001b[0m\n\u001b[1;32m 1319\u001b[0m indexers \u001b[38;5;241m=\u001b[39m drop_dims_from_indexers(indexers, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdims, missing_dims)\n\u001b[1;32m 1321\u001b[0m key \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mtuple\u001b[39m(indexers\u001b[38;5;241m.\u001b[39mget(dim, \u001b[38;5;28mslice\u001b[39m(\u001b[38;5;28;01mNone\u001b[39;00m)) \u001b[38;5;28;01mfor\u001b[39;00m dim \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdims)\n\u001b[0;32m-> 1322\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\n", | |
"File \u001b[0;32m~/miniforge3/envs/echopype/lib/python3.9/site-packages/xarray/core/variable.py:870\u001b[0m, in \u001b[0;36mVariable.__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 857\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Return a new Variable object whose contents are consistent with\u001b[39;00m\n\u001b[1;32m 858\u001b[0m \u001b[38;5;124;03mgetting the provided key from the underlying data.\u001b[39;00m\n\u001b[1;32m 859\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 867\u001b[0m \u001b[38;5;124;03marray `x.values` directly.\u001b[39;00m\n\u001b[1;32m 868\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 869\u001b[0m dims, indexer, new_order \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_broadcast_indexes(key)\n\u001b[0;32m--> 870\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[43mas_indexable\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_data\u001b[49m\u001b[43m)\u001b[49m\u001b[43m[\u001b[49m\u001b[43mindexer\u001b[49m\u001b[43m]\u001b[49m\n\u001b[1;32m 871\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m new_order:\n\u001b[1;32m 872\u001b[0m data \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mmoveaxis(data, \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;28mlen\u001b[39m(new_order)), new_order)\n", | |
"File \u001b[0;32m~/miniforge3/envs/echopype/lib/python3.9/site-packages/xarray/core/indexing.py:657\u001b[0m, in \u001b[0;36mMemoryCachedArray.__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 656\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__getitem__\u001b[39m(\u001b[38;5;28mself\u001b[39m, key):\n\u001b[0;32m--> 657\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mtype\u001b[39m(\u001b[38;5;28mself\u001b[39m)(_wrap_numpy_scalars(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43marray\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m))\n", | |
"File \u001b[0;32m~/miniforge3/envs/echopype/lib/python3.9/site-packages/xarray/core/indexing.py:1264\u001b[0m, in \u001b[0;36mNumpyIndexingAdapter.__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 1262\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__getitem__\u001b[39m(\u001b[38;5;28mself\u001b[39m, key):\n\u001b[1;32m 1263\u001b[0m array, key \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_indexing_array_and_key(key)\n\u001b[0;32m-> 1264\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43marray\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\n", | |
"\u001b[0;31mIndexError\u001b[0m: index 0 is out of bounds for axis 0 with size 0" | |
] | |
} | |
], | |
"source": [ | |
"sound_absorption_da.dropna(dim=\"time1\").squeeze(dim=\"time1\").drop(\"time1\")" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"This is because when we drop NaNs along this dimension, we are left with nothing since `time1`'s single dimension encapsulates the entire array with alternating NaNs and we cannot squeeze when nothing remains:" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"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'><xarray.Dataset>\n", | |
"Dimensions: (channel: 2, ping_time: 63, time1: 0)\n", | |
"Coordinates:\n", | |
" * channel (channel) <U33 'WBT Mini 274021-15-1 ES200-7C_ES' 'WBT ...\n", | |
" * ping_time (ping_time) datetime64[ns] 2023-10-03T12:00:51.97690624...\n", | |
" * time1 (time1) datetime64[ns] \n", | |
"Data variables:\n", | |
" sound_absorption (time1, channel, ping_time) float64 </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-e6d1821b-1476-4a02-97f3-a27cb4d8d507' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-e6d1821b-1476-4a02-97f3-a27cb4d8d507' 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'>channel</span>: 2</li><li><span class='xr-has-index'>ping_time</span>: 63</li><li><span class='xr-has-index'>time1</span>: 0</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-e45a50a1-117f-481a-85ac-50ee21bba9c5' class='xr-section-summary-in' type='checkbox' checked><label for='section-e45a50a1-117f-481a-85ac-50ee21bba9c5' 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'><U33</div><div class='xr-var-preview xr-preview'>'WBT Mini 274021-15-1 ES200-7C_E...</div><input id='attrs-f0bdff2c-dafc-45f8-9eb8-3671dba866f6' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-f0bdff2c-dafc-45f8-9eb8-3671dba866f6' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-35771b11-9baa-4812-aff5-24e1caadb74a' class='xr-var-data-in' type='checkbox'><label for='data-35771b11-9baa-4812-aff5-24e1caadb74a' 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(['WBT Mini 274021-15-1 ES200-7C_ES', 'WBT Mini 274021-15-2 ES70-18CD_ES'],\n", | |
" dtype='<U33')</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'>2023-10-03T12:00:51.976906240 .....</div><input id='attrs-d9d96b0b-0a8e-4f57-938d-918741234da0' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-d9d96b0b-0a8e-4f57-938d-918741234da0' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-edc365fe-ad4f-4f86-8ff9-cd5307838b17' class='xr-var-data-in' type='checkbox'><label for='data-edc365fe-ad4f-4f86-8ff9-cd5307838b17' 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(['2023-10-03T12:00:51.976906240', '2023-10-03T12:00:53.559627776',\n", | |
" '2023-10-03T12:00:54.005223936', '2023-10-03T12:00:55.562006016',\n", | |
" '2023-10-03T12:00:56.009693184', '2023-10-03T12:00:57.569653248',\n", | |
" '2023-10-03T12:00:57.993319936', '2023-10-03T12:00:59.553221120',\n", | |
" '2023-10-03T12:01:00.363073024', '2023-10-03T12:01:01.922873856',\n", | |
" '2023-10-03T12:01:02.371548160', '2023-10-03T12:01:03.949699072',\n", | |
" '2023-10-03T12:01:04.401380864', '2023-10-03T12:01:05.950732800',\n", | |
" '2023-10-03T12:01:06.407278080', '2023-10-03T12:01:07.965466112',\n", | |
" '2023-10-03T12:01:08.388156928', '2023-10-03T12:01:09.937934848',\n", | |
" '2023-10-03T12:01:10.748850176', '2023-10-03T12:01:12.291490816',\n", | |
" '2023-10-03T12:01:12.745195008', '2023-10-03T12:01:14.304367104',\n", | |
" '2023-10-03T12:01:14.748951040', '2023-10-03T12:01:16.317727744',\n", | |
" '2023-10-03T12:01:16.772888064', '2023-10-03T12:01:18.330081792',\n", | |
" '2023-10-03T12:01:18.751777792', '2023-10-03T12:01:20.304416768',\n", | |
" '2023-10-03T12:01:21.177158144', '2023-10-03T12:01:22.737865216',\n", | |
" '2023-10-03T12:01:23.196512256', '2023-10-03T12:01:24.772293120',\n", | |
" '2023-10-03T12:01:25.233106944', '2023-10-03T12:01:26.794712064',\n", | |
" '2023-10-03T12:01:27.250378240', '2023-10-03T12:01:28.811527168',\n", | |
" '2023-10-03T12:01:29.245244928', '2023-10-03T12:01:30.821850112',\n", | |
" '2023-10-03T12:01:31.646898176', '2023-10-03T12:01:33.201689088',\n", | |
" '2023-10-03T12:01:33.640371200', '2023-10-03T12:01:35.215869952',\n", | |
" '2023-10-03T12:01:35.653824000', '2023-10-03T12:01:37.228828160',\n", | |
" '2023-10-03T12:01:37.674447872', '2023-10-03T12:01:39.242184192',\n", | |
" '2023-10-03T12:01:39.659781120', '2023-10-03T12:01:41.244993024',\n", | |
" '2023-10-03T12:01:42.054491136', '2023-10-03T12:01:43.603165184',\n", | |
" '2023-10-03T12:01:44.049811968', '2023-10-03T12:01:45.620483072',\n", | |
" '2023-10-03T12:01:46.073785856', '2023-10-03T12:01:47.643970048',\n", | |
" '2023-10-03T12:01:48.087618048', '2023-10-03T12:01:49.635296256',\n", | |
" '2023-10-03T12:01:50.058952192', '2023-10-03T12:01:51.644869120',\n", | |
" '2023-10-03T12:01:52.455427072', '2023-10-03T12:01:54.007105024',\n", | |
" '2023-10-03T12:01:54.474840064', '2023-10-03T12:01:56.051064832',\n", | |
" '2023-10-03T12:01:56.517842944'], dtype='datetime64[ns]')</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>time1</span></div><div class='xr-var-dims'>(time1)</div><div class='xr-var-dtype'>datetime64[ns]</div><div class='xr-var-preview xr-preview'></div><input id='attrs-2d4d42a5-0a32-4546-9de6-c17532920334' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-2d4d42a5-0a32-4546-9de6-c17532920334' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-5c0cf2e1-a09a-43da-ba26-0c83e26287cc' class='xr-var-data-in' type='checkbox'><label for='data-5c0cf2e1-a09a-43da-ba26-0c83e26287cc' 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>comment :</span></dt><dd>Time coordinate corresponding to environmental variables. Note that Platform.time3 is the same as Environment.time1.</dd><dt><span>long_name :</span></dt><dd>Timestamps for NMEA position datagrams</dd><dt><span>standard_name :</span></dt><dd>time</dd></dl></div><div class='xr-var-data'><pre>array([], dtype='datetime64[ns]')</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-de169c11-a227-4133-8777-31cc11e2a745' class='xr-section-summary-in' type='checkbox' checked><label for='section-de169c11-a227-4133-8777-31cc11e2a745' class='xr-section-summary' >Data variables: <span>(1)</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>sound_absorption</span></div><div class='xr-var-dims'>(time1, channel, ping_time)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'></div><input id='attrs-80f39859-3cf8-4259-bbd8-e0617370d5b8' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-80f39859-3cf8-4259-bbd8-e0617370d5b8' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-92786e9e-d7fb-4974-aefb-e815723c861b' class='xr-var-data-in' type='checkbox'><label for='data-92786e9e-d7fb-4974-aefb-e815723c861b' 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([], shape=(0, 2, 63), dtype=float64)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-807c0049-991a-4794-92ce-c3351deb4e62' class='xr-section-summary-in' type='checkbox' ><label for='section-807c0049-991a-4794-92ce-c3351deb4e62' 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-d1abbd9f-1177-4d11-976a-51f7d40b101c' class='xr-index-data-in' type='checkbox'/><label for='index-d1abbd9f-1177-4d11-976a-51f7d40b101c' 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(['WBT Mini 274021-15-1 ES200-7C_ES', 'WBT Mini 274021-15-2 ES70-18CD_ES'], dtype='object', name='channel'))</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-7671e551-221a-45f2-9d2b-821693df6567' class='xr-index-data-in' type='checkbox'/><label for='index-7671e551-221a-45f2-9d2b-821693df6567' 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(['2023-10-03 12:00:51.976906240',\n", | |
" '2023-10-03 12:00:53.559627776',\n", | |
" '2023-10-03 12:00:54.005223936',\n", | |
" '2023-10-03 12:00:55.562006016',\n", | |
" '2023-10-03 12:00:56.009693184',\n", | |
" '2023-10-03 12:00:57.569653248',\n", | |
" '2023-10-03 12:00:57.993319936',\n", | |
" '2023-10-03 12:00:59.553221120',\n", | |
" '2023-10-03 12:01:00.363073024',\n", | |
" '2023-10-03 12:01:01.922873856',\n", | |
" '2023-10-03 12:01:02.371548160',\n", | |
" '2023-10-03 12:01:03.949699072',\n", | |
" '2023-10-03 12:01:04.401380864',\n", | |
" '2023-10-03 12:01:05.950732800',\n", | |
" '2023-10-03 12:01:06.407278080',\n", | |
" '2023-10-03 12:01:07.965466112',\n", | |
" '2023-10-03 12:01:08.388156928',\n", | |
" '2023-10-03 12:01:09.937934848',\n", | |
" '2023-10-03 12:01:10.748850176',\n", | |
" '2023-10-03 12:01:12.291490816',\n", | |
" '2023-10-03 12:01:12.745195008',\n", | |
" '2023-10-03 12:01:14.304367104',\n", | |
" '2023-10-03 12:01:14.748951040',\n", | |
" '2023-10-03 12:01:16.317727744',\n", | |
" '2023-10-03 12:01:16.772888064',\n", | |
" '2023-10-03 12:01:18.330081792',\n", | |
" '2023-10-03 12:01:18.751777792',\n", | |
" '2023-10-03 12:01:20.304416768',\n", | |
" '2023-10-03 12:01:21.177158144',\n", | |
" '2023-10-03 12:01:22.737865216',\n", | |
" '2023-10-03 12:01:23.196512256',\n", | |
" '2023-10-03 12:01:24.772293120',\n", | |
" '2023-10-03 12:01:25.233106944',\n", | |
" '2023-10-03 12:01:26.794712064',\n", | |
" '2023-10-03 12:01:27.250378240',\n", | |
" '2023-10-03 12:01:28.811527168',\n", | |
" '2023-10-03 12:01:29.245244928',\n", | |
" '2023-10-03 12:01:30.821850112',\n", | |
" '2023-10-03 12:01:31.646898176',\n", | |
" '2023-10-03 12:01:33.201689088',\n", | |
" '2023-10-03 12:01:33.640371200',\n", | |
" '2023-10-03 12:01:35.215869952',\n", | |
" '2023-10-03 12:01:35.653824',\n", | |
" '2023-10-03 12:01:37.228828160',\n", | |
" '2023-10-03 12:01:37.674447872',\n", | |
" '2023-10-03 12:01:39.242184192',\n", | |
" '2023-10-03 12:01:39.659781120',\n", | |
" '2023-10-03 12:01:41.244993024',\n", | |
" '2023-10-03 12:01:42.054491136',\n", | |
" '2023-10-03 12:01:43.603165184',\n", | |
" '2023-10-03 12:01:44.049811968',\n", | |
" '2023-10-03 12:01:45.620483072',\n", | |
" '2023-10-03 12:01:46.073785856',\n", | |
" '2023-10-03 12:01:47.643970048',\n", | |
" '2023-10-03 12:01:48.087618048',\n", | |
" '2023-10-03 12:01:49.635296256',\n", | |
" '2023-10-03 12:01:50.058952192',\n", | |
" '2023-10-03 12:01:51.644869120',\n", | |
" '2023-10-03 12:01:52.455427072',\n", | |
" '2023-10-03 12:01:54.007105024',\n", | |
" '2023-10-03 12:01:54.474840064',\n", | |
" '2023-10-03 12:01:56.051064832',\n", | |
" '2023-10-03 12:01:56.517842944'],\n", | |
" dtype='datetime64[ns]', name='ping_time', freq=None))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>time1</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-a3b0b4c2-12c7-430b-98c6-f60ec44f98bb' class='xr-index-data-in' type='checkbox'/><label for='index-a3b0b4c2-12c7-430b-98c6-f60ec44f98bb' 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([], dtype='datetime64[ns]', name='time1', freq=None))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-a88bbefb-b57e-4ce6-acaa-b2cc116eb5f5' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-a88bbefb-b57e-4ce6-acaa-b2cc116eb5f5' 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>\n", | |
"Dimensions: (channel: 2, ping_time: 63, time1: 0)\n", | |
"Coordinates:\n", | |
" * channel (channel) <U33 'WBT Mini 274021-15-1 ES200-7C_ES' 'WBT ...\n", | |
" * ping_time (ping_time) datetime64[ns] 2023-10-03T12:00:51.97690624...\n", | |
" * time1 (time1) datetime64[ns] \n", | |
"Data variables:\n", | |
" sound_absorption (time1, channel, ping_time) float64 " | |
] | |
}, | |
"execution_count": 9, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"sound_absorption_da.dropna(dim=\"time1\")" | |
] | |
} | |
], | |
"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.18" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment