yantra/patha/ss-tier.js
the text tier, as one adapter: a Julian day (UT) in, the Sūrya-Siddhānta's own quantities out, computed
1006 lines · 80 exports
The header, as the file states it
What it loads
- yantra/patha/kala-dvara.jsmodule
- yantra/patha/sphuta.jsmodule
- yantra/patha/dhruva.jsmodule
- yantra/patha/ss-udaya.jsmodule
- yantra/patha/ss-graha.jsmodule
- yantra/patha/ss-chaya.jsmodule
- yantra/patha/ss-grahana.jsmodule
- yantra/patha/ss-ahargana.jsmodule
- yantra/patha/panchanga.jsmodule
- yantra/patha/dasha.jsmodule
- yantra/patha/muhurta.jsmodule
- yantra/patha/utsava.jsmodule
- yantra/patha/parampara.jsmodule
- yantra/patha/corpus/parampara/registry.json
- yantra/patha/corpus/parampara/samskara.json
- yantra/patha/samskara.jsmodule
- yantra/patha/parahita-madhyama.jsmodule
- yantra/patha/corpus/research/parampara-apply.json
- yantra/meridian.jsmodule
What it exports
MERIDIAN_DEGKALI_JD0LANKA_OFFSETSPAN_YEARSEPSILON_DEGSAMSKARASDEFAULT_SAMSKARASUNRISE_DAYMEASURED_KEYSAMPLITUDE_KEYSBIJA_KEYSTERM_KEYSMOON_BASISPLANET_BASISDEFAULT_CANDIDATEDEFAULT_CANDIDATESX_TERM_KEYSLP_TERM_KEYSX_BASISA_BASISLP_BASISBIJA_SPAN_CENTURIESuseDynamicalTimedeltaTFromTabletimeScaleOftrueNodeAtcrossingNodecrossingNodeOftcrossingsplacesmeasuredOfmeasuredFromRecordplanetWithBijaplanetsAtframeShiftOfplacesOfcenturiesOfuseMeasuredmeasuredRecorddaysOfJdjdOfDaysspandasOfJddaysOfSpandasjdOfSpandasSAVANA_DAYmeanAtDayssiteOfsiteForsiteOnuseParamparacorrectionlabelcalendarT_ayanamshaAtdashautsavamuhurtamodelifsamskaraModuleErrormodelOfgrahassunMoonayanamshaDegayanamshaRateArcsecPerYearayanamshaRulelimbsAtdayOfdayEventslagnameridianlunarMonthlunarYearsamvatsaravimshottarimuhurtasmoonEventsSS verses named in the header
- SS 1.45verseṣaṇmanūnāṃ tu sampīḍya kālaṃ tatsandhibhiḥ saha । kalpādisandhinā sārdhaṃ vaivasvatamanostathā ।।
- SS 2.28verseparamāpakramajyā tu saptarandhraguṇendavaḥ । tadguṇā jyā trijīvāptā taccāpaṃ krāntirucyate ।।
- SS 3.9versetriṃśatkṛtyo yuge bhānāṃ cakraṃ prākparilambate । tadguṇādbhūdinairbhaktāddyugaṇādyadavāpyate ।।
The channels it runs in
Every function, what it calls, who calls it
93 top-level functions read from the source; the doc line is the comment above each; calls and callers are resolved across the registry’s modules by name. Line numbers are the file’s at engine 3f94072.
The modules' default sine is the text's 24-jyā table (owner, 2026-10-27: the formulary); the paramparā tiers and the measured default keep Mādhava's sine, on which their records were measured — this instance is built on it, and the plain text ({ samskara: null }) is answered by a second instance on the table (the routing at the end).
Civil days since midnight at Laṅkā at the Kali epoch (SS 1.45-1.47) of a Julian day in UT.
The Julian day (UT) of a day count t.
{ latitude, longitude (east +) } → the text's site { latitude, deshantara = longitude − MERIDIAN_DEG } (palabha kept): the site on the served meridian. A caller of calendar(opts) on a record tier takes siteFor(site, opts) instead (the site on the tier's own day).
A site on a tier's own day count. Every tier counts its civil day from a midnight on one meridian — the served one (D13) for the plain text, the record's (RECORD_MERIDIAN_DEG, rule A) for every paramparā/measured tier — and t + deśāntara/360 is the place's local time only when the deśāntara is counted from that same meridian. A site comes in on the served meridian (a longitude east, or siteOf's de
The spandas of the turn ({num, den}, the engine's clock: D1c) of a day count.
The spandas of the turn since midnight at Laṅkā at the Kali epoch of a Julian day (UT): one civil day = 30⁸·R/S of them.
The text's mean places at a day count (no saṃskāra): Sphuta.madhyama + SSGraha.meanPlaces.
A rational number of spandas of the turn { num, den } → civil days (float), exact up to the last division.
A rational number of spandas of the turn { num, den } → the day number (JD, UT).
Give the tier a loaded paramparā record (Parampara.load({ registry, samskara })): the browser's way.
The libration's rate at t: 54″ a year × (27 + δ)/27 for a greatest value 27 + δ, signed by the change over a day.
The correction a tier applies: null for the plain text; else a frozen record { name, tierId, corrects, mean(t) → { sun, moon, moonApogee, node, sunApogee }, ayanamshaAt(t), ayanamshaRule, ayanamshaRateArcsecPerYear(t), modelDeltas, modelEpoch, modelAyanamsha (samskara.js model inputs for the eclipse search), label, labelSa, caption, epochKali, source, … }: 'parameshvara' from the paramparā record
The Kerala paramparā (Parahita + Dṛggaṇita) as one correction record — see the header. Every number is read from parahita-madhyama.js or the registry; the samskara.js model for the eclipse search is the text's canon moved, at Parameśvara's epoch, by the difference of the two canons' mean places and, per yuga, by the difference of their rates (both linear in t, so the model is exact [theorem]; chec
A term list compiled once: the nonzero argument entries flat, the amplitudes in typed arrays, the largest multiple per basis.
A bīja on a mean: an epoch (degrees) and a rate (degrees a Julian century from J2000); absent fields are 0.
The T a measured term's slow change is evaluated at: held at the edge of the window it was measured on (the record's termHold, in centuries from J2000), else at the bīja's ±5 centuries.
The measured nirayaṇa frame rate (2026-10-15): the paramparā ayanāṃśa turns faster than the stars (its 54″-class rate against the precession), so a tier fitted on the sāyana residual keeps a nirayaṇa frame that drifts. δ(t) = rate·T (T Julian centuries from J2000, held at ±5 like every bīja) is added to every nirayaṇa longitude and taken from the tier's ayanāṃśa: a pure rotation of the frame — the
The planets' bīja: per graha, a bīja on the mean, the śīghrocca and the mandocca, a scale on each epicycle, and a second manda harmonic (degrees).
A slow Chebyshev series { tc, ts, coef[] } (degrees; x = (jd − J2000 − tc)/ts held at ±1) — the own series' slow part of a mean.
Inside its window the Chebyshev sum. Beyond it, continuous at the edge, the window's own low-order trend goes on: its degree-1 truncation (the window's mean rate; a planet's slow part) or degree-2 (the Moon's: the tidal acceleration is a real T²) — never the high orders, which only describe the window.
A measured slow model { poly: [c0, c1, c2] (degrees, T in Julian centuries from J2000), hold (centuries), continue: 'linear' | 'hold', terms (A_BASIS) }: the own series' ayanāṃśa or obliquity as the tier serves it — the polynomial inside ±hold, beyond it continued along its slope at the edge ('linear': the precession goes on) or held ('hold': the obliquity's swing is bounded), plus the measured nu
The amplitudes of one measured candidate of corpus/research/parampara-apply.json (default 'kerala+all'); the candidates that carry the planets' bīja (the record says which, `planets: true`) get it from record.measured.planets.bodies.
Give the tier the measurement record (corpus/research/parampara-apply.json, or an object carrying its `measured` block): the browser's way; parampara-record.js carries the block and calls this. Node reads the file.
A tier's default measured option: its joint candidate in the record (Kerala: required; the text tier: when the record has it).
sun: { lambda, anomaly } — the tier's true Sun (sidereal) and its mean anomaly (mean − apogee), for the Nīlakaṇṭha form's centre and for the radial variation with the Earth's distance; absent, the text's mean Sun stands and the Sun's radial term is 0.
The means of a tier shifted by the Sun/Moon/node bīja of the measured forms (the text's arithmetic then runs on them).
ΔT in seconds at jd (UT) from a table { fromYear, stepYears, seconds }: linear between its years, held at its ends.
The measured tier's time: the civil day count t → t + ΔT (dynamical), when the record says so.
Every graha at jd: sidereal degrees from the text's Meṣa 0, the latitudes (degrees, north +), the mean places, the Sun's and Moon's equations, and SSGraha.truePlaces in full. The last call is memoised per tier.
The five star-planets of a tier at jd (t its day count, p its places at t): with the measured bīja on means rotated by the measured frame and the tier's true Sun (the convention the measurement fits through: scripts/text-tier-measure.cjs calls this), else the text's four steps, rotated by the frame when there is one.
The true node as the own series defines it (siddhanta-tier trueNode), on the tier's OWN Moon: the latitude's zero crossings on either side of t, bisected to 1e-7 d, the node (the Moon's longitude there, +180° at a descending one) linear between them. The crossings found are kept per tier (a sorted list), so nearby calls reuse them.
Sun and Moon only (for the limbs).
The tier's ayanāṃśa at jd, degrees: SS 3.9-3.10 for the plain text; for the measured tiers (the paramparā defaults) the sky's measured precession, not D23; bare ({ measured: false }): the libration with Parameśvara's phase, the Kerala line (correction()).
Its rate, arcseconds a (sidereal) year: the measured precession's own for the measured tiers; ±54″ by the libration's direction over a day for the text [theorem: 600 turns a yuga × 360° ÷ 4,320,000 years × 0.3]; the bare paramparā tiers' fitted rates (correction()).
The rule the tier's ayanāṃśa follows, in words (for the pages' labels).
Panchanga.limbsAt at jd (tithi 1-30, nakṣatra 1-27, pada, yoga 1-27, karaṇa 1-60) with the text's names (IAST).
The civil day holding jd at the site (SS 14.18: sunrise to sunrise), in JDs: { N, sunriseJd, sunsetJd, nextSunriseJd, vara: { index, name }, polar, rule } — on the tier's calendar: its Sun and its ayanāṃśa make its sunrise.
Sunrise, sunset and the next sunrise of civil day N at the site (JDs; null where the Sun does not cross).
Panchanga.lagnaAt at jd (sidereal, the text's frame: SS ε and SS 3.9-3.10).
Panchanga.meridianAt at jd: { ramcDeg (sāyana), madhyaLagna: { longitude (sidereal), rashi, index }, method }.
── months, years, saṃvatsara ──────────────────────────────────────────────────────────────────────────
The amānta month holding jd (Panchanga.lunarMonth on the tier's places) + startJd, endJd, fullMoonJd. Cached by interval: two instants of one civil day either side of a new moon get their own months.
The lunisolar year holding jd (SSAhargana.lunarYear on the tier's calendar) + startJd, endJd, meshaJd.
SS 1.55 (SSGraha.samvatsara) at jd: mean Jupiter, which no saṃskāra moves. opts.zero picks the reading (0 = A).
── daśā ───────────────────────────────────────────────────────────────────────────────────────────────
Vimśottarī from a birth instant: the birth nakṣatra by the tier's Moon, the elapsed part by time (BPHS 46.16, dasha.js), the text's solar year (dasha.js YEAR "saura-surya"), and the chain running at atJd down to `depth` levels.
Fifteen muhūrtas of the day and fifteen of the night of civil day N (muhurta.js), in JDs; Abhijit is the 8th of the day [standard usage, unverified: muhurta.js says so]. null in a polar day.
Moonrise and moonset in civil day N (utsava.js: the Moon's centre on the horizon, no parallax, no refraction).
The gnomon's shadow at jd (ss-chaya.js): the noon shadow of the sāyana Sun (SS 3.20b-3.22a) and the shadow at the Sun's hour angle at jd (3.34b-3.36); the sāyana Sun is the text's Sun + SS 3.9-3.10. { error } where the text's chain does not reach (a southern place, SS 3.14; the Sun below the horizon at noon).
The eclipsed body against the text's horizon at day count t, read as ss-grahana.js reads an eclipse's contacts: the Laṅkā risings (SS 3.42-3.43) for the hour angle, the Moon's latitude joined to its declination (2.58), the half-day by 2.60-2.63. lamSid: the body's sidereal longitude; betaArcmin: the Moon's latitude (lunar only).
The eclipsed body above the text's horizon at the middle, on the tier's own places.
Lunar and solar eclipses within ±spanDays of jd at the site. Plain text: ss-grahana.js eclipsesBetween. Saṃskāra: the same parvas on the saṃskāra model of samskara.js (the code the fit itself uses), built from what the record corrects (its 'corrects', exactly as placesWith moves the places): the lunar eclipse by Samskara.lunarEclipse, the solar by Samskara.solarEclipseOnModel (the bare tiers: the
The samskara.js model that carries a corrected tier's places into the eclipse search (built once per tier): the correction's modelDeltas about its epoch, with its own ayanāṃśa rule where it has one (the Kerala tier).
samskara.js model deltas of a tier's correction (its modelDeltas): for 'parameshvara' each body the record corrects moved at its epoch by the record's arcminutes ('<body>.epoch') and the libration's phase ('ayanamsha.phase'); for 'kerala' the difference of the canons at the epoch and per yuga.
The labels a page shows for a text tier.