{"id":20687136,"url":"https://github.com/bluegreen-labs/skylight","last_synced_at":"2025-10-13T11:11:42.808Z","repository":{"id":62262202,"uuid":"553782783","full_name":"bluegreen-labs/skylight","owner":"bluegreen-labs","description":"A Simple Sky Illuminance Model","archived":false,"fork":false,"pushed_at":"2025-09-24T13:02:29.000Z","size":6912,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-25T04:22:50.729Z","etag":null,"topics":["ephemerides","illuminance","r","r-package","rstats","sky"],"latest_commit_sha":null,"homepage":"https://bluegreen-labs.github.io/skylight/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bluegreen-labs.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-10-18T19:03:53.000Z","updated_at":"2025-09-24T12:57:18.000Z","dependencies_parsed_at":"2023-01-21T22:46:03.048Z","dependency_job_id":"994eaec3-214e-4e21-a724-b915d694c601","html_url":"https://github.com/bluegreen-labs/skylight","commit_stats":{"total_commits":70,"total_committers":1,"mean_commits":70.0,"dds":0.0,"last_synced_commit":"c12dc7921407aefd797c950768f24436e0191eec"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bluegreen-labs/skylight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluegreen-labs%2Fskylight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluegreen-labs%2Fskylight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluegreen-labs%2Fskylight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluegreen-labs%2Fskylight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluegreen-labs","download_url":"https://codeload.github.com/bluegreen-labs/skylight/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluegreen-labs%2Fskylight/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014757,"owners_count":26085593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ephemerides","illuminance","r","r-package","rstats","sky"],"created_at":"2024-11-16T22:56:04.002Z","updated_at":"2025-10-13T11:11:42.797Z","avatar_url":"https://github.com/bluegreen-labs.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Skylight \u003ca href='https://github.com/bluegreen-labs/skylight'\u003e\u003cimg src='logo.png' align=\"right\" height=\"139\" /\u003e\u003c/a\u003e\n\n[![R-CMD-check](https://github.com/bluegreen-labs/skylight/actions/workflows/check-package.yaml/badge.svg)](https://github.com/bluegreen-labs/skylight/actions/workflows/check-package.yaml)\n[![CRAN\\_Status\\_Badge](https://www.r-pkg.org/badges/version/skylight)](https://cran.r-project.org/package=skylight)\n[![](https://cranlogs.r-pkg.org/badges/grand-total/skylight)](https://cran.r-project.org/package=skylight)\n[![codecov](https://codecov.io/gh/bluegreen-labs/skylight/branch/main/graph/badge.svg?token=66IIX0HL7K)](https://app.codecov.io/gh/bluegreen-labs/skylight)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7222045.svg)](https://doi.org/10.5281/zenodo.7222045)\n\nThe `skylight` package returns sky illuminance parameters for both the sun and \nthe moon, for a given date/time and location. In addition, ancillary \nparameters such as sun and moon azimuth and altitude are provided. The code is \nan almost verbatim transcription of the work by Janiczek and DeYoung (1987), \npublished in the US Naval observatory circular. An online copy of this \nmanuscripts can be found on the internet archive \n(\u003chttps://archive.org/details/DTIC_ADA182110\u003e).\n\nVery few adjustments to the original code where made to ensure equivalency in \nresults. As such, most of the naming of the subroutines and variables was \nretained. However, some changes were made to the main routine and subroutines \nto ensure vectorization of the code to speed up batch processing of data. \n\nWith time more detailed information will be added to all functions, including \nreferences to subroutine functions and more transparent variable names, while\nlimiting variable recycling (a common practice in the original code base). \nThe code delivers equivalent results with the programme certification values \npublished in Table A of Janiczek and DeYoung (1987), as such all original \nlimitations remain (see below).\n\n## How to cite this package in your article\n\n\u003e Hufkens, K. et al. (2023) ‘Evaluating the effects of moonlight on the vertical flight profiles of three western palaearctic swifts’. Royal Society Proceedings B. doi: 10.1098/rspb.2023.0957, in addition reference the original work by Janiczek and DeYoung (1987, see below)\n\n## Limitations\n\nThe sky illuminance model by Janiczek and DeYoung (1987) in `skylight` has some limitations:\n\n- Design specifications aimed for 0.5 degrees in angle, or two minutes of times. Last digits should be considered uncertain by one unit.\n- At latitudes less than 60 degrees, the model should agree with more refined calculations to within one or two minutes of time. For latitudes above this value the model can produce errors of up to four minutes.\n- In some circumstances calculated illuminance values might differ from real light\nlevels of a factor 10 or more.\n- Strong coherence and proper time keeping is required, there is a strong requirement\nto provide dates in GMT, corrections based upon latitude (not civil time zone) should\nbe executed before processing. No warnings are provided.\n\nYet, overall the model should provide a fast approximation where more computationally expensive models would only provide marginal benefits for most applications. \nFor a full description of the model I refer to Janiczek and DeYoung (1987).\n\n## Installation\n\n### stable release\n\nTo install the current stable release use a CRAN repository:\n\n```r\ninstall.packages(\"skylight\")\nlibrary(\"skylight\")\n```\n\n### development release\n\nTo install the development releases of the package run the following\ncommands:\n\n``` r\nif(!require(remotes)){install.packages(\"remotes\")}\nremotes::install_github(\"bluegreen-labs/skylight\")\nlibrary(\"skylight\")\n```\n\nVignettes are not rendered by default, if you want to include additional\ndocumentation please use:\n\n``` r\nif(!require(remotes)){install.packages(\"remotes\")}\nremotes::install_github(\"bluegreen-labs/skylight\", build_vignettes = TRUE)\nlibrary(\"skylight\")\n```\n\n## Use\n### Single date/time and location\n\nskylight values can be calculated for a single point and date using the below call. This will generate a data frame with model values.\n\n```r\n# load the library\nlibrary(skylight)\n\n# calculate sky illuminance values for\n# a single date/time and location\ndf \u003c- skylight(\n      longitude = -135.8,\n      latitude = -23.4,\n      date = as.POSIXct(\"1986-12-18 21:00:00\", tz = \"GMT\"),\n      sky_condition = 1\n    )\n```\n\n### Multiple dates/times and/or locations\n\nThe skylight function is vectorized, so you can provide vectors of input parameters instead of using a loop and the above function call.\n\n```r\n# Generate a dataset with 15 minute values\n# for approximately two months\ninput \u003c- data.frame(\n  longitude = 0,\n  latitude = 50,\n  date =  as.POSIXct(\"2020-06-18 00:00:00\", tz = \"GMT\") + seq(0, 60*24*3600, 900),\n  sky_conditions = 1\n)\n\n# calculate sky illuminance values for\n# a single date/time and location\ndf \u003c- skylight(\n      input$longitude,\n      input$latitude,\n      input$date,\n      1\n    )\n\n# previous results are of the same dimension (rows)\n# as the input data and can be bound together\n# for easy plotting\ninput \u003c- cbind(input, df)\n```\n\nPlotting this data results in \n\n![](https://bluegreen-labs.github.io/skylight/articles/skylight_files/figure-html/unnamed-chunk-4-1.png)\n\n### Piped data workflow\n\n`skylight` supports piped data frames with appropriatedly named columns as input\nto the function. This allows for fast processing of large data frames, with the\nadded advantage that input parameters are returned with the calculated data.\n\nNote that you need a data frame with the three most basic parameters:\n- longitude\n- latitude\n- date\nnamed as such (all lower case). The function will complain if it doesn't\nfind the required column names. Also note that due to the priority of the\npiped construction over the other parameters all parameters should be named\nwhen calling the function in a conventional way.\n\n\n```r\n# recreating the data frame with parameters\n# as before\ninput \u003c- data.frame(\n  longitude = 0,\n  latitude = 50,\n  date =  as.POSIXct(\"2020-06-18 00:00:00\", tz = \"GMT\") + seq(0, 1*24*3600, 1800),\n  sky_condition = 1\n)\n\n# but now using the piped approach to calculate\n# all values\n\ndf \u003c- input |\u003e skylight()\n```\n\n### Speed and other considerations\n\nThe current code, using the vectorized piped approach, is sufficiently fast to\nsupport larger data sets. For example a more advanced cloud cover correction is\ndescribed in the vignettes and taking this analysis as inspiration animations\nof illuminance can be made (as shown below).\n\n![](https://raw.githubusercontent.com/bluegreen-labs/skylight/main/map.gif)\n\n\n## Licensing\n\nThe `skylight` package is distributed under a AGPLv3 license, while the skylight model code resides in the public domain made available by Janiczek and DeYoung (1987). The logo is in part based upon Emoji One v2.0 iconography.\n\n## References\n\n- Janiczek and DeYoung (1997). [Computer Programs for Sun and\n Moon Illuminance With Contingent Tables and Diagrams](https://archive.org/details/DTIC_ADA182110),\n US Naval observatory circular nr. 171, 1987\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluegreen-labs%2Fskylight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluegreen-labs%2Fskylight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluegreen-labs%2Fskylight/lists"}