@arcosmos/astronomy 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.
- package/LICENSE +202 -0
- package/README.md +227 -2
- package/dist/angles.d.ts +51 -0
- package/dist/angles.d.ts.map +1 -0
- package/dist/angles.js +261 -0
- package/dist/angles.js.map +1 -0
- package/dist/constants.d.ts +35 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +44 -0
- package/dist/constants.js.map +1 -0
- package/dist/coordinates.d.ts +213 -0
- package/dist/coordinates.d.ts.map +1 -0
- package/dist/coordinates.js +474 -0
- package/dist/coordinates.js.map +1 -0
- package/dist/distance.d.ts +26 -0
- package/dist/distance.d.ts.map +1 -0
- package/dist/distance.js +54 -0
- package/dist/distance.js.map +1 -0
- package/dist/errors.d.ts +24 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +24 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/kinds.d.ts +86 -0
- package/dist/kinds.d.ts.map +1 -0
- package/dist/kinds.js +29 -0
- package/dist/kinds.js.map +1 -0
- package/dist/parse-unit.d.ts +11 -0
- package/dist/parse-unit.d.ts.map +1 -0
- package/dist/parse-unit.js +222 -0
- package/dist/parse-unit.js.map +1 -0
- package/dist/quantity.d.ts +150 -0
- package/dist/quantity.d.ts.map +1 -0
- package/dist/quantity.js +452 -0
- package/dist/quantity.js.map +1 -0
- package/dist/rounding.d.ts +18 -0
- package/dist/rounding.d.ts.map +1 -0
- package/dist/rounding.js +35 -0
- package/dist/rounding.js.map +1 -0
- package/dist/time.d.ts +100 -0
- package/dist/time.d.ts.map +1 -0
- package/dist/time.js +448 -0
- package/dist/time.js.map +1 -0
- package/dist/units.d.ts +394 -0
- package/dist/units.d.ts.map +1 -0
- package/dist/units.js +353 -0
- package/dist/units.js.map +1 -0
- package/package.json +44 -3
- package/src/angles.ts +286 -0
- package/src/constants.ts +51 -0
- package/src/coordinates.ts +591 -0
- package/src/distance.ts +58 -0
- package/src/errors.ts +27 -0
- package/src/index.ts +27 -0
- package/src/kinds.ts +110 -0
- package/src/parse-unit.ts +230 -0
- package/src/quantity.ts +539 -0
- package/src/rounding.ts +33 -0
- package/src/time.ts +511 -0
- package/src/units.ts +445 -0
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
// Directions on the sky and the frames they are given in. Each frame is Astropy's, defined
|
|
2
|
+
// as Astropy defines it, so a position converted here agrees with Astropy's SkyCoord:
|
|
3
|
+
//
|
|
4
|
+
// - ICRS, the frame every other is defined from.
|
|
5
|
+
// - FK5 at an equinox: the USNO Circular 179 rotation from ICRS (Astropy's B-matrix), then
|
|
6
|
+
// precession from J2000 by the IAU 2006 model (ERFA's bp06).
|
|
7
|
+
// - Galactic: Astropy's rotation from FK5 J2000 (the north galactic pole at RA
|
|
8
|
+
// 192.8594812065348°, Dec 27.12825118085622°, and l = 0 at 122.9319185680026° from the
|
|
9
|
+
// pole's meridian). ERFA's icrs2g uses the Hipparcos definition instead, which differs by
|
|
10
|
+
// up to a few tens of milliarcseconds.
|
|
11
|
+
// - Supergalactic: de Vaucouleurs' rotation from Galactic (the pole at l 47.37°, b 6.32°).
|
|
12
|
+
// - Barycentric mean ecliptic at an equinox: ERFA's ecm06 (IAU 2006 precession and obliquity).
|
|
13
|
+
//
|
|
14
|
+
// A coordinate may carry its distance, proper motion, radial velocity and the time they hold
|
|
15
|
+
// at, and applySpaceMotion moves it to another time as Astropy does, through ERFA's pmsafe. It
|
|
16
|
+
// carries no uncertainty yet. The tests compare every frame and every motion with Astropy.
|
|
17
|
+
import { anp, bp06, c2s, ecm06, epb2jd, epj2jd, ir, pas, pmsafe, rx, rxp, rxr, ry, rz, s2c, seps, tr, trxp, } from '@arcosmos/erfa';
|
|
18
|
+
import { formatAngle, parseAngle } from './angles.js';
|
|
19
|
+
import { QuantityParseError, UncertaintyError, UnitConversionError } from './errors.js';
|
|
20
|
+
import { parseUnit } from './parse-unit.js';
|
|
21
|
+
import { Quantity } from './quantity.js';
|
|
22
|
+
import { time } from './time.js';
|
|
23
|
+
/** The two components of each frame, longitude then latitude, as Astropy names them. */
|
|
24
|
+
export const FRAME_COMPONENTS = {
|
|
25
|
+
icrs: ['ra', 'dec'],
|
|
26
|
+
fk5: ['ra', 'dec'],
|
|
27
|
+
galactic: ['l', 'b'],
|
|
28
|
+
supergalactic: ['sgl', 'sgb'],
|
|
29
|
+
barycentricmeanecliptic: ['lon', 'lat'],
|
|
30
|
+
};
|
|
31
|
+
const TAKES_EQUINOX = new Set(['fk5', 'barycentricmeanecliptic']);
|
|
32
|
+
function parseEquinox(equinox) {
|
|
33
|
+
if (typeof equinox === 'number') {
|
|
34
|
+
if (!Number.isFinite(equinox))
|
|
35
|
+
throw new RangeError(`An equinox must be a finite year, not ${equinox}`);
|
|
36
|
+
return { label: `J${equinox}`, jd: epj2jd(equinox) };
|
|
37
|
+
}
|
|
38
|
+
const match = /^\s*([JB])\s*(\d+(?:\.\d*)?)\s*$/.exec(equinox);
|
|
39
|
+
if (!match)
|
|
40
|
+
throw new QuantityParseError(`"${equinox}" isn't an equinox, such as "J2000" or "B1950"`);
|
|
41
|
+
const year = Number(match[2]);
|
|
42
|
+
return match[1] === 'J'
|
|
43
|
+
? { label: `J${year}`, jd: epj2jd(year) }
|
|
44
|
+
: { label: `B${year}`, jd: epb2jd(year) };
|
|
45
|
+
}
|
|
46
|
+
const J2000 = parseEquinox('J2000');
|
|
47
|
+
/** Astropy's rotation_matrix(angle, axis): a rotation of the frame by `deg` degrees about an axis. */
|
|
48
|
+
function rotation(axis, deg) {
|
|
49
|
+
const rad = deg * (Math.PI / 180);
|
|
50
|
+
return axis === 'x' ? rx(rad, ir()) : axis === 'y' ? ry(rad, ir()) : rz(rad, ir());
|
|
51
|
+
}
|
|
52
|
+
/** Astropy's ICRS to FK5 J2000 matrix, from USNO Circular 179 (offsets in degrees). */
|
|
53
|
+
const ICRS_TO_FK5_J2000 = (() => {
|
|
54
|
+
const eta0 = -19.9 / 3600000.0;
|
|
55
|
+
const xi0 = 9.1 / 3600000.0;
|
|
56
|
+
const da0 = -22.9 / 3600000.0;
|
|
57
|
+
return rxr(rxr(rotation('x', -eta0), rotation('y', xi0)), rotation('z', da0));
|
|
58
|
+
})();
|
|
59
|
+
/** Astropy's FK5 J2000 to Galactic matrix. */
|
|
60
|
+
const FK5_J2000_TO_GALACTIC = rxr(rxr(rotation('z', 180 - 122.9319185680026), rotation('y', 90 - 27.12825118085622)), rotation('z', 192.8594812065348));
|
|
61
|
+
/** Astropy's Galactic to Supergalactic matrix. */
|
|
62
|
+
const GALACTIC_TO_SUPERGALACTIC = rxr(rxr(rotation('z', 90), rotation('y', 90 - 6.32)), rotation('z', 47.37));
|
|
63
|
+
/** FK5 precession from one equinox to another, through J2000, without frame bias (Astropy's _precession_matrix). */
|
|
64
|
+
function precession(from, to) {
|
|
65
|
+
const fromToJ2000 = tr(bp06(from.jd[0], from.jd[1])[1]);
|
|
66
|
+
const j2000ToTo = bp06(to.jd[0], to.jd[1])[1];
|
|
67
|
+
return rxr(j2000ToTo, fromToJ2000);
|
|
68
|
+
}
|
|
69
|
+
// Astropy's path from ICRS to Galactic, step for step: ICRS to FK5 J2000 (with its precession
|
|
70
|
+
// from J2000 to J2000, an identity to rounding), then FK5 J2000 to Galactic (with another).
|
|
71
|
+
const ICRS_TO_GALACTIC = rxr(rxr(FK5_J2000_TO_GALACTIC, precession(J2000, J2000)), rxr(precession(J2000, J2000), ICRS_TO_FK5_J2000));
|
|
72
|
+
/** The matrix from ICRS to a frame, cached per frame and equinox. */
|
|
73
|
+
const matrices = new Map();
|
|
74
|
+
function icrsTo(frame, equinox) {
|
|
75
|
+
const key = `${frame}@${equinox?.label ?? ''}`;
|
|
76
|
+
const cached = matrices.get(key);
|
|
77
|
+
if (cached)
|
|
78
|
+
return cached;
|
|
79
|
+
let m;
|
|
80
|
+
switch (frame) {
|
|
81
|
+
case 'icrs':
|
|
82
|
+
m = ir();
|
|
83
|
+
break;
|
|
84
|
+
case 'fk5':
|
|
85
|
+
m = rxr(precession(J2000, equinox ?? J2000), ICRS_TO_FK5_J2000);
|
|
86
|
+
break;
|
|
87
|
+
case 'galactic':
|
|
88
|
+
m = ICRS_TO_GALACTIC;
|
|
89
|
+
break;
|
|
90
|
+
case 'supergalactic':
|
|
91
|
+
m = rxr(GALACTIC_TO_SUPERGALACTIC, ICRS_TO_GALACTIC);
|
|
92
|
+
break;
|
|
93
|
+
case 'barycentricmeanecliptic': {
|
|
94
|
+
const jd = (equinox ?? J2000).jd;
|
|
95
|
+
m = ecm06(jd[0], jd[1]);
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (matrices.size >= 64)
|
|
100
|
+
matrices.clear();
|
|
101
|
+
matrices.set(key, m);
|
|
102
|
+
return m;
|
|
103
|
+
}
|
|
104
|
+
/** The two proper-motion components of each frame, as Astropy names them (pm_ra_cosdec, pm_dec...). */
|
|
105
|
+
export const FRAME_PROPER_MOTIONS = {
|
|
106
|
+
icrs: ['pmRaCosdec', 'pmDec'],
|
|
107
|
+
fk5: ['pmRaCosdec', 'pmDec'],
|
|
108
|
+
galactic: ['pmLCosb', 'pmB'],
|
|
109
|
+
supergalactic: ['pmSglCossgb', 'pmSgb'],
|
|
110
|
+
barycentricmeanecliptic: ['pmLonCoslat', 'pmLat'],
|
|
111
|
+
};
|
|
112
|
+
const RAD = parseUnit('rad');
|
|
113
|
+
const DEG = parseUnit('deg');
|
|
114
|
+
const ARCSEC = parseUnit('arcsec');
|
|
115
|
+
const PC = parseUnit('pc');
|
|
116
|
+
const RAD_PER_YR = parseUnit('rad/yr');
|
|
117
|
+
const MAS_PER_YR = parseUnit('mas/yr');
|
|
118
|
+
const KM_PER_S = parseUnit('km/s');
|
|
119
|
+
function radians(input, name) {
|
|
120
|
+
const angle = typeof input === 'string' ? parseAngle(input) : input;
|
|
121
|
+
if (angle.kind !== 'angle')
|
|
122
|
+
throw new UnitConversionError(`${name} must be an angle, not ${angle.kind}`);
|
|
123
|
+
return angle.to(RAD).value;
|
|
124
|
+
}
|
|
125
|
+
/** A quantity's value in a unit, refusing an uncertainty or a limit, which a coordinate can't carry yet. */
|
|
126
|
+
function plainValue(q, unit, name) {
|
|
127
|
+
if (q.uncertainty !== null || q.limit !== null) {
|
|
128
|
+
throw new UncertaintyError(`${name} has an uncertainty or is a limit, which a coordinate can't carry yet`);
|
|
129
|
+
}
|
|
130
|
+
if (q.kind !== unit.kind)
|
|
131
|
+
throw new UnitConversionError(`${name} must be a quantity of ${unit.kind}, not ${q.kind}`);
|
|
132
|
+
return q.to(unit).value;
|
|
133
|
+
}
|
|
134
|
+
const NO_MOTION = { distancePc: null, pmLonCoslat: null, pmLat: null, rv: null, obstime: null };
|
|
135
|
+
/** Unit vectors east and north at a direction, the axes of a proper motion. */
|
|
136
|
+
function tangentBasis(lon, lat) {
|
|
137
|
+
const sl = Math.sin(lon);
|
|
138
|
+
const cl = Math.cos(lon);
|
|
139
|
+
const sb = Math.sin(lat);
|
|
140
|
+
return [[-sl, cl, 0], [-sb * cl, -sb * sl, Math.cos(lat)]];
|
|
141
|
+
}
|
|
142
|
+
const dot = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
143
|
+
/**
|
|
144
|
+
* A direction on the sky in a frame, with its distance and motion if known:
|
|
145
|
+
* `skyCoord({ ra: q(10.684, 'deg'), dec: q(41.269, 'deg') })`. Immutable. Named after Astropy's
|
|
146
|
+
* SkyCoord, of which it is the part for directions and space motion.
|
|
147
|
+
*/
|
|
148
|
+
export class SkyCoord {
|
|
149
|
+
frame;
|
|
150
|
+
/** The equinox of FK5 and ecliptic coordinates ("J2000" by default); null for the others. */
|
|
151
|
+
equinox;
|
|
152
|
+
/** @internal Longitude in radians, 0 <= lon < 2pi. */
|
|
153
|
+
lonRad;
|
|
154
|
+
/** @internal Latitude in radians. */
|
|
155
|
+
latRad;
|
|
156
|
+
/** @internal Distance, proper motion (rad/yr, the longitude's times cos(latitude)) and radial velocity. */
|
|
157
|
+
motion;
|
|
158
|
+
#equinox;
|
|
159
|
+
/** @internal Use skyCoord(). */
|
|
160
|
+
constructor(frame, lonRad, latRad, equinox, motion = NO_MOTION) {
|
|
161
|
+
if (!Number.isFinite(lonRad) || !Number.isFinite(latRad))
|
|
162
|
+
throw new RangeError('A coordinate must be finite');
|
|
163
|
+
if (Math.abs(latRad) > Math.PI / 2) {
|
|
164
|
+
throw new RangeError(`A latitude must be within ±90°, not ${latRad * (180 / Math.PI)}°`);
|
|
165
|
+
}
|
|
166
|
+
if (motion.distancePc !== null && !(motion.distancePc > 0 && Number.isFinite(motion.distancePc))) {
|
|
167
|
+
throw new RangeError(`A distance must be positive and finite, not ${motion.distancePc} pc`);
|
|
168
|
+
}
|
|
169
|
+
this.frame = frame;
|
|
170
|
+
this.#equinox = equinox;
|
|
171
|
+
this.equinox = equinox?.label ?? null;
|
|
172
|
+
this.lonRad = anp(lonRad);
|
|
173
|
+
this.latRad = latRad;
|
|
174
|
+
this.motion = motion;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The longitude component (ra, l, sgl or lon), in degrees from 0 up to 360. A longitude just
|
|
178
|
+
* under 2pi can round to 360 in degrees: it wraps to 0, as Astropy's Longitude does.
|
|
179
|
+
*/
|
|
180
|
+
get lon() {
|
|
181
|
+
const deg = new Quantity(this.lonRad, RAD).to(DEG);
|
|
182
|
+
return deg.value >= 360 ? new Quantity(deg.value - 360, DEG) : deg;
|
|
183
|
+
}
|
|
184
|
+
/** The latitude component (dec, b, sgb or lat), in degrees. */
|
|
185
|
+
get lat() {
|
|
186
|
+
return new Quantity(this.latRad, RAD).to(DEG);
|
|
187
|
+
}
|
|
188
|
+
get ra() { return this.component('ra', this.lon); }
|
|
189
|
+
get dec() { return this.component('dec', this.lat); }
|
|
190
|
+
get l() { return this.component('l', this.lon); }
|
|
191
|
+
get b() { return this.component('b', this.lat); }
|
|
192
|
+
get sgl() { return this.component('sgl', this.lon); }
|
|
193
|
+
get sgb() { return this.component('sgb', this.lat); }
|
|
194
|
+
/** The distance, in parsecs, or null when not known. */
|
|
195
|
+
get distance() {
|
|
196
|
+
return this.motion.distancePc === null ? null : new Quantity(this.motion.distancePc, PC);
|
|
197
|
+
}
|
|
198
|
+
/** The proper motion along the longitude, times cos(latitude) (pm_ra_cosdec in ICRS), in mas/yr; null when not known. */
|
|
199
|
+
get pmLonCoslat() {
|
|
200
|
+
return this.motion.pmLonCoslat === null ? null : new Quantity(this.motion.pmLonCoslat, RAD_PER_YR).to(MAS_PER_YR);
|
|
201
|
+
}
|
|
202
|
+
/** The proper motion along the latitude (pm_dec in ICRS), in mas/yr; null when not known. */
|
|
203
|
+
get pmLat() {
|
|
204
|
+
return this.motion.pmLat === null ? null : new Quantity(this.motion.pmLat, RAD_PER_YR).to(MAS_PER_YR);
|
|
205
|
+
}
|
|
206
|
+
get pmRaCosdec() { return this.properMotion('pmRaCosdec', this.pmLonCoslat); }
|
|
207
|
+
get pmDec() { return this.properMotion('pmDec', this.pmLat); }
|
|
208
|
+
get pmLCosb() { return this.properMotion('pmLCosb', this.pmLonCoslat); }
|
|
209
|
+
get pmB() { return this.properMotion('pmB', this.pmLat); }
|
|
210
|
+
/** The radial velocity, in km/s, or null when not known. */
|
|
211
|
+
get radialVelocity() {
|
|
212
|
+
return this.motion.rv === null ? null : new Quantity(this.motion.rv, KM_PER_S);
|
|
213
|
+
}
|
|
214
|
+
/** The time the position and motion hold at, or null. */
|
|
215
|
+
get obstime() {
|
|
216
|
+
return this.motion.obstime;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* The same direction in another frame: `c.transformTo('galactic')`,
|
|
220
|
+
* `c.transformTo('fk5', { equinox: 'J1975' })`. A proper motion turns with it; the distance
|
|
221
|
+
* and radial velocity don't change.
|
|
222
|
+
*/
|
|
223
|
+
transformTo(frame, options = {}) {
|
|
224
|
+
const equinox = frameEquinox(frame, options.equinox);
|
|
225
|
+
const from = icrsTo(this.frame, this.#equinox);
|
|
226
|
+
const to = icrsTo(frame, equinox);
|
|
227
|
+
const [lon, lat] = c2s(rxp(to, trxp(from, s2c(this.lonRad, this.latRad))));
|
|
228
|
+
let motion = this.motion;
|
|
229
|
+
if (motion.pmLonCoslat !== null && motion.pmLat !== null) {
|
|
230
|
+
const [east, north] = tangentBasis(this.lonRad, this.latRad);
|
|
231
|
+
const v = [
|
|
232
|
+
motion.pmLonCoslat * east[0] + motion.pmLat * north[0],
|
|
233
|
+
motion.pmLonCoslat * east[1] + motion.pmLat * north[1],
|
|
234
|
+
motion.pmLonCoslat * east[2] + motion.pmLat * north[2],
|
|
235
|
+
];
|
|
236
|
+
const turned = rxp(to, trxp(from, v));
|
|
237
|
+
const [east2, north2] = tangentBasis(lon, lat);
|
|
238
|
+
motion = { ...motion, pmLonCoslat: dot(turned, east2), pmLat: dot(turned, north2) };
|
|
239
|
+
}
|
|
240
|
+
return new SkyCoord(frame, lon, lat, equinox, motion);
|
|
241
|
+
}
|
|
242
|
+
get icrs() { return this.transformTo('icrs'); }
|
|
243
|
+
/** In FK5 at J2000. */
|
|
244
|
+
get fk5() { return this.transformTo('fk5'); }
|
|
245
|
+
get galactic() { return this.transformTo('galactic'); }
|
|
246
|
+
get supergalactic() { return this.transformTo('supergalactic'); }
|
|
247
|
+
/** In the barycentric mean ecliptic at J2000. */
|
|
248
|
+
get barycentricmeanecliptic() { return this.transformTo('barycentricmeanecliptic'); }
|
|
249
|
+
/**
|
|
250
|
+
* Where the star is at another time, by its proper motion, and its parallax and radial
|
|
251
|
+
* velocity where known: Astropy's apply_space_motion, through ERFA's pmsafe. Give the new
|
|
252
|
+
* time (`newObstime`, which needs this coordinate's `obstime`) or the interval (`dt`; with
|
|
253
|
+
* no `obstime`, the interval is counted from J2000 and the result has none either). The
|
|
254
|
+
* motion is rigorous: along a straight line in space, with the light-time and perspective
|
|
255
|
+
* effects ERFA's starpm includes. Needs a proper motion, or as Astropy, a distance and a
|
|
256
|
+
* radial velocity (the proper motion then taken as zero).
|
|
257
|
+
*
|
|
258
|
+
* Unlike Astropy, a radial velocity that wasn't given stays unknown. Astropy reports pmsafe's,
|
|
259
|
+
* which for a star with no radial velocity comes from the distance pmsafe assumes, up to about
|
|
260
|
+
* 1 km/s, and isn't a measurement.
|
|
261
|
+
*/
|
|
262
|
+
applySpaceMotion(options) {
|
|
263
|
+
if ((options.newObstime === undefined) === (options.dt === undefined)) {
|
|
264
|
+
throw new TypeError('Give newObstime or dt, not both');
|
|
265
|
+
}
|
|
266
|
+
const radialOnly = this.motion.pmLonCoslat === null && this.motion.rv !== null && this.motion.distancePc !== null;
|
|
267
|
+
if ((this.motion.pmLonCoslat === null || this.motion.pmLat === null) && !radialOnly) {
|
|
268
|
+
throw new TypeError('Moving a coordinate needs its proper motion, or a distance and a radial velocity');
|
|
269
|
+
}
|
|
270
|
+
if (options.newObstime !== undefined && this.motion.obstime === null) {
|
|
271
|
+
throw new TypeError('This coordinate has no obstime: give dt, the interval, rather than a new time');
|
|
272
|
+
}
|
|
273
|
+
let t1;
|
|
274
|
+
let t2;
|
|
275
|
+
let newObstime;
|
|
276
|
+
if (options.dt === undefined) {
|
|
277
|
+
t1 = this.motion.obstime;
|
|
278
|
+
t2 = options.newObstime;
|
|
279
|
+
newObstime = t2;
|
|
280
|
+
}
|
|
281
|
+
else if (this.motion.obstime === null) {
|
|
282
|
+
// As Astropy: with no obstime, the interval is counted from J2000, which only sets dt.
|
|
283
|
+
t1 = time('J2000');
|
|
284
|
+
t2 = t1.plus(options.dt);
|
|
285
|
+
newObstime = null;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
t1 = this.motion.obstime;
|
|
289
|
+
t2 = t1.plus(options.dt);
|
|
290
|
+
newObstime = t2;
|
|
291
|
+
}
|
|
292
|
+
const icrs = this.transformTo('icrs');
|
|
293
|
+
const start = radialOnly ? { ...icrs.motion, pmLonCoslat: 0, pmLat: 0 } : icrs.motion;
|
|
294
|
+
const [ra2, dec2, motion] = moveIcrs(icrs.lonRad, icrs.latRad, start, t1.tdb, t2.tdb);
|
|
295
|
+
const moved = new SkyCoord('icrs', ra2, dec2, null, { ...motion, obstime: newObstime });
|
|
296
|
+
return moved.transformTo(this.frame, this.equinox === null ? {} : { equinox: this.equinox });
|
|
297
|
+
}
|
|
298
|
+
/** The angle between two directions, in degrees. The other is converted to this one's frame first. */
|
|
299
|
+
separation(other) {
|
|
300
|
+
const o = other.inFrameOf(this);
|
|
301
|
+
return new Quantity(seps(this.lonRad, this.latRad, o.lonRad, o.latRad), RAD).to(DEG);
|
|
302
|
+
}
|
|
303
|
+
/** The position angle of the other direction from this one, east of north, in degrees from 0 to 360. */
|
|
304
|
+
positionAngle(other) {
|
|
305
|
+
const o = other.inFrameOf(this);
|
|
306
|
+
return new Quantity(anp(pas(this.lonRad, this.latRad, o.lonRad, o.latRad)), RAD).to(DEG);
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* The coordinate as text, as Astropy's SkyCoord.to_string writes it: "10.6847 41.2690" in
|
|
310
|
+
* the "decimal" style (with `precision: 4`), "00h42m44.3s +41d16m09s" in "hmsdms". Options
|
|
311
|
+
* are formatAngle's, applied to both components.
|
|
312
|
+
*/
|
|
313
|
+
toString(style = 'decimal', options = {}) {
|
|
314
|
+
const styles = {
|
|
315
|
+
hmsdms: [{ unit: 'hourangle', pad: true }, { unit: 'deg', pad: true, alwaysSign: true }],
|
|
316
|
+
dms: [{ unit: 'deg' }, { unit: 'deg' }],
|
|
317
|
+
decimal: [{ unit: 'deg', decimal: true }, { unit: 'deg', decimal: true }],
|
|
318
|
+
};
|
|
319
|
+
const [lonOptions, latOptions] = styles[style];
|
|
320
|
+
return `${formatAngle(this.lon, { ...lonOptions, ...options })} ${formatAngle(this.lat, { ...latOptions, ...options })}`;
|
|
321
|
+
}
|
|
322
|
+
/** Its frame, components and motion in the units the getters give, and `obstime` as the Time writes itself. */
|
|
323
|
+
toJSON() {
|
|
324
|
+
const [lonName, latName] = FRAME_COMPONENTS[this.frame];
|
|
325
|
+
const [pmLonName, pmLatName] = FRAME_PROPER_MOTIONS[this.frame];
|
|
326
|
+
const json = {
|
|
327
|
+
frame: this.frame,
|
|
328
|
+
...(this.equinox ? { equinox: this.equinox } : {}),
|
|
329
|
+
[lonName]: this.lon.value,
|
|
330
|
+
[latName]: this.lat.value,
|
|
331
|
+
};
|
|
332
|
+
if (this.motion.distancePc !== null)
|
|
333
|
+
json.distance = this.motion.distancePc;
|
|
334
|
+
const pmLon = this.pmLonCoslat;
|
|
335
|
+
const pmLat = this.pmLat;
|
|
336
|
+
if (pmLon && pmLat) {
|
|
337
|
+
json[pmLonName] = pmLon.value;
|
|
338
|
+
json[pmLatName] = pmLat.value;
|
|
339
|
+
}
|
|
340
|
+
if (this.motion.rv !== null)
|
|
341
|
+
json.radialVelocity = this.motion.rv;
|
|
342
|
+
if (this.motion.obstime)
|
|
343
|
+
json.obstime = this.motion.obstime.toJSON();
|
|
344
|
+
return json;
|
|
345
|
+
}
|
|
346
|
+
component(name, value) {
|
|
347
|
+
if (!FRAME_COMPONENTS[this.frame].includes(name)) {
|
|
348
|
+
const [lonName, latName] = FRAME_COMPONENTS[this.frame];
|
|
349
|
+
throw new TypeError(`A ${this.frame} coordinate has ${lonName} and ${latName}, not ${name}`);
|
|
350
|
+
}
|
|
351
|
+
return value;
|
|
352
|
+
}
|
|
353
|
+
properMotion(name, value) {
|
|
354
|
+
if (!FRAME_PROPER_MOTIONS[this.frame].includes(name)) {
|
|
355
|
+
const [lonName, latName] = FRAME_PROPER_MOTIONS[this.frame];
|
|
356
|
+
throw new TypeError(`A ${this.frame} coordinate's proper motions are ${lonName} and ${latName}, not ${name}`);
|
|
357
|
+
}
|
|
358
|
+
return value;
|
|
359
|
+
}
|
|
360
|
+
inFrameOf(target) {
|
|
361
|
+
if (this.frame === target.frame && this.equinox === target.equinox)
|
|
362
|
+
return this;
|
|
363
|
+
return this.transformTo(target.frame, target.equinox === null ? {} : { equinox: target.equinox });
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Astropy's apply_space_motion on an ICRS position and its motion, between two TDB times:
|
|
368
|
+
* ERFA's pmsafe, with the proper motion in RA taken without cos(dec), a parallax of 0 where the
|
|
369
|
+
* distance isn't known, and a radial velocity of 0 where it isn't. A distance or radial
|
|
370
|
+
* velocity not known stays unknown.
|
|
371
|
+
*/
|
|
372
|
+
function moveIcrs(ra, dec, m, from, to) {
|
|
373
|
+
const pmr = m.pmLonCoslat / Math.cos(dec);
|
|
374
|
+
const parallaxZero = m.distancePc === null;
|
|
375
|
+
const px = parallaxZero ? 0.0 : 1 / m.distancePc;
|
|
376
|
+
const rv = m.rv ?? 0.0;
|
|
377
|
+
const [ra2, dec2, pmr2, pmd2, px2, rv2, status] = pmsafe(ra, dec, pmr, m.pmLat, px, rv, from.jd1, from.jd2, to.jd1, to.jd2);
|
|
378
|
+
if (status < 0)
|
|
379
|
+
throw new RangeError(`ERFA couldn't move this star (pmsafe status ${status})`);
|
|
380
|
+
return [ra2, dec2, {
|
|
381
|
+
distancePc: parallaxZero ? null : 1 / px2,
|
|
382
|
+
pmLonCoslat: pmr2 * Math.cos(dec2),
|
|
383
|
+
pmLat: pmd2,
|
|
384
|
+
rv: m.rv === null ? null : rv2,
|
|
385
|
+
obstime: null,
|
|
386
|
+
}];
|
|
387
|
+
}
|
|
388
|
+
const MAS_YR_TO_RAD_YR = MAS_PER_YR.to(RAD_PER_YR);
|
|
389
|
+
/**
|
|
390
|
+
* Where an ICRS star is at another time: the same computation as SkyCoord.applySpaceMotion
|
|
391
|
+
* (Astropy's apply_space_motion through ERFA's pmsafe), on plain numbers, for moving many stars
|
|
392
|
+
* between the same two times without making a coordinate for each. A parallax of zero or
|
|
393
|
+
* less counts as unknown, as no distance.
|
|
394
|
+
*/
|
|
395
|
+
export function moveStar(star, from, to) {
|
|
396
|
+
const plx = star.parallaxMas !== null && star.parallaxMas > 0 ? star.parallaxMas : null;
|
|
397
|
+
const motion = {
|
|
398
|
+
distancePc: plx === null ? null : 1000 / plx,
|
|
399
|
+
pmLonCoslat: star.pmRaCosdecMasYr * MAS_YR_TO_RAD_YR,
|
|
400
|
+
pmLat: star.pmDecMasYr * MAS_YR_TO_RAD_YR,
|
|
401
|
+
rv: star.radialVelocityKmS,
|
|
402
|
+
obstime: null,
|
|
403
|
+
};
|
|
404
|
+
const [ra, dec, moved] = moveIcrs(star.raDeg * (Math.PI / 180), star.decDeg * (Math.PI / 180), motion, from.tdb, to.tdb);
|
|
405
|
+
const raDeg = anp(ra) * (180 / Math.PI);
|
|
406
|
+
return {
|
|
407
|
+
raDeg: raDeg >= 360 ? raDeg - 360 : raDeg,
|
|
408
|
+
decDeg: dec * (180 / Math.PI),
|
|
409
|
+
pmRaCosdecMasYr: moved.pmLonCoslat / MAS_YR_TO_RAD_YR,
|
|
410
|
+
pmDecMasYr: moved.pmLat / MAS_YR_TO_RAD_YR,
|
|
411
|
+
parallaxMas: moved.distancePc === null ? null : 1000 / moved.distancePc,
|
|
412
|
+
radialVelocityKmS: moved.rv,
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* The rotation from one frame to another, as `transformTo` turns a direction: a vector `v`
|
|
417
|
+
* (a direction or a cartesian position) in `from` is `M v` in `to`, and the transpose turns it
|
|
418
|
+
* back. For code that turns many positions on plain numbers, where a SkyCoord each would cost
|
|
419
|
+
* too much: `frameRotation('icrs', 'galactic')` is Astropy's ICRS-to-Galactic matrix. Each
|
|
420
|
+
* equinox defaults to J2000, and only FK5 and the ecliptic take one.
|
|
421
|
+
*/
|
|
422
|
+
export function frameRotation(from, to, options = {}) {
|
|
423
|
+
const source = icrsTo(from, frameEquinox(from, options.fromEquinox));
|
|
424
|
+
return rxr(icrsTo(to, frameEquinox(to, options.toEquinox)), tr(source));
|
|
425
|
+
}
|
|
426
|
+
function frameEquinox(frame, equinox) {
|
|
427
|
+
if (!TAKES_EQUINOX.has(frame)) {
|
|
428
|
+
if (equinox !== undefined)
|
|
429
|
+
throw new TypeError(`The ${frame} frame takes no equinox`);
|
|
430
|
+
return null;
|
|
431
|
+
}
|
|
432
|
+
return equinox === undefined ? J2000 : parseEquinox(equinox);
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* A direction on the sky, and its distance and motion if given: `skyCoord({ ra: q(10.684,
|
|
436
|
+
* 'deg'), dec: q(41.269, 'deg') })` (ICRS by default), `skyCoord({ ra: '00h42m44.3s', dec:
|
|
437
|
+
* '+41d16m09s' })`, `skyCoord({ l: q(121.17, 'deg'), b: q(-21.57, 'deg'), frame: 'galactic' })`.
|
|
438
|
+
* Proper motions come both or neither, named as the frame names them (`pmRaCosdec` and
|
|
439
|
+
* `pmDec` in ICRS). A latitude beyond ±90° is refused; a longitude is wrapped into 0 to 360°.
|
|
440
|
+
*/
|
|
441
|
+
export function skyCoord(input) {
|
|
442
|
+
const frame = input.frame ?? 'icrs';
|
|
443
|
+
const [lonName, latName] = FRAME_COMPONENTS[frame];
|
|
444
|
+
const [pmLonName, pmLatName] = FRAME_PROPER_MOTIONS[frame];
|
|
445
|
+
const values = input;
|
|
446
|
+
const lon = values[lonName];
|
|
447
|
+
const lat = values[latName];
|
|
448
|
+
if (lon === undefined || lat === undefined) {
|
|
449
|
+
throw new TypeError(`A ${frame} coordinate is made from ${lonName} and ${latName}`);
|
|
450
|
+
}
|
|
451
|
+
const pmLon = values[pmLonName];
|
|
452
|
+
const pmLat = values[pmLatName];
|
|
453
|
+
if ((pmLon === undefined) !== (pmLat === undefined)) {
|
|
454
|
+
throw new TypeError(`Give both proper motions, ${pmLonName} and ${pmLatName}, or neither`);
|
|
455
|
+
}
|
|
456
|
+
if (input.distance !== undefined && input.parallax !== undefined) {
|
|
457
|
+
throw new TypeError('Give a distance or a parallax, not both');
|
|
458
|
+
}
|
|
459
|
+
let distancePc = null;
|
|
460
|
+
if (input.distance !== undefined)
|
|
461
|
+
distancePc = plainValue(input.distance, PC, 'The distance');
|
|
462
|
+
else if (input.parallax !== undefined)
|
|
463
|
+
distancePc = 1 / plainValue(input.parallax, ARCSEC, 'The parallax');
|
|
464
|
+
const motion = {
|
|
465
|
+
distancePc,
|
|
466
|
+
pmLonCoslat: pmLon === undefined ? null : plainValue(pmLon, RAD_PER_YR, pmLonName),
|
|
467
|
+
pmLat: pmLat === undefined ? null : plainValue(pmLat, RAD_PER_YR, pmLatName),
|
|
468
|
+
rv: input.radialVelocity === undefined ? null : plainValue(input.radialVelocity, KM_PER_S, 'The radial velocity'),
|
|
469
|
+
obstime: input.obstime ?? null,
|
|
470
|
+
};
|
|
471
|
+
const equinox = frameEquinox(frame, 'equinox' in input ? input.equinox : undefined);
|
|
472
|
+
return new SkyCoord(frame, radians(lon, lonName), radians(lat, latName), equinox, motion);
|
|
473
|
+
}
|
|
474
|
+
//# sourceMappingURL=coordinates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinates.js","sourceRoot":"","sources":["../src/coordinates.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,sFAAsF;AACtF,EAAE;AACF,iDAAiD;AACjD,2FAA2F;AAC3F,+DAA+D;AAC/D,+EAA+E;AAC/E,yFAAyF;AACzF,4FAA4F;AAC5F,yCAAyC;AACzC,2FAA2F;AAC3F,+FAA+F;AAC/F,EAAE;AACF,6FAA6F;AAC7F,+FAA+F;AAC/F,2FAA2F;AAC3F,OAAO,EACL,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAa,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,GAC7G,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAA2B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AC,QAAQ,KAAK,SAAS;QAAE,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,cAAc,CAAC,CAAA;SACxF,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS;QAAE,UAAU,GAAG,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,CAAA;IAC1G,MAAM,MAAM,GAAW;QACrB,UAAU;QACV,WAAW,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC;QAClF,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC;QAC5E,EAAE,EAAE,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,cAAc,EAAE,QAAQ,EAAE,qBAAqB,CAAC;QACjH,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI;KAC/B,CAAA;IACD,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,EAAE,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IACnF,OAAO,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AAC3F,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Quantity } from './quantity.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The distance a parallax puts a star at, 1 / parallax, in parsecs: Astropy's
|
|
4
|
+
* Distance(parallax=...). Its error is propagated to first order, d × sigma / parallax. A
|
|
5
|
+
* parallax of zero or less gives no distance and throws (Astropy refuses a negative one), as
|
|
6
|
+
* do a limit, asymmetric errors and percentiles, as in any arithmetic here.
|
|
7
|
+
*/
|
|
8
|
+
export declare function distanceFromParallax(parallax: Quantity<'angle'>): Quantity<'length'>;
|
|
9
|
+
/**
|
|
10
|
+
* The distance modulus, 5 log10(d / 10 pc), in magnitudes: Astropy's Distance.distmod. An
|
|
11
|
+
* absolute magnitude is the apparent magnitude less it. Its error is propagated to first
|
|
12
|
+
* order, 5 / ln 10 × sigma / d. A distance of zero or less throws, as do a limit, asymmetric
|
|
13
|
+
* errors and percentiles.
|
|
14
|
+
*/
|
|
15
|
+
export declare function distanceModulus(distance: Quantity<'length'>): Quantity<'magnitude'>;
|
|
16
|
+
/**
|
|
17
|
+
* 1000 / parallax: the distance in parsecs for a parallax in mas, on plain numbers. NaN for a
|
|
18
|
+
* parallax of zero or less, which gives no distance.
|
|
19
|
+
*/
|
|
20
|
+
export declare function parallaxDistancePc(parallaxMas: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* 5 log10(d / 10 pc): the distance modulus in magnitudes for a distance in parsecs, on plain
|
|
23
|
+
* numbers, as Astropy computes it. NaN for a distance of zero or less.
|
|
24
|
+
*/
|
|
25
|
+
export declare function distanceModulusPc(distancePc: number): number;
|
|
26
|
+
//# sourceMappingURL=distance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distance.d.ts","sourceRoot":"","sources":["../src/distance.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,QAAQ,EAAwB,MAAM,eAAe,CAAA;AAKnE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAMpF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,CAQnF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5D"}
|
package/dist/distance.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Distances from parallaxes, and the distance modulus, as Astropy's Distance gives them
|
|
2
|
+
// (Distance(parallax=...) and Distance.distmod). Each comes in two forms: on quantities, with
|
|
3
|
+
// the error propagated to first order as any computation here is, and on plain numbers, for
|
|
4
|
+
// many stars at once (a map's, a diagram's), as moveStar is for applySpaceMotion.
|
|
5
|
+
//
|
|
6
|
+
// 1 / parallax is biased once the parallax error is more than about a tenth of the parallax,
|
|
7
|
+
// and a parallax of zero or less gives no distance at all. These helpers don't correct for
|
|
8
|
+
// either: they compute what Astropy computes.
|
|
9
|
+
import { q, requireArithmetic } from './quantity.js';
|
|
10
|
+
/** 1000 pc mas: a parallax of 1 mas is 1000 pc away. Exact. */
|
|
11
|
+
const PARSEC_MAS = q(1000, 'pc mas', { sigma: 0 });
|
|
12
|
+
/**
|
|
13
|
+
* The distance a parallax puts a star at, 1 / parallax, in parsecs: Astropy's
|
|
14
|
+
* Distance(parallax=...). Its error is propagated to first order, d × sigma / parallax. A
|
|
15
|
+
* parallax of zero or less gives no distance and throws (Astropy refuses a negative one), as
|
|
16
|
+
* do a limit, asymmetric errors and percentiles, as in any arithmetic here.
|
|
17
|
+
*/
|
|
18
|
+
export function distanceFromParallax(parallax) {
|
|
19
|
+
requireArithmetic(parallax, 'turned into a distance');
|
|
20
|
+
if (!(parallax.value > 0)) {
|
|
21
|
+
throw new RangeError(`A parallax of ${parallax} gives no distance: only a positive parallax does`);
|
|
22
|
+
}
|
|
23
|
+
return PARSEC_MAS.div(parallax).as('length').to('pc');
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The distance modulus, 5 log10(d / 10 pc), in magnitudes: Astropy's Distance.distmod. An
|
|
27
|
+
* absolute magnitude is the apparent magnitude less it. Its error is propagated to first
|
|
28
|
+
* order, 5 / ln 10 × sigma / d. A distance of zero or less throws, as do a limit, asymmetric
|
|
29
|
+
* errors and percentiles.
|
|
30
|
+
*/
|
|
31
|
+
export function distanceModulus(distance) {
|
|
32
|
+
requireArithmetic(distance, 'turned into a distance modulus');
|
|
33
|
+
const pc = distance.to('pc');
|
|
34
|
+
if (!(pc.value > 0)) {
|
|
35
|
+
throw new RangeError(`A distance of ${distance} has no distance modulus: only a positive distance does`);
|
|
36
|
+
}
|
|
37
|
+
const sigma = pc.sigma === null ? null : (5 / Math.LN10) * pc.sigma / pc.value;
|
|
38
|
+
return q(distanceModulusPc(pc.value), 'mag', sigma === null ? {} : { sigma });
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 1000 / parallax: the distance in parsecs for a parallax in mas, on plain numbers. NaN for a
|
|
42
|
+
* parallax of zero or less, which gives no distance.
|
|
43
|
+
*/
|
|
44
|
+
export function parallaxDistancePc(parallaxMas) {
|
|
45
|
+
return parallaxMas > 0 ? 1000 / parallaxMas : NaN;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 5 log10(d / 10 pc): the distance modulus in magnitudes for a distance in parsecs, on plain
|
|
49
|
+
* numbers, as Astropy computes it. NaN for a distance of zero or less.
|
|
50
|
+
*/
|
|
51
|
+
export function distanceModulusPc(distancePc) {
|
|
52
|
+
return distancePc > 0 ? 5 * Math.log10(distancePc) - 5 : NaN;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=distance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distance.js","sourceRoot":"","sources":["../src/distance.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,8FAA8F;AAC9F,4FAA4F;AAC5F,kFAAkF;AAClF,EAAE;AACF,6FAA6F;AAC7F,2FAA2F;AAC3F,8CAA8C;A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AAC,EAAE,KAAK,EAAE,CAAC,CAAA;AAC/E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,OAAO,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,CAAA;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAkB;IAClD,OAAO,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;AAC9D,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** A unit written in a form the parser doesn't accept, or a symbol it doesn't know. */
|
|
2
|
+
export declare class UnitParseError extends Error {
|
|
3
|
+
readonly name = "UnitParseError";
|
|
4
|
+
}
|
|
5
|
+
/** Two units of different kinds, such as a length and a time, which no factor converts. */
|
|
6
|
+
export declare class UnitConversionError extends Error {
|
|
7
|
+
readonly name = "UnitConversionError";
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Arithmetic the uncertainties don't allow as given: an asymmetric error, percentiles, or a
|
|
11
|
+
* limit, where first-order propagation isn't defined. The message says what to do instead.
|
|
12
|
+
*/
|
|
13
|
+
export declare class UncertaintyError extends Error {
|
|
14
|
+
readonly name = "UncertaintyError";
|
|
15
|
+
}
|
|
16
|
+
/** Text that isn't a number followed by a unit. */
|
|
17
|
+
export declare class QuantityParseError extends Error {
|
|
18
|
+
readonly name = "QuantityParseError";
|
|
19
|
+
}
|
|
20
|
+
/** Text that isn't a time: not ISO 8601, not a J or B year, or an impossible date. */
|
|
21
|
+
export declare class TimeParseError extends Error {
|
|
22
|
+
readonly name = "TimeParseError";
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,qBAAa,cAAe,SAAQ,KAAK;IACvC,SAAkB,IAAI,oBAAmB;CAC1C;AAED,2FAA2F;AAC3F,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,SAAkB,IAAI,yBAAwB;CAC/C;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,SAAkB,IAAI,sBAAqB;CAC5C;AAED,mDAAmD;AACnD,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,SAAkB,IAAI,wBAAuB;CAC9C;AAED,sFAAsF;AACtF,qBAAa,cAAe,SAAQ,KAAK;IACvC,SAAkB,IAAI,oBAAmB;CAC1C"}
|