Skip to content
Snippets Groups Projects
MatfiletoNetCDF_CL_ARTofMELT_v1.ipynb 485 KiB
Newer Older
       "  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-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",
       "  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",
       "  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-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-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",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt;\n",
       "Dimensions:                       (cloud_layer: 3, range_levels: 770, sky_condition_layer: 5, time: 108477)\n",
       "Coordinates:\n",
       "  * time                          (time) datetime64[ns] 2023-05-07T00:00:22.2...\n",
       "  * range_levels                  (range_levels) int32 1 2 3 4 ... 768 769 770\n",
       "  * cloud_layer                   (cloud_layer) int32 1 2 3\n",
       "  * sky_condition_layer           (sky_condition_layer) int32 1 2 3 4 5\n",
       "Data variables: (12/15)\n",
       "    day_of_year                   (time) float32 127.0 127.0 ... 164.7 164.7\n",
       "    year                          (time) int32 2023 2023 2023 ... 2023 2023 2023\n",
       "    month                         (time) int32 5 5 5 5 5 5 5 5 ... 6 6 6 6 6 6 6\n",
       "    day                           (time) int32 7 7 7 7 7 7 ... 13 13 13 13 13 13\n",
       "    hour                          (time) int32 0 0 0 0 0 0 ... 16 16 16 16 16 16\n",
       "    minute                        (time) int32 0 0 1 1 2 2 ... 21 22 22 23 23 24\n",
       "    ...                            ...\n",
       "    vertical_visibility           (time) float32 nan nan nan nan ... nan nan nan\n",
       "    highest_detected_signal       (time) float32 nan nan nan nan ... nan nan nan\n",
       "    cloud_base_altitude           (time, cloud_layer) float32 915.0 nan ... nan\n",
       "    sky_condition_cloud_fraction  (time, sky_condition_layer) float32 6.0 ......\n",
       "    sky_condition_cloud_altitude  (time, sky_condition_layer) float32 775.0 ....\n",
       "    backscatter_profile           (time, range_levels) float32 0.00041 ... -0...\n",
       "Attributes: (12/27)\n",
       "    Conventions:                           CF-1.8\n",
       "    source:                                Ceilometer\n",
       "    instrument_model:                      Vaisala Ceilometer CL31\n",
       "    creator_name:                          Sonja Murto\n",
       "    creator_email:                         sonja.murto@misu.su.se\n",
       "    creator_url:                           https://orcid.org/0000-0002-4966-9077\n",
       "    ...                                    ...\n",
       "    time_coverage_start:                   2023-05-07T00:00:22\n",
       "    time_coverage_end:                     2023-06-13T16:24:22\n",
       "    geospatial_bounds:                     80.52392166666667N, -3.87377499999...\n",
       "    platform_altitude:                     Located at approximately 25 m a.s.l\n",
       "    location_keywords:                     Oden, Arctic Ocean, Fram Strait, a...\n",
Sonja Murto's avatar
Sonja Murto committed
       "    comments:                              This file consists of ceilometer d...</pre><div class='xr-wrap' hidden><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-2595830e-84c7-4bc6-80bb-6faf43cca029' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-2595830e-84c7-4bc6-80bb-6faf43cca029' 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'>cloud_layer</span>: 3</li><li><span class='xr-has-index'>range_levels</span>: 770</li><li><span class='xr-has-index'>sky_condition_layer</span>: 5</li><li><span class='xr-has-index'>time</span>: 108477</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-c6b5e696-3756-4540-9952-9896b17a74b8' class='xr-section-summary-in' type='checkbox'  checked><label for='section-c6b5e696-3756-4540-9952-9896b17a74b8' class='xr-section-summary' >Coordinates: <span>(4)</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'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>datetime64[ns]</div><div class='xr-var-preview xr-preview'>2023-05-07T00:00:22.266003 ... 2...</div><input id='attrs-991fef4d-194d-42a3-a4c7-076a067a88db' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-991fef4d-194d-42a3-a4c7-076a067a88db' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-be261f4b-8bc1-4326-a818-3a6b26a5c1b8' class='xr-var-data-in' type='checkbox'><label for='data-be261f4b-8bc1-4326-a818-3a6b26a5c1b8' 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([&#x27;2023-05-07T00:00:22.266003000&#x27;, &#x27;2023-05-07T00:00:52.264995000&#x27;,\n",
       "       &#x27;2023-05-07T00:01:22.265003000&#x27;, ..., &#x27;2023-06-13T16:23:22.296001000&#x27;,\n",
       "       &#x27;2023-06-13T16:23:52.296000000&#x27;, &#x27;2023-06-13T16:24:22.295002000&#x27;],\n",
