# Third-party notices and scientific references

`js-ephemeris-lite` is distributed under the Mozilla Public License 2.0.
That license applies to the original source-code implementation in this
repository. It does not replace or supersede rights that may exist in the
scientific models, published coefficient tables, reference ephemerides, or
historical calendar material identified below.

The runtime package contains selected numerical coefficients, JavaScript
evaluators, fitted correction coefficients, and a compressed historical
civil-day profile. Model and data sources are credited below.

## Upstream calendar materials

The following materials originate from **Shou Xing Tian Wen Li / Shou Xing
Wan Nian Li** (寿星天文历 / 寿星万年历), authored by Xu Jianwei (许剑伟):

- the arithmetic Hijri calendar rules from `oba.getHuiLi()`, re-expressed using integer cycles with reverse conversion added;
- the ancient-calendar rules and civil-day assignments used to generate
  `src/generated/historical-calendar-data.js`;
- the first seven fields of the 529 era-name records generated in
  `src/generated/chinese-era-data.js`.

- Upstream project mirror and attribution: <https://github.com/sxwnl/sxwnl>
- Upstream copyright statement:
  <https://sxwnl.github.io/src/sm1.htm#copyright>

The upstream distribution describes the program as open source, asks that its
astronomical algorithms and ancient-calendar data not be arbitrarily modified,
and does not provide a conventional SPDX license for the historical tables.
The materials listed above remain identified as third-party material and are
not claimed to be relicensed under MPL-2.0.

## cnlunar rules used by `huangli-lite`

The sibling `huangli-lite` package derives its traditional shen-sha
(神煞), daily auspicious/inauspicious activities, and supporting base rules
and data from **cnlunar**. This project rewrites those rules in JavaScript and
maintains its own corrections, conflict resolution, activity filtering,
provenance, boundary handling, and structured output.

- Source: <https://github.com/OPN48/cnlunar>
- License: <https://github.com/OPN48/cnlunar/blob/master/LICENSE>
- Copyright (c) 2025 OPN48; MIT License.

The package-specific notice is distributed in
`packages/huangli/THIRD_PARTY_NOTICES.md`.


## VSOP2013 Mercury, Venus, Earth and Mars

The Mercury, Venus, Earth and Mars sections of `src/planet-series.js`
contain direct heliocentric L/B/R coefficients generated from the complete
VSOP2013 Mercury, Venus, Earth and Mars elliptic-element
solution. Offline coordinate conversion and Fourier/polynomial expansion are
followed by coefficient selection targeting DE441. These tables fold fitted
polynomial and periodic residual terms into the same coefficient series.
Runtime evaluation uses 299/160/242, 156/82/153, 386/50/475 and 489/101/528
classic Fourier–monomial terms for Mercury, Venus, physical Earth and Mars.
Fast event paths truncate Earth by complete same-frequency polynomial envelopes,
not by separating their time powers. Runtime evaluation does
not solve Kepler's equation. The Earth table incorporates the library's lunar
displacement during generation, so it represents physical Earth without a
runtime lunar subtraction.

The fitted residual coefficients are generated by this project, not copied
from the VSOP2013 distribution.

- IMCCE VSOP2013 distribution and documentation:
  <https://ftp.imcce.fr/pub/ephem/planets/vsop2013/solution/>
- VSOP2013 model documentation:
  <https://ftp.imcce.fr/pub/ephem/planets/vsop2013/solution/README.pdf>

MPL-2.0 covers this project's implementation, not a relicensing of the
underlying published planetary theory or reference ephemerides.

## TOP2013 Jupiter, Saturn, Uranus and Neptune

The Jupiter, Saturn, Uranus and Neptune sections of `src/planet-series.js` contain
selections from the official `TOP2013LBR.dat` spherical-coordinate
series. The published tables use the classic polynomial-in-time Poisson form.
All four use DE441-directed selection with fitted
polynomial and periodic residuals folded into one table. Some residual
frequencies are selected from a training spectrum and locally refined.
Each planet uses one global coefficient table, without regional selections
or separate correction tables. Runtime evaluation does not solve Kepler's equation.

The fitted residual coefficients are generated by this project, not copied
from TOP2013. The targets are the four planetary-system barycenters relative
to the Sun. The former segmented Uranus/Neptune corrections are not distributed.

- IMCCE TOP2013 distribution: <https://ftp.imcce.fr/pub/ephem/planets/top2013/>
- TOP2013 documentation: <https://ftp.imcce.fr/pub/ephem/planets/top2013/README.pdf>

## Pluto approximation

The `PLUTO_NEAR_*` and `PLUTO_FALLBACK_*` arrays in `src/planet-series.js` contain this
project's direct fits to JPL DE441 Pluto-system-barycenter positions (target 9)
relative to the Sun. The recommended 1600..2200 interval uses a padded Chebyshev
fit; other dates remain computable using a low-accuracy mixed-frequency fit.
The frequency dictionary uses a few TOP2013 mean motions as seeds, not TOP2013
Pluto amplitude coefficients. The private full-range precision candidates were
not adopted. See the README warning; results are not Pluto body-center or
photocenter predictions and are not suitable for precision occultation timing.

The approximate apparent-disc radius, 1188.3 km, follows the
[JPL physical-parameter table](https://ssd.jpl.nasa.gov/planets/phys_par.html).

## ELP/MPP02

The lunar series in `src/moon-series.js` contains a truncated,
reordered subset selected from the ELP/MPP02 DE405-mode coefficient tables
`ELP_MAIN.S1..S3` and `ELP_PERT.S1..S3`.

- J. Chapront and G. Francou, "The lunar theory ELP revisited. Introduction
  of new planetary perturbations," *Astronomy & Astrophysics* 404 (2003),
  735–742. DOI: <https://doi.org/10.1051/0004-6361:20030529>
- Original table location published by Observatoire de Paris/SYRTE:
  `ftp://cyrano-se.obspm.fr/pub/2_lunar_solutions/2_elpmpp02`

The coefficient files used to generate this package did not contain an SPDX
or other explicit software license. This notice provides attribution and does
not claim that the original ELP/MPP02 coefficient files are relicensed under
MPL-2.0.

## IAU precession and nutation models

The coordinate layer implements the IAU 2000B nutation model, IAU 2006 mean
obliquity, and the long-term precession expressions published by Vondrák,
Capitaine, and Wallace.

- J. Vondrák, N. Capitaine, and P. Wallace, "New precession expressions,
  valid for long time intervals," *Astronomy & Astrophysics* 534 (2011),
  A22. DOI: <https://doi.org/10.1051/0004-6361/201117274>
- IAU Standards of Fundamental Astronomy: <https://www.iausofa.org/>
- SOFA terms and conditions: <https://www.iausofa.org/terms-and-conditions>

SOFA is copyright the International Astronomical Union Standards of
Fundamental Astronomy Board. `js-ephemeris-lite` is not software provided by
or endorsed by the IAU SOFA Board.

## JPL DE441 reference fits

Some correction coefficients in the Earth, Moon, Mercury, Venus, Mars,
Jupiter, Saturn, Uranus, and Neptune models were fitted by this project
against JPL DE441 samples. The package distributes the fitted coefficients;
the DE441 binary kernel is used during coefficient generation.

- R. S. Park, W. M. Folkner, J. G. Williams, and D. H. Boggs, "The JPL
  Planetary and Lunar Ephemerides DE440 and DE441," *The Astronomical
  Journal* 161:105 (2021). DOI:
  <https://doi.org/10.3847/1538-3881/abd414>
- JPL/NAIF planetary kernel archive:
  <https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/>

## Optional minor-body ephemeris package

The coefficient assets distributed by the optional
`asteroid-ephemeris-lite` workspace package were generated
from the canonical minor-body vectors published by the author's
**ephemeris-data** project. That dataset combines NASA/JPL small-body SPKs
with project-generated numerical extensions outside the official kernel
intervals. The runtime package contains only compact fitted coefficients, not
the SPK files or canonical sample arrays.

- Derived-data repository: <https://github.com/RedSC1/ephemeris-data>
- JPL small-body kernel archive:
  <https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/asteroids/>
- JPL Horizons: <https://ssd.jpl.nasa.gov/horizons/>
- Apache License 2.0 for the derived ephemeris-data material:
  <https://www.apache.org/licenses/LICENSE-2.0>

The optional package documentation identifies which date ranges come directly from JPL
SPKs and which use the numerical extensions. NASA/JPL source data and the
project-generated extensions must not be presented as having the same
provenance.

## Historical Chinese calendar profile

`src/generated/historical-calendar-data.js` contains civil-day assignments
derived from the upstream ancient-calendar data and rules identified at the
beginning of this notice. This project stores the derived assignments in a
compact linear-plus-sparse-residual representation. Users who require
independently licensed historical calendar data should replace or omit this
generated profile and use the `china-astronomical` or `local-astronomical`
modes instead.

The upstream documentation states that its historical calendar was checked
against works including Zhang Peiyu's *San Qian Wu Bai Nian Li Ri Tian Xiang*,
Chen Yuan's *Er Shi Shi Shuo Run Biao*, and Fang Shiming's historical
Chinese/Western calendar concordance. Those publications are cited as
historical references only and are not included in this repository.

## Project-generated material

This project generates and maintains:

- truncation selection and ordering;
- low-term event estimators and their fitted slow corrections;
- DE441 residual-fit coefficients;
- JavaScript evaluators, solvers, time types, calendar APIs, and tests;
- the packed 32-bit runtime representation of the historical profile.

## Chinese era-name text and boundary data

`src/generated/chinese-era-data.js` combines three separately attributed data
sources. It is generated by `tools/build-chinese-era-data.mjs`.

### Era-name records: upstream `JNB` table

The first seven fields of each of the 529 records are parsed from the `JNB`
table in the upstream `src/lunar.js` identified above. Those fields are, in
order: start year, nominal duration, previously used era years, dynasty, ruler
title, ruler name, and era name.

Two deliberate source-field normalizations are applied. The finite `9999`-year
duration value serves as a sentinel for the open-ended modern record and is
expanded to `999999999` years so the record remains open throughout this
project's extended ephemeris range. This normalization does not alter the
record's start year, era name, or year numbering; the source offset `1948`
is preserved unchanged.

The Later Han Tianfu row is published upstream as `947,12,0`, which swaps the
nominal-duration and previously-used-era-year fields. It is normalized to
`947,1,11`: Later Han continued with Tianfu year 12 for one year before
Qianyou. Keeping `12,0` would incorrectly extend Liu Zhiyuan and Tianfu through
958 and restart the era at year 1.

Run `npm run verify:chinese-era-data` to verify the generated records against a
local upstream checkout and detect unintended source-field changes.

### Exact civil-day boundaries: DDBC

The eighth field is added by this project. For 177 safely matched records, it
contains Chinese civil-day boundaries derived from the October 2010 snapshot
of the **DDBC Time Authority Database**, assembled by the Library and
Information Center of Dharma Drum Buddhist College (法鼓佛教學院). The generator
reads `authority_time_chinese.sql`, uses canonical names and only status `S`
month rows, and joins the dynasty, emperor, era, and month tables. DDBC civil
day numbers are converted to double UT Julian Days at UTC+8 midnight. Matching
is deliberately conservative: ambiguous or insufficiently supported matches
remain `null` rather than receiving a falsely precise boundary.

For a `null` eighth field, the source table supplies only the nominal start
year and duration. The runtime marks the boundary as year precision and
computes the corresponding historical lunar-year start JD as a documented
fallback. The known 1912 and 1949 modern civil boundaries are maintained
separately in `src/chinese-era.js`; they are not attributed to DDBC.

The DDBC archive's included `README` and `COPYING` files state CC BY-SA 3.0
Unported. The February 2012 download page also labels the database CC BY-SA
2.5 Taiwan. The generated file preserves attribution and does not claim to
relicense those boundary data under MPL-2.0.

- DDBC download page: <https://authority.dila.edu.tw/docs/open_content/download.php>
- CC BY-SA 2.5 Taiwan: <https://creativecommons.org/licenses/by-sa/2.5/tw/>
- CC BY-SA 3.0 Unported: <https://creativecommons.org/licenses/by-sa/3.0/>

### Era transition boundaries: manakai/data-locale

For upstream `JNB` records that can be matched conservatively by era name,
nominal start year, polity, ruler, and ruler title, the eighth field can also contain
the first and last applicable civil days from **manakai/data-locale**'s merged
`calendar-era-defs.json`. Supplemental ruler labels are resolved by tag ID
through the merged `tags.json`, using `name_cn`/`label_cn` for simplified
Chinese rather than the upstream default or Japanese label. A small reviewed
display table normalizes selected monarch tags from a title, Khitan/Jurchen
personal or childhood name, or less familiar non-Han name to the temple/ruler
title and common Chinese historiographical name; the upstream monarch tag ID remains embedded
in the generated record's source metadata. The corresponding `name_tw`/
`label_tw` fields remain the authoritative Traditional Chinese variant for
unmodified labels. The upstream model distinguishes the first day of an era from other
transition events such as proclamation, commencement, possible dates, and
historically reported incorrect dates. This project imports only the canonical
`start_day` and inclusive `end_day` selected by the upstream era definition.

Where one manakai era interval crosses an independently attested ruler change,
a reviewed ruler-segment table can split the display label without changing
the era name or its year count. East Dan's Ganlu interval is currently split
at Yelü Bei's recorded departure and Yelü Anduan's investiture; the uncertain
middle interval intentionally carries no personal ruler label.

A conservative manakai-only subset supplements polities absent from the
upstream `JNB` table, including Shu Han and Sun Wu, the seven major Warring States,
selected Five Dynasties and Ten Kingdoms, Khitan/Liao, Western Xia, Jin,
Balhae, and related short-lived regimes. The Warring States layer imports
reviewed ruler-accession chronologies as year-precision labels; synthetic
January boundaries used by a source to represent an uncertain historical year
are not exposed as precise accession dates. It is limited to Qin, Qi, Chu,
Yan, Han, Zhao, and Wei from 500 BCE onward rather than importing every Spring
and Autumn polity. Supplemental records
normally require an explicit polity, ruler, first day, and last day. The
canonical Western Xia sequence is the narrow exception: where manakai supplies
an explicit polity, ruler, nominal first year, and exact last day but no
`start_day`, runtime begins the label at that historical lunar year's first day
and reports year precision (`月日不详`). Equally ranked but conflicting boundary
alternatives are omitted rather than guessed. Entries
tagged as reopened, interrupted, restored, old, disputed, erroneous, or
fictional are also omitted from the continuous-boundary layer; reopened eras
require transition-event intervals and must not be represented by one span
from their earliest start to latest end.

The automatic manakai-only expansion stops before 1912. Later political or
puppet-regime chronologies are not imported. The separately documented
Republic, modern Gregorian, and Hongxian rules in `src/chinese-era.js` are
project-maintained exceptions rather than automatic manakai expansion.

The upstream day object contains JD, Julian-calendar, Gregorian-calendar, and
historical-calendar spellings for the same day. This project imports the JD,
normalizes the Chinese civil boundary to UTC+8 midnight, and converts the
inclusive `end_day` to a half-open `endJdExclusive`. It does not reinterpret a
pre-1582 Julian date as a proleptic Gregorian date. The generated source header
records the SHA-256 digest of the merged JSON used for that build.

The manakai documentation dedicates the JSON files and documentation to the
public domain under CC0 to the extent possible under law.

- Repository: <https://github.com/manakai/data-locale>
- Era data model and license: <https://github.com/manakai/data-locale/blob/master/doc/calendar-era-defs.txt>
- CC0 1.0 Universal: <https://creativecommons.org/publicdomain/zero/1.0/>
