mattparrilla / mansfield-stake

Visualize the snow depth at the Mt. Mansfield stake
1 stars 1 forks source link

Clean Data #3

Closed mattparrilla closed 9 years ago

mattparrilla commented 9 years ago

There seem to be some weird spikes (like the one around thanksgiving), make sure all data is clean. screenshot 2015-01-21 14 10 30

mattparrilla commented 9 years ago

views.py

# Sometimes there are 0 measurements instead of nulls or there are
# impossibly low measurements (like a 2" measurement between a 34"
# and a 38" measurement. This eliminates those anomolies.
if ((depth < 5 and last_depth > 10 or last_depth - depth > 20) and
    (int(month) > 9 or int(month) < 4)):

    depth = last_depth

# In 1956 there's an extra zero (120 instead of 12)
elif depth - last_depth > 100:
    depth = last_depth