Skip to article frontmatterSkip to article content

Tutorial Author Micah’: Micah Sandusky

Tutorial Author Micah_o: Micah Johnson

SnowEx has introduced a unique opportunity to study SWE in a way that’s unprecedented, but with more data comes new challenges.

examples

The SnowEx database is a resource that shortcuts the time it takes to ask cross dataset questions

What’s in it?

  • Snow pits - Density, hardness profiles, grain types + sizes
  • Manual snow depths - TONS of depths (Can you say spirals?)
  • Snow Micropenetrometer (SMP) profiles - (Subsampled to every 100th)
  • Snow depth + SWE rasters from ASO Inc.
  • GPR
  • Pit site notes
  • Camera Derived snow depths
  • Snow off DEM from USGS 3DEP
  • And almost all the associated metadata

Technically, what is it?

  • PostgreSQL database
  • PostGIS extension
  • Supports vector and raster data
  • And a host of GIS operations
  • AND NOW WITH API!

So what’s the catch?

New tech can create barriers...

pits not bits

TL;DR Do less wrangling, do more crunching.

How do I get at this magical box of data ?

Welcome to API Land

from snowexsql.api import PointMeasurements

df = PointMeasurements.from_filter(type="depth", instrument='pit ruler', limit=100)
df.plot(column='value', cmap='jet', vmin=10, vmax=150)
df
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 from snowexsql.api import PointMeasurements
      3 df = PointMeasurements.from_filter(type="depth", instrument='pit ruler', limit=100)
      4 df.plot(column='value', cmap='jet', vmin=10, vmax=150)

ModuleNotFoundError: No module named 'snowexsql'

Old Ways / Advanced Users

Advanced queries can be made using SQL or SQAlchemy under the hood.

See previous presentations

Engine objects, session objects, and a crash course in ORM, oh my!