adding data noise
[notebooks.git] / 05-Python-netcdf.ipynb
blob91bc76df7bae9f0ee6589a98686e775c11b81098
2   "nbformat": 4,
3   "nbformat_minor": 0,
4   "metadata": {
5     "colab": {
6       "name": "read_wrfout.ipynb",
7       "provenance": [],
8       "collapsed_sections": []
9     },
10     "kernelspec": {
11       "name": "python3",
12       "display_name": "Python 3"
13     },
14     "language_info": {
15       "name": "python"
16     }
17   },
18   "cells": [
19     {
20       "cell_type": "markdown",
21       "metadata": {
22         "id": "OFIaHCyd0qEQ"
23       },
24       "source": [
25         "**Python basics 05 - download a NetCDF file and read it**"
26       ]
27     },
28     {
29       "cell_type": "markdown",
30       "metadata": {
31         "id": "IKDq7FUT1KMG"
32       },
33       "source": [
34         "Run rhe code below to upload a file. Try to run it twice to see what happens."
35       ]
36     },
37     {
38       "cell_type": "code",
39       "metadata": {
40         "id": "7K6rHVEh0rYE"
41       },
42       "source": [
43         "! wget --no-clobber --output-document=wrf.nc https://home.chpc.utah.edu/~u0703457/people_share/jan/simulation_canopy/wrfout_d01_2018-09-16_00:00:00\n"
44       ],
45       "execution_count": null,
46       "outputs": []
47     },
48     {
49       "cell_type": "markdown",
50       "metadata": {
51         "id": "tBF5Sq-M0sHO"
52       },
53       "source": [
54         " **Exercise 1** Find the documenation of the wget command online and describe the meaning of the arguments used."
55       ]
56     },
57     {
58       "cell_type": "markdown",
59       "metadata": {
60         "id": "PkltxD-y0g-3"
61       },
62       "source": [
63         "**Exercise 2** Complete the code below to read the arrays XLAT, XLONG as lats, lons, and variable tr17_1 from the file you uploaded similarly as in https://github.com/openwfm/wrfxpy/blob/829abe55c950840693dfae09adbb928ffdf3652a/src/forecast.py#L522, and print their shape (i.e., dimensions). Hint: look up NumPy shape online. "
64       ]
65     },
66     {
67       "cell_type": "code",
68       "metadata": {
69         "id": "3EuCTj_WHNTH"
70       },
71       "source": [
72         "import netCDF4 as nc4\n",
73         "your code here\n"
74       ],
75       "execution_count": null,
76       "outputs": []
77     }
78   ]