|
34 | 34 | { |
35 | 35 | "cell_type": "code", |
36 | 36 | "execution_count": null, |
37 | | - "id": "8ac0d0cc-a65d-4368-baa9-7d5dfb4936a7", |
| 37 | + "id": "78db0877-2ba9-4e8f-ba2e-a07e4de491ca", |
38 | 38 | "metadata": {}, |
39 | 39 | "outputs": [], |
40 | 40 | "source": [ |
|
71 | 71 | " \"len\": 40.0,\n", |
72 | 72 | " \"res\": 120.0,\n", |
73 | 73 | " \"maxi\": 5,\n", |
74 | | - " \"cycle\": 15,\n", |
75 | 74 | " \"rgt\": 658,\n", |
76 | 75 | " \"time_start\":'2020-01-01',\n", |
77 | 76 | " \"time_end\":'2021-01-01',\n", |
|
82 | 81 | { |
83 | 82 | "cell_type": "code", |
84 | 83 | "execution_count": null, |
85 | | - "id": "970e0770-abe9-4e2a-b1af-bc6e330fb566", |
86 | | - "metadata": {}, |
| 84 | + "id": "b815e8d8-c71a-4305-8649-fa4e95b64325", |
| 85 | + "metadata": { |
| 86 | + "tags": [] |
| 87 | + }, |
87 | 88 | "outputs": [], |
88 | 89 | "source": [ |
89 | 90 | "#\n", |
90 | 91 | "# Set DEM of Interest\n", |
91 | 92 | "#\n", |
92 | | - "id = 17\n", |
93 | 93 | "gdf.attrs['file_directory']" |
94 | 94 | ] |
95 | 95 | }, |
|
143 | 143 | "#\n", |
144 | 144 | "# Get Boundaries for each Raster\n", |
145 | 145 | "#\n", |
| 146 | + "p0 = 132\n", |
| 147 | + "p1 = 148\n", |
146 | 148 | "raster_of_interest = {}\n", |
147 | | - "for i in gdf.attrs['file_directory']:\n", |
| 149 | + "for i in list(gdf.attrs['file_directory'].keys())[p0:p1]:\n", |
| 150 | + " print(\"Retrieving raster info for:\", gdf.attrs['file_directory'][i])\n", |
148 | 151 | " rlist = getBB(gdf.attrs['file_directory'][i])\n", |
149 | 152 | " raster_of_interest[\"dem\"+str(i)] = sliderule.toregion(rlist)" |
150 | 153 | ] |
|
168 | 171 | " else:\n", |
169 | 172 | " return None\n", |
170 | 173 | "sampled_data = gdf[gdf['strips.time'].notnull()]\n", |
171 | | - "for i in gdf.attrs['file_directory']:\n", |
| 174 | + "for i in list(gdf.attrs['file_directory'].keys())[p0:p1]:\n", |
172 | 175 | " sampled_data[\"dem\"+str(i)] = sampled_data.apply(lambda x: getValue(x, i), axis=1)" |
173 | 176 | ] |
174 | 177 | }, |
175 | 178 | { |
176 | 179 | "cell_type": "code", |
177 | 180 | "execution_count": null, |
178 | | - "id": "24e1c0c3-b4e5-4bcd-af34-26bfa6885c91", |
| 181 | + "id": "f23a3827-93b6-47cb-9842-8f8269e0a871", |
179 | 182 | "metadata": {}, |
180 | 183 | "outputs": [], |
181 | 184 | "source": [ |
182 | | - "\n", |
183 | | - "#\n", |
184 | | - "# Create Boundaries for Region and Raster\n", |
185 | | - "#\n", |
186 | | - "\n", |
187 | 185 | "#\n", |
188 | | - "# Plot\n", |
| 186 | + "# Plot Overlays of Boundaries and Returns\n", |
189 | 187 | "#\n", |
190 | 188 | "fig = plt.figure(num=None, figsize=(24, 24))\n", |
191 | 189 | "region_lons = [p[\"lon\"] for p in region_of_interest[\"poly\"]]\n", |
192 | 190 | "region_lats = [p[\"lat\"] for p in region_of_interest[\"poly\"]]\n", |
193 | 191 | "ax = {}\n", |
194 | | - "for i in gdf.attrs['file_directory']:\n", |
| 192 | + "k = 0\n", |
| 193 | + "for i in list(gdf.attrs['file_directory'].keys())[p0:p1]:\n", |
195 | 194 | " raster_lons = [p[\"lon\"] for p in raster_of_interest[\"dem\"+str(i)][\"poly\"]]\n", |
196 | 195 | " raster_lats = [p[\"lat\"] for p in raster_of_interest[\"dem\"+str(i)][\"poly\"]]\n", |
197 | 196 | " plot_data = sampled_data[sampled_data[\"dem\"+str(i)].notnull()]\n", |
198 | 197 | " plot_data = sampled_data[sampled_data[\"dem\"+str(i)] > -9990]\n", |
199 | | - " ax[i] = plt.subplot(5,4,i+1)\n", |
200 | | - " gdf.plot(ax=ax[i], column='h_mean', color='y', markersize=0.5)\n", |
201 | | - " plot_data.plot(ax=ax[i], column='h_mean', color='b', markersize=0.5)\n", |
202 | | - " ax[i].plot(region_lons, region_lats, linewidth=1.5, color='r', zorder=2)\n", |
203 | | - " ax[i].plot(raster_lons, raster_lats, linewidth=1.5, color='g', zorder=2)\n", |
| 198 | + " ax[k] = plt.subplot(5,4,k+1)\n", |
| 199 | + " gdf.plot(ax=ax[k], column='h_mean', color='y', markersize=0.5)\n", |
| 200 | + " plot_data.plot(ax=ax[k], column='h_mean', color='b', markersize=0.5)\n", |
| 201 | + " ax[k].plot(region_lons, region_lats, linewidth=1.5, color='r', zorder=2)\n", |
| 202 | + " ax[k].plot(raster_lons, raster_lats, linewidth=1.5, color='g', zorder=2)\n", |
| 203 | + " k += 1\n", |
204 | 204 | "plt.tight_layout()" |
205 | 205 | ] |
206 | 206 | }, |
|
218 | 218 | "######################\n", |
219 | 219 | "# Select DEM File ID #\n", |
220 | 220 | "######################\n", |
221 | | - "file_id = 5\n", |
| 221 | + "file_id = list(gdf.attrs['file_directory'].keys())[p0]\n", |
222 | 222 | "\n", |
223 | 223 | "# Setup Plot\n", |
224 | 224 | "fig,ax = plt.subplots(num=None, figsize=(10, 8))\n", |
|
0 commit comments