Sonja Murto's avatar
Sonja Murto committed
       "      dtype=&#x27;datetime64[ns]&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>range_levels</span></div><div class='xr-var-dims'>(range_levels)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>1 2 3 4 5 6 ... 766 767 768 769 770</div><input id='attrs-ce3989d0-c035-4a6d-a3b7-7a72d01f6835' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-ce3989d0-c035-4a6d-a3b7-7a72d01f6835' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-9ee1e740-c001-40b3-827c-d6af04db85d4' class='xr-var-data-in' type='checkbox'><label for='data-9ee1e740-c001-40b3-827c-d6af04db85d4' 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([  1,   2,   3, ..., 768, 769, 770], dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>cloud_layer</span></div><div class='xr-var-dims'>(cloud_layer)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>1 2 3</div><input id='attrs-9a589097-d840-4cb2-ac55-ac07c99fa45a' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-9a589097-d840-4cb2-ac55-ac07c99fa45a' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-65dd0ad0-bd35-4759-850d-821d8eded4bd' class='xr-var-data-in' type='checkbox'><label for='data-65dd0ad0-bd35-4759-850d-821d8eded4bd' 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([1, 2, 3], dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>sky_condition_layer</span></div><div class='xr-var-dims'>(sky_condition_layer)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>1 2 3 4 5</div><input id='attrs-f8f3940a-a211-415c-8b22-caf67c5e147c' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-f8f3940a-a211-415c-8b22-caf67c5e147c' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3bba2ffd-ed9b-4ed6-a567-a13d75134fe0' class='xr-var-data-in' type='checkbox'><label for='data-3bba2ffd-ed9b-4ed6-a567-a13d75134fe0' 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([1, 2, 3, 4, 5], dtype=int32)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-5c4b4bac-7157-4bd0-b537-8c97f513eda9' class='xr-section-summary-in' type='checkbox'  ><label for='section-5c4b4bac-7157-4bd0-b537-8c97f513eda9' class='xr-section-summary' >Data variables: <span>(15)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>day_of_year</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>127.0 127.0 127.0 ... 164.7 164.7</div><input id='attrs-abb5a7fb-774f-4da2-a03a-c0dc942df841' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-abb5a7fb-774f-4da2-a03a-c0dc942df841' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-005e1ad2-515f-4c8a-8eed-a307b6acd595' class='xr-var-data-in' type='checkbox'><label for='data-005e1ad2-515f-4c8a-8eed-a307b6acd595' 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>type :</span></dt><dd>float32</dd><dt><span>dimension :</span></dt><dd>time</dd><dt><span>units :</span></dt><dd>1</dd><dt><span>long_name :</span></dt><dd>Day of Year</dd><dt><span>description :</span></dt><dd>time as decimal day of year</dd></dl></div><div class='xr-var-data'><pre>array([127.00026, 127.0006 , 127.00095, ..., 164.68289, 164.68324,\n",
       "       164.6836 ], dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>year</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>2023 2023 2023 ... 2023 2023 2023</div><input id='attrs-f78d9d87-9c44-4536-bca5-c5c496b3e2e7' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-f78d9d87-9c44-4536-bca5-c5c496b3e2e7' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-9a2daeaf-fb4f-405d-bffe-1dc0c8cd247b' class='xr-var-data-in' type='checkbox'><label for='data-9a2daeaf-fb4f-405d-bffe-1dc0c8cd247b' 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>type :</span></dt><dd>int32</dd><dt><span>dimension :</span></dt><dd>time</dd><dt><span>units :</span></dt><dd>1</dd><dt><span>long_name :</span></dt><dd>Year</dd></dl></div><div class='xr-var-data'><pre>array([2023, 2023, 2023, ..., 2023, 2023, 2023], dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>month</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>5 5 5 5 5 5 5 5 ... 6 6 6 6 6 6 6 6</div><input id='attrs-94989e29-7ffb-47e8-a9d0-d915fbc2b340' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-94989e29-7ffb-47e8-a9d0-d915fbc2b340' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-77bda41d-a5e3-4960-bf4f-84751081fe08' class='xr-var-data-in' type='checkbox'><label for='data-77bda41d-a5e3-4960-bf4f-84751081fe08' 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>type :</span></dt><dd>int32</dd><dt><span>dimension :</span></dt><dd>time</dd><dt><span>units :</span></dt><dd>1</dd><dt><span>long_name :</span></dt><dd>Month</dd></dl></div><div class='xr-var-data'><pre>array([5, 5, 5, ..., 6, 6, 6], dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>day</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>7 7 7 7 7 7 7 ... 13 13 13 13 13 13</div><input id='attrs-0d552525-696f-45e5-9261-7927609a9a4a' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-0d552525-696f-45e5-9261-7927609a9a4a' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-fb2a6a18-6d22-4a6c-b517-77cc8dd4ae98' class='xr-var-data-in' type='checkbox'><label for='data-fb2a6a18-6d22-4a6c-b517-77cc8dd4ae98' 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>type :</span></dt><dd>int32</dd><dt><span>dimension :</span></dt><dd>time</dd><dt><span>units :</span></dt><dd>1</dd><dt><span>long_name :</span></dt><dd>Day</dd></dl></div><div class='xr-var-data'><pre>array([ 7,  7,  7, ..., 13, 13, 13], dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>hour</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>0 0 0 0 0 0 0 ... 16 16 16 16 16 16</div><input id='attrs-5674d3a9-0665-406b-a5f6-5fb38c55235f' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-5674d3a9-0665-406b-a5f6-5fb38c55235f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-8aa8892a-dcec-4025-89a4-8d6c165148cd' class='xr-var-data-in' type='checkbox'><label for='data-8aa8892a-dcec-4025-89a4-8d6c165148cd' 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>type :</span></dt><dd>int32</dd><dt><span>dimension :</span></dt><dd>time</dd><dt><span>units :</span></dt><dd>1</dd><dt><span>long_name :</span></dt><dd>Hour</dd></dl></div><div class='xr-var-data'><pre>array([ 0,  0,  0, ..., 16, 16, 16], dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>minute</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>0 0 1 1 2 2 3 ... 21 22 22 23 23 24</div><input id='attrs-a72888bf-8faa-4638-9925-e1defdfece87' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-a72888bf-8faa-4638-9925-e1defdfece87' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ea82698c-1504-4df1-b9c5-31fe5469e5ee' class='xr-var-data-in' type='checkbox'><label for='data-ea82698c-1504-4df1-b9c5-31fe5469e5ee' 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>type :</span></dt><dd>int32</dd><dt><span>dimension :</span></dt><dd>time</dd><dt><span>units :</span></dt><dd>1</dd><dt><span>long_name :</span></dt><dd>Minute</dd></dl></div><div class='xr-var-data'><pre>array([ 0,  0,  1, ..., 23, 23, 24], dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>second</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>22 52 22 52 22 ... 22 52 22 52 22</div><input id='attrs-c809e45a-48a7-4a89-9f28-919b541076c8' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-c809e45a-48a7-4a89-9f28-919b541076c8' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-7b76f7f4-ad30-4dd7-8e8c-67298d648cfb' class='xr-var-data-in' type='checkbox'><label for='data-7b76f7f4-ad30-4dd7-8e8c-67298d648cfb' 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>type :</span></dt><dd>int32</dd><dt><span>dimension :</span></dt><dd>time</dd><dt><span>units :</span></dt><dd>1</dd><dt><span>long_name :</span></dt><dd>Second</dd><dt><span>description :</span></dt><dd>Time averaged to closest second</dd></dl></div><div class='xr-var-data'><pre>array([22, 52, 22, ..., 22, 52, 22], dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>ceilometer_range</span></div><div class='xr-var-dims'>(range_levels)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>35 45 55 65 ... 7695 7705 7715 7725</div><input id='attrs-fdb4f47c-a272-4a3c-a0a3-37fd93b1beaa' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-fdb4f47c-a272-4a3c-a0a3-37fd93b1beaa' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f5664c11-31e9-49b4-a9b7-d271f07ecb4f' class='xr-var-data-in' type='checkbox'><label for='data-f5664c11-31e9-49b4-a9b7-d271f07ecb4f' 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>type :</span></dt><dd>int32</dd><dt><span>dimension :</span></dt><dd>range_levels</dd><dt><span>units :</span></dt><dd>m</dd><dt><span>long_name :</span></dt><dd>Ceilometer Range</dd><dt><span>description :</span></dt><dd>Ranges for the ceilometer backscatter profile, including the instrument height</dd></dl></div><div class='xr-var-data'><pre>array([  35,   45,   55,   65,   75,   85,   95,  105,  115,  125,  135,\n",
       "        145,  155,  165,  175,  185,  195,  205,  215,  225,  235,  245,\n",
       "        255,  265,  275,  285,  295,  305,  315,  325,  335,  345,  355,\n",
       "        365,  375,  385,  395,  405,  415,  425,  435,  445,  455,  465,\n",
       "        475,  485,  495,  505,  515,  525,  535,  545,  555,  565,  575,\n",
       "        585,  595,  605,  615,  625,  635,  645,  655,  665,  675,  685,\n",
       "        695,  705,  715,  725,  735,  745,  755,  765,  775,  785,  795,\n",
       "        805,  815,  825,  835,  845,  855,  865,  875,  885,  895,  905,\n",
       "        915,  925,  935,  945,  955,  965,  975,  985,  995, 1005, 1015,\n",
       "       1025, 1035, 1045, 1055, 1065, 1075, 1085, 1095, 1105, 1115, 1125,\n",
       "       1135, 1145, 1155, 1165, 1175, 1185, 1195, 1205, 1215, 1225, 1235,\n",
       "       1245, 1255, 1265, 1275, 1285, 1295, 1305, 1315, 1325, 1335, 1345,\n",
       "       1355, 1365, 1375, 1385, 1395, 1405, 1415, 1425, 1435, 1445, 1455,\n",
       "       1465, 1475, 1485, 1495, 1505, 1515, 1525, 1535, 1545, 1555, 1565,\n",
       "       1575, 1585, 1595, 1605, 1615, 1625, 1635, 1645, 1655, 1665, 1675,\n",
       "       1685, 1695, 1705, 1715, 1725, 1735, 1745, 1755, 1765, 1775, 1785,\n",
       "       1795, 1805, 1815, 1825, 1835, 1845, 1855, 1865, 1875, 1885, 1895,\n",
       "       1905, 1915, 1925, 1935, 1945, 1955, 1965, 1975, 1985, 1995, 2005,\n",
       "       2015, 2025, 2035, 2045, 2055, 2065, 2075, 2085, 2095, 2105, 2115,\n",
       "       2125, 2135, 2145, 2155, 2165, 2175, 2185, 2195, 2205, 2215, 2225,\n",
       "...\n",
       "       5645, 5655, 5665, 5675, 5685, 5695, 5705, 5715, 5725, 5735, 5745,\n",
       "       5755, 5765, 5775, 5785, 5795, 5805, 5815, 5825, 5835, 5845, 5855,\n",
       "       5865, 5875, 5885, 5895, 5905, 5915, 5925, 5935, 5945, 5955, 5965,\n",
       "       5975, 5985, 5995, 6005, 6015, 6025, 6035, 6045, 6055, 6065, 6075,\n",
       "       6085, 6095, 6105, 6115, 6125, 6135, 6145, 6155, 6165, 6175, 6185,\n",
       "       6195, 6205, 6215, 6225, 6235, 6245, 6255, 6265, 6275, 6285, 6295,\n",
       "       6305, 6315, 6325, 6335, 6345, 6355, 6365, 6375, 6385, 6395, 6405,\n",
       "       6415, 6425, 6435, 6445, 6455, 6465, 6475, 6485, 6495, 6505, 6515,\n",
       "       6525, 6535, 6545, 6555, 6565, 6575, 6585, 6595, 6605, 6615, 6625,\n",
       "       6635, 6645, 6655, 6665, 6675, 6685, 6695, 6705, 6715, 6725, 6735,\n",
       "       6745, 6755, 6765, 6775, 6785, 6795, 6805, 6815, 6825, 6835, 6845,\n",
       "       6855, 6865, 6875, 6885, 6895, 6905, 6915, 6925, 6935, 6945, 6955,\n",
       "       6965, 6975, 6985, 6995, 7005, 7015, 7025, 7035, 7045, 7055, 7065,\n",
       "       7075, 7085, 7095, 7105, 7115, 7125, 7135, 7145, 7155, 7165, 7175,\n",
       "       7185, 7195, 7205, 7215, 7225, 7235, 7245, 7255, 7265, 7275, 7285,\n",
       "       7295, 7305, 7315, 7325, 7335, 7345, 7355, 7365, 7375, 7385, 7395,\n",
       "       7405, 7415, 7425, 7435, 7445, 7455, 7465, 7475, 7485, 7495, 7505,\n",
       "       7515, 7525, 7535, 7545, 7555, 7565, 7575, 7585, 7595, 7605, 7615,\n",
       "       7625, 7635, 7645, 7655, 7665, 7675, 7685, 7695, 7705, 7715, 7725],\n",
