Nine-graha sidereal positions
gochara.graha-positions
Sidereal longitude produces rashi, Nakshatra, Pada, retrograde state, and next ingress for nine grahas.
Assurance
| Level | Current statement |
|---|---|
| Documented and traceable | Yes — the canonical record includes the process and a worked example. |
| Regression or reproduction checked | Linked to 1 repository test file(s). |
| Independently source-supported | Partial support only; read the provenance note and limitations before generalizing. |
Computation method
Method type: algorithm
Compute sidereal longitude and speed for each of nine Grahas, derive the categorical fields, and search adaptively for the next 30-degree sign crossing.
Process
- Set the requested Swiss Ephemeris sidereal mode.
- Compute longitude and daily speed; derive Ketu as mean Rahu plus 180 degrees.
- Map longitude to Rashi, one of 27 Nakshatras, and one of four Padas; mark negative speed as retrograde.
- Step adaptively toward the nearest sign boundary and bisect the first sign-index change with 40 iterations.
- Convert the ingress to an IST date, emit the next Rashi, and restore Lahiri mode.
Formulae
Rashi, Nakshatra, and Pada
r=floor(lambda/30); n=floor(lambda/(360/27)); pada=(floor((lambda/(360/27))*4) mod 4)+1- lambda: normalized sidereal longitude in degrees
Worked example
Guru at Hyderabad sunrise, 2026-06-11
Inputs
- UT Julian day: 2461202.5077662035
- Ayanamsa: Lahiri
Calculation
- Guru longitude = 91.7834 degrees, placing it in Rashi index 3 and Punarvasu Pada 4.
- Positive daily speed means it is not retrograde.
- The next sign-index crossing is searched numerically.
Result
- Rashi: Karka
- Nakshatra: Punarvasu, Pada 4
- Next Rashi: Simha on 2026-10-31 IST
Method notes
- The longitude evidence boundary is inherited from the Drik calculation; next-ingress date localization is currently fixed to IST.
Contract
Owning layer: calendar
Claim kind: deterministic-fact
Time basis: Requested Julian day, normally local sunrise for daily surfaces.
Inputs
- Julian day
- ayanamsa
Outputs
- longitude
- rashi
- Nakshatra
- Pada
- retrograde
- next ingress date
References and evidence
Evidence classes: astronomical
Verification states: partially_verified
The same Drik longitude evidence boundary applies to these derived fields.
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-librarymcpwebsitegenerated-data
Limitations
- Rahu and Ketu use the selected node convention; next-ingress dates are numerical search results and rasi_until is currently rendered as an IST calendar date rather than the requested city's local date.
Implementation
- owner:
telugu_panchangam/gochara/positions.py—graha_positions
This route is generated from computations.json. Edit the registry and canonical reference prose in the same pull request as a behavior change.