bluegreen-labs / snotelr

a snow data network (SNOTEL) R package
https://bluegreen-labs.github.io/snotelr/
GNU Affero General Public License v3.0
14 stars 10 forks source link

first and last snow melt day of year capped at 179 #24

Closed jeffmarti closed 5 months ago

jeffmarti commented 5 months ago

Hello, it looks like both the "first_snow_melt_doy" and "last_snow_melt_doy" values in the SNOTEL phenology data are capped at DOY 179.

You can also see the effects of this in the phenology plot below (site id 679). Is this an error and am I missing something in the interpretation of the data? Thank you. - Jeff

image

khufkens commented 5 months ago

This is an artefact of dealing with seasonality. The assumption is that the period DOY -180 to 180 captures both SOS and EOS. This most likely is a site at high latitude (Alaska?, didn't check) and snow melt can therefore be initiated very late.

This should be fixed by increasing the window over which the stats are calculated. I should check the logic of the routine to see if just increasing this value does what it should do. Any pull request fixing this would be appreciated though, I'm rather tied up for now.

https://github.com/bluegreen-labs/snotelr/blob/356e557b1b408577def45f60420d91d97ab5d7af/R/snotel_phenology.r#L72

khufkens commented 5 months ago

This is now fixed by #26 in github version 1.3

Check https://github.com/bluegreen-labs/snotelr/blob/master/analysis/test_offset.R

for an example. I've not yet fixed the GUI to have a dynamic offset

jeffmarti commented 5 months ago

Thank you!