@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/src/pfw06.ts ADDED
@@ -0,0 +1,78 @@
1
+ // Translated from ERFA 2.0.1 eraPfw06 (pfw06.c); see LICENSE.
2
+ import { DAS2R, DJ00, DJC } from './constants.ts'
3
+ import { obl06 } from './obl06.ts'
4
+
5
+ /**
6
+ * Precession angles, IAU 2006 (Fukushima-Williams 4-angle formulation).
7
+ *
8
+ * Notes:
9
+ * 1. The TT date date1+date2 is a Julian Date, apportioned in any convenient way between
10
+ * the two arguments. For example, JD(TT)=2450123.7 could be given as (2450123.7, 0.0),
11
+ * the JD method; (2451545.0, -1421.3), the J2000 method; (2400000.5, 50123.2), the MJD
12
+ * method; or (2450123.5, 0.2), the date and time method. The J2000 method is best matched
13
+ * to the way the argument is handled internally and will deliver the optimum resolution.
14
+ * 2. Naming the following points:
15
+ *
16
+ * e = J2000.0 ecliptic pole,
17
+ * p = GCRS pole,
18
+ * E = mean ecliptic pole of date,
19
+ * and P = mean pole of date,
20
+ *
21
+ * the four Fukushima-Williams angles are as follows:
22
+ *
23
+ * gamb = gamma_bar = epE
24
+ * phib = phi_bar = pE
25
+ * psib = psi_bar = pEP
26
+ * epsa = epsilon_A = EP
27
+ *
28
+ * 3. The matrix representing the combined effects of frame bias and precession is:
29
+ *
30
+ * PxB = R_1(-epsa).R_3(-psib).R_1(phib).R_3(gamb)
31
+ *
32
+ * 4. The matrix representing the combined effects of frame bias, precession and nutation
33
+ * is simply:
34
+ *
35
+ * NxPxB = R_1(-epsa-dE).R_3(-psib-dP).R_1(phib).R_3(gamb)
36
+ *
37
+ * where dP and dE are the nutation components with respect to the ecliptic of date.
38
+ *
39
+ * Reference: Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
40
+ *
41
+ * @param date1 TT as a 2-part Julian Date (Note 1)
42
+ * @param date2 TT as a 2-part Julian Date (Note 1)
43
+ * @returns [gamb, phib, psib, epsa]: F-W angles gamma_bar, phi_bar, psi_bar and epsilon_A
44
+ * (radians)
45
+ */
46
+ export function pfw06(
47
+ date1: number,
48
+ date2: number,
49
+ ): [gamb: number, phib: number, psib: number, epsa: number] {
50
+ // Interval between fundamental date J2000.0 and given date (JC).
51
+ const t = ((date1 - DJ00) + date2) / DJC
52
+
53
+ // P03 bias+precession angles.
54
+ const gamb = ( -0.052928 +
55
+ ( 10.556378 +
56
+ ( 0.4932044 +
57
+ ( -0.00031238 +
58
+ ( -0.000002788 +
59
+ ( 0.0000000260 )
60
+ * t) * t) * t) * t) * t) * DAS2R
61
+ const phib = ( 84381.412819 +
62
+ ( -46.811016 +
63
+ ( 0.0511268 +
64
+ ( 0.00053289 +
65
+ ( -0.000000440 +
66
+ ( -0.0000000176 )
67
+ * t) * t) * t) * t) * t) * DAS2R
68
+ const psib = ( -0.041775 +
69
+ ( 5038.481484 +
70
+ ( 1.5584175 +
71
+ ( -0.00018522 +
72
+ ( -0.000026452 +
73
+ ( -0.0000000148 )
74
+ * t) * t) * t) * t) * t) * DAS2R
75
+ const epsa = obl06(date1, date2)
76
+
77
+ return [gamb, phib, psib, epsa]
78
+ }
package/src/pm.ts ADDED
@@ -0,0 +1,11 @@
1
+ // Translated from ERFA 2.0.1 eraPm (pm.c); see LICENSE.
2
+ import type { Vec3 } from './internal.ts'
3
+
4
+ /**
5
+ * Modulus of p-vector.
6
+ *
7
+ * @returns modulus
8
+ */
9
+ export function pm(p: Vec3): number {
10
+ return Math.sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2])
11
+ }
package/src/pmat06.ts ADDED
@@ -0,0 +1,37 @@
1
+ // Translated from ERFA 2.0.1 eraPmat06 (pmat06.c); see LICENSE.
2
+ import { fw2m } from './fw2m.ts'
3
+ import type { Mat3 } from './internal.ts'
4
+ import { pfw06 } from './pfw06.ts'
5
+
6
+ /**
7
+ * Precession matrix (including frame bias) from GCRS to a specified date, IAU 2006 model.
8
+ *
9
+ * Notes:
10
+ * 1. The TT date date1+date2 is a Julian Date, apportioned in any convenient way between
11
+ * the two arguments. For example, JD(TT)=2450123.7 could be given as (2450123.7, 0.0),
12
+ * the JD method; (2451545.0, -1421.3), the J2000 method; (2400000.5, 50123.2), the MJD
13
+ * method; or (2450123.5, 0.2), the date and time method. The J2000 method is best matched
14
+ * to the way the argument is handled internally and will deliver the optimum resolution.
15
+ * 2. The matrix operates in the sense V(date) = rbp * V(GCRS), where the p-vector V(GCRS) is
16
+ * with respect to the Geocentric Celestial Reference System (IAU, 2000) and the p-vector
17
+ * V(date) is with respect to the mean equatorial triad of the given date.
18
+ *
19
+ * References:
20
+ * - Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855
21
+ * - IAU: Trans. International Astronomical Union, Vol. XXIVB; Proc. 24th General Assembly,
22
+ * Manchester, UK. Resolutions B1.3, B1.6. (2000)
23
+ * - Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
24
+ *
25
+ * @param date1 TT as a 2-part Julian Date (Note 1)
26
+ * @param date2 TT as a 2-part Julian Date (Note 1)
27
+ * @returns rbp: bias-precession matrix (Note 2)
28
+ */
29
+ export function pmat06(date1: number, date2: number): Mat3 {
30
+ // Bias-precession Fukushima-Williams angles.
31
+ const [gamb, phib, psib, epsa] = pfw06(date1, date2)
32
+
33
+ // Form the matrix.
34
+ const rbp = fw2m(gamb, phib, psib, epsa)
35
+
36
+ return rbp
37
+ }
package/src/pmp.ts ADDED
@@ -0,0 +1,13 @@
1
+ // Translated from ERFA 2.0.1 eraPmp (pmp.c); see LICENSE.
2
+ import type { Vec3 } from './internal.ts'
3
+
4
+ /**
5
+ * P-vector subtraction.
6
+ *
7
+ * @param a first p-vector
8
+ * @param b second p-vector
9
+ * @returns amb: a - b
10
+ */
11
+ export function pmp(a: Vec3, b: Vec3): Vec3 {
12
+ return [a[0] - b[0], a[1] - b[1], a[2] - b[2]]
13
+ }
package/src/pmpx.ts ADDED
@@ -0,0 +1,75 @@
1
+ // Translated from ERFA 2.0.1 eraPmpx (pmpx.c); see LICENSE.
2
+ import { AULT, DAS2R, DAU, DAYSEC, DJM, DJY } from './constants.ts'
3
+ import type { Vec3 } from './internal.ts'
4
+ import { pdp } from './pdp.ts'
5
+ import { pn } from './pn.ts'
6
+
7
+ /**
8
+ * Proper motion and parallax.
9
+ *
10
+ * Notes:
11
+ * 1. The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
12
+ * 2. The proper motion time interval is for when the starlight reaches the solar system
13
+ * barycenter.
14
+ * 3. To avoid the need for iteration, the Roemer effect (i.e. the small annual modulation
15
+ * of the proper motion coming from the changing light time) is applied approximately,
16
+ * using the direction of the star at the catalog epoch.
17
+ *
18
+ * References:
19
+ * - 1984 Astronomical Almanac, pp B39-B41.
20
+ * - Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to the Astronomical Almanac,
21
+ * 3rd ed., University Science Books (2013), Section 7.2.
22
+ *
23
+ * @param rc ICRS RA at catalog epoch (radians)
24
+ * @param dc ICRS Dec at catalog epoch (radians)
25
+ * @param pr RA proper motion (radians/year, Note 1)
26
+ * @param pd Dec proper motion (radians/year)
27
+ * @param px parallax (arcsec)
28
+ * @param rv radial velocity (km/s, +ve if receding)
29
+ * @param pmt proper motion time interval (SSB, Julian years)
30
+ * @param pob SSB to observer vector (au)
31
+ * @returns pco: coordinate direction (BCRS unit vector)
32
+ */
33
+ export function pmpx(
34
+ rc: number,
35
+ dc: number,
36
+ pr: number,
37
+ pd: number,
38
+ px: number,
39
+ rv: number,
40
+ pmt: number,
41
+ pob: Vec3,
42
+ ): Vec3 {
43
+ // Km/s to au/year
44
+ const VF = DAYSEC * DJM / DAU
45
+
46
+ // Light time for 1 au, Julian years
47
+ const AULTY = AULT / DAYSEC / DJY
48
+
49
+ // Spherical coordinates to unit vector (and useful functions).
50
+ const sr = Math.sin(rc)
51
+ const cr = Math.cos(rc)
52
+ const sd = Math.sin(dc)
53
+ const cd = Math.cos(dc)
54
+ const x = cr * cd
55
+ const y = sr * cd
56
+ const z = sd
57
+ const p: [number, number, number] = [x, y, z]
58
+
59
+ // Proper motion time interval (y) including Roemer effect.
60
+ const dt = pmt + pdp(p, pob) * AULTY
61
+
62
+ // Space motion (radians per year).
63
+ const pxr = px * DAS2R
64
+ const w = VF * rv * pxr
65
+ const pdz = pd * z
66
+ const pm: Vec3 = [-pr * y - pdz * cr + w * x, pr * x - pdz * sr + w * y, pd * cd + w * z]
67
+
68
+ // Coordinate direction of star (unit vector, BCRS).
69
+ for (let i = 0; i < 3; i++) {
70
+ p[i] = p[i]! + (dt * pm[i]! - pxr * pob[i]!)
71
+ }
72
+ const [, pco] = pn(p)
73
+
74
+ return pco
75
+ }
package/src/pmsafe.ts ADDED
@@ -0,0 +1,109 @@
1
+ // Translated from ERFA 2.0.1 eraPmsafe (pmsafe.c); see LICENSE.
2
+ import { seps } from './seps.ts'
3
+ import { starpm } from './starpm.ts'
4
+
5
+ /**
6
+ * Star proper motion: update star catalog data for space motion, with special handling to
7
+ * handle the zero parallax case.
8
+ *
9
+ * Notes:
10
+ * 1. The starting and ending TDB dates ep1a+ep1b and ep2a+ep2b are Julian Dates, apportioned
11
+ * in any convenient way between the two parts (A and B). For example, JD(TDB)=2450123.7
12
+ * could be given as (2450123.7, 0.0), the JD method; (2451545.0, -1421.3), the J2000
13
+ * method; (2400000.5, 50123.2), the MJD method; or (2450123.5, 0.2), the date and time
14
+ * method. The J2000 method is best matched to the way the argument is handled internally
15
+ * and will deliver the optimum resolution.
16
+ * 2. In accordance with normal star-catalog conventions, the object's right ascension and
17
+ * declination are freed from the effects of secular aberration. The frame, which is
18
+ * aligned to the catalog equator and equinox, is Lorentzian and centered on the SSB.
19
+ *
20
+ * The proper motions are the rate of change of the right ascension and declination at
21
+ * the catalog epoch and are in radians per TDB Julian year.
22
+ *
23
+ * The parallax and radial velocity are in the same frame.
24
+ * 3. Care is needed with units. The star coordinates are in radians and the proper motions
25
+ * in radians per Julian year, but the parallax is in arcseconds.
26
+ * 4. The RA proper motion is in terms of coordinate angle, not true angle. If the catalog
27
+ * uses arcseconds for both RA and Dec proper motions, the RA proper motion will need to
28
+ * be divided by cos(Dec) before use.
29
+ * 5. Straight-line motion at constant speed, in the inertial frame, is assumed.
30
+ * 6. An extremely small (or zero or negative) parallax is overridden to ensure that the
31
+ * object is at a finite but very large distance, but not so large that the proper motion
32
+ * is equivalent to a large but safe speed (about 0.1c using the chosen constant). A
33
+ * warning status of 1 is added to the status if this action has been taken.
34
+ *
35
+ * The parallax used is at least F = 326 times the proper motion in one year (radians),
36
+ * which caps the transverse speed at about 1% of c (as the constant's comment says; the
37
+ * note's 0.1c is ERFA's own wording), and at least PXMIN = 5e-7 arcsec.
38
+ * 7. If the space velocity is a significant fraction of c (see the constant VMAX in the
39
+ * function starpv), it is arbitrarily set to zero. When this action occurs, 2 is added
40
+ * to the status.
41
+ * 8. The relativistic adjustment carried out in the starpv function involves an iterative
42
+ * calculation. If the process fails to converge within a set number of iterations, 4 is
43
+ * added to the status.
44
+ * 9. Where the status is -1, the outputs C leaves unset are NaN (see starpm).
45
+ *
46
+ * @param ra1 right ascension (radians), before
47
+ * @param dec1 declination (radians), before
48
+ * @param pmr1 RA proper motion (radians/year), before
49
+ * @param pmd1 Dec proper motion (radians/year), before
50
+ * @param px1 parallax (arcseconds), before
51
+ * @param rv1 radial velocity (km/s, +ve = receding), before
52
+ * @param ep1a "before" epoch, part A (Note 1)
53
+ * @param ep1b "before" epoch, part B (Note 1)
54
+ * @param ep2a "after" epoch, part A (Note 1)
55
+ * @param ep2b "after" epoch, part B (Note 1)
56
+ * @returns [ra2, dec2, pmr2, pmd2, px2, rv2, status]: right ascension (radians), declination
57
+ * (radians), RA proper motion (radians/year), Dec proper motion (radians/year), parallax
58
+ * (arcseconds) and radial velocity (km/s, +ve = receding), after; and status: -1 = system
59
+ * error (should not occur), 0 = no warnings or errors, 1 = distance overridden (Note 6),
60
+ * 2 = excessive velocity (Note 7), 4 = solution didn't converge (Note 8), else = binary
61
+ * logical OR of the above warnings
62
+ */
63
+ export function pmsafe(
64
+ ra1: number,
65
+ dec1: number,
66
+ pmr1: number,
67
+ pmd1: number,
68
+ px1: number,
69
+ rv1: number,
70
+ ep1a: number,
71
+ ep1b: number,
72
+ ep2a: number,
73
+ ep2b: number,
74
+ ): [ra2: number, dec2: number, pmr2: number, pmd2: number, px2: number, rv2: number, status: number] {
75
+ // Minimum allowed parallax (arcsec)
76
+ const PXMIN = 5e-7
77
+
78
+ // Factor giving maximum allowed transverse speed of about 1% c
79
+ const F = 326.0
80
+
81
+ let ra2: number, dec2: number, pmr2: number, pmd2: number, px2: number, rv2: number
82
+ let j: number
83
+
84
+ // Proper motion in one year (radians).
85
+ let pm = seps(ra1, dec1, ra1 + pmr1, dec1 + pmd1)
86
+
87
+ // Override the parallax to reduce the chances of a warning status.
88
+ let jpx = 0
89
+ let px1a = px1
90
+ pm *= F
91
+ if (px1a < pm) {
92
+ jpx = 1
93
+ px1a = pm
94
+ }
95
+ if (px1a < PXMIN) {
96
+ jpx = 1
97
+ px1a = PXMIN
98
+ }
99
+
100
+ // Carry out the transformation using the modified parallax.
101
+ ;[ra2, dec2, pmr2, pmd2, px2, rv2, j] = starpm(
102
+ ra1, dec1, pmr1, pmd1, px1a, rv1,
103
+ ep1a, ep1b, ep2a, ep2b,
104
+ )
105
+
106
+ // Revise and return the status.
107
+ if (!(j % 2)) j += jpx
108
+ return [ra2, dec2, pmr2, pmd2, px2, rv2, j]
109
+ }
package/src/pn.ts ADDED
@@ -0,0 +1,26 @@
1
+ // Translated from ERFA 2.0.1 eraPn (pn.c); see LICENSE.
2
+ import type { Vec3 } from './internal.ts'
3
+ import { pm } from './pm.ts'
4
+ import { sxp } from './sxp.ts'
5
+ import { zp } from './zp.ts'
6
+
7
+ /**
8
+ * Convert a p-vector into modulus and unit vector.
9
+ *
10
+ * Notes:
11
+ * 1. If p is null, the result is null. Otherwise the result is a unit vector.
12
+ *
13
+ * @param p p-vector
14
+ * @returns [r, u]: modulus and unit vector
15
+ */
16
+ export function pn(p: Vec3): [r: number, u: Vec3] {
17
+ let u: Vec3
18
+ const w = pm(p)
19
+ if (w === 0.0) {
20
+ u = zp()
21
+ } else {
22
+ u = sxp(1.0 / w, p)
23
+ }
24
+ const r = w
25
+ return [r, u]
26
+ }
package/src/ppp.ts ADDED
@@ -0,0 +1,13 @@
1
+ // Translated from ERFA 2.0.1 eraPpp (ppp.c); see LICENSE.
2
+ import type { Vec3 } from './internal.ts'
3
+
4
+ /**
5
+ * P-vector addition.
6
+ *
7
+ * @param a first p-vector
8
+ * @param b second p-vector
9
+ * @returns apb: a + b
10
+ */
11
+ export function ppp(a: Vec3, b: Vec3): Vec3 {
12
+ return [a[0] + b[0], a[1] + b[1], a[2] + b[2]]
13
+ }
package/src/ppsp.ts ADDED
@@ -0,0 +1,20 @@
1
+ // Translated from ERFA 2.0.1 eraPpsp (ppsp.c); see LICENSE.
2
+ import type { Vec3 } from './internal.ts'
3
+ import { ppp } from './ppp.ts'
4
+ import { sxp } from './sxp.ts'
5
+
6
+ /**
7
+ * P-vector plus scaled p-vector.
8
+ *
9
+ * @param a first p-vector
10
+ * @param s scalar (multiplier for b)
11
+ * @param b second p-vector
12
+ * @returns apsb: a + s*b
13
+ */
14
+ export function ppsp(a: Vec3, s: number, b: Vec3): Vec3 {
15
+ // s*b.
16
+ const sb = sxp(s, b)
17
+
18
+ // a + s*b.
19
+ return ppp(a, sb)
20
+ }
package/src/pv2s.ts ADDED
@@ -0,0 +1,71 @@
1
+ // Translated from ERFA 2.0.1 eraPv2s (pv2s.c); see LICENSE.
2
+ import type { PV } from './internal.ts'
3
+
4
+ /**
5
+ * Convert position/velocity from Cartesian to spherical coordinates.
6
+ *
7
+ * Notes:
8
+ * 1. If the position part of pv is null, theta, phi, td and pd are indeterminate. This is
9
+ * handled by extrapolating the position through unit time by using the velocity part of
10
+ * pv. This moves the origin without changing the direction of the velocity component.
11
+ * If the position and velocity components of pv are both null, zeroes are returned for
12
+ * all six results.
13
+ * 2. If the position is a pole, theta, td and pd are indeterminate. In such cases zeroes are
14
+ * returned for all three.
15
+ *
16
+ * @param pv pv-vector
17
+ * @returns [theta, phi, r, td, pd, rd]: longitude angle (radians), latitude angle
18
+ * (radians), radial distance, and the rates of change of theta, phi and r
19
+ */
20
+ export function pv2s(
21
+ pv: PV,
22
+ ): [theta: number, phi: number, r: number, td: number, pd: number, rd: number] {
23
+ let theta: number, phi: number, td: number, pd: number
24
+
25
+ // Components of position/velocity vector.
26
+ let x = pv[0][0]
27
+ let y = pv[0][1]
28
+ let z = pv[0][2]
29
+ const xd = pv[1][0]
30
+ const yd = pv[1][1]
31
+ const zd = pv[1][2]
32
+
33
+ // Component of r in XY plane squared.
34
+ let rxy2 = x * x + y * y
35
+
36
+ // Modulus squared.
37
+ let r2 = rxy2 + z * z
38
+
39
+ // Modulus.
40
+ const rtrue = Math.sqrt(r2)
41
+
42
+ // If null vector, move the origin along the direction of movement.
43
+ let rw = rtrue
44
+ if (rtrue === 0.0) {
45
+ x = xd
46
+ y = yd
47
+ z = zd
48
+ rxy2 = x * x + y * y
49
+ r2 = rxy2 + z * z
50
+ rw = Math.sqrt(r2)
51
+ }
52
+
53
+ // Position and velocity in spherical coordinates.
54
+ const rxy = Math.sqrt(rxy2)
55
+ const xyp = x * xd + y * yd
56
+ if (rxy2 !== 0.0) {
57
+ theta = Math.atan2(y, x)
58
+ phi = Math.atan2(z, rxy)
59
+ td = (x * yd - y * xd) / rxy2
60
+ pd = (zd * rxy2 - z * xyp) / (r2 * rxy)
61
+ } else {
62
+ theta = 0.0
63
+ phi = z !== 0.0 ? Math.atan2(z, rxy) : 0.0
64
+ td = 0.0
65
+ pd = 0.0
66
+ }
67
+ const r = rtrue
68
+ const rd = rw !== 0.0 ? (xyp + z * zd) / rw : 0.0
69
+
70
+ return [theta, phi, r, td, pd, rd]
71
+ }
package/src/pvdpv.ts ADDED
@@ -0,0 +1,30 @@
1
+ // Translated from ERFA 2.0.1 eraPvdpv (pvdpv.c); see LICENSE.
2
+ import type { PV } from './internal.ts'
3
+ import { pdp } from './pdp.ts'
4
+
5
+ /**
6
+ * Inner (=scalar=dot) product of two pv-vectors.
7
+ *
8
+ * Note: if the position and velocity components of the two pv-vectors are ( ap, av ) and
9
+ * ( bp, bv ), the result, a . b, is the pair of numbers ( ap . bp , ap . bv + av . bp ). The
10
+ * two numbers are the dot-product of the two p-vectors and its derivative.
11
+ *
12
+ * @param a first pv-vector
13
+ * @param b second pv-vector
14
+ * @returns adb: a . b (see note)
15
+ */
16
+ export function pvdpv(a: PV, b: PV): [number, number] {
17
+ // a . b = constant part of result.
18
+ const adb0 = pdp(a[0], b[0])
19
+
20
+ // a . bdot
21
+ const adbd = pdp(a[0], b[1])
22
+
23
+ // adot . b
24
+ const addb = pdp(a[1], b[0])
25
+
26
+ // Velocity part of result.
27
+ const adb1 = adbd + addb
28
+
29
+ return [adb0, adb1]
30
+ }
package/src/pvm.ts ADDED
@@ -0,0 +1,19 @@
1
+ // Translated from ERFA 2.0.1 eraPvm (pvm.c); see LICENSE.
2
+ import type { PV } from './internal.ts'
3
+ import { pm } from './pm.ts'
4
+
5
+ /**
6
+ * Modulus of pv-vector.
7
+ *
8
+ * @param pv pv-vector
9
+ * @returns [r, s]: modulus of position component, and modulus of velocity component
10
+ */
11
+ export function pvm(pv: PV): [r: number, s: number] {
12
+ // Distance.
13
+ const r = pm(pv[0])
14
+
15
+ // Speed.
16
+ const s = pm(pv[1])
17
+
18
+ return [r, s]
19
+ }
package/src/pvmpv.ts ADDED
@@ -0,0 +1,14 @@
1
+ // Translated from ERFA 2.0.1 eraPvmpv (pvmpv.c); see LICENSE.
2
+ import type { PV } from './internal.ts'
3
+ import { pmp } from './pmp.ts'
4
+
5
+ /**
6
+ * Subtract one pv-vector from another.
7
+ *
8
+ * @param a first pv-vector
9
+ * @param b second pv-vector
10
+ * @returns amb: a - b
11
+ */
12
+ export function pvmpv(a: PV, b: PV): PV {
13
+ return [pmp(a[0], b[0]), pmp(a[1], b[1])]
14
+ }
package/src/pvppv.ts ADDED
@@ -0,0 +1,14 @@
1
+ // Translated from ERFA 2.0.1 eraPvppv (pvppv.c); see LICENSE.
2
+ import type { PV } from './internal.ts'
3
+ import { ppp } from './ppp.ts'
4
+
5
+ /**
6
+ * Add one pv-vector to another.
7
+ *
8
+ * @param a first pv-vector
9
+ * @param b second pv-vector
10
+ * @returns apb: a + b
11
+ */
12
+ export function pvppv(a: PV, b: PV): PV {
13
+ return [ppp(a[0], b[0]), ppp(a[1], b[1])]
14
+ }
package/src/pvstar.ts ADDED
@@ -0,0 +1,113 @@
1
+ // Translated from ERFA 2.0.1 eraPvstar (pvstar.c); see LICENSE.
2
+ import { anp } from './anp.ts'
3
+ import { DAU, DAYSEC, DC, DJY, DR2AS } from './constants.ts'
4
+ import type { PV, Vec3 } from './internal.ts'
5
+ import { pdp } from './pdp.ts'
6
+ import { pm } from './pm.ts'
7
+ import { pmp } from './pmp.ts'
8
+ import { pn } from './pn.ts'
9
+ import { ppp } from './ppp.ts'
10
+ import { pv2s } from './pv2s.ts'
11
+ import { sxp } from './sxp.ts'
12
+
13
+ /**
14
+ * Convert star position+velocity vector to catalog coordinates. ERFA overwrites the
15
+ * velocity of its argument with the observed velocity; this leaves pv as it was.
16
+ *
17
+ * Notes:
18
+ * 1. The specified pv-vector is the coordinate direction (and its rate of change) for the
19
+ * date at which the light leaving the star reached the solar-system barycenter.
20
+ * 2. The star data returned by this function are "observables" for an imaginary observer
21
+ * at the solar-system barycenter. Proper motion and radial velocity are, strictly, in
22
+ * terms of barycentric coordinate time, TCB. For most practical applications, it is
23
+ * permissible to neglect the distinction between TCB and ordinary "proper" time on Earth
24
+ * (TT/TAI). The result will, as a rule, be limited by the intrinsic accuracy of the
25
+ * proper-motion and radial-velocity data; moreover, the supplied pv-vector is likely to
26
+ * be merely an intermediate result (for example generated by the function starpv), so
27
+ * that a change of time unit will cancel out overall.
28
+ *
29
+ * In accordance with normal star-catalog conventions, the object's right ascension and
30
+ * declination are freed from the effects of secular aberration. The frame, which is
31
+ * aligned to the catalog equator and equinox, is Lorentzian and centered on the SSB.
32
+ *
33
+ * Summarizing, the specified pv-vector is for most stars almost identical to the result
34
+ * of applying the standard geometrical "space motion" transformation to the catalog
35
+ * data. The differences, which are the subject of the Stumpff paper cited below, are:
36
+ * (i) in stars with significant radial velocity and proper motion, the constantly
37
+ * changing light-time distorts the apparent proper motion (a classical, not a
38
+ * relativistic, effect); (ii) the transformation complies with special relativity.
39
+ * 3. Care is needed with units. The star coordinates are in radians and the proper motions
40
+ * in radians per Julian year, but the parallax is in arcseconds; the radial velocity is
41
+ * in km/s, but the pv-vector result is in au and au/day.
42
+ * 4. The proper motions are the rate of change of the right ascension and declination at
43
+ * the catalog epoch and are in radians per Julian year. The RA proper motion is in terms
44
+ * of coordinate angle, not true angle, and will thus be numerically larger at high
45
+ * declinations.
46
+ * 5. Straight-line motion at constant speed in the inertial frame is assumed. If the speed
47
+ * is greater than or equal to the speed of light, the function aborts with an error
48
+ * status.
49
+ * 6. The inverse transformation is performed by the function starpv.
50
+ * 7. C leaves the outputs unset on an error, and they are NaN: all six for -1, all but dec
51
+ * for -2 (pv2s has set dec by then).
52
+ *
53
+ * Reference: Stumpff, P., 1985, Astron.Astrophys. 144, 232-240.
54
+ *
55
+ * @param pv pv-vector (au, au/day)
56
+ * @returns [ra, dec, pmr, pmd, px, rv, status]: right ascension (radians), declination
57
+ * (radians), RA proper motion (radians/year), Dec proper motion (radians/year), parallax
58
+ * (arcsec), radial velocity (km/s, positive = receding), and status: 0 = OK, -1 =
59
+ * superluminal speed (Note 5), -2 = null position vector
60
+ */
61
+ export function pvstar(
62
+ pv: PV,
63
+ ): [ra: number, dec: number, pmr: number, pmd: number, px: number, rv: number, status: number] {
64
+ let r: number, pu: Vec3, a: number, dec: number, rad: number, decd: number, rd: number
65
+
66
+ // Isolate the radial component of the velocity (au/day, inertial).
67
+ ;[r, pu] = pn(pv[0])
68
+ const vr = pdp(pu, pv[1])
69
+ const ur = sxp(vr, pu)
70
+
71
+ // Isolate the transverse component of the velocity (au/day, inertial).
72
+ const ut = pmp(pv[1], ur)
73
+ const vt = pm(ut)
74
+
75
+ // Special-relativity dimensionless parameters.
76
+ const bett = vt / DC
77
+ const betr = vr / DC
78
+
79
+ // The observed-to-inertial correction terms.
80
+ const d = 1.0 + betr
81
+ const w = betr * betr + bett * bett
82
+ if (d === 0.0 || w > 1.0) return [NaN, NaN, NaN, NaN, NaN, NaN, -1]
83
+ const del = -w / (Math.sqrt(1.0 - w) + 1.0)
84
+
85
+ // Scale inertial tangential velocity vector into observed (au/d).
86
+ const ust = sxp(1.0 / d, ut)
87
+
88
+ // Compute observed radial velocity vector (au/d).
89
+ const usr = sxp(DC * (betr - del) / d, pu)
90
+
91
+ // Combine the two to obtain the observed velocity vector.
92
+ const pvo: PV = [pv[0], ppp(usr, ust)]
93
+
94
+ // Cartesian to spherical.
95
+ ;[a, dec, r, rad, decd, rd] = pv2s(pvo)
96
+ if (r === 0.0) return [NaN, dec, NaN, NaN, NaN, NaN, -2]
97
+
98
+ // Return RA in range 0 to 2pi.
99
+ const ra = anp(a)
100
+
101
+ // Return proper motions in radians per year.
102
+ const pmr = rad * DJY
103
+ const pmd = decd * DJY
104
+
105
+ // Return parallax in arcsec.
106
+ const px = DR2AS / r
107
+
108
+ // Return radial velocity in km/s.
109
+ const rv = 1e-3 * rd * DAU / DAYSEC
110
+
111
+ // Success.
112
+ return [ra, dec, pmr, pmd, px, rv, 0]
113
+ }
package/src/pvu.ts ADDED
@@ -0,0 +1,20 @@
1
+ // Translated from ERFA 2.0.1 eraPvu (pvu.c); see LICENSE.
2
+ import { cp } from './cp.ts'
3
+ import type { PV } from './internal.ts'
4
+ import { ppsp } from './ppsp.ts'
5
+
6
+ /**
7
+ * Update a pv-vector.
8
+ *
9
+ * Notes:
10
+ * 1. "Update" means "refer the position component of the vector to a new date dt time units
11
+ * from the existing date".
12
+ * 2. The time units of dt must match those of the velocity.
13
+ *
14
+ * @param dt time interval
15
+ * @param pv pv-vector
16
+ * @returns upv: p updated, v unchanged
17
+ */
18
+ export function pvu(dt: number, pv: PV): PV {
19
+ return [ppsp(pv[0], dt, pv[1]), cp(pv[1])]
20
+ }