Sonja Murto's avatar
Sonja Murto committed
       "      dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>flag_cloudcode</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>1 1 2 2 1 1 1 1 ... 1 1 1 1 1 1 1 1</div><input id='attrs-d799e1f3-7de1-4dd3-9ed5-c18797970841' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-d799e1f3-7de1-4dd3-9ed5-c18797970841' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-efcac1bd-be03-4498-b72a-5ad89c034138' class='xr-var-data-in' type='checkbox'><label for='data-efcac1bd-be03-4498-b72a-5ad89c034138' 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>type :</span></dt><dd>int32</dd><dt><span>dimension :</span></dt><dd>time</dd><dt><span>units :</span></dt><dd>1</dd><dt><span>long_name :</span></dt><dd>Data flag: Cloudcode</dd><dt><span>flag_values :</span></dt><dd>-1,0,1,2,3,4</dd><dt><span>flag_meanings :</span></dt><dd>missing_data\n",
       "no_significant_backscatter\n",
       "one_cloud_base_detected\n",
       "two_cloud_bases_detected\n",
       "three_cloud_bases_detected\n",
Sonja Murto's avatar
Sonja Murto committed
       "full_obscuration</dd><dt><span>description :</span></dt><dd>Code for number of cloud bases detected; see Readme document for more information</dd></dl></div><div class='xr-var-data'><pre>array([1, 1, 2, ..., 1, 1, 1], dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>vertical_visibility</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>nan nan nan nan ... nan nan nan nan</div><input id='attrs-54a35b35-82da-444f-a86b-caef98f787b2' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-54a35b35-82da-444f-a86b-caef98f787b2' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c8c59782-e623-4533-a532-48d8357e02f2' class='xr-var-data-in' type='checkbox'><label for='data-c8c59782-e623-4533-a532-48d8357e02f2' 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>type :</span></dt><dd>float32</dd><dt><span>dimension :</span></dt><dd>time</dd><dt><span>units :</span></dt><dd>m</dd><dt><span>long_name :</span></dt><dd>Vertical Visibilility</dd><dt><span>description :</span></dt><dd>Vertical visibility given in case of obscured cloud base (at flag_cloudcode 4), else NaN</dd></dl></div><div class='xr-var-data'><pre>array([nan, nan, nan, ..., nan, nan, nan], dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>highest_detected_signal</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>nan nan nan nan ... nan nan nan nan</div><input id='attrs-d5813921-3bb8-43ca-b3a3-8cfdae7bf32a' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-d5813921-3bb8-43ca-b3a3-8cfdae7bf32a' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-643fbeca-f9df-4fb0-b336-30b00265a631' class='xr-var-data-in' type='checkbox'><label for='data-643fbeca-f9df-4fb0-b336-30b00265a631' 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>type :</span></dt><dd>float32</dd><dt><span>dimension :</span></dt><dd>time</dd><dt><span>units :</span></dt><dd>m</dd><dt><span>long_name :</span></dt><dd>Highest Signal Detected</dd><dt><span>description :</span></dt><dd>Highest signal detected given in case of obscured cloud base (at flag_cloudcode 4), else NaN</dd></dl></div><div class='xr-var-data'><pre>array([nan, nan, nan, ..., nan, nan, nan], dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>cloud_base_altitude</span></div><div class='xr-var-dims'>(time, cloud_layer)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>915.0 nan nan ... 265.0 nan nan</div><input id='attrs-48d9898d-ea5a-4904-8ce4-26eb5d2ad7ea' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-48d9898d-ea5a-4904-8ce4-26eb5d2ad7ea' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-02774637-8d28-4358-b10a-024b57bea8f7' class='xr-var-data-in' type='checkbox'><label for='data-02774637-8d28-4358-b10a-024b57bea8f7' 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>type :</span></dt><dd>float32</dd><dt><span>dimension :</span></dt><dd>time, cloud_layer</dd><dt><span>units :</span></dt><dd>m</dd><dt><span>long_name :</span></dt><dd>Cloud Base Altitude</dd><dt><span>description :</span></dt><dd>cloud base height of 1-3 cloud layers; NaN if no layer detected. Instrument height incorporated.</dd></dl></div><div class='xr-var-data'><pre>array([[915.,  nan,  nan],\n",
       "       [765.,  nan,  nan],\n",
       "       [745., 945.,  nan],\n",
       "       ...,\n",
       "       [325.,  nan,  nan],\n",
       "       [325.,  nan,  nan],\n",
