|
14 | 14 | { |
15 | 15 | "cell_type": "code", |
16 | 16 | "id": "50093a3b-2193-4041-8409-de3dc594cf7d", |
17 | | - "metadata": {}, |
| 17 | + "metadata": { |
| 18 | + "ExecuteTime": { |
| 19 | + "end_time": "2025-04-24T15:27:45.368831Z", |
| 20 | + "start_time": "2025-04-24T15:27:45.362743Z" |
| 21 | + } |
| 22 | + }, |
18 | 23 | "source": [ |
19 | 24 | "\n", |
20 | 25 | "\n", |
21 | 26 | "# For testing and development purposes, enter a start year, end year, and\n", |
22 | | - "# an dora id number to analyze. The value of dora_id can also be a direct\n", |
| 27 | + "# a dora id number to analyze. The value of dora_id can also be a direct\n", |
23 | 28 | "# path to a /pp directory.\n", |
24 | 29 | "\n", |
25 | 30 | "config = {\n", |
|
29 | 34 | "}" |
30 | 35 | ], |
31 | 36 | "outputs": [], |
32 | | - "execution_count": null |
| 37 | + "execution_count": 1 |
33 | 38 | }, |
34 | 39 | { |
35 | | - "metadata": {}, |
| 40 | + "metadata": { |
| 41 | + "ExecuteTime": { |
| 42 | + "end_time": "2025-04-24T15:27:47.535298Z", |
| 43 | + "start_time": "2025-04-24T15:27:47.530951Z" |
| 44 | + } |
| 45 | + }, |
36 | 46 | "cell_type": "code", |
37 | 47 | "source": [ |
38 | 48 | "# Make sure this cell is active so that the workflow and Dora can update\n", |
|
43 | 53 | ], |
44 | 54 | "id": "9b94e2fadf0ab2c6", |
45 | 55 | "outputs": [], |
46 | | - "execution_count": null |
| 56 | + "execution_count": 2 |
47 | 57 | }, |
48 | 58 | { |
49 | 59 | "cell_type": "code", |
50 | 60 | "id": "cae4343a-ced9-41be-9fa6-3a6b42188886", |
51 | | - "metadata": {}, |
| 61 | + "metadata": { |
| 62 | + "ExecuteTime": { |
| 63 | + "end_time": "2025-04-24T15:27:49.675915Z", |
| 64 | + "start_time": "2025-04-24T15:27:49.668710Z" |
| 65 | + } |
| 66 | + }, |
52 | 67 | "source": [ |
53 | 68 | "print(str(config))" |
54 | 69 | ], |
55 | | - "outputs": [], |
56 | | - "execution_count": null |
| 70 | + "outputs": [ |
| 71 | + { |
| 72 | + "name": "stdout", |
| 73 | + "output_type": "stream", |
| 74 | + "text": [ |
| 75 | + "{'startyr': None, 'endyr': None, 'dora_id': 'odiv-413'}\n" |
| 76 | + ] |
| 77 | + } |
| 78 | + ], |
| 79 | + "execution_count": 3 |
57 | 80 | }, |
58 | 81 | { |
59 | 82 | "cell_type": "markdown", |
|
64 | 87 | ] |
65 | 88 | }, |
66 | 89 | { |
| 90 | + "metadata": { |
| 91 | + "ExecuteTime": { |
| 92 | + "end_time": "2025-04-24T15:28:03.718328Z", |
| 93 | + "start_time": "2025-04-24T15:27:52.003735Z" |
| 94 | + } |
| 95 | + }, |
67 | 96 | "cell_type": "code", |
68 | | - "id": "dfcdc828-ad45-4ef0-92bc-05df9c036270", |
69 | | - "metadata": {}, |
70 | 97 | "source": [ |
71 | 98 | "import doralite\n", |
72 | | - "import glob\n", |
73 | 99 | "import momlevel\n", |
74 | 100 | "import subprocess\n", |
75 | 101 | "import os\n", |
|
85 | 111 | "\n", |
86 | 112 | "from matplotlib.colors import ListedColormap, BoundaryNorm" |
87 | 113 | ], |
| 114 | + "id": "c57e0f8b0c23ad83", |
88 | 115 | "outputs": [], |
89 | | - "execution_count": null |
| 116 | + "execution_count": 4 |
90 | 117 | }, |
91 | 118 | { |
92 | 119 | "cell_type": "code", |
93 | 120 | "id": "806241bd-ebea-4640-ab69-cea6edba62de", |
94 | | - "metadata": {}, |
| 121 | + "metadata": { |
| 122 | + "ExecuteTime": { |
| 123 | + "end_time": "2025-04-24T15:28:18.455386Z", |
| 124 | + "start_time": "2025-04-24T15:28:18.133552Z" |
| 125 | + } |
| 126 | + }, |
95 | 127 | "source": [ |
96 | 128 | "# momgrid will use a directory of pre-computed weights that is used for calculating basic area-weighted statistics later\n", |
97 | 129 | "import momgrid\n", |
98 | 130 | "os.environ[\"MOMGRID_WEIGHTS_DIR\"] = \"/nbhome/John.Krasting/grid_weights\"" |
99 | 131 | ], |
100 | 132 | "outputs": [], |
101 | | - "execution_count": null |
| 133 | + "execution_count": 5 |
102 | 134 | }, |
103 | 135 | { |
104 | 136 | "cell_type": "markdown", |
|
111 | 143 | { |
112 | 144 | "cell_type": "code", |
113 | 145 | "id": "04229c22-3781-400f-a390-8c5eaaef5189", |
114 | | - "metadata": {}, |
| 146 | + "metadata": { |
| 147 | + "ExecuteTime": { |
| 148 | + "end_time": "2025-04-24T15:28:21.109929Z", |
| 149 | + "start_time": "2025-04-24T15:28:21.014072Z" |
| 150 | + } |
| 151 | + }, |
115 | 152 | "source": [ |
116 | 153 | "# Define some local variables. These are taken from the doralite object\n", |
117 | 154 | "# or they can be defined locally\n", |
|
136 | 173 | "end = int(end) if end is not None else 9999" |
137 | 174 | ], |
138 | 175 | "outputs": [], |
139 | | - "execution_count": null |
| 176 | + "execution_count": 6 |
140 | 177 | }, |
141 | 178 | { |
142 | 179 | "cell_type": "markdown", |
|
150 | 187 | "cell_type": "code", |
151 | 188 | "id": "382835f3-a3d7-419f-a92f-e65808230c59", |
152 | 189 | "metadata": { |
153 | | - "jupyter": { |
154 | | - "is_executing": true |
| 190 | + "ExecuteTime": { |
| 191 | + "end_time": "2025-04-24T15:28:28.100167Z", |
| 192 | + "start_time": "2025-04-24T15:28:27.611343Z" |
155 | 193 | } |
156 | 194 | }, |
157 | 195 | "source": [ |
|
198 | 236 | "\n", |
199 | 237 | "#_ = [print(x) for x in filelist]" |
200 | 238 | ], |
201 | | - "outputs": [], |
202 | | - "execution_count": null |
| 239 | + "outputs": [ |
| 240 | + { |
| 241 | + "ename": "KeyError", |
| 242 | + "evalue": "'CATALOG_FILE'", |
| 243 | + "output_type": "error", |
| 244 | + "traceback": [ |
| 245 | + "\u001B[31m---------------------------------------------------------------------------\u001B[39m", |
| 246 | + "\u001B[31mKeyError\u001B[39m Traceback (most recent call last)", |
| 247 | + "\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[7]\u001B[39m\u001B[32m, line 11\u001B[39m\n\u001B[32m 9\u001B[39m cat = intake.open_esm_datastore(os.environ[\u001B[33m'\u001B[39m\u001B[33mCATALOG_FILE\u001B[39m\u001B[33m'\u001B[39m])\n\u001B[32m 10\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m:\n\u001B[32m---> \u001B[39m\u001B[32m11\u001B[39m \u001B[38;5;28mprint\u001B[39m(\u001B[33mf\u001B[39m\u001B[33m\"\u001B[39m\u001B[33mERROR: Could not load catalog file \u001B[39m\u001B[38;5;132;01m{\u001B[39;00m\u001B[43mos\u001B[49m\u001B[43m.\u001B[49m\u001B[43menviron\u001B[49m\u001B[43m[\u001B[49m\u001B[33;43m'\u001B[39;49m\u001B[33;43mCATALOG_FILE\u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[43m]\u001B[49m\u001B[38;5;132;01m}\u001B[39;00m\u001B[33m\"\u001B[39m)\n\u001B[32m 13\u001B[39m tos_subset = cat.search(variable_id=\u001B[33m'\u001B[39m\u001B[33mtos\u001B[39m\u001B[33m'\u001B[39m, frequency=frequency)\n\u001B[32m 14\u001B[39m filelist = \u001B[38;5;28msorted\u001B[39m([path \u001B[38;5;28;01mfor\u001B[39;00m path \u001B[38;5;129;01min\u001B[39;00m tos_subset.df[\u001B[33m'\u001B[39m\u001B[33mpath\u001B[39m\u001B[33m'\u001B[39m]])\n", |
| 248 | + "\u001B[36mFile \u001B[39m\u001B[32m<frozen os>:714\u001B[39m, in \u001B[36m__getitem__\u001B[39m\u001B[34m(self, key)\u001B[39m\n", |
| 249 | + "\u001B[31mKeyError\u001B[39m: 'CATALOG_FILE'" |
| 250 | + ] |
| 251 | + } |
| 252 | + ], |
| 253 | + "execution_count": 7 |
203 | 254 | }, |
204 | 255 | { |
205 | 256 | "cell_type": "markdown", |
|
0 commit comments