adokter / bioRad

R package for analysis and visualisation of biological signals in weather radar data
http://adokter.github.io/bioRad
Other
28 stars 16 forks source link

deprecate maptools for sunset / sunrise calculation #561

Closed adokter closed 1 year ago

adokter commented 1 year ago

With deprecation of maptools package (#545) sunrise and sunset calculation is lost in its current form.

Functions currently parsing an argument to sunrise / sunset functions (usually elev, the solar elevation defining sunset / sunset):

adokter commented 1 year ago

Option 1: Package suncalc provides sunrise/sunset times

Option 2: A skeleton package with former maptools sunrise/sunset functions is available, which could be copied into bioRad

Option 3: strip out sp methods from sunMaptools, use only what we need

adokter commented 1 year ago

see also https://github.com/adokter/bioRad/issues/500

baptischmi commented 1 year ago

Option 1: Package suncalc provides sunrise/sunset times

  • pros: no sp dependence, maintained by others
  • cons: no sun elevation argument, would require elev argument deprecation in all above functions

Option 2: A skeleton package with former maptools sunrise/sunset functions is available, which could be copied into bioRad

  • pros: no need to change anything
  • cons: sunMapTools still dependent on sp, which will be deprecated in the future

Option 3: strip out sp methods from sunMaptools, use only what we need

  • pros: keeps elev argument, less refactor in bioRad
  • cons: another piece of code to maintain ourselves

Note that for suncalc::getSunlightTimes(), the 'elev' argument is categorised in the keep argument. Available variables are : "sunrise" : sunrise (top edge of the sun appears on the horizon) "sunriseEnd" : sunrise ends (bottom edge of the sun touches the horizon) "goldenHourEnd" : morning golden hour (soft light, best time for photography) ends "solarNoon" : solar noon (sun is in the highest position) "goldenHour" : evening golden hour starts "sunsetStart" : sunset starts (bottom edge of the sun touches the horizon) "sunset" : sunset (sun disappears below the horizon, evening civil twilight starts) "dusk" : dusk (evening nautical twilight starts) "nauticalDusk" : nautical dusk (evening astronomical twilight starts) "night" : night starts (dark enough for astronomical observations) "nadir" : nadir (darkest moment of the night, sun is in the lowest position) "nightEnd" : night ends (morning astronomical twilight starts) "nauticalDawn" : nautical dawn (morning nautical twilight starts) "dawn" : dawn (morning nautical twilight ends, morning civil twilight starts)

bart1 commented 1 year ago

Hi not very relevant any more but for future reference I would not go for the suncalc package as long at this issue is not resolved: https://github.com/datastorm-open/suncalc/issues/8