@arcosmos/erfa 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (478) hide show
  1. package/LICENSE +56 -0
  2. package/README.md +109 -2
  3. package/dist/a2af.d.ts +36 -0
  4. package/dist/a2af.d.ts.map +1 -0
  5. package/dist/a2af.js +44 -0
  6. package/dist/a2af.js.map +1 -0
  7. package/dist/a2tf.d.ts +36 -0
  8. package/dist/a2tf.d.ts.map +1 -0
  9. package/dist/a2tf.js +42 -0
  10. package/dist/a2tf.js.map +1 -0
  11. package/dist/af2a.d.ts +19 -0
  12. package/dist/af2a.d.ts.map +1 -0
  13. package/dist/af2a.js +34 -0
  14. package/dist/af2a.js.map +1 -0
  15. package/dist/anp.d.ts +8 -0
  16. package/dist/anp.d.ts.map +1 -0
  17. package/dist/anp.js +16 -0
  18. package/dist/anp.js.map +1 -0
  19. package/dist/anpm.d.ts +8 -0
  20. package/dist/anpm.d.ts.map +1 -0
  21. package/dist/anpm.js +16 -0
  22. package/dist/anpm.js.map +1 -0
  23. package/dist/bi00.d.ts +27 -0
  24. package/dist/bi00.d.ts.map +1 -0
  25. package/dist/bi00.js +40 -0
  26. package/dist/bi00.js.map +1 -0
  27. package/dist/bp06.d.ts +27 -0
  28. package/dist/bp06.d.ts.map +1 -0
  29. package/dist/bp06.js +46 -0
  30. package/dist/bp06.js.map +1 -0
  31. package/dist/c2s.d.ts +14 -0
  32. package/dist/c2s.d.ts.map +1 -0
  33. package/dist/c2s.js +21 -0
  34. package/dist/c2s.js.map +1 -0
  35. package/dist/cal2jd.d.ts +27 -0
  36. package/dist/cal2jd.d.ts.map +1 -0
  37. package/dist/cal2jd.js +58 -0
  38. package/dist/cal2jd.js.map +1 -0
  39. package/dist/constants.d.ts +59 -0
  40. package/dist/constants.d.ts.map +1 -0
  41. package/dist/constants.js +60 -0
  42. package/dist/constants.js.map +1 -0
  43. package/dist/cp.d.ts +9 -0
  44. package/dist/cp.d.ts.map +1 -0
  45. package/dist/cp.js +10 -0
  46. package/dist/cp.js.map +1 -0
  47. package/dist/cpv.d.ts +9 -0
  48. package/dist/cpv.d.ts.map +1 -0
  49. package/dist/cpv.js +12 -0
  50. package/dist/cpv.js.map +1 -0
  51. package/dist/cr.d.ts +9 -0
  52. package/dist/cr.d.ts.map +1 -0
  53. package/dist/cr.js +12 -0
  54. package/dist/cr.js.map +1 -0
  55. package/dist/d2dtf.d.ts +49 -0
  56. package/dist/d2dtf.d.ts.map +1 -0
  57. package/dist/d2dtf.js +142 -0
  58. package/dist/d2dtf.js.map +1 -0
  59. package/dist/d2tf.d.ts +36 -0
  60. package/dist/d2tf.d.ts.map +1 -0
  61. package/dist/d2tf.js +77 -0
  62. package/dist/d2tf.js.map +1 -0
  63. package/dist/dat.d.ts +55 -0
  64. package/dist/dat.d.ts.map +1 -0
  65. package/dist/dat.js +168 -0
  66. package/dist/dat.js.map +1 -0
  67. package/dist/datini.d.ts +26 -0
  68. package/dist/datini.d.ts.map +1 -0
  69. package/dist/datini.js +37 -0
  70. package/dist/datini.js.map +1 -0
  71. package/dist/dtdb.d.ts +105 -0
  72. package/dist/dtdb.d.ts.map +1 -0
  73. package/dist/dtdb.js +1076 -0
  74. package/dist/dtdb.js.map +1 -0
  75. package/dist/dtf2d.d.ts +45 -0
  76. package/dist/dtf2d.d.ts.map +1 -0
  77. package/dist/dtf2d.js +112 -0
  78. package/dist/dtf2d.js.map +1 -0
  79. package/dist/eceq06.d.ts +24 -0
  80. package/dist/eceq06.d.ts.map +1 -0
  81. package/dist/eceq06.js +44 -0
  82. package/dist/eceq06.js.map +1 -0
  83. package/dist/ecm06.d.ts +30 -0
  84. package/dist/ecm06.d.ts.map +1 -0
  85. package/dist/ecm06.js +45 -0
  86. package/dist/ecm06.js.map +1 -0
  87. package/dist/epb.d.ts +24 -0
  88. package/dist/epb.d.ts.map +1 -0
  89. package/dist/epb.js +30 -0
  90. package/dist/epb.js.map +1 -0
  91. package/dist/epb2jd.d.ts +14 -0
  92. package/dist/epb2jd.d.ts.map +1 -0
  93. package/dist/epb2jd.js +20 -0
  94. package/dist/epb2jd.js.map +1 -0
  95. package/dist/epj.d.ts +24 -0
  96. package/dist/epj.d.ts.map +1 -0
  97. package/dist/epj.js +29 -0
  98. package/dist/epj.js.map +1 -0
  99. package/dist/epj2jd.d.ts +14 -0
  100. package/dist/epj2jd.d.ts.map +1 -0
  101. package/dist/epj2jd.js +20 -0
  102. package/dist/epj2jd.js.map +1 -0
  103. package/dist/eqec06.d.ts +24 -0
  104. package/dist/eqec06.d.ts.map +1 -0
  105. package/dist/eqec06.js +44 -0
  106. package/dist/eqec06.js.map +1 -0
  107. package/dist/era00.d.ts +29 -0
  108. package/dist/era00.d.ts.map +1 -0
  109. package/dist/era00.js +51 -0
  110. package/dist/era00.js.map +1 -0
  111. package/dist/fw2m.d.ts +51 -0
  112. package/dist/fw2m.d.ts.map +1 -0
  113. package/dist/fw2m.js +61 -0
  114. package/dist/fw2m.js.map +1 -0
  115. package/dist/g2icrs.d.ts +33 -0
  116. package/dist/g2icrs.d.ts.map +1 -0
  117. package/dist/g2icrs.js +69 -0
  118. package/dist/g2icrs.js.map +1 -0
  119. package/dist/gmst06.d.ts +32 -0
  120. package/dist/gmst06.d.ts.map +1 -0
  121. package/dist/gmst06.js +49 -0
  122. package/dist/gmst06.js.map +1 -0
  123. package/dist/icrs2g.d.ts +33 -0
  124. package/dist/icrs2g.d.ts.map +1 -0
  125. package/dist/icrs2g.js +69 -0
  126. package/dist/icrs2g.js.map +1 -0
  127. package/dist/index.d.ts +95 -0
  128. package/dist/index.d.ts.map +1 -0
  129. package/dist/index.js +106 -0
  130. package/dist/index.js.map +1 -0
  131. package/dist/internal.d.ts +23 -0
  132. package/dist/internal.d.ts.map +1 -0
  133. package/dist/internal.js +32 -0
  134. package/dist/internal.js.map +1 -0
  135. package/dist/ir.d.ts +9 -0
  136. package/dist/ir.d.ts.map +1 -0
  137. package/dist/ir.js +14 -0
  138. package/dist/ir.js.map +1 -0
  139. package/dist/jd2cal.d.ts +31 -0
  140. package/dist/jd2cal.d.ts.map +1 -0
  141. package/dist/jd2cal.js +106 -0
  142. package/dist/jd2cal.js.map +1 -0
  143. package/dist/jdcalf.d.ts +28 -0
  144. package/dist/jdcalf.d.ts.map +1 -0
  145. package/dist/jdcalf.js +84 -0
  146. package/dist/jdcalf.js.map +1 -0
  147. package/dist/leap-seconds.d.ts +30 -0
  148. package/dist/leap-seconds.d.ts.map +1 -0
  149. package/dist/leap-seconds.js +42 -0
  150. package/dist/leap-seconds.js.map +1 -0
  151. package/dist/obl06.d.ts +19 -0
  152. package/dist/obl06.d.ts.map +1 -0
  153. package/dist/obl06.js +32 -0
  154. package/dist/obl06.js.map +1 -0
  155. package/dist/pap.d.ts +19 -0
  156. package/dist/pap.d.ts.map +1 -0
  157. package/dist/pap.js +45 -0
  158. package/dist/pap.js.map +1 -0
  159. package/dist/pas.d.ts +17 -0
  160. package/dist/pas.d.ts.map +1 -0
  161. package/dist/pas.js +24 -0
  162. package/dist/pas.js.map +1 -0
  163. package/dist/pdp.d.ts +8 -0
  164. package/dist/pdp.d.ts.map +1 -0
  165. package/dist/pdp.js +9 -0
  166. package/dist/pdp.js.map +1 -0
  167. package/dist/pfw06.d.ts +43 -0
  168. package/dist/pfw06.d.ts.map +1 -0
  169. package/dist/pfw06.js +73 -0
  170. package/dist/pfw06.js.map +1 -0
  171. package/dist/pm.d.ts +8 -0
  172. package/dist/pm.d.ts.map +1 -0
  173. package/dist/pm.js +9 -0
  174. package/dist/pm.js.map +1 -0
  175. package/dist/pmat06.d.ts +26 -0
  176. package/dist/pmat06.d.ts.map +1 -0
  177. package/dist/pmat06.js +34 -0
  178. package/dist/pmat06.js.map +1 -0
  179. package/dist/pmp.d.ts +10 -0
  180. package/dist/pmp.d.ts.map +1 -0
  181. package/dist/pmp.js +11 -0
  182. package/dist/pmp.js.map +1 -0
  183. package/dist/pmpx.d.ts +29 -0
  184. package/dist/pmpx.d.ts.map +1 -0
  185. package/dist/pmpx.js +59 -0
  186. package/dist/pmpx.js.map +1 -0
  187. package/dist/pmsafe.d.ts +60 -0
  188. package/dist/pmsafe.d.ts.map +1 -0
  189. package/dist/pmsafe.js +91 -0
  190. package/dist/pmsafe.js.map +1 -0
  191. package/dist/pn.d.ts +12 -0
  192. package/dist/pn.d.ts.map +1 -0
  193. package/dist/pn.js +25 -0
  194. package/dist/pn.js.map +1 -0
  195. package/dist/ppp.d.ts +10 -0
  196. package/dist/ppp.d.ts.map +1 -0
  197. package/dist/ppp.js +11 -0
  198. package/dist/ppp.js.map +1 -0
  199. package/dist/ppsp.d.ts +11 -0
  200. package/dist/ppsp.d.ts.map +1 -0
  201. package/dist/ppsp.js +17 -0
  202. package/dist/ppsp.js.map +1 -0
  203. package/dist/pv2s.d.ts +19 -0
  204. package/dist/pv2s.d.ts.map +1 -0
  205. package/dist/pv2s.js +61 -0
  206. package/dist/pv2s.js.map +1 -0
  207. package/dist/pvdpv.d.ts +14 -0
  208. package/dist/pvdpv.d.ts.map +1 -0
  209. package/dist/pvdpv.js +24 -0
  210. package/dist/pvdpv.js.map +1 -0
  211. package/dist/pvm.d.ts +9 -0
  212. package/dist/pvm.d.ts.map +1 -0
  213. package/dist/pvm.js +15 -0
  214. package/dist/pvm.js.map +1 -0
  215. package/dist/pvmpv.d.ts +10 -0
  216. package/dist/pvmpv.d.ts.map +1 -0
  217. package/dist/pvmpv.js +12 -0
  218. package/dist/pvmpv.js.map +1 -0
  219. package/dist/pvppv.d.ts +10 -0
  220. package/dist/pvppv.d.ts.map +1 -0
  221. package/dist/pvppv.js +12 -0
  222. package/dist/pvppv.js.map +1 -0
  223. package/dist/pvstar.d.ts +51 -0
  224. package/dist/pvstar.d.ts.map +1 -0
  225. package/dist/pvstar.js +97 -0
  226. package/dist/pvstar.js.map +1 -0
  227. package/dist/pvu.d.ts +15 -0
  228. package/dist/pvu.d.ts.map +1 -0
  229. package/dist/pvu.js +19 -0
  230. package/dist/pvu.js.map +1 -0
  231. package/dist/pvxpv.d.ts +15 -0
  232. package/dist/pvxpv.d.ts.map +1 -0
  233. package/dist/pvxpv.js +29 -0
  234. package/dist/pvxpv.js.map +1 -0
  235. package/dist/pxp.d.ts +8 -0
  236. package/dist/pxp.d.ts.map +1 -0
  237. package/dist/pxp.js +15 -0
  238. package/dist/pxp.js.map +1 -0
  239. package/dist/rx.d.ts +21 -0
  240. package/dist/rx.d.ts.map +1 -0
  241. package/dist/rx.js +30 -0
  242. package/dist/rx.js.map +1 -0
  243. package/dist/rxp.d.ts +10 -0
  244. package/dist/rxp.d.ts.map +1 -0
  245. package/dist/rxp.js +21 -0
  246. package/dist/rxp.js.map +1 -0
  247. package/dist/rxr.d.ts +10 -0
  248. package/dist/rxr.d.ts.map +1 -0
  249. package/dist/rxr.js +27 -0
  250. package/dist/rxr.js.map +1 -0
  251. package/dist/ry.d.ts +21 -0
  252. package/dist/ry.d.ts.map +1 -0
  253. package/dist/ry.js +30 -0
  254. package/dist/ry.js.map +1 -0
  255. package/dist/rz.d.ts +21 -0
  256. package/dist/rz.d.ts.map +1 -0
  257. package/dist/rz.js +30 -0
  258. package/dist/rz.js.map +1 -0
  259. package/dist/s2c.d.ts +10 -0
  260. package/dist/s2c.d.ts.map +1 -0
  261. package/dist/s2c.js +12 -0
  262. package/dist/s2c.js.map +1 -0
  263. package/dist/s2pv.d.ts +14 -0
  264. package/dist/s2pv.d.ts.map +1 -0
  265. package/dist/s2pv.js +27 -0
  266. package/dist/s2pv.js.map +1 -0
  267. package/dist/s2xpv.d.ts +11 -0
  268. package/dist/s2xpv.d.ts.map +1 -0
  269. package/dist/s2xpv.js +13 -0
  270. package/dist/s2xpv.js.map +1 -0
  271. package/dist/sepp.d.ts +16 -0
  272. package/dist/sepp.d.ts.map +1 -0
  273. package/dist/sepp.js +26 -0
  274. package/dist/sepp.js.map +1 -0
  275. package/dist/seps.d.ts +11 -0
  276. package/dist/seps.d.ts.map +1 -0
  277. package/dist/seps.js +20 -0
  278. package/dist/seps.js.map +1 -0
  279. package/dist/starpm.d.ts +56 -0
  280. package/dist/starpm.d.ts.map +1 -0
  281. package/dist/starpm.js +90 -0
  282. package/dist/starpm.js.map +1 -0
  283. package/dist/starpv.d.ts +62 -0
  284. package/dist/starpv.d.ts.map +1 -0
  285. package/dist/starpv.js +147 -0
  286. package/dist/starpv.js.map +1 -0
  287. package/dist/sxp.d.ts +10 -0
  288. package/dist/sxp.d.ts.map +1 -0
  289. package/dist/sxp.js +11 -0
  290. package/dist/sxp.js.map +1 -0
  291. package/dist/sxpv.d.ts +10 -0
  292. package/dist/sxpv.d.ts.map +1 -0
  293. package/dist/sxpv.js +12 -0
  294. package/dist/sxpv.js.map +1 -0
  295. package/dist/taitt.d.ts +19 -0
  296. package/dist/taitt.d.ts.map +1 -0
  297. package/dist/taitt.js +36 -0
  298. package/dist/taitt.js.map +1 -0
  299. package/dist/taiut1.d.ts +20 -0
  300. package/dist/taiut1.d.ts.map +1 -0
  301. package/dist/taiut1.js +36 -0
  302. package/dist/taiut1.js.map +1 -0
  303. package/dist/taiutc.d.ts +33 -0
  304. package/dist/taiutc.d.ts.map +1 -0
  305. package/dist/taiutc.js +73 -0
  306. package/dist/taiutc.js.map +1 -0
  307. package/dist/tcbtdb.d.ts +29 -0
  308. package/dist/tcbtdb.d.ts.map +1 -0
  309. package/dist/tcbtdb.js +51 -0
  310. package/dist/tcbtdb.js.map +1 -0
  311. package/dist/tcgtt.d.ts +18 -0
  312. package/dist/tcgtt.d.ts.map +1 -0
  313. package/dist/tcgtt.js +35 -0
  314. package/dist/tcgtt.js.map +1 -0
  315. package/dist/tdbtcb.d.ts +29 -0
  316. package/dist/tdbtcb.d.ts.map +1 -0
  317. package/dist/tdbtcb.js +55 -0
  318. package/dist/tdbtcb.js.map +1 -0
  319. package/dist/tdbtt.d.ts +27 -0
  320. package/dist/tdbtt.d.ts.map +1 -0
  321. package/dist/tdbtt.js +43 -0
  322. package/dist/tdbtt.js.map +1 -0
  323. package/dist/tf2a.d.ts +19 -0
  324. package/dist/tf2a.d.ts.map +1 -0
  325. package/dist/tf2a.js +34 -0
  326. package/dist/tf2a.js.map +1 -0
  327. package/dist/tr.d.ts +9 -0
  328. package/dist/tr.d.ts.map +1 -0
  329. package/dist/tr.js +22 -0
  330. package/dist/tr.js.map +1 -0
  331. package/dist/trxp.d.ts +10 -0
  332. package/dist/trxp.d.ts.map +1 -0
  333. package/dist/trxp.js +15 -0
  334. package/dist/trxp.js.map +1 -0
  335. package/dist/tttai.d.ts +19 -0
  336. package/dist/tttai.d.ts.map +1 -0
  337. package/dist/tttai.js +36 -0
  338. package/dist/tttai.js.map +1 -0
  339. package/dist/tttcg.d.ts +18 -0
  340. package/dist/tttcg.d.ts.map +1 -0
  341. package/dist/tttcg.js +37 -0
  342. package/dist/tttcg.js.map +1 -0
  343. package/dist/tttdb.d.ts +27 -0
  344. package/dist/tttdb.d.ts.map +1 -0
  345. package/dist/tttdb.js +43 -0
  346. package/dist/tttdb.js.map +1 -0
  347. package/dist/ttut1.d.ts +19 -0
  348. package/dist/ttut1.d.ts.map +1 -0
  349. package/dist/ttut1.js +35 -0
  350. package/dist/ttut1.js.map +1 -0
  351. package/dist/ut1tai.d.ts +20 -0
  352. package/dist/ut1tai.d.ts.map +1 -0
  353. package/dist/ut1tai.js +36 -0
  354. package/dist/ut1tai.js.map +1 -0
  355. package/dist/ut1tt.d.ts +19 -0
  356. package/dist/ut1tt.d.ts.map +1 -0
  357. package/dist/ut1tt.js +35 -0
  358. package/dist/ut1tt.js.map +1 -0
  359. package/dist/ut1utc.d.ts +35 -0
  360. package/dist/ut1utc.d.ts.map +1 -0
  361. package/dist/ut1utc.js +107 -0
  362. package/dist/ut1utc.js.map +1 -0
  363. package/dist/utctai.d.ts +33 -0
  364. package/dist/utctai.d.ts.map +1 -0
  365. package/dist/utctai.js +94 -0
  366. package/dist/utctai.js.map +1 -0
  367. package/dist/utcut1.d.ts +34 -0
  368. package/dist/utcut1.d.ts.map +1 -0
  369. package/dist/utcut1.js +63 -0
  370. package/dist/utcut1.js.map +1 -0
  371. package/dist/zp.d.ts +8 -0
  372. package/dist/zp.d.ts.map +1 -0
  373. package/dist/zp.js +9 -0
  374. package/dist/zp.js.map +1 -0
  375. package/dist/zpv.d.ts +8 -0
  376. package/dist/zpv.d.ts.map +1 -0
  377. package/dist/zpv.js +10 -0
  378. package/dist/zpv.js.map +1 -0
  379. package/dist/zr.d.ts +9 -0
  380. package/dist/zr.d.ts.map +1 -0
  381. package/dist/zr.js +14 -0
  382. package/dist/zr.js.map +1 -0
  383. package/package.json +42 -3
  384. package/src/a2af.ts +48 -0
  385. package/src/a2tf.ts +45 -0
  386. package/src/af2a.ts +38 -0
  387. package/src/anp.ts +15 -0
  388. package/src/anpm.ts +15 -0
  389. package/src/bi00.ts +42 -0
  390. package/src/bp06.ts +51 -0
  391. package/src/c2s.ts +23 -0
  392. package/src/cal2jd.ts +67 -0
  393. package/src/constants.ts +60 -0
  394. package/src/cp.ts +12 -0
  395. package/src/cpv.ts +13 -0
  396. package/src/cr.ts +13 -0
  397. package/src/d2dtf.ts +153 -0
  398. package/src/d2tf.ts +87 -0
  399. package/src/dat.ts +186 -0
  400. package/src/datini.ts +49 -0
  401. package/src/dtdb.ts +1110 -0
  402. package/src/dtf2d.ts +124 -0
  403. package/src/eceq06.ts +54 -0
  404. package/src/ecm06.ts +51 -0
  405. package/src/epb.ts +31 -0
  406. package/src/epb2jd.ts +21 -0
  407. package/src/epj.ts +30 -0
  408. package/src/epj2jd.ts +21 -0
  409. package/src/eqec06.ts +54 -0
  410. package/src/era00.ts +54 -0
  411. package/src/fw2m.ts +64 -0
  412. package/src/g2icrs.ts +74 -0
  413. package/src/gmst06.ts +51 -0
  414. package/src/icrs2g.ts +74 -0
  415. package/src/index.ts +108 -0
  416. package/src/internal.ts +46 -0
  417. package/src/ir.ts +16 -0
  418. package/src/jd2cal.ts +117 -0
  419. package/src/jdcalf.ts +93 -0
  420. package/src/leap-seconds.ts +47 -0
  421. package/src/obl06.ts +34 -0
  422. package/src/pap.ts +54 -0
  423. package/src/pas.ts +25 -0
  424. package/src/pdp.ts +11 -0
  425. package/src/pfw06.ts +78 -0
  426. package/src/pm.ts +11 -0
  427. package/src/pmat06.ts +37 -0
  428. package/src/pmp.ts +13 -0
  429. package/src/pmpx.ts +75 -0
  430. package/src/pmsafe.ts +109 -0
  431. package/src/pn.ts +26 -0
  432. package/src/ppp.ts +13 -0
  433. package/src/ppsp.ts +20 -0
  434. package/src/pv2s.ts +71 -0
  435. package/src/pvdpv.ts +30 -0
  436. package/src/pvm.ts +19 -0
  437. package/src/pvmpv.ts +14 -0
  438. package/src/pvppv.ts +14 -0
  439. package/src/pvstar.ts +113 -0
  440. package/src/pvu.ts +20 -0
  441. package/src/pvxpv.ts +33 -0
  442. package/src/pxp.ts +17 -0
  443. package/src/rx.ts +32 -0
  444. package/src/rxp.ts +24 -0
  445. package/src/rxr.ts +29 -0
  446. package/src/ry.ts +32 -0
  447. package/src/rz.ts +32 -0
  448. package/src/s2c.ts +14 -0
  449. package/src/s2pv.ts +30 -0
  450. package/src/s2xpv.ts +15 -0
  451. package/src/sepp.ts +28 -0
  452. package/src/seps.ts +20 -0
  453. package/src/starpm.ts +108 -0
  454. package/src/starpv.ts +167 -0
  455. package/src/sxp.ts +13 -0
  456. package/src/sxpv.ts +14 -0
  457. package/src/taitt.ts +38 -0
  458. package/src/taiut1.ts +41 -0
  459. package/src/taiutc.ts +76 -0
  460. package/src/tcbtdb.ts +54 -0
  461. package/src/tcgtt.ts +37 -0
  462. package/src/tdbtcb.ts +59 -0
  463. package/src/tdbtt.ts +48 -0
  464. package/src/tf2a.ts +38 -0
  465. package/src/tr.ts +24 -0
  466. package/src/trxp.ts +18 -0
  467. package/src/tttai.ts +38 -0
  468. package/src/tttcg.ts +40 -0
  469. package/src/tttdb.ts +48 -0
  470. package/src/ttut1.ts +40 -0
  471. package/src/ut1tai.ts +41 -0
  472. package/src/ut1tt.ts +40 -0
  473. package/src/ut1utc.ts +115 -0
  474. package/src/utctai.ts +97 -0
  475. package/src/utcut1.ts +66 -0
  476. package/src/zp.ts +11 -0
  477. package/src/zpv.ts +12 -0
  478. package/src/zr.ts +16 -0
