diff --git a/Jupyter_notebooks/NES_create_netcdf_test.ipynb b/Jupyter_notebooks/NES_create_netcdf_test.ipynb index 188e4b21e641494213a19e4e2d9f98428b32d8b4..e19764cf90651dd90c8abe3cad7e715828646c5e 100644 --- a/Jupyter_notebooks/NES_create_netcdf_test.ipynb +++ b/Jupyter_notebooks/NES_create_netcdf_test.ipynb @@ -7,7 +7,15 @@ "outputs": [], "source": [ "from nes import *\n", - "import xarray as xr" + "import xarray as xr\n", + "from netCDF4 import Dataset" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Create regular grid" ] }, { @@ -415,7 +423,7 @@ "Data variables:\n", " crs |S1 b''\n", "Attributes:\n", - " Conventions: CF-1.7
array(['1996-12-31T00:00:00.000000000'], dtype='datetime64[ns]')
array([0.])
array([41.15, 41.25, 41.35, 41.45, 41.55, 41.65, 41.75, 41.85, 41.95, 42.05])
array([1.85, 1.95, 2.05, 2.15, 2.25, 2.35, 2.45, 2.55, 2.65, 2.75])
array(b'', dtype='|S1')
array(['1996-12-31T00:00:00.000000000'], dtype='datetime64[ns]')
array([0.])
array([41.15, 41.25, 41.35, 41.45, 41.55, 41.65, 41.75, 41.85, 41.95, 42.05])
array([1.85, 1.95, 2.05, 2.15, 2.25, 2.35, 2.45, 2.55, 2.65, 2.75])
array(b'', dtype='|S1')
array(['1996-12-31T00:00:00.000000000'], dtype='datetime64[ns]')
array([0.])
array([-27. , -26.8, -26.6, -26.4, -26.2, -26. , -25.8, -25.6, -25.4, -25.2])
array([-35. , -34.8, -34.6, -34.4, -34.2, -34. , -33.8, -33.6, -33.4, -33.2])
array([[-27. , -26.8, -26.6, -26.4, -26.2, -26. , -25.8, -25.6, -25.4, -25.2],\n", + " Conventions: CF-1.7
array(['1996-12-31T00:00:00.000000000'], dtype='datetime64[ns]')
array([0.])
array([-27. , -26.8, -26.6, -26.4, -26.2, -26. , -25.8, -25.6, -25.4, -25.2])
array([-35. , -34.8, -34.6, -34.4, -34.2, -34. , -33.8, -33.6, -33.4, -33.2])
array([[-27. , -26.8, -26.6, -26.4, -26.2, -26. , -25.8, -25.6, -25.4, -25.2],\n", " [-27. , -26.8, -26.6, -26.4, -26.2, -26. , -25.8, -25.6, -25.4, -25.2],\n", " [-27. , -26.8, -26.6, -26.4, -26.2, -26. , -25.8, -25.6, -25.4, -25.2],\n", " [-27. , -26.8, -26.6, -26.4, -26.2, -26. , -25.8, -25.6, -25.4, -25.2],\n", @@ -863,7 +878,7 @@ " [-27. , -26.8, -26.6, -26.4, -26.2, -26. , -25.8, -25.6, -25.4, -25.2],\n", " [-27. , -26.8, -26.6, -26.4, -26.2, -26. , -25.8, -25.6, -25.4, -25.2],\n", " [-27. , -26.8, -26.6, -26.4, -26.2, -26. , -25.8, -25.6, -25.4, -25.2],\n", - " [-27. , -26.8, -26.6, -26.4, -26.2, -26. , -25.8, -25.6, -25.4, -25.2]])
array([[-35. , -34.8, -34.6, -34.4, -34.2, -34. , -33.8, -33.6, -33.4, -33.2],\n", + " [-27. , -26.8, -26.6, -26.4, -26.2, -26. , -25.8, -25.6, -25.4, -25.2]])
array([[-35. , -34.8, -34.6, -34.4, -34.2, -34. , -33.8, -33.6, -33.4, -33.2],\n", " [-35. , -34.8, -34.6, -34.4, -34.2, -34. , -33.8, -33.6, -33.4, -33.2],\n", " [-35. , -34.8, -34.6, -34.4, -34.2, -34. , -33.8, -33.6, -33.4, -33.2],\n", " [-35. , -34.8, -34.6, -34.4, -34.2, -34. , -33.8, -33.6, -33.4, -33.2],\n", @@ -872,7 +887,7 @@ " [-35. , -34.8, -34.6, -34.4, -34.2, -34. , -33.8, -33.6, -33.4, -33.2],\n", " [-35. , -34.8, -34.6, -34.4, -34.2, -34. , -33.8, -33.6, -33.4, -33.2],\n", " [-35. , -34.8, -34.6, -34.4, -34.2, -34. , -33.8, -33.6, -33.4, -33.2],\n", - " [-35. , -34.8, -34.6, -34.4, -34.2, -34. , -33.8, -33.6, -33.4, -33.2]])
array(b'', dtype='|S1')
array(b'', dtype='|S1')
<xarray.Dataset>\n", + "Dimensions: (time: 1, lev: 1, lat: 4, lon: 4)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 1996-12-31\n", + " * lev (lev) float64 0.0\n", + " * lat (lat) float64 0.0 10.0 23.0 50.0\n", + " * lon (lon) float64 25.0 -30.0 41.0 12.0\n", + "Data variables:\n", + " *empty*\n", + "Attributes:\n", + " Conventions: CF-1.7
array(['1996-12-31T00:00:00.000000000'], dtype='datetime64[ns]')
array([0.])
array([ 0., 10., 23., 50.])
array([ 25., -30., 41., 12.])
<xarray.Dataset>\n", + "Dimensions: (station: 8643, time: 744)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 2021-07-01 ... 2021-0...\n", + "Dimensions without coordinates: station\n", + "Data variables: (12/20)\n", + " station_code (station) |S75 b'AD0942A' ... b'ES2074A'\n", + " station_start_date (station) |S75 b'2004-06-17' ... b'nan'\n", + " station_zone (station) |S75 b'nan' b'nan' ... b'nature'\n", + " lat (station) float32 42.51 42.52 ... 28.09 28.48\n", + " street_type (station) |S75 b'nan' b'nan' ... b'nan' b'nan'\n", + " country_code (station) |S75 b'AD' b'AD' ... b'ES' b'ES'\n", + " ... ...\n", + " lon (station) float32 1.539 1.565 ... -16.26\n", + " station_end_date (station) |S75 b'nan' b'nan' ... b'nan' b'nan'\n", + " station_local_code (station) |S75 b'942' b'944' ... b'38038033'\n", + " station_rural_back (station) |S75 b'nan' b'nan' ... b'nan' b'nan'\n", + " station_ozone_classification (station) |S75 b'nan' b'nan' ... b'nan' b'nan'\n", + " pm10 (time, station) float32 ...
array(['2021-07-01T00:00:00.000000000', '2021-07-01T01:00:00.000000000',\n", + " '2021-07-01T02:00:00.000000000', ..., '2021-07-31T21:00:00.000000000',\n", + " '2021-07-31T22:00:00.000000000', '2021-07-31T23:00:00.000000000'],\n", + " dtype='datetime64[ns]')
array([b'AD0942A', b'AD0944A', b'AD0945A', ..., b'ES2070A', b'ES2073A',\n", + " b'ES2074A'], dtype='|S75')
array([b'2004-06-17', b'2006-02-10', b'2011-05-01', ..., b'2015-01-01',\n", + " b'2015-01-03', b'nan'], dtype='|S75')
array([b'nan', b'nan', b'nan', ..., b'farming', b'nature', b'nature'],\n", + " dtype='|S75')
array([42.509724, 42.516945, 42.53488 , ..., 40.94667 , 28.09148 , 28.47544 ],\n", + " dtype=float32)
array([b'nan', b'nan', b'nan', ..., b'nan', b'nan', b'nan'], dtype='|S75')
array([b'AD', b'AD', b'AD', ..., b'ES', b'ES', b'ES'], dtype='|S75')
array([b'nan', b'nan', b'nan', ..., b'aragon', b'canarias', b'canarias'],\n", + " dtype='|S75')
array([b'escaldes-engordany', b'engolasters', b'envalira', ...,\n", + " b'monagregagrav', b'el calvario-ss gomera', b'palmetum'], dtype='|S75')
array([b'urban', b'rural', b'rural', ..., b'rural', b'urban', b'urban'],\n", + " dtype='|S75')
array([b'andorra la vella', b'nan', b'nan', ..., b'calanda',\n", + " b'san sebastin de la gomera', b'santa cruz de tenerife'], dtype='|S75')
array([b'no', b'no', b'no', ..., b'no', b'no', b'no'], dtype='|S75')
array([b'background', b'background', b'background', ..., b'background',\n", + " b'industrial', b'industrial'], dtype='|S75')
array([b'andorra', b'andorra', b'andorra', ..., b'spain', b'spain', b'spain'],\n", + " dtype='|S75')
array([1.080e+03, 1.637e+03, 2.515e+03, ..., 5.700e+02, 2.000e+00, 2.000e+00],\n", + " dtype=float32)
array([ 1.539172, 1.565014, 1.716986, ..., -0.29083 , -17.11573 ,\n", + " -16.25853 ], dtype=float32)
array([b'nan', b'nan', b'nan', ..., b'nan', b'nan', b'nan'], dtype='|S75')
array([b'942', b'944', b'945', ..., b'44051005', b'38036003', b'38038033'],\n", + " dtype='|S75')
array([b'nan', b'nan', b'nan', ..., b'remote', b'nan', b'nan'], dtype='|S75')
array([b'nan', b'nan', b'nan', ..., b'nan', b'nan', b'nan'], dtype='|S75')
[6430392 values with dtype=float32]
<xarray.Dataset>\n", + "Dimensions: (time: 1, lev: 1, lat: 8643, lon: 8643)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 1996-12-31\n", + " * lev (lev) float64 0.0\n", + " * lat (lat) float64 42.51 42.52 42.53 41.33 ... 36.96 40.95 28.09 28.48\n", + " * lon (lon) float64 1.539 1.565 1.717 19.82 ... -0.2908 -17.12 -16.26\n", + "Data variables:\n", + " *empty*\n", + "Attributes:\n", + " Conventions: CF-1.7
array(['1996-12-31T00:00:00.000000000'], dtype='datetime64[ns]')
array([0.])
array([42.509724, 42.516945, 42.534882, ..., 40.946671, 28.09148 , 28.475439])
array([ 1.539172, 1.565014, 1.716986, ..., -0.29083 , -17.11573 ,\n", + " -16.25853 ])