Sonja Murto's avatar
Sonja Murto committed
       "       [265.,  nan,  nan]], dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>sky_condition_cloud_fraction</span></div><div class='xr-var-dims'>(time, sky_condition_layer)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>6.0 8.0 0.0 0.0 ... 0.0 0.0 0.0 0.0</div><input id='attrs-b26e213f-9303-477a-99fa-53683dab2588' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-b26e213f-9303-477a-99fa-53683dab2588' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-cb395ca5-285f-4bbd-ab88-eb8c7ec719f2' class='xr-var-data-in' type='checkbox'><label for='data-cb395ca5-285f-4bbd-ab88-eb8c7ec719f2' 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>type :</span></dt><dd>float32</dd><dt><span>dimension :</span></dt><dd>time, sky_condition_layer</dd><dt><span>units :</span></dt><dd>octal</dd><dt><span>long_name :</span></dt><dd>Sky Condition Cloud Fraction</dd><dt><span>description :</span></dt><dd>Cloud fraction calculated with the sky condition algorithm. 0-8 = cloud coverage of up to 5 levels; 9 = obscuration. NaN = missing data or no detected layer.</dd></dl></div><div class='xr-var-data'><pre>array([[6., 8., 0., 0., 0.],\n",
       "       [6., 8., 0., 0., 0.],\n",
       "       [6., 8., 0., 0., 0.],\n",
       "       ...,\n",
       "       [8., 0., 0., 0., 0.],\n",
       "       [8., 0., 0., 0., 0.],\n",
Sonja Murto's avatar
Sonja Murto committed
       "       [8., 0., 0., 0., 0.]], dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>sky_condition_cloud_altitude</span></div><div class='xr-var-dims'>(time, sky_condition_layer)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>775.0 1.525e+03 nan ... nan nan nan</div><input id='attrs-9146d70b-efee-4545-8ea5-e12df1dcb1a7' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-9146d70b-efee-4545-8ea5-e12df1dcb1a7' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c85c0deb-9b35-4bbf-8ab6-285b8826ff89' class='xr-var-data-in' type='checkbox'><label for='data-c85c0deb-9b35-4bbf-8ab6-285b8826ff89' 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>type :</span></dt><dd>float32</dd><dt><span>dimension :</span></dt><dd>time, sky_condition_layer</dd><dt><span>units :</span></dt><dd>m</dd><dt><span>long_name :</span></dt><dd>Sky Condition Cloud Altitude</dd><dt><span>description :</span></dt><dd>Cloud layer height calculated with the sky condition algorithm. Cloud layer height given for 1-5 sky condition layers; NaN if no layer detected. Vertical visibility is reported as height if obscuration (at sky_condition_cloud_fraction 9). Instrument height incorporated.</dd></dl></div><div class='xr-var-data'><pre>array([[ 775., 1525.,   nan,   nan,   nan],\n",
       "       [ 775., 1525.,   nan,   nan,   nan],\n",
       "       [ 775., 1525.,   nan,   nan,   nan],\n",
       "       ...,\n",
       "       [ 365.,   nan,   nan,   nan,   nan],\n",
       "       [ 365.,   nan,   nan,   nan,   nan],\n",