package/dist/d2tf.js ADDED
@@ -0,0 +1,77 @@
1
+ // Translated from ERFA 2.0.1 eraD2tf (d2tf.c); see LICENSE.
2
+ import { DAYSEC } from './constants.js';
3
+ import { dint, dnint } from './internal.js';
4
+ /**
5
+ * Decompose days to hours, minutes, seconds, fraction.
6
+ *
7
+ * Notes:
8
+ * 1. The argument ndp is interpreted as follows:
9
+ *
10
+ * ndp resolution
11
+ * : ...0000 00 00
12
+ * -7 1000 00 00
13
+ * -6 100 00 00
14
+ * -5 10 00 00
15
+ * -4 1 00 00
16
+ * -3 0 10 00
17
+ * -2 0 01 00
18
+ * -1 0 00 10
19
+ * 0 0 00 01
20
+ * 1 0 00 00.1
21
+ * 2 0 00 00.01
22
+ * 3 0 00 00.001
23
+ * : 0 00 00.000...
24
+ *
25
+ * 2. The largest positive useful value for ndp is determined by the size of days, the format
26
+ * of double on the target platform, and the risk of overflowing ihmsf[3]. On a typical
27
+ * platform, for days up to 1.0, the available floating-point precision might correspond
28
+ * to ndp=12. In C the practical limit is typically ndp=9, set by the capacity of a
29
+ * 32-bit int; here the fields are numbers, exact as integers up to 2^53.
30
+ * 3. The absolute value of days may exceed 1.0. In cases where it does not, it is up to the
31
+ * caller to test for and handle the case where days is very nearly 1.0 and rounds up to
32
+ * 24 hours, by testing for ihmsf[0]=24 and setting ihmsf[0-3] to zero.
33
+ *
34
+ * @param ndp resolution (Note 1)
35
+ * @param days interval in days
36
+ * @returns [sign, ihmsf]: '+' or '-', and hours, minutes, seconds, fraction
37
+ */
38
+ export function d2tf(ndp, days) {
39
+ let nrs, rs;
40
+ // Handle sign.
41
+ const sign = days >= 0.0 ? '+' : '-';
42
+ // Interval in seconds.
43
+ let a = DAYSEC * Math.abs(days);
44
+ // Pre-round if resolution coarser than 1s (then pretend ndp=1).
45
+ if (ndp < 0) {
46
+ nrs = 1;
47
+ for (let n = 1; n <= -ndp; n++) {
48
+ nrs *= n === 2 || n === 4 ? 6 : 10;
49
+ }
50
+ rs = nrs;
51
+ const w = a / rs;
52
+ a = rs * dnint(w);
53
+ }
54
+ // Express the unit of each field in resolution units.
55
+ nrs = 1;
56
+ for (let n = 1; n <= ndp; n++) {
57
+ nrs *= 10;
58
+ }
59
+ rs = nrs;
60
+ const rm = rs * 60.0;
61
+ const rh = rm * 60.0;
62
+ // Round the interval and express in resolution units.
63
+ a = dnint(rs * a);
64
+ // Break into fields.
65
+ let ah = a / rh;
66
+ ah = dint(ah);
67
+ a -= ah * rh;
68
+ let am = a / rm;
69
+ am = dint(am);
70
+ a -= am * rm;
71
+ let as = a / rs;
72
+ as = dint(as);
73
+ const af = a - as * rs;
74
+ // Return results.
75
+ return [sign, [ah, am, as, af]];
76
+ }
77
+ //# sourceMappingURL=d2tf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"d2tf.js","sourceRoot":"","sources":["../src/d2tf.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,IAAI,CAClB,GAAW,EACX,IAAY;IAEZ,IAAI,GAAW,EAAE,EAAU,CAAA;IAE3B,eAAe;IACf,MAAM,IAAI,GAAG,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAA;IAEpC,uBAAuB;IACvB,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAE/B,gEAAgE;IAChE,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;QACZ,GAAG,GAAG,CAA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I,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;AACjC,CAAC"}
package/dist/dat.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ /**
2
+ * For a given UTC date, calculate Delta(AT) = TAI-UTC.
3
+ *
4
+ * IMPORTANT: a new version of this function must be produced whenever a new leap second is
5
+ * announced (latest leap second: 2016 December 31), with a new line in the table of changes
6
+ * and IYV set to the current year. Between releases, setLeapSeconds replaces the table at
7
+ * run time, as pyerfa and Astropy do.
8
+ *
9
+ * Notes:
10
+ * 1. UTC began at 1960 January 1.0 (JD 2436934.5) and it is improper to call the function
11
+ * with an earlier date. If this is attempted, zero is returned together with a warning
12
+ * status. Because leap seconds cannot, in principle, be predicted in advance, a reliable
13
+ * check for dates beyond the valid range is impossible. To guard against gross errors, a
14
+ * year five or more after the release year of the present function (IYV, 2023) is
15
+ * considered dubious: from 2029 on. In this case a warning status is returned but the
16
+ * result is computed in the normal way. For both too-early and too-late years, the
17
+ * warning status is +1. This is distinct from the error status -1, which signifies a year
18
+ * so early that JD could not be computed. "Too early" is before the first year of the
19
+ * table in use.
20
+ * 2. If the specified date is for a day which ends with a leap second, the TAI-UTC value
21
+ * returned is for the period leading up to the leap second. If the date is for a day
22
+ * which begins as a leap second ends, the TAI-UTC returned is for the period following
23
+ * the leap second.
24
+ * 3. The day number must be in the normal calendar range, for example 1 through 30 for
25
+ * April. The "almanac" convention of allowing such dates as January 0 and December 32 is
26
+ * not supported in this function, in order to avoid confusion near leap seconds.
27
+ * 4. The fraction of day is used only for dates before the introduction of leap seconds, the
28
+ * first of which occurred at the end of 1971. It is tested for validity (0 to 1 is the
29
+ * valid range) even if not used; if invalid, zero is used and status -4 is returned. For
30
+ * many applications, setting fd to zero is acceptable; the resulting error is always less
31
+ * than 3 ms (and occurs only pre-1972).
32
+ * 5. The status value returned in the case where there are multiple errors refers to the
33
+ * first error detected. For example, if the month and day are 13 and 32 respectively,
34
+ * status -2 (bad month) will be returned. The "internal error" status refers to a case
35
+ * that is impossible with the built-in table.
36
+ * 6. In cases where a valid result is not available, zero is returned.
37
+ * 7. The pre-1972 drift applies to the first 14 rows of the table in use, whatever it holds:
38
+ * a replacement table (setLeapSeconds) must keep the built-in table's first 14 rows.
39
+ *
40
+ * References:
41
+ * - For dates from 1961 January 1 onwards, the expressions from the file
42
+ * ftp://maia.usno.navy.mil/ser7/tai-utc.dat are used.
43
+ * - The 5ms timestep at 1961 January 1 is taken from 2.58.1 (p87) of the 1992 Explanatory
44
+ * Supplement.
45
+ *
46
+ * @param iy UTC: year (Notes 1 and 2)
47
+ * @param im month (Note 2)
48
+ * @param id day (Notes 2 and 3)
49
+ * @param fd fraction of day (Note 4)
50
+ * @returns [deltat, status]: TAI minus UTC in seconds, and status (Note 5): 1 = dubious
51
+ * year (Note 1), 0 = OK, -1 = bad year, -2 = bad month, -3 = bad day (Note 3), -4 = bad
52
+ * fraction (Note 4), -5 = internal error (Note 5)
53
+ */
54
+ export declare function dat(iy: number, im: number, id: number, fd: number): [deltat: number, status: number];
55
+ //# sourceMappingURL=dat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dat.d.ts","sourceRoot":"","sources":["../src/dat.ts"],"names":[],"mappings":"AA8EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,GAAG,CACjB,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,GACT,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAiDlC"}
package/dist/dat.js ADDED
@@ -0,0 +1,168 @@
1
+ // Translated from ERFA 2.0.1 eraDat (dat.c); see LICENSE.
2
+ import { cal2jd } from './cal2jd.js';
3
+ import { datini } from './datini.js';
4
+ // Release year for this version of eraDat
5
+ const IYV = 2023;
6
+ // Reference dates (MJD) and drift rates (s/day), pre leap seconds
7
+ const drift = [
8
+ [37300.0, 0.0012960],
9
+ [37300.0, 0.0012960],
10
+ [37300.0, 0.0012960],
11
+ [37665.0, 0.0011232],
12
+ [37665.0, 0.0011232],
13
+ [38761.0, 0.0012960],
14
+ [38761.0, 0.0012960],
15
+ [38761.0, 0.0012960],
16
+ [38761.0, 0.0012960],
17
+ [38761.0, 0.0012960],
18
+ [38761.0, 0.0012960],
19
+ [38761.0, 0.0012960],
20
+ [39126.0, 0.0025920],
21
+ [39126.0, 0.0025920],
22
+ ];
23
+ // Number of Delta(AT) expressions before leap seconds were introduced
24
+ const NERA1 = drift.length;
25
+ // Dates and Delta(AT)s
26
+ const _changes = [
27
+ { iyear: 1960, month: 1, delat: 1.4178180 },
28
+ { iyear: 1961, month: 1, delat: 1.4228180 },
29
+ { iyear: 1961, month: 8, delat: 1.3728180 },
30
+ { iyear: 1962, month: 1, delat: 1.8458580 },
31
+ { iyear: 1963, month: 11, delat: 1.9458580 },
32
+ { iyear: 1964, month: 1, delat: 3.2401300 },
33
+ { iyear: 1964, month: 4, delat: 3.3401300 },
34
+ { iyear: 1964, month: 9, delat: 3.4401300 },
35
+ { iyear: 1965, month: 1, delat: 3.5401300 },
36
+ { iyear: 1965, month: 3, delat: 3.6401300 },
37
+ { iyear: 1965, month: 7, delat: 3.7401300 },
38
+ { iyear: 1965, month: 9, delat: 3.8401300 },
39
+ { iyear: 1966, month: 1, delat: 4.3131700 },
40
+ { iyear: 1968, month: 2, delat: 4.2131700 },
41
+ { iyear: 1972, month: 1, delat: 10.0 },
42
+ { iyear: 1972, month: 7, delat: 11.0 },
43
+ { iyear: 1973, month: 1, delat: 12.0 },
44
+ { iyear: 1974, month: 1, delat: 13.0 },
45
+ { iyear: 1975, month: 1, delat: 14.0 },
46
+ { iyear: 1976, month: 1, delat: 15.0 },
47
+ { iyear: 1977, month: 1, delat: 16.0 },
48
+ { iyear: 1978, month: 1, delat: 17.0 },
49
+ { iyear: 1979, month: 1, delat: 18.0 },
50
+ { iyear: 1980, month: 1, delat: 19.0 },
51
+ { iyear: 1981, month: 7, delat: 20.0 },
52
+ { iyear: 1982, month: 7, delat: 21.0 },
53
+ { iyear: 1983, month: 7, delat: 22.0 },
54
+ { iyear: 1985, month: 7, delat: 23.0 },
55
+ { iyear: 1988, month: 1, delat: 24.0 },
56
+ { iyear: 1990, month: 1, delat: 25.0 },
57
+ { iyear: 1991, month: 1, delat: 26.0 },
58
+ { iyear: 1992, month: 7, delat: 27.0 },
59
+ { iyear: 1993, month: 7, delat: 28.0 },
60
+ { iyear: 1994, month: 7, delat: 29.0 },
61
+ { iyear: 1996, month: 1, delat: 30.0 },
62
+ { iyear: 1997, month: 7, delat: 31.0 },
63
+ { iyear: 1999, month: 1, delat: 32.0 },
64
+ { iyear: 2006, month: 1, delat: 33.0 },
65
+ { iyear: 2009, month: 1, delat: 34.0 },
66
+ { iyear: 2012, month: 7, delat: 35.0 },
67
+ { iyear: 2015, month: 7, delat: 36.0 },
68
+ { iyear: 2017, month: 1, delat: 37.0 },
69
+ ];
70
+ // Number of Delta(AT) changes
71
+ const _NDAT = _changes.length;
72
+ /**
73
+ * For a given UTC date, calculate Delta(AT) = TAI-UTC.
74
+ *
75
+ * IMPORTANT: a new version of this function must be produced whenever a new leap second is
76
+ * announced (latest leap second: 2016 December 31), with a new line in the table of changes
77
+ * and IYV set to the current year. Between releases, setLeapSeconds replaces the table at
78
+ * run time, as pyerfa and Astropy do.
79
+ *
80
+ * Notes:
81
+ * 1. UTC began at 1960 January 1.0 (JD 2436934.5) and it is improper to call the function
82
+ * with an earlier date. If this is attempted, zero is returned together with a warning
83
+ * status. Because leap seconds cannot, in principle, be predicted in advance, a reliable
84
+ * check for dates beyond the valid range is impossible. To guard against gross errors, a
85
+ * year five or more after the release year of the present function (IYV, 2023) is
86
+ * considered dubious: from 2029 on. In this case a warning status is returned but the
87
+ * result is computed in the normal way. For both too-early and too-late years, the
88
+ * warning status is +1. This is distinct from the error status -1, which signifies a year
89
+ * so early that JD could not be computed. "Too early" is before the first year of the
90
+ * table in use.
91
+ * 2. If the specified date is for a day which ends with a leap second, the TAI-UTC value
92
+ * returned is for the period leading up to the leap second. If the date is for a day
93
+ * which begins as a leap second ends, the TAI-UTC returned is for the period following
94
+ * the leap second.
95
+ * 3. The day number must be in the normal calendar range, for example 1 through 30 for
96
+ * April. The "almanac" convention of allowing such dates as January 0 and December 32 is
97
+ * not supported in this function, in order to avoid confusion near leap seconds.
98
+ * 4. The fraction of day is used only for dates before the introduction of leap seconds, the
99
+ * first of which occurred at the end of 1971. It is tested for validity (0 to 1 is the
100
+ * valid range) even if not used; if invalid, zero is used and status -4 is returned. For
101
+ * many applications, setting fd to zero is acceptable; the resulting error is always less
102
+ * than 3 ms (and occurs only pre-1972).
103
+ * 5. The status value returned in the case where there are multiple errors refers to the
104
+ * first error detected. For example, if the month and day are 13 and 32 respectively,
105
+ * status -2 (bad month) will be returned. The "internal error" status refers to a case
106
+ * that is impossible with the built-in table.
107
+ * 6. In cases where a valid result is not available, zero is returned.
108
+ * 7. The pre-1972 drift applies to the first 14 rows of the table in use, whatever it holds:
109
+ * a replacement table (setLeapSeconds) must keep the built-in table's first 14 rows.
110
+ *
111
+ * References:
112
+ * - For dates from 1961 January 1 onwards, the expressions from the file
113
+ * ftp://maia.usno.navy.mil/ser7/tai-utc.dat are used.
114
+ * - The 5ms timestep at 1961 January 1 is taken from 2.58.1 (p87) of the 1992 Explanatory
115
+ * Supplement.
116
+ *
117
+ * @param iy UTC: year (Notes 1 and 2)
118
+ * @param im month (Note 2)
119
+ * @param id day (Notes 2 and 3)
120
+ * @param fd fraction of day (Note 4)
121
+ * @returns [deltat, status]: TAI minus UTC in seconds, and status (Note 5): 1 = dubious
122
+ * year (Note 1), 0 = OK, -1 = bad year, -2 = bad month, -3 = bad day (Note 3), -4 = bad
123
+ * fraction (Note 4), -5 = internal error (Note 5)
124
+ */
125
+ export function dat(iy, im, id, fd) {
126
+ // Get/initialise leap-second if needed
127
+ const [NDAT, changes] = datini(_changes, _NDAT);
128
+ // Miscellaneous local variables
129
+ let i;
130
+ // Initialize the result to zero.
131
+ let da = 0.0;
132
+ let deltat = da;
133
+ // If invalid fraction of a day, set error status and give up.
134
+ if (fd < 0.0 || fd > 1.0)
135
+ return [deltat, -4];
136
+ // Convert the date into an MJD.
137
+ const [, djm, js] = cal2jd(iy, im, id);
138
+ let j = js;
139
+ // If invalid year, month, or day, give up.
140
+ if (j < 0)
141
+ return [deltat, j];
142
+ // If pre-UTC year, set warning status and give up.
143
+ if (iy < changes[0].iyear)
144
+ return [deltat, 1];
145
+ // If suspiciously late year, set warning status but proceed.
146
+ if (iy > IYV + 5)
147
+ j = 1;
148
+ // Combine year and month to form a date-ordered integer...
149
+ const m = 12 * iy + im;
150
+ // ...and use it to find the preceding table entry.
151
+ for (i = NDAT - 1; i >= 0; i--) {
152
+ if (m >= 12 * changes[i].iyear + changes[i].month)
153
+ break;
154
+ }
155
+ // Prevent underflow warnings.
156
+ if (i < 0)
157
+ return [deltat, -5];
158
+ // Get the Delta(AT).
159
+ da = changes[i].delat;
160
+ // If pre-1972, adjust for drift.
161
+ if (i < NERA1)
162
+ da += (djm + fd - drift[i][0]) * drift[i][1];
163
+ // Return the Delta(AT) value.
164
+ deltat = da;
165
+ // Return the status.
166
+ return [deltat, j];
167
+ }
168
+ //# sourceMappingURL=dat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dat.js","sourceRoot":"","sources":["../src/dat.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGpC,0CAA0C;AAC1C,MAAM,GAAG,GAAG,IAAI,CAAA;AAEhB,kEAAkE;AAClE,MAAM,KAAK,GAA2C;IACpD,CAAC,OAAO,EAAE,SAAS,CAAC;IACpB,CAAC,OAAO,EAAE,SAAS,CAAC;IACpB,CAAC,OAAO,EAAE,SAAS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I,EAAE,GAAG,OAAO,CAAC,CAAC,CAAE,CAAC,KAAK;QAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;IAE9C,6DAA6D;IAC7D,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;QAAE,CAAC,GAAG,CAAC,CAAA;IAEvB,2DAA2D;IAC3D,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;IAEtB,mDAAmD;IACnD,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/B,IAAI,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC,CAAE,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC,CAAE,CAAC,KAAK;YAAE,MAAK;IAC5D,CAAC;IAED,8BAA8B;IAC9B,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAA;IAE9B,qBAAqB;IACrB,EAAE,GAAG,OAAO,CAAC,CAAC,CAAE,CAAC,KAAK,CAAA;IAEtB,iCAAiC;IACjC,IAAI,CAAC,GAAG,KAAK;QAAE,EAAE,IAAI,CAAC,GAAG,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAA;IAE7D,8BAA8B;IAC9B,MAAM,GAAG,EAAE,CAAA;IAEX,qBAAqB;IACrB,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AACpB,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * A row of a leap-second table (eraLEAPSECOND): from the start of month `month` of year
3
+ * `iyear`, TAI-UTC is `delat` seconds. Before 1972, dat adds a drift to the first rows.
4
+ */
5
+ export type LeapSecond = {
6
+ iyear: number;
7
+ month: number;
8
+ delat: number;
9
+ };
10
+ /**
11
+ * eraSetLeapSeconds: use this table. A count <= 0 causes a reset of the table to the
12
+ * built-in version. No sanity checks are performed.
13
+ */
14
+ export declare function setTable(leapseconds: readonly LeapSecond[], count: number): void;
15
+ /** The table in use and its number of entries, as eraGetLeapSeconds reads them. */
16
+ export declare function getTable(): [NDAT: number, leapseconds: readonly LeapSecond[]];
17
+ /**
18
+ * Get the leap second table, initializing it to the built-in version if necessary. For dat
19
+ * only.
20
+ *
21
+ * @param builtin the built-in table
22
+ * @param nBuiltin its number of entries
23
+ * @returns [NDAT, leapseconds]: the number of entries, and the table in use
24
+ */
25
+ export declare function datini(builtin: readonly LeapSecond[], nBuiltin: number): [NDAT: number, leapseconds: readonly LeapSecond[]];
26
+ //# sourceMappingURL=datini.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datini.d.ts","sourceRoot":"","sources":["../src/datini.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAOxE;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAGhF;AAED,mFAAmF;AACnF,wBAAgB,QAAQ,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC,CAE7E;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CACpB,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,QAAQ,EAAE,MAAM,GACf,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC,CAKpD"}
package/dist/datini.js ADDED
@@ -0,0 +1,37 @@
1
+ // Translated from ERFA 2.0.1 eraDatini, with the table eraSetLeapSeconds sets and
2
+ // eraGetLeapSeconds reads (erfadatextra.c, not derived from SOFA); see LICENSE.
3
+ //
4
+ // Internal: the leap-second table in use. dat reads it through datini; leap-seconds.ts gets
5
+ // and sets it. Kept apart from both so that dat and leap-seconds.ts don't import each other.
6
+ // Not exported from the package, except the LeapSecond type.
7
+ // The table in use and its number of entries. NDAT <= 0 means the built-in table, which
8
+ // datini installs on dat's next call.
9
+ let changes = [];
10
+ let NDAT = -1;
11
+ /**
12
+ * eraSetLeapSeconds: use this table. A count <= 0 causes a reset of the table to the
13
+ * built-in version. No sanity checks are performed.
14
+ */
15
+ export function setTable(leapseconds, count) {
16
+ changes = leapseconds;
17
+ NDAT = count;
18
+ }
19
+ /** The table in use and its number of entries, as eraGetLeapSeconds reads them. */
20
+ export function getTable() {
21
+ return [NDAT, changes];
22
+ }
23
+ /**
24
+ * Get the leap second table, initializing it to the built-in version if necessary. For dat
25
+ * only.
26
+ *
27
+ * @param builtin the built-in table
28
+ * @param nBuiltin its number of entries
29
+ * @returns [NDAT, leapseconds]: the number of entries, and the table in use
30
+ */
31
+ export function datini(builtin, nBuiltin) {
32
+ if (NDAT <= 0) {
33
+ setTable(builtin, nBuiltin);
34
+ }
35
+ return [NDAT, changes];
36
+ }
37
+ //# sourceMappingURL=datini.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datini.js","sourceRoot":"","sources":["../src/datini.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,gFAAgF;AAChF,EAAE;AACF,4FAA4F;AAC5F,6FAA6F;AAC7F,6DAA6D;AAQ7D,wFAAwF;AACxF,sCAAsC;AACtC,IAAI,OAAO,GAA0B,EAAE,CAAA;AACvC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAA;AAEb;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,WAAkC,EAAE,KAAa;IACxE,OAAO,GAAG,WAAW,CAAA;IACrB,IAAI,GAAG,KAAK,CAAA;AACd,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,QAAQ;IACtB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;AACxB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM,CACpB,OAA8B,EAC9B,QAAgB;IAEhB,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;QACd,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IAC7B,CAAC;IACD,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;AACxB,CAAC"}
package/dist/dtdb.d.ts ADDED
@@ -0,0 +1,105 @@
1
+ /**
2
+ * An approximation to TDB-TT, the difference between barycentric dynamical time and
3
+ * terrestrial time, for an observer on the Earth.
4
+ *
5
+ * The different time scales - proper, coordinate and realized - are related to each other:
6
+ *
7
+ * TAI <- physically realized
8
+ * :
9
+ * offset <- observed (nominally +32.184s)
10
+ * :
11
+ * TT <- terrestrial time
12
+ * :
13
+ * rate adjustment (L_G) <- definition of TT
14
+ * :
15
+ * TCG <- time scale for GCRS
16
+ * :
17
+ * "periodic" terms <- dtdb is an implementation
18
+ * :
19
+ * rate adjustment (L_C) <- function of solar-system ephemeris
20
+ * :
21
+ * TCB <- time scale for BCRS
22
+ * :
23
+ * rate adjustment (-L_B) <- definition of TDB
24
+ * :
25
+ * TDB <- TCB scaled to track TT
26
+ * :
27
+ * "periodic" terms <- -dtdb is an approximation
28
+ * :
29
+ * TT <- terrestrial time
30
+ *
31
+ * Adopted values for the various constants can be found in the IERS Conventions (McCarthy &
32
+ * Petit 2003).
33
+ *
34
+ * Notes:
35
+ * 1. The date date1+date2 is a Julian Date, apportioned in any convenient way between the
36
+ * two arguments. For example, JD(TT)=2450123.7 could be given as (2450123.7, 0.0), the JD
37
+ * method; (2451545.0, -1421.3), the J2000 method; (2400000.5, 50123.2), the MJD method;
38
+ * or (2450123.5, 0.2), the date and time method. The J2000 method is best matched to the
39
+ * way the argument is handled internally and will deliver the optimum resolution.
40
+ * Although the date is, formally, barycentric dynamical time (TDB), the terrestrial
41
+ * dynamical time (TT) can be used with no practical effect on the accuracy of the
42
+ * prediction.
43
+ * 2. TT can be regarded as a coordinate time that is realized as an offset of 32.184s from
44
+ * International Atomic Time, TAI. TT is a specific linear transformation of geocentric
45
+ * coordinate time TCG, which is the time scale for the Geocentric Celestial Reference
46
+ * System, GCRS.
47
+ * 3. TDB is a coordinate time, and is a specific linear transformation of barycentric
48
+ * coordinate time TCB, which is the time scale for the Barycentric Celestial Reference
49
+ * System, BCRS.
50
+ * 4. The difference TCG-TCB depends on the masses and positions of the bodies of the solar
51
+ * system and the velocity of the Earth. It is dominated by a rate difference, the
52
+ * residual being of a periodic character. The latter, which is modeled by the present
53
+ * function, comprises a main (annual) sinusoidal term of amplitude approximately 0.00166
54
+ * seconds, plus planetary terms up to about 20 microseconds, and lunar and diurnal terms
55
+ * up to 2 microseconds. These effects come from the changing transverse Doppler effect
56
+ * and gravitational red-shift as the observer (on the Earth's surface) experiences
57
+ * variations in speed (with respect to the BCRS) and gravitational potential.
58
+ * 5. TDB can be regarded as the same as TCB but with a rate adjustment to keep it close to
59
+ * TT, which is convenient for many applications. The history of successive attempts to
60
+ * define TDB is set out in Resolution 3 adopted by the IAU General Assembly in 2006,
61
+ * which defines a fixed TDB(TCB) transformation that is consistent with contemporary
62
+ * solar-system ephemerides. Future ephemerides will imply slightly changed
63
+ * transformations between TCG and TCB, which could introduce a linear drift between TDB
64
+ * and TT; however, any such drift is unlikely to exceed 1 nanosecond per century.
65
+ * 6. The geocentric TDB-TT model used in the present function is that of Fairhead &
66
+ * Bretagnon (1990), in its full form. It was originally supplied by Fairhead (private
67
+ * communications with P.T.Wallace, 1990) as a Fortran subroutine. The present function
68
+ * contains an adaptation of the Fairhead code. The numerical results are essentially
69
+ * unaffected by the changes, the differences with respect to the Fairhead & Bretagnon
70
+ * original being at the 1e-20 s level. The topocentric part of the model is from Moyer
71
+ * (1981) and Murray (1983), with fundamental arguments adapted from Simon et al. 1994. It
72
+ * is an approximation to the expression ( v / c ) . ( r / c ), where v is the
73
+ * barycentric velocity of the Earth, r is the geocentric position of the observer and c
74
+ * is the speed of light. By supplying zeroes for u and v, the topocentric part of the
75
+ * model can be nullified, and the function will return the Fairhead & Bretagnon result
76
+ * alone.
77
+ * 7. During the interval 1950-2050, the absolute accuracy is better than +/- 3 nanoseconds
78
+ * relative to time ephemerides obtained by direct numerical integrations based on the
79
+ * JPL DE405 solar system ephemeris.
80
+ * 8. It must be stressed that the present function is merely a model, and that numerical
81
+ * integration of solar-system ephemerides is the definitive method for predicting the
82
+ * relationship between TCG and TCB and hence between TT and TDB.
83
+ *
84
+ * References:
85
+ * - Fairhead, L., & Bretagnon, P., Astron.Astrophys., 229, 240-247 (1990).
86
+ * - IAU 2006 Resolution 3.
87
+ * - McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), IERS Technical Note No. 32,
88
+ * BKG (2004)
89
+ * - Moyer, T.D., Cel.Mech., 23, 33 (1981).
90
+ * - Murray, C.A., Vectorial Astrometry, Adam Hilger (1983).
91
+ * - Seidelmann, P.K. et al., Explanatory Supplement to the Astronomical Almanac, Chapter 2,
92
+ * University Science Books (1992).
93
+ * - Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M., Francou, G. & Laskar, J.,
94
+ * Astron.Astrophys., 282, 663-683 (1994).
95
+ *
96
+ * @param date1 date, TDB (Notes 1-3)
97
+ * @param date2 date, TDB (Notes 1-3)
98
+ * @param ut universal time (UT1, fraction of one day)
99
+ * @param elong longitude (east positive, radians)
100
+ * @param u distance from Earth spin axis (km)
101
+ * @param v distance north of equatorial plane (km)
102
+ * @returns TDB-TT (seconds)
103
+ */
104
+ export declare function dtdb(date1: number, date2: number, ut: number, elong: number, u: number, v: number): number;
105
+ //# sourceMappingURL=dtdb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dtdb.d.ts","sourceRoot":"","sources":["../src/dtdb.ts"],"names":[],"mappings":"AAi4BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGG;AACH,wBAAgB,IAAI,CAClB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACR,MAAM,CAsGR"}