Skip to content

Commit

Permalink
Added show import
Browse files Browse the repository at this point in the history
  • Loading branch information
micahjohnson150 committed Aug 17, 2024
1 parent dfd7f79 commit 220d6eb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions book/tutorials/snowex_database/5_plot_raster_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,26 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'show' is not defined",
"ename": "AttributeError",
"evalue": "type object 'RasterMeasurements' has no attribute 'from_filter'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[2], line 12\u001b[0m\n\u001b[1;32m 9\u001b[0m ds \u001b[38;5;241m=\u001b[39m RasterMeasurements\u001b[38;5;241m.\u001b[39mfrom_filter(observers\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mASO Inc.\u001b[39m\u001b[38;5;124m'\u001b[39m, date\u001b[38;5;241m=\u001b[39mdt, \u001b[38;5;28mtype\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mswe\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 11\u001b[0m \u001b[38;5;66;03m# Plot it up!\u001b[39;00m\n\u001b[0;32m---> 12\u001b[0m \u001b[43mshow\u001b[49m(ds[\u001b[38;5;241m0\u001b[39m], vmin\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0.1\u001b[39m, vmax\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0.4\u001b[39m, cmap\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mwinter\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 14\u001b[0m \u001b[38;5;66;03m# Note the resolution!\u001b[39;00m\n\u001b[1;32m 15\u001b[0m ds[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m.\u001b[39mres\n",
"\u001b[0;31mNameError\u001b[0m: name 'show' is not defined"
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[1], line 10\u001b[0m\n\u001b[1;32m 7\u001b[0m dt \u001b[38;5;241m=\u001b[39m datetime(\u001b[38;5;241m2020\u001b[39m, \u001b[38;5;241m2\u001b[39m, \u001b[38;5;241m13\u001b[39m)\n\u001b[1;32m 9\u001b[0m \u001b[38;5;66;03m# Query db filtering to swe on a certain date surveyed by ASO\u001b[39;00m\n\u001b[0;32m---> 10\u001b[0m ds \u001b[38;5;241m=\u001b[39m \u001b[43mRasterMeasurements\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_filter\u001b[49m(observers\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mASO Inc.\u001b[39m\u001b[38;5;124m'\u001b[39m, date\u001b[38;5;241m=\u001b[39mdt, \u001b[38;5;28mtype\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mswe\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 12\u001b[0m \u001b[38;5;66;03m# Plot it up!\u001b[39;00m\n\u001b[1;32m 13\u001b[0m show(ds[\u001b[38;5;241m0\u001b[39m], vmin\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0.1\u001b[39m, vmax\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0.4\u001b[39m, cmap\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mwinter\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
"\u001b[0;31mAttributeError\u001b[0m: type object 'RasterMeasurements' has no attribute 'from_filter'"
]
}
],
"source": [
"# import in the raster measurments class\n",
"from snowexsql.api import RasterMeasurements\n",
"from datetime import datetime \n",
"from rasterio.plot import show\n",
"\n",
"# Pick a date\n",
"dt = datetime(2020, 2, 13)\n",
Expand Down

0 comments on commit 220d6eb

Please sign in to comment.