Sonja Murto's avatar
Sonja Murto committed
       "       [ 365.,   nan,   nan,   nan,   nan]], dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>backscatter_profile</span></div><div class='xr-var-dims'>(time, range_levels)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>0.00041 0.00021 ... -0.00099</div><input id='attrs-13854140-a1ce-4c87-b996-b13aa98728d9' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-13854140-a1ce-4c87-b996-b13aa98728d9' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3ba3a9a3-c354-4c35-be4d-179994d3474c' class='xr-var-data-in' type='checkbox'><label for='data-3ba3a9a3-c354-4c35-be4d-179994d3474c' 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>type :</span></dt><dd>float32</dd><dt><span>dimension :</span></dt><dd>time, range_levels</dd><dt><span>units :</span></dt><dd>1 km-1 steradians-1</dd><dt><span>long_name :</span></dt><dd>Backscatter Profile</dd><dt><span>description :</span></dt><dd>backscatter coefficient profile</dd></dl></div><div class='xr-var-data'><pre>array([[ 0.00041,  0.00021,  0.00021, ...,  0.00481,  0.00636,  0.00369],\n",
       "       [ 0.00054,  0.00023,  0.00022, ..., -0.00383, -0.00429, -0.00371],\n",
       "       [ 0.00011,  0.00021,  0.00021, ..., -0.00184, -0.00054,  0.00392],\n",
       "       ...,\n",
       "       [ 0.01576,  0.01214,  0.01054, ...,  0.00153, -0.00049, -0.00063],\n",
       "       [ 0.0024 ,  0.00564,  0.00816, ..., -0.00122,  0.00081,  0.00131],\n",
       "       [ 0.0178 ,  0.01494,  0.02054, ..., -0.00102, -0.00123, -0.00099]],\n",
Sonja Murto's avatar
Sonja Murto committed
       "      dtype=float32)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-e9f398d8-57b8-4e95-879f-7c4213ff86da' class='xr-section-summary-in' type='checkbox'  ><label for='section-e9f398d8-57b8-4e95-879f-7c4213ff86da' class='xr-section-summary' >Attributes: <span>(27)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>Conventions :</span></dt><dd>CF-1.8</dd><dt><span>source :</span></dt><dd>Ceilometer</dd><dt><span>instrument_model :</span></dt><dd>Vaisala Ceilometer CL31</dd><dt><span>creator_name :</span></dt><dd>Sonja Murto</dd><dt><span>creator_email :</span></dt><dd>sonja.murto@misu.su.se</dd><dt><span>creator_url :</span></dt><dd>https://orcid.org/0000-0002-4966-9077</dd><dt><span>institution :</span></dt><dd>Stockholm University</dd><dt><span>processing_software :</span></dt><dd>Matlab (for creating the matlab file) and a jupyter notebook script (netCDF)</dd><dt><span>sampling_interval :</span></dt><dd>30s</dd><dt><span>product_version :</span></dt><dd>v01</dd><dt><span>last_revised_date :</span></dt><dd>2024-05-31T15:00:00</dd><dt><span>project :</span></dt><dd>ARTofMELT</dd><dt><span>project_principal_investigator :</span></dt><dd>Michael Tjernström</dd><dt><span>project_principal_investigator_email :</span></dt><dd>michaelt@misu.su.se</dd><dt><span>project_principal_investigator_url :</span></dt><dd>https://orcid.org/0000-0002-6908-7410</dd><dt><span>acknowledgement :</span></dt><dd> Knut och Alice Wallenbergs Stiftelse, Grant 2016-0024</dd><dt><span>platform :</span></dt><dd>Swedish Icebreaker Oden</dd><dt><span>platform_type :</span></dt><dd>On Oden&#x27;s 7th deck above the bridge</dd><dt><span>deployment_mode :</span></dt><dd>ship</dd><dt><span>title :</span></dt><dd>Ceilometer cloud base height, vertical visibility and backscatter profiles</dd><dt><span>feature_type :</span></dt><dd>time series</dd><dt><span>time_coverage_start :</span></dt><dd>2023-05-07T00:00:22</dd><dt><span>time_coverage_end :</span></dt><dd>2023-06-13T16:24:22</dd><dt><span>geospatial_bounds :</span></dt><dd>80.52392166666667N, -3.8737749999999997E, 78.04355166666666N, 15.660881666666667E</dd><dt><span>platform_altitude :</span></dt><dd>Located at approximately 25 m a.s.l</dd><dt><span>location_keywords :</span></dt><dd>Oden, Arctic Ocean, Fram Strait, atmosphere, on the ship</dd><dt><span>comments :</span></dt><dd>This file consists of ceilometer data measured with the Vaisala Ceilometer CL31 that was located on the 7th deck, above the bridge (at approximately 25m).The sky condition measurements are time averages to represent an area average. The vertical resolution is 10m * 770, but the measurement height (25m) is included in the backscatter profile ranges, as well as in the cloud base heights (cloud_base_altitude and sky_condition_cloud_altitude). Geospatial bounds are taken from the gps location of the weather station dataset located on Oden. Time variables month, day, hour, minute and second are approximated to the nearest second. Data produced by Sonja Murto. See the document - Readme_CL.txt - for more details.</dd></dl></div></li></ul></div></div>"
      ],
      "text/plain": [
       "<xarray.Dataset>\n",
       "Dimensions:                       (cloud_layer: 3, range_levels: 770, sky_condition_layer: 5, time: 108477)\n",
       "Coordinates:\n",
       "  * time                          (time) datetime64[ns] 2023-05-07T00:00:22.2...\n",
       "  * range_levels                  (range_levels) int32 1 2 3 4 ... 768 769 770\n",
       "  * cloud_layer                   (cloud_layer) int32 1 2 3\n",
       "  * sky_condition_layer           (sky_condition_layer) int32 1 2 3 4 5\n",
       "Data variables: (12/15)\n",
       "    day_of_year                   (time) float32 127.0 127.0 ... 164.7 164.7\n",
       "    year                          (time) int32 2023 2023 2023 ... 2023 2023 2023\n",
       "    month                         (time) int32 5 5 5 5 5 5 5 5 ... 6 6 6 6 6 6 6\n",
       "    day                           (time) int32 7 7 7 7 7 7 ... 13 13 13 13 13 13\n",
       "    hour                          (time) int32 0 0 0 0 0 0 ... 16 16 16 16 16 16\n",
       "    minute                        (time) int32 0 0 1 1 2 2 ... 21 22 22 23 23 24\n",
       "    ...                            ...\n",
       "    vertical_visibility           (time) float32 nan nan nan nan ... nan nan nan\n",
       "    highest_detected_signal       (time) float32 nan nan nan nan ... nan nan nan\n",
       "    cloud_base_altitude           (time, cloud_layer) float32 915.0 nan ... nan\n",
       "    sky_condition_cloud_fraction  (time, sky_condition_layer) float32 6.0 ......\n",
       "    sky_condition_cloud_altitude  (time, sky_condition_layer) float32 775.0 ....\n",
       "    backscatter_profile           (time, range_levels) float32 0.00041 ... -0...\n",
       "Attributes: (12/27)\n",
       "    Conventions:                           CF-1.8\n",
       "    source:                                Ceilometer\n",
       "    instrument_model:                      Vaisala Ceilometer CL31\n",
       "    creator_name:                          Sonja Murto\n",
       "    creator_email:                         sonja.murto@misu.su.se\n",
       "    creator_url:                           https://orcid.org/0000-0002-4966-9077\n",
       "    ...                                    ...\n",
       "    time_coverage_start:                   2023-05-07T00:00:22\n",
       "    time_coverage_end:                     2023-06-13T16:24:22\n",
       "    geospatial_bounds:                     80.52392166666667N, -3.87377499999...\n",
       "    platform_altitude:                     Located at approximately 25 m a.s.l\n",
       "    location_keywords:                     Oden, Arctic Ocean, Fram Strait, a...\n",
       "    comments:                              This file consists of ceilometer d..."
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ds_all"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Save to netCDF\n",
    "ds_all.to_netcdf(load_data + 'CL31_ceilometer_ARTofMELT_20230507_20230613_30s_v01.nc') "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Create netCDF from 1 min average files - remove times with no data points"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "CL_SM_avg = scipy.io.loadmat(load_data + 'CL31_ceilometer_ARTofMELT_20230507_20230613_1min_v01.mat',struct_as_record=True)"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['__header__', '__version__', '__globals__', 'cl31_av'])"
      ]
     },
Sonja Murto's avatar
Sonja Murto committed
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "CL_SM_avg.keys()"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('mday', 'doy', 'cloudcode', 'base_ht', 'vert_vis', 'high_sig', 'sc_frac', 'sc_ht', 'bs_prof', 'ceil_range', 'time')\n"
     ]
    }
   ],
   "source": [
    "# get the data in the mat file\n",
    "Names=CL_SM_avg['cl31_av'].dtype.names\n",
    "ndata = {n: CL_SM_avg['cl31_av'][n][0, 0] for n in Names}\n",
    "print(Names)"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "# create pandas dataframe from the data\n",
    "\n",
    "# 1D variables\n",
    "\n",
    "DF_1min=pd.DataFrame(index=range(len(ndata['doy'])),)\n",
    "DF_1min['doy']=np.array(list(itertools.chain.from_iterable(ndata['doy'])),dtype=float)\n",
    "DF_1min['cloudcode']=np.array(list(itertools.chain.from_iterable(ndata['cloudcode'])),dtype=float)\n",
    "DF_1min['vert_vis']=np.array(list(itertools.chain.from_iterable(ndata['vert_vis'])),dtype=float)\n",
    "DF_1min['high_sig']=np.array(list(itertools.chain.from_iterable(ndata['high_sig'])),dtype=float)\n",
    "\n",
    "\n",
    "#2D cloudlayer\n",
    "DF_1min_cloudbh=pd.DataFrame(index=range(len(ndata['doy'])),data=np.array(ndata['base_ht'],dtype=float))\n",
    "\n",
    "#2D sc_layer_ht\n",
    "DF_1min_scht=pd.DataFrame(index=range(len(ndata['doy'])),data=np.array(ndata['sc_ht'],dtype=float))\n",
    "\n",
    "#2D sc_layer_frac\n",
    "DF_1min_scfrac=pd.DataFrame(index=range(len(ndata['doy'])),data=np.array(ndata['sc_frac'],dtype=float))\n",
    "\n",
    "#2D ranges\n",
    "DF_1min_range=pd.DataFrame(index=range(len(ndata['doy'])),data=np.array(ndata['bs_prof'],dtype=float))"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "54264"
      ]
     },
Sonja Murto's avatar
Sonja Murto committed
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(DF_1min)"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "54251 13\n"
     ]
    }
   ],
   "source": [
    "#check for NaNs\n",
    "selection = DF_1min.iloc[DF_1min[~DF_1min.doy.isna()].index].index.values # size with no nans\n",
    "idx_nan = DF_1min.iloc[DF_1min[DF_1min.doy.isna()].index].index.values # length of nan times\n",
    "print(len(selection),len(idx_nan))"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "#select only no-nan times; for all 5 pandas dataframes\n",
    "DF_1min=DF_1min.iloc[selection].reset_index(drop=True)\n",
    "DF_1min_cloudbh=DF_1min_cloudbh.iloc[selection].reset_index(drop=True)\n",
    "DF_1min_scht=DF_1min_scht.iloc[selection].reset_index(drop=True)\n",
    "DF_1min_scfrac=DF_1min_scfrac.iloc[selection].reset_index(drop=True)\n",
    "DF_1min_range=DF_1min_range.iloc[selection].reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "54251 54251 54251 54251 54251\n"
     ]
    }
   ],
   "source": [
    "#check for right length\n",
    "print(len(DF_1min),len(DF_1min_cloudbh),len(DF_1min_scfrac),len(DF_1min_scht),len(DF_1min_range))"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>doy</th>\n",
       "      <th>cloudcode</th>\n",
       "      <th>vert_vis</th>\n",
       "      <th>high_sig</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: [doy, cloudcode, vert_vis, high_sig]\n",
       "Index: []"
      ]
     },
