Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate maptools for sunset / sunrise calculation #561

Closed
adokter opened this issue May 16, 2023 · 4 comments
Closed

deprecate maptools for sunset / sunrise calculation #561

adokter opened this issue May 16, 2023 · 4 comments
Assignees
Milestone

Comments

@adokter
Copy link
Owner

adokter commented May 16, 2023

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):

  • as.data.frame.vp()
  • as.data.frame.vpts()
  • check_night()
  • check_night.default
  • check_night.vp
  • check_night.list
  • check_night.vpts
  • check_night.vpi
  • check_night.pvol
  • filter_vpts()
  • plot.vpi()
  • sunrise()
  • sunset()
@adokter
Copy link
Owner Author

adokter commented May 16, 2023

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

@adokter
Copy link
Owner Author

adokter commented May 16, 2023

see also #500

@baptischmi
Copy link
Collaborator

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)

@adokter adokter added this to the 0.7.0 milestone Jun 6, 2023
@bart1
Copy link
Collaborator

bart1 commented Jun 6, 2023

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: datastorm-open/suncalc#8

@iskandari iskandari self-assigned this Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants