Commit 72107a5e authored by Georg Siemund's avatar Georg Siemund
Browse files

Delete NetCDF_fileStorage_performancetest__1_.ipynb

parent 4c61785a
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook tests the read and write performance of NetCDF files inside file storage."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import xarray as xr\n",
"xr.set_options(display_style='html')\n",
"import intake\n",
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. Load CMIP6 Data with Intake ESM"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"According to: http://gallery.pangeo.io/repos/pangeo-gallery/cmip6/intake_ESM_example.html"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"cat_url = \"/mnt/lustre02/work/ik1017/Catalogs/mistral-cmip6.json\"\n",
"col = intake.open_esm_datastore(cat_url)\n",
"cat = col.search(experiment_id=['historical', 'ssp585'], table_id='Amon', variable_id='tas',\n",
" grid_label='gn', source_id=\"MPI-ESM1-2-HR\")\n",
"cat.df"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"dset_dict = cat.to_dataset_dict(zarr_kwargs={'consolidated': True})\n",
"list(dset_dict.keys())"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"type(ds)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ds = dset_dict['ScenarioMIP.DWD.MPI-ESM1-2-HR.ssp585.Amon.gn']\n",
"ds"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"data = ds.tas.data\n",
"data"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"ds.tas[0, 0].plot(figsize=(16, 8), center=False, robust=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"class DevNullStore:\n",
"\n",
" def __init__(self):\n",
" pass\n",
"\n",
" def __setitem__(*args, **kwargs):\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"null_store = DevNullStore()\n",
"# this line produces no error but actually does nothing\n",
"null_store['foo'] = 'bar'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "zarr_test",
"language": "python",
"name": "zarr_test"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment