|
29 | 29 | "source": [ |
30 | 30 | "from mhkit.wave.io import ndbc\n", |
31 | 31 | "from mhkit.wave.io.hindcast import wind_toolkit\n", |
| 32 | + "from mhkit.tidal.graphics import plot_rose\n", |
| 33 | + "from mhkit.tidal.graphics import plot_joint_probability_distribution\n", |
32 | 34 | "import pandas as pd\n", |
33 | 35 | "import numpy as np\n", |
34 | 36 | "import matplotlib.pyplot as plt" |
|
85 | 87 | " </thead>\n", |
86 | 88 | " <tbody>\n", |
87 | 89 | " <tr>\n", |
88 | | - " <th>1211</th>\n", |
| 90 | + " <th>1214</th>\n", |
89 | 91 | " <td>46022</td>\n", |
90 | 92 | " <td>1996</td>\n", |
91 | 93 | " <td>46022c1996.txt.gz</td>\n", |
92 | 94 | " </tr>\n", |
93 | 95 | " <tr>\n", |
94 | | - " <th>1212</th>\n", |
| 96 | + " <th>1215</th>\n", |
95 | 97 | " <td>46022</td>\n", |
96 | 98 | " <td>1997</td>\n", |
97 | 99 | " <td>46022c1997.txt.gz</td>\n", |
98 | 100 | " </tr>\n", |
99 | 101 | " <tr>\n", |
100 | | - " <th>1213</th>\n", |
| 102 | + " <th>1216</th>\n", |
101 | 103 | " <td>46022</td>\n", |
102 | 104 | " <td>1998</td>\n", |
103 | 105 | " <td>46022c1998.txt.gz</td>\n", |
104 | 106 | " </tr>\n", |
105 | 107 | " <tr>\n", |
106 | | - " <th>1214</th>\n", |
| 108 | + " <th>1217</th>\n", |
107 | 109 | " <td>46022</td>\n", |
108 | 110 | " <td>1999</td>\n", |
109 | 111 | " <td>46022c1999.txt.gz</td>\n", |
110 | 112 | " </tr>\n", |
111 | 113 | " <tr>\n", |
112 | | - " <th>1215</th>\n", |
| 114 | + " <th>1218</th>\n", |
113 | 115 | " <td>46022</td>\n", |
114 | 116 | " <td>2000</td>\n", |
115 | 117 | " <td>46022c2000.txt.gz</td>\n", |
116 | 118 | " </tr>\n", |
117 | 119 | " <tr>\n", |
118 | | - " <th>1216</th>\n", |
| 120 | + " <th>1219</th>\n", |
119 | 121 | " <td>46022</td>\n", |
120 | 122 | " <td>2001</td>\n", |
121 | 123 | " <td>46022c2001.txt.gz</td>\n", |
122 | 124 | " </tr>\n", |
123 | 125 | " <tr>\n", |
124 | | - " <th>1217</th>\n", |
| 126 | + " <th>1220</th>\n", |
125 | 127 | " <td>46022</td>\n", |
126 | 128 | " <td>2002</td>\n", |
127 | 129 | " <td>46022c2002.txt.gz</td>\n", |
128 | 130 | " </tr>\n", |
129 | 131 | " <tr>\n", |
130 | | - " <th>1218</th>\n", |
| 132 | + " <th>1221</th>\n", |
131 | 133 | " <td>46022</td>\n", |
132 | 134 | " <td>2003</td>\n", |
133 | 135 | " <td>46022c2003.txt.gz</td>\n", |
134 | 136 | " </tr>\n", |
135 | 137 | " <tr>\n", |
136 | | - " <th>1219</th>\n", |
| 138 | + " <th>1222</th>\n", |
137 | 139 | " <td>46022</td>\n", |
138 | 140 | " <td>2004</td>\n", |
139 | 141 | " <td>46022c2004.txt.gz</td>\n", |
140 | 142 | " </tr>\n", |
141 | 143 | " <tr>\n", |
142 | | - " <th>1220</th>\n", |
| 144 | + " <th>1223</th>\n", |
143 | 145 | " <td>46022</td>\n", |
144 | 146 | " <td>2005</td>\n", |
145 | 147 | " <td>46022c2005.txt.gz</td>\n", |
146 | 148 | " </tr>\n", |
147 | 149 | " <tr>\n", |
148 | | - " <th>1221</th>\n", |
| 150 | + " <th>1224</th>\n", |
149 | 151 | " <td>46022</td>\n", |
150 | 152 | " <td>2006</td>\n", |
151 | 153 | " <td>46022c2006.txt.gz</td>\n", |
152 | 154 | " </tr>\n", |
153 | 155 | " <tr>\n", |
154 | | - " <th>1222</th>\n", |
| 156 | + " <th>1225</th>\n", |
155 | 157 | " <td>46022</td>\n", |
156 | 158 | " <td>2007</td>\n", |
157 | 159 | " <td>46022c2007.txt.gz</td>\n", |
158 | 160 | " </tr>\n", |
159 | 161 | " <tr>\n", |
160 | | - " <th>1223</th>\n", |
| 162 | + " <th>1226</th>\n", |
161 | 163 | " <td>46022</td>\n", |
162 | 164 | " <td>2008</td>\n", |
163 | 165 | " <td>46022c2008.txt.gz</td>\n", |
164 | 166 | " </tr>\n", |
165 | 167 | " <tr>\n", |
166 | | - " <th>1224</th>\n", |
| 168 | + " <th>1227</th>\n", |
167 | 169 | " <td>46022</td>\n", |
168 | 170 | " <td>2009</td>\n", |
169 | 171 | " <td>46022c2009.txt.gz</td>\n", |
170 | 172 | " </tr>\n", |
171 | 173 | " <tr>\n", |
172 | | - " <th>1225</th>\n", |
| 174 | + " <th>1228</th>\n", |
173 | 175 | " <td>46022</td>\n", |
174 | 176 | " <td>2010</td>\n", |
175 | 177 | " <td>46022c2010.txt.gz</td>\n", |
176 | 178 | " </tr>\n", |
177 | 179 | " <tr>\n", |
178 | | - " <th>1226</th>\n", |
| 180 | + " <th>1229</th>\n", |
179 | 181 | " <td>46022</td>\n", |
180 | 182 | " <td>2011</td>\n", |
181 | 183 | " <td>46022c2011.txt.gz</td>\n", |
182 | 184 | " </tr>\n", |
183 | 185 | " <tr>\n", |
184 | | - " <th>1227</th>\n", |
| 186 | + " <th>1230</th>\n", |
185 | 187 | " <td>46022</td>\n", |
186 | 188 | " <td>2012</td>\n", |
187 | 189 | " <td>46022c2012.txt.gz</td>\n", |
188 | 190 | " </tr>\n", |
189 | 191 | " <tr>\n", |
190 | | - " <th>1228</th>\n", |
| 192 | + " <th>1231</th>\n", |
191 | 193 | " <td>46022</td>\n", |
192 | 194 | " <td>2013</td>\n", |
193 | 195 | " <td>46022c2013.txt.gz</td>\n", |
194 | 196 | " </tr>\n", |
195 | 197 | " <tr>\n", |
196 | | - " <th>1229</th>\n", |
| 198 | + " <th>1232</th>\n", |
197 | 199 | " <td>46022</td>\n", |
198 | 200 | " <td>2014</td>\n", |
199 | 201 | " <td>46022c2014.txt.gz</td>\n", |
200 | 202 | " </tr>\n", |
201 | 203 | " <tr>\n", |
202 | | - " <th>1230</th>\n", |
| 204 | + " <th>1233</th>\n", |
203 | 205 | " <td>46022</td>\n", |
204 | 206 | " <td>2015</td>\n", |
205 | 207 | " <td>46022c2015.txt.gz</td>\n", |
206 | 208 | " </tr>\n", |
207 | 209 | " <tr>\n", |
208 | | - " <th>1231</th>\n", |
| 210 | + " <th>1234</th>\n", |
209 | 211 | " <td>46022</td>\n", |
210 | 212 | " <td>2016</td>\n", |
211 | 213 | " <td>46022c2016.txt.gz</td>\n", |
212 | 214 | " </tr>\n", |
213 | 215 | " <tr>\n", |
214 | | - " <th>1232</th>\n", |
| 216 | + " <th>1235</th>\n", |
215 | 217 | " <td>46022</td>\n", |
216 | 218 | " <td>2017</td>\n", |
217 | 219 | " <td>46022c2017.txt.gz</td>\n", |
218 | 220 | " </tr>\n", |
219 | 221 | " <tr>\n", |
220 | | - " <th>1233</th>\n", |
| 222 | + " <th>1236</th>\n", |
221 | 223 | " <td>46022</td>\n", |
222 | 224 | " <td>2018</td>\n", |
223 | 225 | " <td>46022c2018.txt.gz</td>\n", |
|
228 | 230 | ], |
229 | 231 | "text/plain": [ |
230 | 232 | " id year filename\n", |
231 | | - "1211 46022 1996 46022c1996.txt.gz\n", |
232 | | - "1212 46022 1997 46022c1997.txt.gz\n", |
233 | | - "1213 46022 1998 46022c1998.txt.gz\n", |
234 | | - "1214 46022 1999 46022c1999.txt.gz\n", |
235 | | - "1215 46022 2000 46022c2000.txt.gz\n", |
236 | | - "1216 46022 2001 46022c2001.txt.gz\n", |
237 | | - "1217 46022 2002 46022c2002.txt.gz\n", |
238 | | - "1218 46022 2003 46022c2003.txt.gz\n", |
239 | | - "1219 46022 2004 46022c2004.txt.gz\n", |
240 | | - "1220 46022 2005 46022c2005.txt.gz\n", |
241 | | - "1221 46022 2006 46022c2006.txt.gz\n", |
242 | | - "1222 46022 2007 46022c2007.txt.gz\n", |
243 | | - "1223 46022 2008 46022c2008.txt.gz\n", |
244 | | - "1224 46022 2009 46022c2009.txt.gz\n", |
245 | | - "1225 46022 2010 46022c2010.txt.gz\n", |
246 | | - "1226 46022 2011 46022c2011.txt.gz\n", |
247 | | - "1227 46022 2012 46022c2012.txt.gz\n", |
248 | | - "1228 46022 2013 46022c2013.txt.gz\n", |
249 | | - "1229 46022 2014 46022c2014.txt.gz\n", |
250 | | - "1230 46022 2015 46022c2015.txt.gz\n", |
251 | | - "1231 46022 2016 46022c2016.txt.gz\n", |
252 | | - "1232 46022 2017 46022c2017.txt.gz\n", |
253 | | - "1233 46022 2018 46022c2018.txt.gz" |
| 233 | + "1214 46022 1996 46022c1996.txt.gz\n", |
| 234 | + "1215 46022 1997 46022c1997.txt.gz\n", |
| 235 | + "1216 46022 1998 46022c1998.txt.gz\n", |
| 236 | + "1217 46022 1999 46022c1999.txt.gz\n", |
| 237 | + "1218 46022 2000 46022c2000.txt.gz\n", |
| 238 | + "1219 46022 2001 46022c2001.txt.gz\n", |
| 239 | + "1220 46022 2002 46022c2002.txt.gz\n", |
| 240 | + "1221 46022 2003 46022c2003.txt.gz\n", |
| 241 | + "1222 46022 2004 46022c2004.txt.gz\n", |
| 242 | + "1223 46022 2005 46022c2005.txt.gz\n", |
| 243 | + "1224 46022 2006 46022c2006.txt.gz\n", |
| 244 | + "1225 46022 2007 46022c2007.txt.gz\n", |
| 245 | + "1226 46022 2008 46022c2008.txt.gz\n", |
| 246 | + "1227 46022 2009 46022c2009.txt.gz\n", |
| 247 | + "1228 46022 2010 46022c2010.txt.gz\n", |
| 248 | + "1229 46022 2011 46022c2011.txt.gz\n", |
| 249 | + "1230 46022 2012 46022c2012.txt.gz\n", |
| 250 | + "1231 46022 2013 46022c2013.txt.gz\n", |
| 251 | + "1232 46022 2014 46022c2014.txt.gz\n", |
| 252 | + "1233 46022 2015 46022c2015.txt.gz\n", |
| 253 | + "1234 46022 2016 46022c2016.txt.gz\n", |
| 254 | + "1235 46022 2017 46022c2017.txt.gz\n", |
| 255 | + "1236 46022 2018 46022c2018.txt.gz" |
254 | 256 | ] |
255 | 257 | }, |
256 | 258 | "execution_count": 2, |
|
309 | 311 | " </thead>\n", |
310 | 312 | " <tbody>\n", |
311 | 313 | " <tr>\n", |
312 | | - " <th>1233</th>\n", |
| 314 | + " <th>1236</th>\n", |
313 | 315 | " <td>46022</td>\n", |
314 | 316 | " <td>2018</td>\n", |
315 | 317 | " <td>46022c2018.txt.gz</td>\n", |
|
320 | 322 | ], |
321 | 323 | "text/plain": [ |
322 | 324 | " id year filename\n", |
323 | | - "1233 46022 2018 46022c2018.txt.gz" |
| 325 | + "1236 46022 2018 46022c2018.txt.gz" |
324 | 326 | ] |
325 | 327 | }, |
326 | 328 | "execution_count": 3, |
|
884 | 886 | { |
885 | 887 | "data": { |
886 | 888 | "text/plain": [ |
887 | | - "<matplotlib.legend.Legend at 0x1d0b8c6d370>" |
| 889 | + "<matplotlib.legend.Legend at 0x29b2f3eeeb0>" |
888 | 890 | ] |
889 | 891 | }, |
890 | 892 | "execution_count": 11, |
|
957 | 959 | "width_velocity = 1 # in m/s\n", |
958 | 960 | "\n", |
959 | 961 | "# Plot the wind rose\n", |
960 | | - "ax = ndbc.plot_rose(ndbc_hourly_data['WDIR'],ndbc_hourly_data['WSPD'],\n", |
| 962 | + "ax = plot_rose(ndbc_hourly_data['WDIR'],ndbc_hourly_data['WSPD'],\n", |
961 | 963 | " width_direction,width_velocity)\n" |
962 | 964 | ] |
963 | 965 | }, |
|
982 | 984 | } |
983 | 985 | ], |
984 | 986 | "source": [ |
985 | | - "ax2 = ndbc.plot_rose(wtk_hourly_wind['winddirection_10m_0'],wtk_hourly_wind['windspeed_10m_0'],\n", |
| 987 | + "ax2 = plot_rose(wtk_hourly_wind['winddirection_10m_0'],wtk_hourly_wind['windspeed_10m_0'],\n", |
986 | 988 | " width_direction,width_velocity)" |
987 | 989 | ] |
988 | 990 | }, |
|
999 | 1001 | "execution_count": 14, |
1000 | 1002 | "metadata": {}, |
1001 | 1003 | "outputs": [ |
1002 | | - { |
1003 | | - "name": "stderr", |
1004 | | - "output_type": "stream", |
1005 | | - "text": [ |
1006 | | - "WARNING:urllib3.connectionpool:Retrying (Retry(total=6, connect=10, read=10, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /api/hsds/datasets/d-bf1ee746-f22af1ee-ce40-863b0e-18a71b?domain=%2Fnrel%2Fwtk%2Foffshore_ca%2FOffshore_CA_2018.h5&api_key=x9f0SNincVSAIeKKuGDUOhyvfRYmrTzg06vZyeuw\n", |
1007 | | - "WARNING:urllib3.connectionpool:Retrying (Retry(total=6, connect=10, read=10, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /api/hsds/datasets/d-bf1ee746-f22af1ee-3ec7-709e83-7740a7?domain=%2Fnrel%2Fwtk%2Foffshore_ca%2FOffshore_CA_2018.h5&api_key=x9f0SNincVSAIeKKuGDUOhyvfRYmrTzg06vZyeuw\n", |
1008 | | - "WARNING:urllib3.connectionpool:Retrying (Retry(total=4, connect=10, read=10, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /api/hsds/datasets/d-bf1ee746-f22af1ee-8082-2ff043-910c51?domain=%2Fnrel%2Fwtk%2Foffshore_ca%2FOffshore_CA_2018.h5&api_key=x9f0SNincVSAIeKKuGDUOhyvfRYmrTzg06vZyeuw\n" |
1009 | | - ] |
1010 | | - }, |
1011 | 1004 | { |
1012 | 1005 | "data": { |
1013 | 1006 | "text/plain": [ |
1014 | | - "<matplotlib.legend.Legend at 0x1d0af709e20>" |
| 1007 | + "<matplotlib.legend.Legend at 0x29b2f45adc0>" |
1015 | 1008 | ] |
1016 | 1009 | }, |
1017 | 1010 | "execution_count": 14, |
|
0 commit comments