Sunrise, sunset, moonrise, and moonset
panchangam.rise-set
Swiss Ephemeris rise/transit searches produce local sky-marker instants.
Assurance
| Level | Current statement |
|---|---|
| Documented and traceable | Yes — the canonical record includes the process and a worked example. |
| Regression or reproduction checked | Linked to 2 repository test file(s). |
| Independently source-supported | Partial support only; read the provenance note and limitations before generalizing. |
Computation method
Method type: algorithm
Convert local civil midnight to UT Julian day and ask Swiss Ephemeris for the next Sun or Moon rise/set event using fixed observer and atmosphere parameters.
Process
- Localize 00:00 on the requested date in the IANA timezone and convert it to UTC Julian day.
- Call swe.rise_trans for Sun or Moon with CALC_RISE or CALC_SET.
- Use [longitude, latitude, 0 metres], pressure 1013.25 hPa, temperature 15 C, and Swiss default upper-limb/refraction behavior.
- Search sunset from sunrise and next sunrise from the following local midnight.
- Convert tret[0] to a whole-second UTC datetime.
Worked example
Hyderabad, 2026-06-11
Inputs
- Location: Hyderabad, Asia/Kolkata
- Altitude forced to 0 metres
- Swiss default rise/set flags and atmosphere
Calculation
- Search the next solar rise after local midnight, then solar set after that rise.
- Search the next lunar rise and set after local midnight.
Result
- Sunrise: 05:41:11 IST; sunset: 18:50:12 IST
- Moonrise: 01:55:18 IST; moonset: 14:53:44 IST
Method notes
- Swiss return codes are ignored; polar no-event cases are not represented safely.
- The Hindu disc-centre/no-refraction convention remains unresolved.
Contract
Owning layer: engine-core
Claim kind: deterministic-fact
Time basis: Search from local-midnight Julian day with observer coordinates.
Inputs
- date
- latitude
- longitude
- fixed pressure 1013.25 hPa
- fixed temperature 15 C
- hard-coded altitude 0 m
Outputs
- UTC rise/set instants rendered in local timezone
References and evidence
Evidence classes: astronomical
Verification states: partially_verified
Swiss Ephemeris documents the current astronomical-default behavior; issue 177 tracks the Hindu-calendar convention decision and multi-city comparisons.
panchangam.rise_set_convention
Evidence class: astronomical
Verification state: partially_verified
Locator: Swiss Ephemeris Programmer's Documentation sections 8.12 and 8.12.1; convention decision and comparison gap tracked in GitHub issue 177
Last reviewed: 2026-08-27
Scope: Precisely traces the current astronomical-default rise_trans behavior: upper limb with refraction, fixed 1013.25 hPa and 15 C, and zero-metre altitude passed by all engines. It does not establish that this is the intended Hindu-calendar convention or independently verify multiple city/date cells.
Sources
- Swiss Ephemeris — Astrodienst; Swiss Ephemeris 2.10 Programmer's Documentation and pyswisseph runtime used by the repository; authority type:
astronomical_reference
drik.sidereal_positions
Evidence class: astronomical
Verification state: partially_verified
Locator: Swiss Ephemeris Programmer's Documentation sections 3, 5.8 and 12.2 for calc_ut, sidereal flags and ayanamsa modes; representative date checks in tests/test_drik_engine.py and tests/test_ayanamsa.py
Last reviewed: 2026-08-27
Scope: Traces the Drik longitude API and preserves representative outputs. The current register does not contain an exhaustive independently published position-and-transition fixture, and it establishes no interpretive doctrine.
Sources
- Swiss Ephemeris — Astrodienst; Swiss Ephemeris 2.10 Programmer's Documentation and pyswisseph runtime used by the repository; authority type:
astronomical_reference - Drik Panchang day and festival pages — Drik Panchang; Location- and date-specific web pages; authority type:
published_panchangam
The complete machine-readable source registry is available in provenance.json. A regression fixture or same-code reproduction is not independent verification.
Reproduce and review
Run the linked tests, then the complete offline contract:
python tools/verify_project.pyPublic surfaces
python-librarymcpicswebsite
Limitations
- All engines use the astronomical upper-limb/refraction default, ignore Location.alt and return codes, and lack a registered multi-city decision fixture for the intended public convention.
Implementation
- owner:
telugu_panchangam/engines/utils.py—get_sunrise - owner:
telugu_panchangam/engines/utils.py—get_sunset - owner:
telugu_panchangam/engines/utils.py—get_moonrise - owner:
telugu_panchangam/engines/utils.py—get_moonset
This route is generated from computations.json. Edit the registry and canonical reference prose in the same pull request as a behavior change.