{"id":42581472,"url":"https://github.com/klausbrunner/solarpos","last_synced_at":"2026-01-28T22:09:42.539Z","repository":{"id":65248287,"uuid":"586826686","full_name":"klausbrunner/solarpos","owner":"klausbrunner","description":"Scripting-friendly CLI program to calculate accurate topocentric sun position, sunrise, sunset and twilight times. Supports bulk/stream processing.","archived":false,"fork":false,"pushed_at":"2025-09-18T09:15:33.000Z","size":2123,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-18T11:32:37.944Z","etag":null,"topics":["astronomy","science","solar","solartracker","sun","sun-position","sunpath","sunposition","sunrise-sunset"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klausbrunner.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2023-01-09T10:22:22.000Z","updated_at":"2025-09-18T09:12:26.000Z","dependencies_parsed_at":"2023-02-19T09:15:18.955Z","dependency_job_id":"8dbc4ec3-97a8-4051-86a8-2560f94b3019","html_url":"https://github.com/klausbrunner/solarpos","commit_stats":{"total_commits":135,"total_committers":3,"mean_commits":45.0,"dds":0.3037037037037037,"last_synced_commit":"46497e0e9aa2115c19720b5c85abdb5a8157ab96"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/klausbrunner/solarpos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klausbrunner%2Fsolarpos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klausbrunner%2Fsolarpos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klausbrunner%2Fsolarpos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klausbrunner%2Fsolarpos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klausbrunner","download_url":"https://codeload.github.com/klausbrunner/solarpos/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klausbrunner%2Fsolarpos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28853238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["astronomy","science","solar","solartracker","sun","sun-position","sunpath","sunposition","sunrise-sunset"],"created_at":"2026-01-28T22:09:42.425Z","updated_at":"2026-01-28T22:09:42.533Z","avatar_url":"https://github.com/klausbrunner.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# solarpos\n\n\u003e [!NOTE]  \n\u003e [sunce](https://github.com/klausbrunner/sunce) is a rewrite of `solarpos` with better performance and functional enhancements.\n\n`solarpos` is a command-line application for computing topocentric solar coordinates and solar events such as sunrise, sunset, transit, and twilight. It is designed for scripting and bulk processing: the tool supports time series, geographic sweeps, file input, and streaming, and produces machine-friendly output (CSV or JSON Lines) for use in data pipelines. Built on the [solarpositioning](https://github.com/klausbrunner/solarpositioning) library of high-accuracy algorithms.\n\n## Use cases\n\n![Global Solar Elevation Animation](docs/solar_elevation_animation.webp)\n*Global solar elevation patterns animation created with a Python script using solarpos, combining time range and coordinate sweep*\n\n- **Solar-energy operations** – compute sun angles and event times for panel tracking, production estimates, and scheduling.\n- **Astronomical and simulation tools** – provide precise solar positions for rendering and sky models.\n- **Geospatial processing** – integrate into GIS or ETL pipelines via command-line streaming and CSV/JSON output.\n\n## Requirements and installation\n\n- Java 21 or newer for running the JAR distribution.\n- Native executables are provided for some platforms and do not require a Java runtime.\n\nDownload the latest release JAR from the [releases page](https://github.com/klausbrunner/solarpos/releases/latest) and\nrun with `java -jar solarpos.jar`, or directly use a native build where available. On MacOS, this is easiest using [Homebrew](https://brew.sh):\n\n```shell\nbrew install klausbrunner/tap/solarpos-native\n```\n\n## Quick start\n\nRun the JAR directly or use a native executable:\n\n```bash\n\n# Getting today's sunrise and sunset in Madrid\n# JAR example\njava -jar solarpos.jar 40.42 -3.70 now --timezone UTC sunrise\n\n# Native executable (or shell wrapper) example\nsolarpos 40.42 -3.70 now --timezone UTC sunrise\n```\n\n### Example commands\n\n```bash\n# Sun position in Stockholm on 2026-01-15 at 12:30 CET\nsolarpos 59.334 18.063 2026-01-15T12:30:00+01:00 position\n\n# Time series: positions in Berlin every 10 minutes, CSV output, with delta-T estimate\nsolarpos 52.522 13.413 2023-03-26 --timezone Europe/Berlin --deltat --format=csv position --step=600\n\n# Geographic grid: positions across Central Europe at noon (1° resolution)\nsolarpos 45.0:50.0:1.0 5.0:15.0:1.0 2026-06-21T12:00:00Z --format=csv position\n\n# Sunrise, sunset, and twilight times for Tokyo throughout March 2027, JSON output\nsolarpos 35.68 139.69 2027-03 --timezone Asia/Tokyo --format=json sunrise --twilight\n```\n\n## File input and streaming\n\n`solarpos` accepts file input for coordinates and times and supports stdin streaming via the `@-` syntax. This is useful when composing pipelines or when input is generated programmatically.\n\nInput modes:\n\n- **Coordinate files:** pass `@coords.txt` as the latitude parameter to read coordinates from a file. Each line contains a latitude and longitude (space- or comma-separated).\n- **Time files:** pass `@times.txt` as the date/time parameter to read timestamps from a file, one timestamp per line.\n- **Paired data files:** pass `@data.txt` to provide explicit `latitude longitude datetime` records on each line; paired input is treated as one record per line with no cartesian expansion.\n- **Stdin:** use `@-` in place of a filename to read the corresponding parameter from standard input. Only one parameter may read from stdin at a time.\n\nExamples:\n\n```bash\n# Pipe a single paired record from stdin\necho \"52.0,25.0,2023-06-21T12:00:00\" | solarpos @- position\n\n# Stream coordinate pairs from stdin and evaluate for a fixed time\ncat coords.txt | solarpos @- 2023-06-21T12:00:00 position\n\n# Generate timestamps and pipe them in for a single location\ngenerate-times | solarpos 52.0 25.0 @- position\n```\n\nFiles may include blank lines and comments (lines starting with `#`). Both space-separated and CSV style are accepted.\n\n## Time series and geographic sweeps\n\n- **Time ranges:** pass a year (e.g., `2026`) or year-month (`2026-06`) to obtain a daily series for that period when using the `sunrise` command. The `position` command produces per-step samples for the period or day specified; the step is controlled with `--step` (default 1 hour).\n- **Geographic ranges:** use `start:end:step` syntax for latitude and/or longitude to define a grid (e.g., `40.0:45.0:0.5`). Geographic sweeps combine with time series to produce spatio-temporal datasets.\n\n## Output formats\n\n- `human` (default) – readable text for quick checks.\n- `csv` – comma-separated values with headers by default; use `--no-headers` to omit them.\n- `json` – JSON Lines (one JSON object per line) for streaming and line-oriented processing.\n\n## Key options\n\n- `--timezone=\u003ctz\u003e` – timezone as an offset (e.g., `+01:00`) or a TZ database name (e.g., `Europe/Berlin`).\n- `--deltat[=\u003cseconds\u003e]` – specify delta-T explicitly, or provide the option without value to request an automatic estimate. For background on delta-T see [solarpositioning](https://github.com/klausbrunner/solarpositioning).\n- `--format=\u003cformat\u003e` – output format: `human`, `csv`, or `json`.\n- `--[no-]headers` – include/omit header row for CSV output (default: headers on).\n- `--[no-]parallel` – use parallel processing. Increases throughput, but also memory usage.\n- `--[no-]show-inputs` – include input parameters in the output.\n- `--step=\u003cseconds\u003e` – time step for `position` time series sampling.\n\nRun `solarpos help` or `solarpos help \u003ccommand\u003e` for the full reference.\n\n## License\n\nThis project is distributed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nPlease open issues or pull requests for bugs, documentation improvements, and feature requests. Include command-line examples and expected output when reporting problems.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklausbrunner%2Fsolarpos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklausbrunner%2Fsolarpos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklausbrunner%2Fsolarpos/lists"}