Sonja Murto's avatar
Sonja Murto committed
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DF_1min.iloc[DF_1min[DF_1min.doy.isna()].index] #check again for NaNs - empty!"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "# set time dimension\n",
    "Time_steps=returndatetime_fromdoy(np.array(DF_1min.doy.values,dtype=float))\n",
    "Times_nomicrosec=[pd.to_datetime(T).round('1s') for T in Time_steps]\n",
    "Time_steps_dt64_org=[np.datetime64(t) for t in Time_steps]\n",
    "Time_steps_dt64_org=np.array(Time_steps_dt64_org,dtype='datetime64[ns]')"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "# add date values\n",
    "DF_1min['year']=np.array([Times_nomicrosec[i].year for i in range(len(Time_steps))],dtype=int)\n",
    "DF_1min['month']=np.array([Times_nomicrosec[i].month for i in range(len(Time_steps))],dtype=int)\n",
    "DF_1min['day']=np.array([Times_nomicrosec[i].day for i in range(len(Time_steps))],dtype=int)\n",
    "DF_1min['hour']=np.array([Times_nomicrosec[i].hour for i in range(len(Time_steps))],dtype=int)\n",
    "DF_1min['minute']=np.array([Times_nomicrosec[i].minute for i in range(len(Time_steps))],dtype=int)\n",
    "DF_1min['second']=np.array([Times_nomicrosec[i].second for i in range(len(Time_steps))],dtype=int)"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "# create xr DataArrays\n",
    "\n",
    "#1D: dimension time\n",
    "\n",
    "da_doy=xr.DataArray(data=np.array(DF_1min['doy']).astype('float32'),name=\"day_of_year\",\n",
    "                dims=[\"time\"],coords=dict(time=Time_steps_dt64_org),\n",
    "                  attrs=dict(type=\"float32\",dimension=\"time\",units=\"1\",long_name=\"Day of Year\",\n",
    "                             description=\"time as decimal day of year\"),) #added as 1D\n",
    "\n",
    "#date and time in separate arrays; microseconds approximated to seconds\n",
    "da_year=xr.DataArray(data=np.array(DF_1min['year']).astype('int32'),name=\"year\",dims=[\"time\"],\n",
    "                  coords=dict(time=Time_steps_dt64_org),\n",
    "                  attrs=dict(type=\"int32\",dimension=\"time\",units=\"1\",long_name=\"Year\"),) #added as 1D\n",
    "\n",
    "da_month=xr.DataArray(data=np.array(DF_1min['month']).astype('int32'),name=\"month\",dims=[\"time\"],\n",
    "                  coords=dict(time=Time_steps_dt64_org),\n",
    "                      attrs=dict(type=\"int32\",dimension=\"time\",units=\"1\", long_name=\"Month\"),) #added as 1D\n",
    "\n",
    "da_day=xr.DataArray(data=np.array(DF_1min['day']).astype('int32'),name=\"day\",dims=[\"time\"],\n",
    "                  coords=dict(time=Time_steps_dt64_org),\n",
    "                    attrs=dict(type=\"int32\",dimension=\"time\",units=\"1\",long_name=\"Day\"),) #added as 1D\n",
    "\n",
    "da_hour=xr.DataArray(data=np.array(DF_1min['hour']).astype('int32'),name=\"hour\",dims=[\"time\"],\n",
    "                  coords=dict(time=Time_steps_dt64_org),\n",
    "                     attrs=dict(type=\"int32\",dimension=\"time\",units=\"1\",long_name=\"Hour\"),) #added as 1D\n",
    "\n",
    "da_min=xr.DataArray(data=np.array(DF_1min['minute']).astype('int32'),name=\"minute\",dims=[\"time\"],\n",
    "                  coords=dict(time=Time_steps_dt64_org),\n",
    "                    attrs=dict(type=\"int32\",dimension=\"time\",units=\"1\",long_name=\"Minute\"),) #added as 1D\n",
    "\n",
    "da_sec=xr.DataArray(data=np.array(DF_1min['second']).astype('int32'),name=\"second\",dims=[\"time\"],\n",
    "                  coords=dict(time=Time_steps_dt64_org),\n",
    "                     attrs=dict(type=\"int32\",dimension=\"time\",units=\"1\",long_name=\"Second\",\n",
    "                               description=\"Time averaged to closest second\"),) #added as 1D\n",
    "\n",
    "#add cloudcode flag\n",
    "da_cloudcode=xr.DataArray(data=np.array(DF_1min['cloudcode']).astype('int32'),name=\"flag_cloudcode\",dims=[\"time\"],\n",
    "                        coords=dict(time=Time_steps_dt64_org),\n",
    "                        attrs=dict(type=\"int32\",dimension=\"time\",units=\"1\",\n",
    "                                   long_name='Data flag: Cloudcode',\n",
    "                                   flag_values=\"-1,0,1,2,3,4\", \n",
    "                                   flag_meanings=\"missing_data\\nno_significant_backscatter\\none_cloud_base_detected\\ntwo_cloud_bases_detected\\nthree_cloud_bases_detected\\nfull_obscuration\",\n",
    "                                   description=\"Code for number of cloud bases detected; see Readme document for more information\"),)\n",
    "\n",
    "da_vertvis=xr.DataArray(data=np.array(DF_1min['vert_vis']).astype('float32'),\n",
    "                    name=\"vertical_visibility\",dims=[\"time\"],coords=dict(time=Time_steps_dt64_org),\n",
    "                   attrs=dict(type=\"float32\",dimension=\"time\", units=\"m\",\n",
    "                              long_name=\"Vertical Visibilility\",\n",
    "                             description=\"Vertical visibility given in case of obscured cloud base (at flag_cloudcode 4), else NaN\"),) #added as 1D\n",
    "\n",
    "da_high_sig=xr.DataArray(data=np.array(DF_1min['high_sig']).astype('float32'),\n",
    "                    name=\"highest_detected_signal\",dims=[\"time\"],coords=dict(time=Time_steps_dt64_org),\n",
    "                   attrs=dict(type=\"float32\",dimension=\"time\", units=\"m\",\n",
    "                              long_name=\"Highest Signal Detected\",\n",
    "                             description=\"Highest signal detected given in case of obscured cloud base (at flag_cloudcode 4), else NaN\"),) #added as 1D\n",
    "\n",
    "\n",
    "#1D: dimension range_levels\n",
    "\n",
    "da_ceilrange=xr.DataArray(data=np.array(list(itertools.chain.from_iterable(ndata['ceil_range'])),dtype=int).astype('int32'),\n",
    "                    name=\"ceilometer_range\",dims=[\"range_levels\"],coords=dict(range_levels=range_levs),\n",
    "                          attrs=dict(type=\"int32\",dimension=\"range_levels\",units=\"m\",\n",
    "                                     long_name=\"Ceilometer Range\",\n",
    "                                     description=\"Ranges for the ceilometer backscatter profile, including the instrument height\",),) #added as 1D\n",
    "\n",
    "\n",
    "#2D: dimension time/cloud_layer\n",
    "\n",
    "\n",
    "da_baseht=xr.DataArray(data=np.array(DF_1min_cloudbh,dtype=float).astype('float32'),\n",
    "                    name=\"cloud_base_altitude\",dims=[\"time\",\"cloud_layer\"],\n",
    "                       coords=dict(time=Time_steps_dt64_org,cloud_layer=cloud_layer_levs),\n",
    "                   attrs=dict(type=\"float32\",dimension=\"time, cloud_layer\", units=\"m\",\n",
    "                              long_name=\"Cloud Base Altitude\",\n",
    "                              description=\"cloud base height of 1-3 cloud layers; NaN if no layer detected. \" +\\\n",
    "                              \"Instrument height incorporated.\"),) #added as 2D\n",
    "\n",
    "#2D: dimension time/sky_condition_layer\n",
    "\n",
    "\n",
    "\n",
    "da_scfrac=xr.DataArray(data=np.array(DF_1min_scfrac,dtype=float).astype('float32'),\n",
    "                    name=\"sky_condition_cloud_fraction\",dims=[\"time\",\"sky_condition_layer\"],\n",
    "                       coords=dict(time=Time_steps_dt64_org,sky_condition_layer=sc_layer_levs),\n",
    "                   attrs=dict(type=\"float32\",dimension=\"time, sky_condition_layer\", units=\"octal\",\n",
    "                              long_name=\"Sky Condition Cloud Fraction\",\n",
    "                            description=\"Cloud fraction calculated with the sky condition algorithm. \"+\\\n",
    "                             \"0-8 = cloud coverage of up to 5 levels; 9 = obscuration. \" +\\\n",
    "                             \"NaN = missing data or no detected layer.\"),) #added as 2D\n",
    "\n",
    "da_scht=xr.DataArray(data=np.array(DF_1min_scht,dtype=float).astype('float32'),\n",
    "                    name=\"sky_condition_cloud_altitude\",dims=[\"time\",\"sky_condition_layer\"],\n",
    "                     coords=dict(time=Time_steps_dt64_org,sky_condition_layer=sc_layer_levs),\n",
    "                   attrs=dict(type=\"float32\",dimension=\"time, sky_condition_layer\", units=\"m\",\n",
Sonja Murto's avatar
Sonja Murto committed
    "                              long_name=\"Sky Condition Cloud Altitude\",\n",
    "                              description = \"Cloud layer height calculated with the sky condition algorithm. \"+\\\n",
    "                             \"Cloud layer height given for 1-5 sky condition layers; NaN if no layer detected. \"+\\\n",
    "                             \"Vertical visibility is reported as height if obscuration (at sky_condition_cloud_fraction 9). \"+\\\n",
    "                             \"Instrument height incorporated.\"),) #added as 2D\n",
    "\n",
    "\n",
    "\n",
    "#2D: dimension time/range\n",
    "\n",
    "da_bsprof=xr.DataArray(data=np.array(DF_1min_range,dtype=float).astype('float32'),\n",
    "                    name=\"backscatter_profile\",dims=[\"time\",\"range_levels\"],\n",
    "                       coords=dict(time=Time_steps_dt64_org,range_levels=range_levs),\n",
    "                   attrs=dict(type=\"float32\",dimension=\"time, range_levels\", units=\"1 km-1 steradians-1\",\n",
    "                              long_name=\"Backscatter Profile\", description=\"backscatter coefficient profile\"),) #added as 2D\n"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "15"
      ]
     },
Sonja Murto's avatar
Sonja Murto committed
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#merge all arrays into one\n",
    "\n",
    "ds_all=xr.merge([da_doy,da_year,da_month,da_day,da_hour,da_min,da_sec,\n",
    "                da_ceilrange,da_cloudcode,da_vertvis,da_high_sig,\n",
    "                da_baseht,da_scfrac,da_scht,da_bsprof])\n",
    "\n",
    "len(ds_all)"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2023-05-07 00:00:52')"
      ]
     },
Sonja Murto's avatar
Sonja Murto committed
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#get time range - start\n",
    "Times_nomicrosec[0]"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2023-06-13 16:23:37')"
      ]
     },
Sonja Murto's avatar
Sonja Murto committed
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#get time range - end\n",
    "Times_nomicrosec[-1]"
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "# modify attributes (start/end time and text in comments); \n",
    "# note again geospatial bounds from the weather station data\n",
    "\n",
    "ds_all.attrs = {\"Conventions\" :\"CF-1.8\",\n",
    "                \"source\" : \"Ceilometer\",\n",
    "                \"instrument_model\" : \"Vaisala Ceilometer CL31\",\n",
    "                \"creator_name\" : \"Sonja Murto\",\n",
    "                \"creator_email\" : \"sonja.murto@misu.su.se\",\n",
    "                \"creator_url\" : \"https://orcid.org/0000-0002-4966-9077\",\n",
    "                \"institution\" : \"Stockholm University\",  \n",
    "                \"processing_software\" : \"Matlab (for creating the matlab file) and a jupyter notebook script (netCDF)\",\n",
    "                \"sampling_interval\": \"original 30s; here 1min averages\", \n",
    "                \"product_version\" : \"v01\",\n",
    "                \"last_revised_date\" : \"2024-05-31T15:00:00\", \n",
    "                \"project\" : \"ARTofMELT\",\n",
    "                \"project_principal_investigator\" : \"Michael Tjernström\",\n",
    "                \"project_principal_investigator_email\" : \"michaelt@misu.su.se\",\n",
    "                \"project_principal_investigator_url\" : \"https://orcid.org/0000-0002-6908-7410\",                \n",
    "                \"acknowledgement\" : \" Knut och Alice Wallenbergs Stiftelse, Grant 2016-0024\",\n",
    "                \"platform\" : \"Swedish Icebreaker Oden\",\n",
    "                \"platform_type\" : \"On Oden's 7th deck above the bridge\",\n",
    "                \"deployment_mode\" : \"ship\",\n",
    "                \"title\" : \"Ceilometer cloud base height, vertical visibility and backscatter profiles\",\n",
    "                \"feature_type\" : \"time series\",   \n",
    "                \"time_coverage_start\" : \"2023-05-07T00:00:52\",\n",
    "                \"time_coverage_end\" : \"2023-06-13T16:23:37\",\n",
    "                \"geospatial_bounds\" : \"80.52392166666667N, -3.8737749999999997E, 78.04355166666666N, 15.660881666666667E\",\n",
    "                \"platform_altitude\" : \"Located at approximately 25 m a.s.l\",\n",
    "                \"location_keywords\": \"Oden, Arctic Ocean, Fram Strait, atmosphere, on the ship\",\n",
    "                \"comments\" : \"This file consists of 1 min averages of ceilometer data \" +\\\n",
    "                \"measured with the Vaisala Ceilometer CL31 that was located on the 7th deck, \"+\\\n",
    "                \"above the bridge (at approximately 25m).\" + \\\n",
    "                \"The sky condition measurements are time averages to represent an area average. \" + \\\n",
    "                \"The vertical resolution is 10m * 770, but the measurement height (25m) is included in the backscatter profile ranges, \" + \\\n",
    "                \"as well as in the cloud base heights (cloud_base_altitude and sky_condition_cloud_altitude). \" + \\\n",
    "                \"Geospatial bounds are taken from the gps location of the weather station dataset located on Oden. \" +\\\n",
    "                \"Time variables month, day, hour, minute and second are approximated to the nearest second. \" +\\\n",
    "                \"Data produced by Sonja Murto. See the document - Readme_CL.txt - for more details.\"}\n",
    "               "
   ]
  },
  {
   "cell_type": "code",
Sonja Murto's avatar
Sonja Murto committed
   "execution_count": 37,
   "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.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;\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",