{ "cells": [ { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "from netCDF4 import Dataset\n", "import os" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "folder = r'p:\\metocean-data\\open\\ERA5\\data\\Global'" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "longitude (720,)\n", "latitude (361,)\n", "time (8760,)\n", "swh (8760, 361, 720)\n" ] } ], "source": [ "DShs = Dataset(os.path.join(folder,'Hs\\era5_Global_Hs_1981.nc'))\n", "for i in DShs.variables:\n", " print(i, DShs.variables[i].shape)" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [], "source": [ "#DShs.variables['longitude'][:] # 0.5 degree from -180 to 179.5 (left-right)\n", "#DShs.variables['latitude'][:] # 0.5 degree from 90 to -90 (top-down)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "longitude (1440,)\n", "latitude (721,)\n", "time (8760,)\n", "msl (8760, 721, 1440)\n" ] } ], "source": [ "DSmslp = Dataset(os.path.join(folder,'msl_p\\era5_Global_msl_p_1981.nc'))\n", "for i in DSmslp.variables:\n", " print(i, DSmslp.variables[i].shape)" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "#DSmslp.variables['longitude'][:] # 0.25 degree from -180 to 179.5 (left-right)\n", "#DSmslp.variables['latitude'][:] # 0.25 degree from 90 to -90 (top-down)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "longitude (1440,)\n", "latitude (721,)\n", "time (365,)\n", "lsm (365, 721, 1440)\n" ] } ], "source": [ "DSlandsea = Dataset(os.path.join(folder,'ERA5_landsea_mask.nc'))\n", "for i in DSlandsea.variables:\n", " print(i, DSlandsea.variables[i].shape)" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [], "source": [ "#DSlandsea.variables['longitude'][:] # 0.25 degree from 0 to 359.75 (left-right)\n", "#DSlandsea.variables['latitude'][:] # 0.25 degree from 90 to -90 (top-down)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.6" } }, "nbformat": 4, "nbformat_minor": 4 }