yantra/patha/vedha-lekha.js
वेध-लेख: the owner's observation ledger, its seal and its certifier (slice 7 of the vedha-yantra
1079 lines · 0 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-chaya.jsmodule
- yantra/patha/ss-grahana.jsmodule
- yantra/patha/ss-drishya.jsmodule
- yantra/patha/yantra.jsmodule
What it exports
SS verses named in the header
- SS 2.28verseparamāpakramajyā tu saptarandhraguṇendavaḥ । tadguṇā jyā trijīvāptā taccāpaṃ krāntirucyate ।।
The channels it runs in
Every function, what it calls, who calls it
70 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.
── SHA-256 ───────────────────────────────────────────────────────────────────────────────────── The constants are the first 32 bits of the fractional parts of the square roots (H) and cube roots (K) of the first 8 and 64 primes. They are derived here as integer roots in BigInt — floor(√(p·2⁶⁴)) and floor(∛(p·2⁹⁶)) mod 2³² — so no constant is typed in; the published vectors in the test decide whet
UTF-8 bytes of a string (a lone surrogate becomes U+FFFD).
SHA-256 of a string (as UTF-8) or of bytes, as 64 lowercase hex digits.
Canonical JSON: object keys sorted, no white space; only strings, finite numbers, booleans, null, arrays and plain objects; undefined members are dropped (as JSON drops them).
── what the instruments cannot have produced ─────────────────────────────────────────────────── The frame gate's names (kala-dvara.test.js [FRAME]), each spelled here with a "·" so that this file itself passes that gate; the test checks that the expression rebuilt from them is the gate's own.
Why a string cannot stand in the ledger, or null.
Walks every key and string of a value: modern field names and modern strings.
Fields of an object outside `keys` (modern fields are reported once, by scanModern).
An arc { amsha, kala, vikala } (degrees, minutes, seconds) → degrees.
Degrees → { amsha, kala, vikala } (vikala fractional unless `round`).
Asus → { ghati, vinadi, prana } (prana fractional unless `round`).
An arc read to the whole vikalā → integer vikalā (arcseconds), as dhruva.js's exact arithmetic takes it.
The uncertainty (1σ) of one reading, { amsha, kala, vikala } → vikalā; more than zero.
One greatest elongation → { N, vikala }: signed vikalā on the provisional line's scale, east (purva) positive.
One solstice noon → { N, vikala }: the signed zenith distance, south of the zenith positive.
An uttara-rekha record's readings, checked: { e, w, sigma } (vikalā). Throws, with the reason, on the first fault.
An ayananta-yugma record's readings, checked: { k, m, sigma } (vikalā). Throws, with the reason, on the first fault.
One uttara-rekha record → where true north lies on the owner's line, east (purva) positive, with its σ. A PREVIEW: nothing is applied. Validates the record itself before dhruva.js sees it, and throws a readable error if it fails.
One ayananta-yugma record → ε and the latitude, each with its σ, beside the text's ε (SS 2.28) and the given place (placeOf; optional). A PREVIEW: nothing is applied. Validates the record itself before dhruva.js sees it, and throws a readable error if it fails. warnings: a noon that the text's own Sun puts more than 15° (about 15 days) from its solstice — a check of this module against a mis-dated
── one record, against the schema ──────────────────────────────────────────────────────────────
The kind's own fields (the chāyā kinds by ss-chaya.js's own validate). Throws on the first fault.
The record's day: its own, or for a frame kind the later of its two readings' days (the record is whole only then).
Every fault of one record that does not need the rest of the ledger, as { where, reason }.
── the ledger ──────────────────────────────────────────────────────────────────────────────────
A new, empty ledger for a place: { site: { name, deshantara, palabha | latitude }, shanku? }.
Appends one record; returns the new ledger (the old one is untouched). opts.at: the Kali day of writing (default: the record's own day, else the last entry's). Refuses a record that fails its own checks, a day after `at`, an `at` earlier than the last, a gaṇita citation that is not already in the ledger, and any sealed ledger. Synthetic records may be written (the certifier decides whether they ar
The chain alone: seq, prev, the hashes, the order of `at`, and the seal. { ok, n, head, genesis, problems }.
Closes a ledger with its final hash. opts.at: the Kali day of sealing (default: the last entry's).
The ledger as a file (JSON, two-space indent).
A ledger file back to a (frozen) ledger. It is not certified by being read: call certify or verify.
The certifier. Takes a ledger or its file (a JSON string). Refuses, with a reason each: fields outside the schema; fields of a modern clock (UTC style), Julian day, equatorial or horizontal coordinate (RA/Dec), geodetic datum (WGS84) or ephemeris; any string naming a modern source or carrying a modern time stamp; entries out of order; a broken chain or seal; a record of a day after it was written;
── the text's predictions, in the owner's units (used by reduce and by any synthetic generator) ────
The model's site { latitude, deshantara, palabha } from the ledger's site (palabhā by the table, 3.12b-3.17a).
Sunrise of civil day N (days since the Kali epoch): the instant the true Sun's hour angle — the meridian's asus (ss-grahana.js) less the Sun's ascension (ss-udaya.js, 3.42) — is minus its half-day (2.61-2.63): the zero of SSUdaya.sinceSunrise, so the same instant ss-grahana.js's clock counts from. opts.ascension is passed to it; opts.sunrise "text" takes 2.46's sunrise instead (ss-drishya.js).
Sunset of day N by the same rule as sunriseAt: the instant the Sun's own time since rising equals its whole day, twice the half-day of 2.61-2.63 (council G-3: one rule for both ends of the day).
Asus of the turn between two instants (civil days): 1.34-1.37.
The instant `asus` of the turn after t0.
A star on the meridian on the night after the sunrise of day N: { name, dhruvaka, vikshepa } (sidereal degrees, from ch.8). It crosses when the meridian's asus (mean Sun's turn, as ss-grahana.js) equal its own ascension: 3.42's rule at its dhruvaka, which is the foot of its circle through the dhruva (2.63, ch.8). Its declination is the dhruvaka's with the vikṣepa (2.58, 2.63); its meridian altitud
The text's eclipse whose contacts follow the sunrise of day N (ss-grahana.js: 4.1-4.26, 5 for the Sun).
One contact of the text's eclipse, counted from the sunrise of day N in asus of the turn.
The śaṅku's shadow at the instant `asus` of the turn after the sunrise of day N, by the text (3.34b-3.36): the Sun's own asus by 2.59 (ss-chaya.js), its nata from the meridian, the shadow and the side. For synthetic records and for checking a shadow-timed contact.
The reverse: asus of the turn from sunrise of day N, from a shadow and its side (3.37-3.39, 2.62-2.63, 2.59). The Sun's place is taken at the instant found, again until it holds.
The crescent on the evening (horizon "pashcima", the default: 10.1-10.4 at ss-drishya.js's sunset) or the morning ("purva": 10.1's east, at its sunrise) of day N: the text's kālāṃśa and its verdict (seen at twelve or more).
The Moon's polar longitude (sidereal degrees): its sāyana place less 7.10's āyana part (latitude′ × the declination of λ + 90° in degrees, as seconds) — the foot of its own circle through the dhruva — less the ayanāṃśa.
The instant after the sunrise of day N at which the Moon's polar longitude reaches the star's dhruvaka (8.14-8.15), in asus of the turn from that sunrise; null when it does not on that civil day. The text's yoga has no lambana: what the observer sees carries the Moon's parallax, which the reduction reports and does not remove.
── the reduction ───────────────────────────────────────────────────────────────────────────────
The catalogue (corpus/surya-siddhanta/yogatara.json, or a list of { name, dhruvaka, vikshepa }) as a name → star map.
Reduces a certified ledger. The chāyā records go, as a "vedha-chaya/1" file, to ss-chaya.js's reduce; each of the other observations comes back with what it measured [measured], the text's prediction beside it, and the antara. The frame kinds (uttara-rekha, ayananta-yugma) come back as a preview (northLine, solsticePair) beside the text's ε and the ledger's place, applied to nothing; summary.uttar