Skip to content

Instantly share code, notes, and snippets.

@geografif
Last active March 1, 2024 01:09
Show Gist options
  • Save geografif/ce4265a41b524389193dc07446130989 to your computer and use it in GitHub Desktop.
Save geografif/ce4265a41b524389193dc07446130989 to your computer and use it in GitHub Desktop.
netcdf.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/geografif/ce4265a41b524389193dc07446130989/netcdf.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"source": [
"References:\n",
"\n",
"* Must read!: [**Everything about marine heatwave**](https://www.marineheatwaves.org/) / [tracker](https://www.marineheatwaves.org/tracker.html)\n",
"* [MHW definition](https://theoceancode.netlify.app/)\n",
"* [MHW categories](https://coralreefwatch.noaa.gov/product/marine_heatwave/)\n",
"* [Download Ostia SST data from Python API](https://help.marine.copernicus.eu/en/collections/5821001-python-library-api)\n",
"* [workflow](https://www.researchgate.net/figure/Workflow-to-reveal-the-dynamical-organization-of-marine-heatwaves-MHWs-using-Mapper_fig1_348583546)\n",
"* [presentation slide](https://theoceancode.netlify.app/files/day_1_basics#/how---definition)\n",
"\n",
"Youtube:\n",
"* [Marine Heatwaves – Trends, Impacts Attribution, and Software](https://www.youtube.com/watch?v=RRdkzvQ3bqo)\n",
"* https://marine.copernicus.eu/services/user-learning-services/tutorials\n",
"* [Marine Data 4 Med part 1](https://www.youtube.com/watch?v=COx_VG5--Wk) / notebook: https://marine.copernicus.eu/services/user-learning-services/mediterranean-sea-training-2022-discover-copernicus-marine-service\n",
"* [Marine Data 4 Med part 2](https://www.youtube.com/watch?v=TG-yWfoK3L8) / notebook: https://marine.copernicus.eu/services/user-learning-services/mediterranean-sea-training-2022-marine-heat-waves\n",
"* [Marine Data 4 Med workshop resources](https://padlet.com/copernicusmarineservice/marinedata4med-material-9kxldxd78vm8t4yi)\n",
"\n",
"Marine Heatwave papers:\n",
"* Hobday AJ, Oliver ECJ, Sen Gupta A, Benthuysen JA, Burrows MT, Donat MG, Holbrook NJ, Moore PJ, Thomsen MS, Wernberg T, Smale DA. 2018. [Categorizing and naming marine heatwaves](). Oceanography 31, 2. doi: 10.5670/oceanog.2018.205.\n",
"* Hobday AJ, Alexander LV, Perkins SE, Smale DA, Staub SC, Oliver ECJ, Benthuysen JA, Burrows MT, Donat MG, Feng M, Holbrook NJ, Moore PJ, Scannell HA, Sen Gupta A, Wernberg T. 2016. [A hierarchical approach to defining marine heatwaves](). Progress in Oceanography 141, 227-238.\n",
"* Oliver ECJ, Donat MG, Burrows MT, Moore PJ, Smale DA, Alexander LV, Benthuysen JA, Feng M, Gupta AS, Hobday AJ, Holbrook NJ, Perkins-Kirkpatrick E, Scannell A, Straub SC, Wernberg T. 2018. [Longer and more frequent marine heatwaves over the past century](https://www.nature.com/articles/s41467-018-03732-9.pdf). Nature Communications 9, 1324. doi: 10.1038/s41467-018-03732-9\n",
"\n",
"Working with NetCDF file:\n",
"* [Merging data with known dimension in R](https://stackoverflow.com/questions/55187266/how-to-merge-netcdf-files-separately-in-r)\n",
"* [Read NetCDF as rasterstack file in R](https://gist.github.com/geografif/64699469ba8feaf3219f0009b62d8498)\n",
"* [Extract NetCDF data as time-series table in R](https://towardsdatascience.com/how-to-crack-open-netcdf-files-in-r-and-extract-data-as-time-series-24107b70dcd) / [R script](https://github.com/BraeuNerd/ncdfwithRexample/blob/main/ncdfwithRexample.R)\n",
"* [merge NetCDF files in python](https://stackoverflow.com/questions/30946476/combine-multiple-netcdf-files-into-timeseries-multidimensional-array-python) / [2](https://copyprogramming.com/howto/python-xarray-merge-netcdf-files-code-example)\n",
"* [Visualizing data in NetCDF format](https://www.youtube.com/watch?v=XqoetylQAIY)\n",
"\n",
"Marine Heatwave Package:\n",
"* [mhw-detect python package](https://pypi.org/project/mhw-detect/) / [paper](https://passage.phys.ocean.dal.ca/~olivere/docs/Hobdayetal_2016_PO_HierarchMHWDefn.pdf) / [jupyter notebook example](https://github.com/ecjoliver/marineHeatWaves/blob/master/docs/example_synthetic.ipynb)\n",
"* [xmhw python package](https://github.com/coecms/xmhw)\n",
"* [RmarineHeatWaves: Detect Marine Heat Waves and Marine Cold Spells R package](https://github.com/ajsmit/RmarineHeatWaves) / [pdf](https://cran.r-project.org/web/packages/RmarineHeatWaves/RmarineHeatWaves.pdf)\n",
"* [heatwaveR R package](https://robwschlegel.github.io/heatwaveR/) / [pdf](https://joss.theoj.org/papers/10.21105/joss.00821)\n",
"* [heatwave3: detect MHW directly from NetCDF data](https://robwschlegel.github.io/heatwave3/index.html)\n",
"\n",
"Data Bali Lombok:\n",
"[MHW](https://drive.google.com/drive/folders/1XURh-zCWisOp6fE6HnFu4u4R96Dgx37c)\n",
"\n",
"\n",
"\n"
],
"metadata": {
"id": "CvTI-_4K-W49"
}
},
{
"cell_type": "code",
"source": [
"import os\n",
"import pandas\n",
"\n",
"# ngecek working directory saat ini\n",
"os.getcwd()"
],
"metadata": {
"id": "xZPKgb4rsQgX",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 36
},
"outputId": "878a756e-4c3b-4aad-ef05-2301033df4e0"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'/content'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 1
}
]
},
{
"cell_type": "code",
"source": [
"# menghubungkan Google Collab ke folder Google Drive\n",
"from google.colab import drive\n",
"drive.mount('/content/drive')"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "nvdyxKDV1VRX",
"outputId": "c5a1d68d-5a81-4888-b348-a6ac7588e96a"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Mounted at /content/drive\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# mengubah working directory ke folder spesifik di Google Drive\n",
"os.chdir('/content/drive/My Drive/Colab Notebooks/MHW')\n",
"os.getcwd()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 36
},
"id": "642G3d-1sajg",
"outputId": "db92183a-cf23-4dac-df10-7536f10b002c"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'/content/drive/My Drive/Colab Notebooks/MHW'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 3
}
]
},
{
"cell_type": "markdown",
"source": [
"**Download OSTIA SST NetCDF data via Python API**"
],
"metadata": {
"id": "z4y5ef_vjnKV"
}
},
{
"cell_type": "code",
"source": [
"pip install copernicus_marine_client"
],
"metadata": {
"id": "6A4a6gjMjlCI"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "CPhnvadpnfga"
},
"outputs": [],
"source": [
"import copernicus_marine_client as copernicusmarine\n",
"\n",
"copernicusmarine.subset(\n",
" dataset_id=\"METOFFICE-GLO-SST-L4-NRT-OBS-SST-V2\", #sst dataset v2 start 2007\n",
" #dataset_id =\"METOFFICE-GLO-SST-L4-REP-OBS-SST\", #sst dataset start 1981\n",
" variables=[\"analysed_sst\"],\n",
" minimum_longitude=114.974998474121,\n",
" maximum_longitude=116.4749988474121,\n",
" minimum_latitude=-9.02499961853027,\n",
" maximum_latitude=-8.02499961853027,\n",
" start_datetime=\"2022-06-01T00:00:00\",\n",
" end_datetime=\"2023-12-31T23:59:59\",\n",
" minimum_depth=0,\n",
" maximum_depth=1,\n",
" output_filename= \"2022-06-01_2023-12-31.nc\",\n",
" output_directory = \"ostia\" #folder di dalam working directory\n",
");\n",
"\n",
"#Cannot download full period of 1983 - 2023. Therefore, two files were downloaded which are\n",
"# .nc file for 1983-01-01 to 2022-05-31 and .nc file for 2022-06-01 to 2023-12-31\n",
"\n",
"#username: sair\n",
"#password:T0l0n953y3"
]
},
{
"cell_type": "markdown",
"source": [
"Menggabungkan beberapa file NetCDF beda periode menjadi satu file NetCDF"
],
"metadata": {
"id": "gJwh2KD5j57_"
}
},
{
"cell_type": "code",
"source": [
"import xarray as xr\n",
"\n",
"nc_gabung = xr.open_mfdataset(os.path.join(\"ostia2/*.nc\")) # \"*.nc\" untuk membuka semua file yang berformat .nc\n",
"nc_gabung"
],
"metadata": {
"id": "q9MMzm3shSb1",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 767
},
"outputId": "ff532104-53d5-4cd3-ef93-3f09731e32dd"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: (time: 15340, lat: 21, lon: 31)\n",
"Coordinates:\n",
" * time (time) datetime64[ns] 1982-01-01T12:00:00 ... 2023-12-3...\n",
" * lat (lat) float32 -9.025 -8.975 -8.925 ... -8.075 -8.025\n",
" * lon (lon) float32 115.0 115.0 115.1 ... 116.4 116.4 116.5\n",
"Data variables:\n",
" analysed_sst (time, lat, lon) float32 dask.array<chunksize=(15340, 21, 31), meta=np.ndarray>\n",
" analysis_error (time, lat, lon) float32 dask.array<chunksize=(15340, 21, 31), meta=np.ndarray>\n",
" sea_ice_fraction (time, lat, lon) float32 dask.array<chunksize=(15340, 21, 31), meta=np.ndarray>\n",
" mask (time, lat, lon) float32 dask.array<chunksize=(15340, 21, 31), meta=np.ndarray>\n",
"Attributes: (12/52)\n",
" Conventions: CF-1.4, ACDD-1.3\n",
" title: Global SST & Sea Ice Analysis, L4 OSTIA, 0.05...\n",
" summary: A merged, multi-sensor L4 Foundation SST product\n",
" references: Donlon, C.J., Martin, M., Stark, J.D., Robert...\n",
" institution: UKMO\n",
" history: Created from sst.nc; obs_anal.nc; seaice.nc\n",
" ... ...\n",
" cdm_data_type: grid\n",
" History: Translated to CF-1.0 Conventions by Netcdf-Ja...\n",
" geospatial_lat_min: -9.024999618530273\n",
" geospatial_lat_max: -8.024999618530273\n",
" geospatial_lon_min: 114.9749984741211\n",
" geospatial_lon_max: 116.4749984741211"
],
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
"html[theme=dark],\n",
"body[data-theme=dark],\n",
"body.vscode-dark {\n",
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
" --xr-border-color: #1F1F1F;\n",
" --xr-disabled-color: #515151;\n",
" --xr-background-color: #111111;\n",
" --xr-background-color-row-even: #111111;\n",
" --xr-background-color-row-odd: #313131;\n",
"}\n",
"\n",
".xr-wrap {\n",
" display: block !important;\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-text-repr-fallback {\n",
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
" display: none;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-index-preview {\n",
" grid-column: 2 / 5;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data,\n",
".xr-index-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data,\n",
".xr-index-data-in:checked ~ .xr-index-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-index-name div,\n",
".xr-index-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data,\n",
".xr-index-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt,\n",
".xr-attrs dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2,\n",
".xr-no-icon {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt;\n",
"Dimensions: (time: 15340, lat: 21, lon: 31)\n",
"Coordinates:\n",
" * time (time) datetime64[ns] 1982-01-01T12:00:00 ... 2023-12-3...\n",
" * lat (lat) float32 -9.025 -8.975 -8.925 ... -8.075 -8.025\n",
" * lon (lon) float32 115.0 115.0 115.1 ... 116.4 116.4 116.5\n",
"Data variables:\n",
" analysed_sst (time, lat, lon) float32 dask.array&lt;chunksize=(15340, 21, 31), meta=np.ndarray&gt;\n",
" analysis_error (time, lat, lon) float32 dask.array&lt;chunksize=(15340, 21, 31), meta=np.ndarray&gt;\n",
" sea_ice_fraction (time, lat, lon) float32 dask.array&lt;chunksize=(15340, 21, 31), meta=np.ndarray&gt;\n",
" mask (time, lat, lon) float32 dask.array&lt;chunksize=(15340, 21, 31), meta=np.ndarray&gt;\n",
"Attributes: (12/52)\n",
" Conventions: CF-1.4, ACDD-1.3\n",
" title: Global SST &amp; Sea Ice Analysis, L4 OSTIA, 0.05...\n",
" summary: A merged, multi-sensor L4 Foundation SST product\n",
" references: Donlon, C.J., Martin, M., Stark, J.D., Robert...\n",
" institution: UKMO\n",
" history: Created from sst.nc; obs_anal.nc; seaice.nc\n",
" ... ...\n",
" cdm_data_type: grid\n",
" History: Translated to CF-1.0 Conventions by Netcdf-Ja...\n",
" geospatial_lat_min: -9.024999618530273\n",
" geospatial_lat_max: -8.024999618530273\n",
" geospatial_lon_min: 114.9749984741211\n",
" geospatial_lon_max: 116.4749984741211</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-73acef4e-e28a-46cd-a267-96bb703f03b7' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-73acef4e-e28a-46cd-a267-96bb703f03b7' 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'>time</span>: 15340</li><li><span class='xr-has-index'>lat</span>: 21</li><li><span class='xr-has-index'>lon</span>: 31</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-bd46deda-1cf5-4c0f-bd5c-6c1d007f1cbb' class='xr-section-summary-in' type='checkbox' checked><label for='section-bd46deda-1cf5-4c0f-bd5c-6c1d007f1cbb' 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'>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'>1982-01-01T12:00:00 ... 2023-12-...</div><input id='attrs-5bb0872f-aff5-499c-8b90-577167ad2cc8' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-5bb0872f-aff5-499c-8b90-577167ad2cc8' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-baeeb204-7ba8-43e3-8805-b8df5f140247' class='xr-var-data-in' type='checkbox'><label for='data-baeeb204-7ba8-43e3-8805-b8df5f140247' 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>reference time of sst field</dd><dt><span>standard_name :</span></dt><dd>time</dd><dt><span>axis :</span></dt><dd>T</dd><dt><span>comment :</span></dt><dd></dd><dt><span>_ChunkSizes :</span></dt><dd>1</dd><dt><span>_CoordinateAxisType :</span></dt><dd>Time</dd></dl></div><div class='xr-var-data'><pre>array([&#x27;1982-01-01T12:00:00.000000000&#x27;, &#x27;1982-01-02T12:00:00.000000000&#x27;,\n",
" &#x27;1982-01-03T12:00:00.000000000&#x27;, ..., &#x27;2023-12-29T12:00:00.000000000&#x27;,\n",
" &#x27;2023-12-30T12:00:00.000000000&#x27;, &#x27;2023-12-31T12:00:00.000000000&#x27;],\n",
" dtype=&#x27;datetime64[ns]&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>lat</span></div><div class='xr-var-dims'>(lat)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>-9.025 -8.975 ... -8.075 -8.025</div><input id='attrs-1c211474-af66-4070-a015-99ea5551f3ea' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-1c211474-af66-4070-a015-99ea5551f3ea' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-1d632d6e-fa73-4fdd-aa44-bf99caa18c22' class='xr-var-data-in' type='checkbox'><label for='data-1d632d6e-fa73-4fdd-aa44-bf99caa18c22' 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>standard_name :</span></dt><dd>latitude</dd><dt><span>long_name :</span></dt><dd>latitude</dd><dt><span>units :</span></dt><dd>degrees_north</dd><dt><span>valid_min :</span></dt><dd>-90.0</dd><dt><span>valid_max :</span></dt><dd>90.0</dd><dt><span>axis :</span></dt><dd>Y</dd><dt><span>comment :</span></dt><dd> Latitude geographical coordinates,WGS84 projection</dd><dt><span>_ChunkSizes :</span></dt><dd>3600</dd><dt><span>_CoordinateAxisType :</span></dt><dd>Lat</dd></dl></div><div class='xr-var-data'><pre>array([-9.025, -8.975, -8.925, -8.875, -8.825, -8.775, -8.725, -8.675, -8.625,\n",
" -8.575, -8.525, -8.475, -8.425, -8.375, -8.325, -8.275, -8.225, -8.175,\n",
" -8.125, -8.075, -8.025], dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>lon</span></div><div class='xr-var-dims'>(lon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>115.0 115.0 115.1 ... 116.4 116.5</div><input id='attrs-56176551-b6ab-43a4-8283-7a68f43b5c53' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-56176551-b6ab-43a4-8283-7a68f43b5c53' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3a63b2a3-74a6-4e46-acb7-e3d73621066c' class='xr-var-data-in' type='checkbox'><label for='data-3a63b2a3-74a6-4e46-acb7-e3d73621066c' 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>standard_name :</span></dt><dd>longitude</dd><dt><span>long_name :</span></dt><dd>longitude</dd><dt><span>units :</span></dt><dd>degrees_east</dd><dt><span>valid_min :</span></dt><dd>-180.0</dd><dt><span>valid_max :</span></dt><dd>180.0</dd><dt><span>axis :</span></dt><dd>X</dd><dt><span>comment :</span></dt><dd> Longitude geographical coordinates,WGS84 projection</dd><dt><span>_ChunkSizes :</span></dt><dd>7200</dd><dt><span>_CoordinateAxisType :</span></dt><dd>Lon</dd></dl></div><div class='xr-var-data'><pre>array([114.975, 115.025, 115.075, 115.125, 115.175, 115.225, 115.275, 115.325,\n",
" 115.375, 115.425, 115.475, 115.525, 115.575, 115.625, 115.675, 115.725,\n",
" 115.775, 115.825, 115.875, 115.925, 115.975, 116.025, 116.075, 116.125,\n",
" 116.175, 116.225, 116.275, 116.325, 116.375, 116.425, 116.475],\n",
" dtype=float32)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-8ecb087c-8229-44f4-8b45-33107d8a2372' class='xr-section-summary-in' type='checkbox' checked><label for='section-8ecb087c-8229-44f4-8b45-33107d8a2372' class='xr-section-summary' >Data variables: <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>analysed_sst</span></div><div class='xr-var-dims'>(time, lat, lon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(15340, 21, 31), meta=np.ndarray&gt;</div><input id='attrs-6da617f3-448b-4d36-8420-bbe2b5c34c65' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-6da617f3-448b-4d36-8420-bbe2b5c34c65' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ab8b3dca-dd76-4b52-bafb-4b792c089cad' class='xr-var-data-in' type='checkbox'><label for='data-ab8b3dca-dd76-4b52-bafb-4b792c089cad' 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>analysed sea surface temperature</dd><dt><span>standard_name :</span></dt><dd>sea_surface_foundation_temperature</dd><dt><span>units :</span></dt><dd>kelvin</dd><dt><span>valid_min :</span></dt><dd>-300</dd><dt><span>valid_max :</span></dt><dd>4500</dd><dt><span>source :</span></dt><dd>AMSR2-REMSS-L2P-v2.0, AMSRE-REMSS-L2P-v2.0, TMI-REMSS-L2P-v04, GOES&lt;13,16&gt;-OSISAF-L3C-v2.0, SEVIRI-OSISAF-L3C-v2.0, SLSTR&lt;A,B&gt;-C3S-L3C-v2.0, ATSR&lt;1,2&gt;-ESACCI-L3U-v2.0, AATSR-ESACCI-L3U-v2.0, AVHRR&lt;06,07,08,09,10,11,12,14,15,16,17,18,19&gt;-ESACCI-L3U-v2.0, AVHRRMT&lt;A,B&gt;-ESACCI-L3U-v2.0, GMI-REMSS-L3U-v2.0, VIIRS&lt;NPP,N20&gt;-OSPO-L3U-v2.0</dd><dt><span>reference :</span></dt><dd>C.J. Donlon, M. Martin,J.D. Stark, J. Roberts-Jones, E. Fiedler, W. Wimmer. The operational sea surface temperature and sea ice analysis (OSTIA) system. Remote Sensing Environ., 116 (2012), pp. 140-158 http://dx.doi.org/10.1016/j.rse.2010.10.017</dd><dt><span>comment :</span></dt><dd> OSTIA foundation SST</dd><dt><span>_ChunkSizes :</span></dt><dd>[ 1 1200 2400]</dd></dl></div><div class='xr-var-data'><table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 38.09 MiB </td>\n",
" <td> 38.09 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (15340, 21, 31) </td>\n",
" <td> (15340, 21, 31) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 1 chunks in 17 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> float32 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.41261651458248\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
" <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >31</text>\n",
" <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">21</text>\n",
" <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">15340</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>analysis_error</span></div><div class='xr-var-dims'>(time, lat, lon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(15340, 21, 31), meta=np.ndarray&gt;</div><input id='attrs-db451634-eec8-44b0-bad4-23448973d0f0' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-db451634-eec8-44b0-bad4-23448973d0f0' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-aef83b38-69fb-4138-ab00-91a262517c6f' class='xr-var-data-in' type='checkbox'><label for='data-aef83b38-69fb-4138-ab00-91a262517c6f' 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>estimated error standard deviation of analysed_sst</dd><dt><span>standard_name :</span></dt><dd>sea_surface_foundation_temperature standard_error</dd><dt><span>units :</span></dt><dd>kelvin</dd><dt><span>comment :</span></dt><dd> OSTIA foundation SST analysis standard deviation error</dd><dt><span>_ChunkSizes :</span></dt><dd>[ 1 1200 2400]</dd></dl></div><div class='xr-var-data'><table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 38.09 MiB </td>\n",
" <td> 38.09 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (15340, 21, 31) </td>\n",
" <td> (15340, 21, 31) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 1 chunks in 14 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> float32 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.41261651458248\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
" <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >31</text>\n",
" <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">21</text>\n",
" <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">15340</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>sea_ice_fraction</span></div><div class='xr-var-dims'>(time, lat, lon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(15340, 21, 31), meta=np.ndarray&gt;</div><input id='attrs-a36056e7-fea9-414a-bb54-7fb9e8987dc5' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-a36056e7-fea9-414a-bb54-7fb9e8987dc5' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-9c3af363-0514-41e4-8f73-e3814efa01ef' class='xr-var-data-in' type='checkbox'><label for='data-9c3af363-0514-41e4-8f73-e3814efa01ef' 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>sea ice area fraction</dd><dt><span>standard_name :</span></dt><dd>sea_ice_area_fraction</dd><dt><span>units :</span></dt><dd>1</dd><dt><span>source :</span></dt><dd>EUMETSAT OSI-SAF</dd><dt><span>comment :</span></dt><dd> Sea ice area fraction</dd><dt><span>_ChunkSizes :</span></dt><dd>[ 1 1800 3600]</dd></dl></div><div class='xr-var-data'><table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 38.09 MiB </td>\n",
" <td> 38.09 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (15340, 21, 31) </td>\n",
" <td> (15340, 21, 31) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 1 chunks in 14 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> float32 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.41261651458248\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
" <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >31</text>\n",
" <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">21</text>\n",
" <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">15340</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>mask</span></div><div class='xr-var-dims'>(time, lat, lon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(15340, 21, 31), meta=np.ndarray&gt;</div><input id='attrs-0981d495-a71e-4d24-8d80-8fd1857c4427' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-0981d495-a71e-4d24-8d80-8fd1857c4427' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6f89be79-9b44-4a78-9fde-dedf6608637b' class='xr-var-data-in' type='checkbox'><label for='data-6f89be79-9b44-4a78-9fde-dedf6608637b' 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>land sea ice lake bit mask</dd><dt><span>flag_masks :</span></dt><dd>[ 1 2 4 8 16]</dd><dt><span>flag_meanings :</span></dt><dd>water land optional_lake_surface sea_ice optional_river_surface</dd><dt><span>source :</span></dt><dd>NAVOCEANO_landmask_v1.0 EUMETSAT_OSI-SAF_icemask ARCLake_lakemask</dd><dt><span>comment :</span></dt><dd> Land/ open ocean/ sea ice /lake mask</dd><dt><span>_ChunkSizes :</span></dt><dd>[ 1 1800 3600]</dd></dl></div><div class='xr-var-data'><table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 38.09 MiB </td>\n",
" <td> 38.09 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (15340, 21, 31) </td>\n",
" <td> (15340, 21, 31) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 1 chunks in 14 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> float32 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"156\" height=\"146\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"25\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,96.00085180870013 10.0,25.41261651458248\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"35\" y1=\"0\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 35.41261651458248,0.0 106.00085180870013,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"80\" y1=\"70\" x2=\"106\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"96\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"96\" style=\"stroke-width:2\" />\n",
" <line x1=\"106\" y1=\"70\" x2=\"106\" y2=\"96\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"80.58823529411765,70.58823529411765 106.00085180870013,70.58823529411765 106.00085180870013,96.00085180870013 80.58823529411765,96.00085180870013\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"93.294544\" y=\"116.000852\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >31</text>\n",
" <text x=\"126.000852\" y=\"83.294544\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.000852,83.294544)\">21</text>\n",
" <text x=\"35.294118\" y=\"80.706734\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,80.706734)\">15340</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table></div></li></ul></div></li><li class='xr-section-item'><input id='section-7321a54e-127c-4ecc-9cbe-1cdaed07c6f8' class='xr-section-summary-in' type='checkbox' ><label for='section-7321a54e-127c-4ecc-9cbe-1cdaed07c6f8' 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>time</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-a7a7431a-ad9a-4532-8e8f-7953ca883a80' class='xr-index-data-in' type='checkbox'/><label for='index-a7a7431a-ad9a-4532-8e8f-7953ca883a80' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(DatetimeIndex([&#x27;1982-01-01 12:00:00&#x27;, &#x27;1982-01-02 12:00:00&#x27;,\n",
" &#x27;1982-01-03 12:00:00&#x27;, &#x27;1982-01-04 12:00:00&#x27;,\n",
" &#x27;1982-01-05 12:00:00&#x27;, &#x27;1982-01-06 12:00:00&#x27;,\n",
" &#x27;1982-01-07 12:00:00&#x27;, &#x27;1982-01-08 12:00:00&#x27;,\n",
" &#x27;1982-01-09 12:00:00&#x27;, &#x27;1982-01-10 12:00:00&#x27;,\n",
" ...\n",
" &#x27;2023-12-22 12:00:00&#x27;, &#x27;2023-12-23 12:00:00&#x27;,\n",
" &#x27;2023-12-24 12:00:00&#x27;, &#x27;2023-12-25 12:00:00&#x27;,\n",
" &#x27;2023-12-26 12:00:00&#x27;, &#x27;2023-12-27 12:00:00&#x27;,\n",
" &#x27;2023-12-28 12:00:00&#x27;, &#x27;2023-12-29 12:00:00&#x27;,\n",
" &#x27;2023-12-30 12:00:00&#x27;, &#x27;2023-12-31 12:00:00&#x27;],\n",
" dtype=&#x27;datetime64[ns]&#x27;, name=&#x27;time&#x27;, length=15340, freq=&#x27;D&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>lat</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-016604b5-6881-4ba3-ad1a-442a2b84c822' class='xr-index-data-in' type='checkbox'/><label for='index-016604b5-6881-4ba3-ad1a-442a2b84c822' 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(Float64Index([-9.024999618530273, -8.975000381469727, -8.925000190734863,\n",
" -8.875, -8.824999809265137, -8.774999618530273,\n",
" -8.725000381469727, -8.675000190734863, -8.625,\n",
" -8.574999809265137, -8.524999618530273, -8.475000381469727,\n",
" -8.425000190734863, -8.375, -8.324999809265137,\n",
" -8.274999618530273, -8.225000381469727, -8.175000190734863,\n",
" -8.125, -8.074999809265137, -8.024999618530273],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;lat&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>lon</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-cfbba7ce-8e51-4c40-99d9-8153719ab201' class='xr-index-data-in' type='checkbox'/><label for='index-cfbba7ce-8e51-4c40-99d9-8153719ab201' 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(Float64Index([ 114.9749984741211, 115.0250015258789, 115.07499694824219,\n",
" 115.125, 115.17500305175781, 115.2249984741211,\n",
" 115.2750015258789, 115.32499694824219, 115.375,\n",
" 115.42500305175781, 115.4749984741211, 115.5250015258789,\n",
" 115.57499694824219, 115.625, 115.67500305175781,\n",
" 115.7249984741211, 115.7750015258789, 115.82499694824219,\n",
" 115.875, 115.92500305175781, 115.9749984741211,\n",
" 116.0250015258789, 116.07499694824219, 116.125,\n",
" 116.17500305175781, 116.2249984741211, 116.2750015258789,\n",
" 116.32499694824219, 116.375, 116.42500305175781,\n",
" 116.4749984741211],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;lon&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-539de8c3-8a8b-4a22-8675-bc60013e08bf' class='xr-section-summary-in' type='checkbox' ><label for='section-539de8c3-8a8b-4a22-8675-bc60013e08bf' class='xr-section-summary' >Attributes: <span>(52)</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.4, ACDD-1.3</dd><dt><span>title :</span></dt><dd>Global SST &amp; Sea Ice Analysis, L4 OSTIA, 0.05 deg daily (METOFFICE-GLO-SST-L4-REP-OBS-SST-V2)</dd><dt><span>summary :</span></dt><dd>A merged, multi-sensor L4 Foundation SST product</dd><dt><span>references :</span></dt><dd>Donlon, C.J., Martin, M., Stark, J.D., Roberts-Jones, J., Fiedler, E., Wimmer, W., 2011. The Operational Sea Surface Temperature and Sea Ice Analysis (OSTIA). Remote Sensing of the Environment</dd><dt><span>institution :</span></dt><dd>UKMO</dd><dt><span>history :</span></dt><dd>Created from sst.nc; obs_anal.nc; seaice.nc</dd><dt><span>comment :</span></dt><dd>WARNING Some applications are unable to properly handle signed byte values. If values are encountered &gt; 127, please subtract 256 from this reported value</dd><dt><span>license :</span></dt><dd>These data are available free of charge under the CMEMS data policy</dd><dt><span>id :</span></dt><dd>OSTIA-UKMO-L4-GLOB-v2.0</dd><dt><span>naming_authority :</span></dt><dd>org.ghrsst</dd><dt><span>product_version :</span></dt><dd>3.2</dd><dt><span>uuid :</span></dt><dd>a2df4a18-6f19-4772-9532-39307a0e2794</dd><dt><span>gds_version_id :</span></dt><dd>2.4</dd><dt><span>netcdf_version_id :</span></dt><dd>4.1</dd><dt><span>date_created :</span></dt><dd>20221012T085721Z</dd><dt><span>start_time :</span></dt><dd>20220531T000000Z</dd><dt><span>time_coverage_start :</span></dt><dd>20220531T000000Z</dd><dt><span>stop_time :</span></dt><dd>20220601T000000Z</dd><dt><span>time_coverage_end :</span></dt><dd>20220601T000000Z</dd><dt><span>file_quality_level :</span></dt><dd>3</dd><dt><span>source :</span></dt><dd>AMSR2-REMSS-L2P-v2.0, AMSRE-REMSS-L2P-v2.0, TMI-REMSS-L2P-v04, GOES&lt;13,16&gt;-OSISAF-L3C-v2.0, SEVIRI-OSISAF-L3C-v2.0, SLSTR&lt;A,B&gt;-C3S-L3C-v2.0, ATSR&lt;1,2&gt;-ESACCI-L3U-v2.0, AATSR-ESACCI-L3U-v2.0, AVHRR&lt;06,07,08,09,10,11,12,14,15,16,17,18,19&gt;-ESACCI-L3U-v2.0, AVHRRMT&lt;A,B&gt;-ESACCI-L3U-v2.0, GMI-REMSS-L3U-v2.0, VIIRS-OSPO-L3U-v2.0, OSISAF_ICE, NCEP_ICE</dd><dt><span>platform :</span></dt><dd>GCOM-W, AQUA, TRMM, GOES&lt;13,16&gt;, MetoSat&lt;08,09,10,11&gt;, Sentinel-&lt;3a,3b&gt;, ERS&lt;1,2&gt;, NOAA-&lt;06,07,08,09,10,11,12,14,15,16,17,18,19&gt;, MetOp&lt;A,B&gt;, GPM-Core, Suomi-NPP, NOAA-20</dd><dt><span>sensor :</span></dt><dd>AMSR2, AMSRE, TMI, GOES&lt;13,16&gt;, SEVIRI, SLSTR&lt;A,B&gt;, ATSR1, ATSR2, AATSR, AVHRR&lt;06,07,08,09,10,11,12,14,15,16,17,18,19&gt;, AVHRRMT&lt;A,B&gt;, GMI, VIIRS&lt;NPP,N20&gt;</dd><dt><span>Metadata_Conventions :</span></dt><dd>Unidata Observation Dataset v1.0</dd><dt><span>metadata_link :</span></dt><dd>http://podaac.jpl.nasa.gov/ws/metadata/dataset?format=gcmd&amp;shortName=UKMO-L4HRfnd-GLOB-OSTIA</dd><dt><span>keywords :</span></dt><dd>Oceans &gt; Ocean Temperature &gt; Sea Surface Temperature</dd><dt><span>keywords_vocabulary :</span></dt><dd>NASA Global Change Master Directory (GCMD) Science Keywords</dd><dt><span>standard_name_vocabulary :</span></dt><dd>NetCDF Climate and Forecast (CF) Metadata Convention</dd><dt><span>westernmost_longitude :</span></dt><dd>-180.0</dd><dt><span>easternmost_longitude :</span></dt><dd>180.00002</dd><dt><span>southernmost_latitude :</span></dt><dd>-90.0</dd><dt><span>northernmost_latitude :</span></dt><dd>90.0</dd><dt><span>spatial_resolution :</span></dt><dd>0.05 degree</dd><dt><span>geospatial_lat_units :</span></dt><dd>degrees_north</dd><dt><span>geospatial_lat_resolution :</span></dt><dd>0.05</dd><dt><span>geospatial_lon_units :</span></dt><dd>degrees_east</dd><dt><span>geospatial_lon_resolution :</span></dt><dd>0.05</dd><dt><span>acknowledgment :</span></dt><dd>Please acknowledge the use of these data with the following statement: These data were provided by GHRSST, Met Office and CMEMS</dd><dt><span>creator_name :</span></dt><dd>Met Office as part of CMEMS</dd><dt><span>creator_email :</span></dt><dd>servicedesk.cmems@mercator-ocean.eu</dd><dt><span>creator_url :</span></dt><dd>http://marine.copernicus.eu</dd><dt><span>project :</span></dt><dd>Group for High Resolution Sea Surface Temperature</dd><dt><span>publisher_name :</span></dt><dd>GHRSST Project Office</dd><dt><span>publisher_url :</span></dt><dd>http://www.ghrsst.org</dd><dt><span>publisher_email :</span></dt><dd>ghrsst-po@nceo.ac.uk</dd><dt><span>processing_level :</span></dt><dd>L4</dd><dt><span>cdm_data_type :</span></dt><dd>grid</dd><dt><span>History :</span></dt><dd>Translated to CF-1.0 Conventions by Netcdf-Java CDM (CFGridWriter2)\n",
"Original Dataset = METOFFICE-GLO-SST-L4-REP-OBS-SST; Translation Date = 2023-11-30T11:37:11.962Z</dd><dt><span>geospatial_lat_min :</span></dt><dd>-9.024999618530273</dd><dt><span>geospatial_lat_max :</span></dt><dd>-8.024999618530273</dd><dt><span>geospatial_lon_min :</span></dt><dd>114.9749984741211</dd><dt><span>geospatial_lon_max :</span></dt><dd>116.4749984741211</dd></dl></div></li></ul></div></div>"
]
},
"metadata": {},
"execution_count": 6
}
]
},
{
"cell_type": "code",
"source": [
"# ekspor gabungan ke dalam format NetCDF di Google Drive\n",
"nc_gabung.to_netcdf('ostia2/nc_gabung.nc')"
],
"metadata": {
"id": "oigSkLhKigVZ"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# Mengubah nc_gabung ke format dataframe dan ekspor sebagai csv di Google Drive\n",
"df_gabung = nc_gabung.to_dataframe()\n",
"\n",
"df_gabung.to_csv('ostia2/export.csv', index=True)"
],
"metadata": {
"id": "zlsACHLAhXdD"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# check df data structure\n",
"df_gabung.head()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 238
},
"id": "Gp0dDitJkkcT",
"outputId": "9a9d44f1-72e9-4e3b-cbe5-7332c20367ae"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" analysed_sst analysis_error \\\n",
"time lat lon \n",
"1982-01-01 12:00:00 -9.025 114.974998 301.759979 NaN \n",
" 115.025002 301.750000 NaN \n",
" 115.074997 301.729980 NaN \n",
" 115.125000 301.709991 NaN \n",
" 115.175003 301.690002 NaN \n",
"\n",
" sea_ice_fraction mask \n",
"time lat lon \n",
"1982-01-01 12:00:00 -9.025 114.974998 NaN NaN \n",
" 115.025002 NaN NaN \n",
" 115.074997 NaN NaN \n",
" 115.125000 NaN NaN \n",
" 115.175003 NaN NaN "
],
"text/html": [
"\n",
" <div id=\"df-eea83e16-706c-480c-a8ae-bd32ef894176\" class=\"colab-df-container\">\n",
" <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></th>\n",
" <th></th>\n",
" <th>analysed_sst</th>\n",
" <th>analysis_error</th>\n",
" <th>sea_ice_fraction</th>\n",
" <th>mask</th>\n",
" </tr>\n",
" <tr>\n",
" <th>time</th>\n",
" <th>lat</th>\n",
" <th>lon</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th rowspan=\"5\" valign=\"top\">1982-01-01 12:00:00</th>\n",
" <th rowspan=\"5\" valign=\"top\">-9.025</th>\n",
" <th>114.974998</th>\n",
" <td>301.759979</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>115.025002</th>\n",
" <td>301.750000</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>115.074997</th>\n",
" <td>301.729980</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>115.125000</th>\n",
" <td>301.709991</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>115.175003</th>\n",
" <td>301.690002</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-eea83e16-706c-480c-a8ae-bd32ef894176')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-eea83e16-706c-480c-a8ae-bd32ef894176 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-eea83e16-706c-480c-a8ae-bd32ef894176');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-0473e752-b723-4862-aea8-a276164a6df1\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-0473e752-b723-4862-aea8-a276164a6df1')\"\n",
" title=\"Suggest charts\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-0473e752-b723-4862-aea8-a276164a6df1 button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 9
}
]
},
{
"cell_type": "code",
"source": [
"import pandas as pd\n",
"# Execute pip install xarray first\n",
"import xarray\n",
"\n",
"# Example dataframe\n",
"#diz = {\n",
"# 'Country':['DE','DE','DE'],\n",
"# 'Latitude':[511.622,511.622,511.622],\n",
"# 'Longitude':[149.506,149.506,149.506]\n",
"#}\n",
"\n",
"df = pd.read_csv('withseast3.csv')\n",
"\n",
"\n",
"#df = pd.DataFrame(diz)\n",
"\n",
"# Create xray Dataset from Pandas DataFrame\n",
"#xr = xarray.Dataset.from_dataframe(df)\n",
"\n",
"# Save to netCDF\n",
"#xr.to_netcdf('test.nc')"
],
"metadata": {
"id": "_yl92ylvBc5l"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"df"
],
"metadata": {
"id": "mr_rPtrJBwsL",
"outputId": "142f9062-f905-4f5e-a445-38087f8f970d",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 424
}
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" time lat lon temp seas thresh\n",
"0 1982-01-01 -8.025 114.975 28.989984 29.3538 30.0176\n",
"1 1982-01-02 -8.025 114.975 28.959985 29.3361 30.0057\n",
"2 1982-01-03 -8.025 114.975 28.939996 29.3177 29.9927\n",
"3 1982-01-04 -8.025 114.975 28.999994 29.2992 29.9781\n",
"4 1982-01-05 -8.025 114.975 29.010004 29.2812 29.9663\n",
"... ... ... ... ... ... ...\n",
"9986335 2023-12-27 -9.025 116.475 NaN 28.9167 29.2871\n",
"9986336 2023-12-28 -9.025 116.475 NaN 28.9150 29.2832\n",
"9986337 2023-12-29 -9.025 116.475 NaN 28.9134 29.2793\n",
"9986338 2023-12-30 -9.025 116.475 NaN 28.9118 29.2758\n",
"9986339 2023-12-31 -9.025 116.475 NaN 28.9103 29.2735\n",
"\n",
"[9986340 rows x 6 columns]"
],
"text/html": [
"\n",
" <div id=\"df-5616f8b5-36ad-472c-ad2d-dcd59beaa2ed\" class=\"colab-df-container\">\n",
" <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>time</th>\n",
" <th>lat</th>\n",
" <th>lon</th>\n",
" <th>temp</th>\n",
" <th>seas</th>\n",
" <th>thresh</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1982-01-01</td>\n",
" <td>-8.025</td>\n",
" <td>114.975</td>\n",
" <td>28.989984</td>\n",
" <td>29.3538</td>\n",
" <td>30.0176</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1982-01-02</td>\n",
" <td>-8.025</td>\n",
" <td>114.975</td>\n",
" <td>28.959985</td>\n",
" <td>29.3361</td>\n",
" <td>30.0057</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1982-01-03</td>\n",
" <td>-8.025</td>\n",
" <td>114.975</td>\n",
" <td>28.939996</td>\n",
" <td>29.3177</td>\n",
" <td>29.9927</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>1982-01-04</td>\n",
" <td>-8.025</td>\n",
" <td>114.975</td>\n",
" <td>28.999994</td>\n",
" <td>29.2992</td>\n",
" <td>29.9781</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1982-01-05</td>\n",
" <td>-8.025</td>\n",
" <td>114.975</td>\n",
" <td>29.010004</td>\n",
" <td>29.2812</td>\n",
" <td>29.9663</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9986335</th>\n",
" <td>2023-12-27</td>\n",
" <td>-9.025</td>\n",
" <td>116.475</td>\n",
" <td>NaN</td>\n",
" <td>28.9167</td>\n",
" <td>29.2871</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9986336</th>\n",
" <td>2023-12-28</td>\n",
" <td>-9.025</td>\n",
" <td>116.475</td>\n",
" <td>NaN</td>\n",
" <td>28.9150</td>\n",
" <td>29.2832</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9986337</th>\n",
" <td>2023-12-29</td>\n",
" <td>-9.025</td>\n",
" <td>116.475</td>\n",
" <td>NaN</td>\n",
" <td>28.9134</td>\n",
" <td>29.2793</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9986338</th>\n",
" <td>2023-12-30</td>\n",
" <td>-9.025</td>\n",
" <td>116.475</td>\n",
" <td>NaN</td>\n",
" <td>28.9118</td>\n",
" <td>29.2758</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9986339</th>\n",
" <td>2023-12-31</td>\n",
" <td>-9.025</td>\n",
" <td>116.475</td>\n",
" <td>NaN</td>\n",
" <td>28.9103</td>\n",
" <td>29.2735</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>9986340 rows × 6 columns</p>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-5616f8b5-36ad-472c-ad2d-dcd59beaa2ed')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-5616f8b5-36ad-472c-ad2d-dcd59beaa2ed button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-5616f8b5-36ad-472c-ad2d-dcd59beaa2ed');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-beb8b4af-7f89-4bcd-b1ee-5f207023f16c\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-beb8b4af-7f89-4bcd-b1ee-5f207023f16c')\"\n",
" title=\"Suggest charts\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-beb8b4af-7f89-4bcd-b1ee-5f207023f16c button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "dataframe",
"variable_name": "df"
}
},
"metadata": {},
"execution_count": 30
}
]
},
{
"cell_type": "code",
"source": [
"# reorder column based on name\n",
"#df = df[['mean', 4,3,2,1]]"
],
"metadata": {
"id": "IxMk4gMbZDBm"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"df['time'] = pd.to_datetime(df['time'])\n",
"print(df)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "quAvmoGtMRI0",
"outputId": "4a57a7f5-ada4-40aa-ad85-a0b0890e1b79"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
" time lat lon temp seas thresh\n",
"0 1982-01-01 -8.025 114.975 28.989984 29.3538 30.0176\n",
"1 1982-01-02 -8.025 114.975 28.959985 29.3361 30.0057\n",
"2 1982-01-03 -8.025 114.975 28.939996 29.3177 29.9927\n",
"3 1982-01-04 -8.025 114.975 28.999994 29.2992 29.9781\n",
"4 1982-01-05 -8.025 114.975 29.010004 29.2812 29.9663\n",
"... ... ... ... ... ... ...\n",
"9986335 2023-12-27 -9.025 116.475 NaN 28.9167 29.2871\n",
"9986336 2023-12-28 -9.025 116.475 NaN 28.9150 29.2832\n",
"9986337 2023-12-29 -9.025 116.475 NaN 28.9134 29.2793\n",
"9986338 2023-12-30 -9.025 116.475 NaN 28.9118 29.2758\n",
"9986339 2023-12-31 -9.025 116.475 NaN 28.9103 29.2735\n",
"\n",
"[9986340 rows x 6 columns]\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"dt = df.set_index(['time', 'lat', 'lon']) #.to_xarray()\n",
"dt = dt.drop(['seas', 'thresh'], axis=1)\n",
"dt"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 455
},
"id": "7gLcOH6yLgOQ",
"outputId": "a1de0fb9-6b3a-40aa-af3f-b7052eea38f7"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" temp\n",
"time lat lon \n",
"1982-01-01 -8.025 114.975 28.989984\n",
"1982-01-02 -8.025 114.975 28.959985\n",
"1982-01-03 -8.025 114.975 28.939996\n",
"1982-01-04 -8.025 114.975 28.999994\n",
"1982-01-05 -8.025 114.975 29.010004\n",
"... ...\n",
"2023-12-27 -9.025 116.475 NaN\n",
"2023-12-28 -9.025 116.475 NaN\n",
"2023-12-29 -9.025 116.475 NaN\n",
"2023-12-30 -9.025 116.475 NaN\n",
"2023-12-31 -9.025 116.475 NaN\n",
"\n",
"[9986340 rows x 1 columns]"
],
"text/html": [
"\n",
" <div id=\"df-c9f52f5d-ef7b-445e-819d-41c0d7143222\" class=\"colab-df-container\">\n",
" <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></th>\n",
" <th></th>\n",
" <th>temp</th>\n",
" </tr>\n",
" <tr>\n",
" <th>time</th>\n",
" <th>lat</th>\n",
" <th>lon</th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1982-01-01</th>\n",
" <th>-8.025</th>\n",
" <th>114.975</th>\n",
" <td>28.989984</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1982-01-02</th>\n",
" <th>-8.025</th>\n",
" <th>114.975</th>\n",
" <td>28.959985</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1982-01-03</th>\n",
" <th>-8.025</th>\n",
" <th>114.975</th>\n",
" <td>28.939996</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1982-01-04</th>\n",
" <th>-8.025</th>\n",
" <th>114.975</th>\n",
" <td>28.999994</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1982-01-05</th>\n",
" <th>-8.025</th>\n",
" <th>114.975</th>\n",
" <td>29.010004</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-12-27</th>\n",
" <th>-9.025</th>\n",
" <th>116.475</th>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-12-28</th>\n",
" <th>-9.025</th>\n",
" <th>116.475</th>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-12-29</th>\n",
" <th>-9.025</th>\n",
" <th>116.475</th>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-12-30</th>\n",
" <th>-9.025</th>\n",
" <th>116.475</th>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-12-31</th>\n",
" <th>-9.025</th>\n",
" <th>116.475</th>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>9986340 rows × 1 columns</p>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-c9f52f5d-ef7b-445e-819d-41c0d7143222')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-c9f52f5d-ef7b-445e-819d-41c0d7143222 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-c9f52f5d-ef7b-445e-819d-41c0d7143222');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-cbc04822-1b3f-4ebf-bf5c-f7ca0e339954\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-cbc04822-1b3f-4ebf-bf5c-f7ca0e339954')\"\n",
" title=\"Suggest charts\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-cbc04822-1b3f-4ebf-bf5c-f7ca0e339954 button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "dataframe",
"variable_name": "dt"
}
},
"metadata": {},
"execution_count": 32
}
]
},
{
"cell_type": "code",
"source": [
"# Create xray Dataset from Pandas DataFrame\n",
"xr = xarray.Dataset.from_dataframe(dt)\n",
"xr"
],
"metadata": {
"id": "aKc7KCXDB0AK",
"outputId": "04f14fca-ec19-4328-baf1-ca17b51028ef",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 270
}
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: (time: 15340, lat: 21, lon: 31)\n",
"Coordinates:\n",
" * time (time) datetime64[ns] 1982-01-01 1982-01-02 ... 2023-12-31\n",
" * lat (lat) float64 -9.025 -8.975 -8.925 -8.875 ... -8.125 -8.075 -8.025\n",
" * lon (lon) float64 115.0 115.0 115.1 115.1 ... 116.3 116.4 116.4 116.5\n",
"Data variables:\n",
" temp (time, lat, lon) float64 28.61 28.6 28.58 ... 30.86 30.89 30.95"
],
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
"html[theme=dark],\n",
"body[data-theme=dark],\n",
"body.vscode-dark {\n",
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
" --xr-border-color: #1F1F1F;\n",
" --xr-disabled-color: #515151;\n",
" --xr-background-color: #111111;\n",
" --xr-background-color-row-even: #111111;\n",
" --xr-background-color-row-odd: #313131;\n",
"}\n",
"\n",
".xr-wrap {\n",
" display: block !important;\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-text-repr-fallback {\n",
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
" display: none;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-index-preview {\n",
" grid-column: 2 / 5;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data,\n",
".xr-index-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data,\n",
".xr-index-data-in:checked ~ .xr-index-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-index-name div,\n",
".xr-index-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data,\n",
".xr-index-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt,\n",
".xr-attrs dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2,\n",
".xr-no-icon {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt;\n",
"Dimensions: (time: 15340, lat: 21, lon: 31)\n",
"Coordinates:\n",
" * time (time) datetime64[ns] 1982-01-01 1982-01-02 ... 2023-12-31\n",
" * lat (lat) float64 -9.025 -8.975 -8.925 -8.875 ... -8.125 -8.075 -8.025\n",
" * lon (lon) float64 115.0 115.0 115.1 115.1 ... 116.3 116.4 116.4 116.5\n",
"Data variables:\n",
" temp (time, lat, lon) float64 28.61 28.6 28.58 ... 30.86 30.89 30.95</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-c9b5b52a-3f37-4ef6-8c02-77a0fcce5cc7' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-c9b5b52a-3f37-4ef6-8c02-77a0fcce5cc7' 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'>time</span>: 15340</li><li><span class='xr-has-index'>lat</span>: 21</li><li><span class='xr-has-index'>lon</span>: 31</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-4434878a-5404-494b-90ae-530fc76a9534' class='xr-section-summary-in' type='checkbox' checked><label for='section-4434878a-5404-494b-90ae-530fc76a9534' 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'>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'>1982-01-01 ... 2023-12-31</div><input id='attrs-3b232df4-2a11-4e1c-8a2a-3b5e9e19eb06' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-3b232df4-2a11-4e1c-8a2a-3b5e9e19eb06' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-dda30ae7-be63-4ffb-92a4-6299f0880615' class='xr-var-data-in' type='checkbox'><label for='data-dda30ae7-be63-4ffb-92a4-6299f0880615' 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;1982-01-01T00:00:00.000000000&#x27;, &#x27;1982-01-02T00:00:00.000000000&#x27;,\n",
" &#x27;1982-01-03T00:00:00.000000000&#x27;, ..., &#x27;2023-12-29T00:00:00.000000000&#x27;,\n",
" &#x27;2023-12-30T00:00:00.000000000&#x27;, &#x27;2023-12-31T00:00:00.000000000&#x27;],\n",
" dtype=&#x27;datetime64[ns]&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>lat</span></div><div class='xr-var-dims'>(lat)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>-9.025 -8.975 ... -8.075 -8.025</div><input id='attrs-b58e24fd-d7ee-4546-9c6f-02d060283367' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-b58e24fd-d7ee-4546-9c6f-02d060283367' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-2cc31ff2-4d38-4f4f-b3fd-de360231f088' class='xr-var-data-in' type='checkbox'><label for='data-2cc31ff2-4d38-4f4f-b3fd-de360231f088' 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([-9.025, -8.975, -8.925, -8.875, -8.825, -8.775, -8.725, -8.675, -8.625,\n",
" -8.575, -8.525, -8.475, -8.425, -8.375, -8.325, -8.275, -8.225, -8.175,\n",
" -8.125, -8.075, -8.025])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>lon</span></div><div class='xr-var-dims'>(lon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>115.0 115.0 115.1 ... 116.4 116.5</div><input id='attrs-da200479-f89f-4857-bc2c-c3ae857a3ffa' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-da200479-f89f-4857-bc2c-c3ae857a3ffa' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3ae6a0c9-d614-4714-a650-2c0872c10164' class='xr-var-data-in' type='checkbox'><label for='data-3ae6a0c9-d614-4714-a650-2c0872c10164' 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([114.975, 115.025, 115.075, 115.125, 115.175, 115.225, 115.275, 115.325,\n",
" 115.375, 115.425, 115.475, 115.525, 115.575, 115.625, 115.675, 115.725,\n",
" 115.775, 115.825, 115.875, 115.925, 115.975, 116.025, 116.075, 116.125,\n",
" 116.175, 116.225, 116.275, 116.325, 116.375, 116.425, 116.475])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-3377e208-ed2c-40f0-bb02-2b547011a0ce' class='xr-section-summary-in' type='checkbox' checked><label for='section-3377e208-ed2c-40f0-bb02-2b547011a0ce' 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>temp</span></div><div class='xr-var-dims'>(time, lat, lon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>28.61 28.6 28.58 ... 30.89 30.95</div><input id='attrs-043e9b8c-77b7-4935-a5e0-3e145eef5e96' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-043e9b8c-77b7-4935-a5e0-3e145eef5e96' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-894f7d38-eedf-4c06-aa7b-c7dad8905b54' class='xr-var-data-in' type='checkbox'><label for='data-894f7d38-eedf-4c06-aa7b-c7dad8905b54' 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([[[28.60997925, 28.6 , 28.57998047, ..., 28.67998657,\n",
" 28.7000061 , 28.71999512],\n",
" [28.63997803, 28.61998901, 28.6 , ..., 28.67000732,\n",
" 28.67998657, 28.68999634],\n",
" [28.67000732, 28.64998779, 28.62999878, ..., 28.64998779,\n",
" 28.65999756, 28.67000732],\n",
" ...,\n",
" [28.98998413, 28.98000488, 28.98000488, ..., 28.4999939 ,\n",
" 28.52999268, 28.54998169],\n",
" [28.98998413, 28.98000488, 28.98000488, ..., 28.4999939 ,\n",
" 28.51998291, 28.54998169],\n",
" [28.98998413, 28.98000488, 28.98000488, ..., 28.48998413,\n",
" 28.51000366, 28.54000244]],\n",
"\n",
" [[28.60997925, 28.6 , 28.57998047, ..., 28.7000061 ,\n",
" 28.71999512, 28.73998413],\n",
" [28.63997803, 28.61998901, 28.60997925, ..., 28.67998657,\n",
" 28.7000061 , 28.70998535],\n",
" [28.65999756, 28.64998779, 28.62999878, ..., 28.67000732,\n",
" 28.67998657, 28.68999634],\n",
"...\n",
" [30.39998779, 30.27999268, 30.17998657, ..., 31.01000366,\n",
" 31.07000122, 31.23998413],\n",
" [30.4999939 , 30.40999756, 30.35 , ..., 31.32998047,\n",
" 31.42000732, 31.55999146],\n",
" [30.54998169, 30.4999939 , 30.45998535, ..., 31.54998169,\n",
" 31.63997803, 31.73000488]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [29.23998413, 29.17998657, 29.12999878, ..., 29.80999146,\n",
" 29.82998047, 29.67000732],\n",
" [29.15999756, 29.1 , 29.04998169, ..., 29.86998901,\n",
" 29.89998779, 29.7000061 ],\n",
" ...,\n",
" [30.30999146, 30.20998535, 30.12999878, ..., 30.42000732,\n",
" 30.43999634, 30.55999146],\n",
" [30.42998657, 30.36998901, 30.30999146, ..., 30.67000732,\n",
" 30.7000061 , 30.79000244],\n",
" [30.54000244, 30.48998413, 30.45998535, ..., 30.85997925,\n",
" 30.88997803, 30.9500061 ]]])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-390a5854-45bc-4ecf-8df7-7029bccae1a7' class='xr-section-summary-in' type='checkbox' ><label for='section-390a5854-45bc-4ecf-8df7-7029bccae1a7' 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>time</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-3451f819-51ea-402a-a4bd-4719ff41e28f' class='xr-index-data-in' type='checkbox'/><label for='index-3451f819-51ea-402a-a4bd-4719ff41e28f' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(DatetimeIndex([&#x27;1982-01-01&#x27;, &#x27;1982-01-02&#x27;, &#x27;1982-01-03&#x27;, &#x27;1982-01-04&#x27;,\n",
" &#x27;1982-01-05&#x27;, &#x27;1982-01-06&#x27;, &#x27;1982-01-07&#x27;, &#x27;1982-01-08&#x27;,\n",
" &#x27;1982-01-09&#x27;, &#x27;1982-01-10&#x27;,\n",
" ...\n",
" &#x27;2023-12-22&#x27;, &#x27;2023-12-23&#x27;, &#x27;2023-12-24&#x27;, &#x27;2023-12-25&#x27;,\n",
" &#x27;2023-12-26&#x27;, &#x27;2023-12-27&#x27;, &#x27;2023-12-28&#x27;, &#x27;2023-12-29&#x27;,\n",
" &#x27;2023-12-30&#x27;, &#x27;2023-12-31&#x27;],\n",
" dtype=&#x27;datetime64[ns]&#x27;, name=&#x27;time&#x27;, length=15340, freq=None))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>lat</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-71651548-8cca-4f4e-8503-68877a6405ba' class='xr-index-data-in' type='checkbox'/><label for='index-71651548-8cca-4f4e-8503-68877a6405ba' 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(Float64Index([-9.025, -8.975, -8.925, -8.875, -8.825, -8.775, -8.725, -8.675,\n",
" -8.625, -8.575, -8.525, -8.475, -8.425, -8.375, -8.325, -8.275,\n",
" -8.225, -8.175, -8.125, -8.075, -8.025],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;lat&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>lon</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-7a0bd149-91e0-4b1a-9230-cafa07c2f7dd' class='xr-index-data-in' type='checkbox'/><label for='index-7a0bd149-91e0-4b1a-9230-cafa07c2f7dd' 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(Float64Index([114.975, 115.025, 115.075, 115.125, 115.175, 115.225, 115.275,\n",
" 115.325, 115.375, 115.425, 115.475, 115.525, 115.575, 115.625,\n",
" 115.675, 115.725, 115.775, 115.825, 115.875, 115.925, 115.975,\n",
" 116.025, 116.075, 116.125, 116.175, 116.225, 116.275, 116.325,\n",
" 116.375, 116.425, 116.475],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;lon&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-fd01307a-a65d-4a5a-89c8-067dff0c4821' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-fd01307a-a65d-4a5a-89c8-067dff0c4821' 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>"
]
},
"metadata": {},
"execution_count": 33
}
]
},
{
"cell_type": "code",
"source": [
"# Save to netCDF\n",
"xr.to_netcdf('temp.nc')"
],
"metadata": {
"id": "qnZGcX1QbA6_"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"ds = df.set_index(['time', 'lat', 'lon']) #.to_xarray()\n",
"ds = ds.drop(['seas', 'temp'], axis=1)\n",
"ds"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 455
},
"id": "MJ5c5Y4rrkr3",
"outputId": "9cd784cf-9460-4fe7-fc66-b02cb7ac5866"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" thresh\n",
"time lat lon \n",
"1982-01-01 -8.025 114.975 30.0176\n",
"1982-01-02 -8.025 114.975 30.0057\n",
"1982-01-03 -8.025 114.975 29.9927\n",
"1982-01-04 -8.025 114.975 29.9781\n",
"1982-01-05 -8.025 114.975 29.9663\n",
"... ...\n",
"2023-12-27 -9.025 116.475 29.2871\n",
"2023-12-28 -9.025 116.475 29.2832\n",
"2023-12-29 -9.025 116.475 29.2793\n",
"2023-12-30 -9.025 116.475 29.2758\n",
"2023-12-31 -9.025 116.475 29.2735\n",
"\n",
"[9986340 rows x 1 columns]"
],
"text/html": [
"\n",
" <div id=\"df-ed884b22-07c7-4535-8c7b-afaa986ae531\" class=\"colab-df-container\">\n",
" <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></th>\n",
" <th></th>\n",
" <th>thresh</th>\n",
" </tr>\n",
" <tr>\n",
" <th>time</th>\n",
" <th>lat</th>\n",
" <th>lon</th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1982-01-01</th>\n",
" <th>-8.025</th>\n",
" <th>114.975</th>\n",
" <td>30.0176</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1982-01-02</th>\n",
" <th>-8.025</th>\n",
" <th>114.975</th>\n",
" <td>30.0057</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1982-01-03</th>\n",
" <th>-8.025</th>\n",
" <th>114.975</th>\n",
" <td>29.9927</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1982-01-04</th>\n",
" <th>-8.025</th>\n",
" <th>114.975</th>\n",
" <td>29.9781</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1982-01-05</th>\n",
" <th>-8.025</th>\n",
" <th>114.975</th>\n",
" <td>29.9663</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-12-27</th>\n",
" <th>-9.025</th>\n",
" <th>116.475</th>\n",
" <td>29.2871</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-12-28</th>\n",
" <th>-9.025</th>\n",
" <th>116.475</th>\n",
" <td>29.2832</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-12-29</th>\n",
" <th>-9.025</th>\n",
" <th>116.475</th>\n",
" <td>29.2793</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-12-30</th>\n",
" <th>-9.025</th>\n",
" <th>116.475</th>\n",
" <td>29.2758</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2023-12-31</th>\n",
" <th>-9.025</th>\n",
" <th>116.475</th>\n",
" <td>29.2735</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>9986340 rows × 1 columns</p>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-ed884b22-07c7-4535-8c7b-afaa986ae531')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-ed884b22-07c7-4535-8c7b-afaa986ae531 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-ed884b22-07c7-4535-8c7b-afaa986ae531');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-06bf7a35-d77e-4048-b029-74a60c21aed4\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-06bf7a35-d77e-4048-b029-74a60c21aed4')\"\n",
" title=\"Suggest charts\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-06bf7a35-d77e-4048-b029-74a60c21aed4 button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "dataframe",
"variable_name": "ds"
}
},
"metadata": {},
"execution_count": 35
}
]
},
{
"cell_type": "code",
"source": [
"xz = xarray.Dataset.from_dataframe(ds)\n",
"xz"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 270
},
"id": "0RkiJXm3rsxd",
"outputId": "237a9655-bbe1-402a-c526-c5b1ab07026f"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: (time: 15340, lat: 21, lon: 31)\n",
"Coordinates:\n",
" * time (time) datetime64[ns] 1982-01-01 1982-01-02 ... 2023-12-31\n",
" * lat (lat) float64 -9.025 -8.975 -8.925 -8.875 ... -8.125 -8.075 -8.025\n",
" * lon (lon) float64 115.0 115.0 115.1 115.1 ... 116.3 116.4 116.4 116.5\n",
"Data variables:\n",
" thresh (time, lat, lon) float64 29.35 29.36 29.38 ... 30.0 29.98 29.96"
],
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
"html[theme=dark],\n",
"body[data-theme=dark],\n",
"body.vscode-dark {\n",
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
" --xr-border-color: #1F1F1F;\n",
" --xr-disabled-color: #515151;\n",
" --xr-background-color: #111111;\n",
" --xr-background-color-row-even: #111111;\n",
" --xr-background-color-row-odd: #313131;\n",
"}\n",
"\n",
".xr-wrap {\n",
" display: block !important;\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-text-repr-fallback {\n",
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
" display: none;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-index-preview {\n",
" grid-column: 2 / 5;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data,\n",
".xr-index-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data,\n",
".xr-index-data-in:checked ~ .xr-index-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-index-name div,\n",
".xr-index-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data,\n",
".xr-index-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt,\n",
".xr-attrs dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2,\n",
".xr-no-icon {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt;\n",
"Dimensions: (time: 15340, lat: 21, lon: 31)\n",
"Coordinates:\n",
" * time (time) datetime64[ns] 1982-01-01 1982-01-02 ... 2023-12-31\n",
" * lat (lat) float64 -9.025 -8.975 -8.925 -8.875 ... -8.125 -8.075 -8.025\n",
" * lon (lon) float64 115.0 115.0 115.1 115.1 ... 116.3 116.4 116.4 116.5\n",
"Data variables:\n",
" thresh (time, lat, lon) float64 29.35 29.36 29.38 ... 30.0 29.98 29.96</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-57a17c50-85d4-4703-af38-225e8669ce0f' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-57a17c50-85d4-4703-af38-225e8669ce0f' 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'>time</span>: 15340</li><li><span class='xr-has-index'>lat</span>: 21</li><li><span class='xr-has-index'>lon</span>: 31</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-ba1b3c94-3ef0-4c26-a1e9-d3b4527a074f' class='xr-section-summary-in' type='checkbox' checked><label for='section-ba1b3c94-3ef0-4c26-a1e9-d3b4527a074f' 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'>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'>1982-01-01 ... 2023-12-31</div><input id='attrs-23054ff7-8f6e-4a65-adbb-a3d6c507bb57' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-23054ff7-8f6e-4a65-adbb-a3d6c507bb57' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-658885a2-43bf-4e2f-83d3-ac2a8eec7217' class='xr-var-data-in' type='checkbox'><label for='data-658885a2-43bf-4e2f-83d3-ac2a8eec7217' 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;1982-01-01T00:00:00.000000000&#x27;, &#x27;1982-01-02T00:00:00.000000000&#x27;,\n",
" &#x27;1982-01-03T00:00:00.000000000&#x27;, ..., &#x27;2023-12-29T00:00:00.000000000&#x27;,\n",
" &#x27;2023-12-30T00:00:00.000000000&#x27;, &#x27;2023-12-31T00:00:00.000000000&#x27;],\n",
" dtype=&#x27;datetime64[ns]&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>lat</span></div><div class='xr-var-dims'>(lat)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>-9.025 -8.975 ... -8.075 -8.025</div><input id='attrs-b9a84427-9fc7-433a-b725-d47fcbff5bea' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-b9a84427-9fc7-433a-b725-d47fcbff5bea' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-e73b7051-81cc-4669-91f0-13b50db87ed3' class='xr-var-data-in' type='checkbox'><label for='data-e73b7051-81cc-4669-91f0-13b50db87ed3' 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([-9.025, -8.975, -8.925, -8.875, -8.825, -8.775, -8.725, -8.675, -8.625,\n",
" -8.575, -8.525, -8.475, -8.425, -8.375, -8.325, -8.275, -8.225, -8.175,\n",
" -8.125, -8.075, -8.025])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>lon</span></div><div class='xr-var-dims'>(lon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>115.0 115.0 115.1 ... 116.4 116.5</div><input id='attrs-4b6ad817-d5d8-4d7d-be4d-c039edf683ca' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-4b6ad817-d5d8-4d7d-be4d-c039edf683ca' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-1f74bb40-d0d2-4464-bbe4-3945ebd53bcc' class='xr-var-data-in' type='checkbox'><label for='data-1f74bb40-d0d2-4464-bbe4-3945ebd53bcc' 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([114.975, 115.025, 115.075, 115.125, 115.175, 115.225, 115.275, 115.325,\n",
" 115.375, 115.425, 115.475, 115.525, 115.575, 115.625, 115.675, 115.725,\n",
" 115.775, 115.825, 115.875, 115.925, 115.975, 116.025, 116.075, 116.125,\n",
" 116.175, 116.225, 116.275, 116.325, 116.375, 116.425, 116.475])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-52075f8e-3d9d-44f8-ae22-96f8cf621c99' class='xr-section-summary-in' type='checkbox' checked><label for='section-52075f8e-3d9d-44f8-ae22-96f8cf621c99' 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>thresh</span></div><div class='xr-var-dims'>(time, lat, lon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>29.35 29.36 29.38 ... 29.98 29.96</div><input id='attrs-57e63cce-125c-40c5-9639-092748880d20' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-57e63cce-125c-40c5-9639-092748880d20' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c9e4ead0-d504-43b5-adce-aa6f9cb25da2' class='xr-var-data-in' type='checkbox'><label for='data-c9e4ead0-d504-43b5-adce-aa6f9cb25da2' 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([[[29.3493, 29.3573, 29.3792, ..., 29.2893, 29.2845, 29.272 ],\n",
" [29.4939, 29.4917, 29.5019, ..., 29.462 , 29.4576, 29.4134],\n",
" [29.4813, 29.4775, 29.467 , ..., 29.4011, 29.376 , 29.3087],\n",
" ...,\n",
" [29.9123, 29.8684, 29.8374, ..., 29.8907, 29.872 , 29.8668],\n",
" [29.9823, 29.9271, 29.8974, ..., 29.9448, 29.9302, 29.9123],\n",
" [30.0176, 29.9666, 29.9352, ..., 29.9788, 29.9626, 29.9408]],\n",
"\n",
" [[29.3422, 29.3517, 29.3721, ..., 29.2867, 29.2823, 29.271 ],\n",
" [29.4913, 29.4895, 29.4996, ..., 29.4555, 29.4515, 29.4088],\n",
" [29.4794, 29.4759, 29.4654, ..., 29.3933, 29.3683, 29.3026],\n",
" ...,\n",
" [29.9013, 29.8573, 29.8252, ..., 29.8739, 29.8562, 29.8505],\n",
" [29.9719, 29.9138, 29.8829, ..., 29.9284, 29.9128, 29.8945],\n",
" [30.0057, 29.9524, 29.9193, ..., 29.9601, 29.9445, 29.9209]],\n",
"\n",
" [[29.3357, 29.3452, 29.3656, ..., 29.2835, 29.2794, 29.2691],\n",
" [29.4888, 29.4873, 29.4967, ..., 29.4484, 29.445 , 29.4033],\n",
" [29.4775, 29.4739, 29.4634, ..., 29.3852, 29.3602, 29.2967],\n",
" ...,\n",
"...\n",
" ...,\n",
" [29.9392, 29.8966, 29.8701, ..., 29.9382, 29.9189, 29.913 ],\n",
" [30.0095, 29.9595, 29.9361, ..., 29.9897, 29.9801, 29.9677],\n",
" [30.0489, 30.0009, 29.9775, ..., 30.0321, 30.0168, 29.9995]],\n",
"\n",
" [[29.3638, 29.3696, 29.3923, ..., 29.2954, 29.29 , 29.2758],\n",
" [29.4974, 29.4956, 29.5058, ..., 29.4733, 29.4686, 29.4228],\n",
" [29.4852, 29.4801, 29.4705, ..., 29.4153, 29.3892, 29.319 ],\n",
" ...,\n",
" [29.9304, 29.8873, 29.8591, ..., 29.9223, 29.9036, 29.8977],\n",
" [30.0011, 29.9485, 29.9225, ..., 29.9748, 29.9639, 29.9487],\n",
" [30.0388, 29.9896, 29.9636, ..., 30.0146, 29.9981, 29.9797]],\n",
"\n",
" [[29.3567, 29.3632, 29.3854, ..., 29.2915, 29.2867, 29.2735],\n",
" [29.4958, 29.4937, 29.5032, ..., 29.4678, 29.4631, 29.4179],\n",
" [29.483 , 29.4788, 29.4686, ..., 29.4084, 29.3831, 29.3142],\n",
" ...,\n",
" [29.9211, 29.8779, 29.8484, ..., 29.9068, 29.8878, 29.8821],\n",
" [29.992 , 29.9381, 29.9097, ..., 29.96 , 29.9468, 29.9297],\n",
" [30.0279, 29.9783, 29.9494, ..., 29.9972, 29.9798, 29.9601]]])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-910ac7f0-bd5a-40af-85d8-c6569e110570' class='xr-section-summary-in' type='checkbox' ><label for='section-910ac7f0-bd5a-40af-85d8-c6569e110570' 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>time</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-2146e9c9-18d4-4952-8bea-c7de7c40015b' class='xr-index-data-in' type='checkbox'/><label for='index-2146e9c9-18d4-4952-8bea-c7de7c40015b' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(DatetimeIndex([&#x27;1982-01-01&#x27;, &#x27;1982-01-02&#x27;, &#x27;1982-01-03&#x27;, &#x27;1982-01-04&#x27;,\n",
" &#x27;1982-01-05&#x27;, &#x27;1982-01-06&#x27;, &#x27;1982-01-07&#x27;, &#x27;1982-01-08&#x27;,\n",
" &#x27;1982-01-09&#x27;, &#x27;1982-01-10&#x27;,\n",
" ...\n",
" &#x27;2023-12-22&#x27;, &#x27;2023-12-23&#x27;, &#x27;2023-12-24&#x27;, &#x27;2023-12-25&#x27;,\n",
" &#x27;2023-12-26&#x27;, &#x27;2023-12-27&#x27;, &#x27;2023-12-28&#x27;, &#x27;2023-12-29&#x27;,\n",
" &#x27;2023-12-30&#x27;, &#x27;2023-12-31&#x27;],\n",
" dtype=&#x27;datetime64[ns]&#x27;, name=&#x27;time&#x27;, length=15340, freq=None))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>lat</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-c5c2852a-022d-4740-a4f9-6dc9f13b09c0' class='xr-index-data-in' type='checkbox'/><label for='index-c5c2852a-022d-4740-a4f9-6dc9f13b09c0' 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(Float64Index([-9.025, -8.975, -8.925, -8.875, -8.825, -8.775, -8.725, -8.675,\n",
" -8.625, -8.575, -8.525, -8.475, -8.425, -8.375, -8.325, -8.275,\n",
" -8.225, -8.175, -8.125, -8.075, -8.025],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;lat&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>lon</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-81cb2a9f-107f-42b7-9b73-2825104cdd3e' class='xr-index-data-in' type='checkbox'/><label for='index-81cb2a9f-107f-42b7-9b73-2825104cdd3e' 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(Float64Index([114.975, 115.025, 115.075, 115.125, 115.175, 115.225, 115.275,\n",
" 115.325, 115.375, 115.425, 115.475, 115.525, 115.575, 115.625,\n",
" 115.675, 115.725, 115.775, 115.825, 115.875, 115.925, 115.975,\n",
" 116.025, 116.075, 116.125, 116.175, 116.225, 116.275, 116.325,\n",
" 116.375, 116.425, 116.475],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;lon&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-adac8607-9f42-4c49-aa4d-c6a61f72fd28' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-adac8607-9f42-4c49-aa4d-c6a61f72fd28' 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>"
]
},
"metadata": {},
"execution_count": 36
}
]
},
{
"cell_type": "code",
"source": [
"xz.to_netcdf('thresh.nc')"
],
"metadata": {
"id": "GbcjD8hPr0t_"
},
"execution_count": null,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment