Open BonnieAhr opened 3 years ago
Hi Bonnie. I have a similar thing that uses suncalc to pull "sunrise", "sunset", "dawn", "dusk" but day/night would be a useful addition. LMK where your function lives for future reference. Cheers!
DawnDusk from blocklab
As a different option to solar irradiance sometimes you want a categorical variable for day/night/or crepuscular periods. The function I currently use pulls down sunrise/sunset times using package suncalc (for the local time) and then adds a column to the data "TimeofDay" with either a "Day" or "night" distinction. It also has an option to add another category of crepuscular. The user can choose if crepuscular means 1 hour before/after sunrise and sunset or can change it to be 2 hours etc and it will include a "dawn" or "dusk" category.