Drik sidereal planetary longitudes
astronomy.drik-sidereal-longitudes
Swiss Ephemeris longitudes under the selected ayanamsa form the Drik astronomical basis.
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
Select the requested Swiss Ephemeris sidereal mode, calculate the body's geocentric ecliptic longitude at the supplied UT Julian day, normalize it to one revolution, and restore Lahiri mode for cached callers.
Process
- Validate the ayanamsa name and map it to a Swiss Ephemeris sidereal-mode constant.
- Set that global sidereal mode and call calc_ut with FLG_SWIEPH | FLG_SIDEREAL for the requested body.
- Take result[0] modulo 360 degrees as the longitude.
- Restore Lahiri mode before returning so later cached Lahiri calculations do not inherit mutable global state.
Worked example
Hyderabad sunrise, 2026-06-11, Lahiri
Inputs
- UT Julian day: 2461202.5077662035
- Bodies: Sun and Moon
- Ayanamsa: lahiri
Calculation
- Swiss Ephemeris is called separately for Sun and Moon with sidereal flags.
- Each returned longitude is normalized with value modulo 360.
Result
- Sun: 55.8893662040 degrees
- Moon: 358.4708221648 degrees
- Moon-Sun elongation used downstream: 302.5814559608 degrees
Method notes
- The example reproduces the repository runtime; it is not an independent ephemeris comparison.
- Swiss Ephemeris global sidereal mode makes restoration part of the computation contract.
Contract
Owning layer: engine-core
Claim kind: deterministic-fact
Time basis: UTC Julian day; ayanamsa is explicit and defaults to Lahiri.
Inputs
- Julian day
- Swiss Ephemeris body
- ayanamsa
Outputs
- sidereal longitude in degrees [0, 360)
References and evidence
Evidence classes: astronomical
Verification states: partially_verified
Representative Drik cells are independently compared; the full range remains broader than those cells.
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-librarymcpicswebsitegenerated-data
Limitations
- Accuracy and conventions inherit Swiss Ephemeris and the chosen ayanamsa.
Implementation
- owner:
telugu_panchangam/engines/utils.py—sidereal_longitude_with_ayanamsa - owner:
telugu_panchangam/engines/drik.py—DrikGanitaEngine._sun_lon - owner:
telugu_panchangam/engines/drik.py—DrikGanitaEngine._moon_lon
This route is generated from computations.json. Edit the registry and canonical reference prose in the same pull request as a behavior change.