@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
package/dist/angles.js
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// Angles as text: reading "12h30m45.6s", "-12d30m45s" or "12:30:45.6", and writing them back
|
|
2
|
+
// in sexagesimal or decimal form. Both follow Astropy's Angle: the same grammar, the same
|
|
3
|
+
// range checks, and to_string's rounding, carrying and padding, so a string written here is
|
|
4
|
+
// the one Astropy writes. The tests compare both with Astropy.
|
|
5
|
+
import { QuantityParseError, UnitConversionError } from './errors.js';
|
|
6
|
+
import { parseUnit } from './parse-unit.js';
|
|
7
|
+
import { Quantity } from './quantity.js';
|
|
8
|
+
/**
|
|
9
|
+
* Angle units read after a number, other than degrees and hours. Astropy tries its unit names
|
|
10
|
+
* in alphabetical order and takes the first that matches, so "radian" reads as "rad" followed
|
|
11
|
+
* by "ian", and fails: the long names are left out here for the same result.
|
|
12
|
+
*/
|
|
13
|
+
const SIMPLE_UNITS = {
|
|
14
|
+
arcmin: 'arcmin', arcsec: 'arcsec', mas: 'mas', mrad: 'mrad', rad: 'rad', uas: 'uas', urad: 'urad',
|
|
15
|
+
};
|
|
16
|
+
const SIMPLE_UNIT = new RegExp(`^(?:${Object.keys(SIMPLE_UNITS).join('|')})`);
|
|
17
|
+
// Astropy's lexer, rule for rule and in its order. Only a space is ignored.
|
|
18
|
+
const LEXER = [
|
|
19
|
+
[/^(?:\d+\.\d*|\.\d+)(?:[eE][+\-−]?\d+)?/, (t) => ({ type: 'F', value: Number(t.replace('−', '-')) })],
|
|
20
|
+
[/^\d+/, (t) => ({ type: 'I', value: Number(t) })],
|
|
21
|
+
[/^[+\-−]/, (t) => ({ type: '+', value: t === '+' ? 1 : -1 })],
|
|
22
|
+
[/^[EW]/, (t, rest) => (rest.length === 0 ? { type: 'E', value: t === 'W' ? -1 : 1 } : null)],
|
|
23
|
+
[/^[NS]/, (t, rest) => (rest.length === 0 ? { type: 'N', value: t === 'S' ? -1 : 1 } : null)],
|
|
24
|
+
[SIMPLE_UNIT, (t) => ({ type: 'U', unit: SIMPLE_UNITS[t] })],
|
|
25
|
+
[/^(?:m(?:in(?:ute(?:s)?)?)?|′|'|ᵐ)/, () => ({ type: 'M' })],
|
|
26
|
+
[/^(?:s(?:ec(?:ond(?:s)?)?)?|″|"|ˢ)/, () => ({ type: 'S' })],
|
|
27
|
+
[/^(?:d(?:eg(?:ree(?:s)?)?)?|°)/, () => ({ type: 'D' })],
|
|
28
|
+
[/^(?:hour(?:s)?|h(?:r)?|ʰ)/, () => ({ type: 'H' })],
|
|
29
|
+
[/^:/, () => ({ type: 'C' })],
|
|
30
|
+
];
|
|
31
|
+
function lex(text) {
|
|
32
|
+
const tokens = [];
|
|
33
|
+
let rest = text.trim();
|
|
34
|
+
outer: while (rest.length) {
|
|
35
|
+
if (rest[0] === ' ') {
|
|
36
|
+
rest = rest.slice(1);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
for (const [pattern, make] of LEXER) {
|
|
40
|
+
const match = pattern.exec(rest)?.[0];
|
|
41
|
+
if (match === undefined)
|
|
42
|
+
continue;
|
|
43
|
+
const token = make(match, rest.slice(match.length));
|
|
44
|
+
if (!token)
|
|
45
|
+
continue;
|
|
46
|
+
tokens.push(token);
|
|
47
|
+
rest = rest.slice(match.length);
|
|
48
|
+
continue outer;
|
|
49
|
+
}
|
|
50
|
+
throw new QuantityParseError(`Unexpected "${rest[0]}" in the angle "${text}"`);
|
|
51
|
+
}
|
|
52
|
+
return tokens;
|
|
53
|
+
}
|
|
54
|
+
// Astropy's grammar, over the token letters. A number is I or F; "generic" is one to three
|
|
55
|
+
// numbers separated by spaces or colons.
|
|
56
|
+
const NUM = '[IF]';
|
|
57
|
+
const GENERIC = `(?:${NUM}|I${NUM}|IC${NUM}|II${NUM}|ICIC${NUM})`;
|
|
58
|
+
const SEXAGESIMAL = (mark) => `(?:I${mark}|I${mark}${NUM}|I${mark}IM|I${mark}FM|I${mark}IM${NUM}|I${mark}IM${NUM}S|${GENERIC}${mark})`;
|
|
59
|
+
const GRAMMAR = new RegExp(`^\\+?(?:${SEXAGESIMAL('H')}E?|${SEXAGESIMAL('D')}[EN]?|${GENERIC}[MSU]?[EN]?)$`);
|
|
60
|
+
function angleUnit(text) {
|
|
61
|
+
const u = parseUnit(text);
|
|
62
|
+
if (u.kind !== 'angle')
|
|
63
|
+
throw new UnitConversionError(`${text} isn't an angle unit`);
|
|
64
|
+
return u;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* An angle from text, as Astropy's Angle reads it:
|
|
68
|
+
*
|
|
69
|
+
* - "12h30m45.6s", "12h30m", "12.5h", "12ʰ30ᵐ45ˢ" (hours);
|
|
70
|
+
* - "-12d30m45s", "+41d12m00s", "10d30.5m", "1.5 deg", "12°30′45″" (degrees);
|
|
71
|
+
* - "30m" and "45s" alone are arcminutes and arcseconds; "1.2 mas", "0.5 rad" and the like;
|
|
72
|
+
* - "12:30:45.6" or "12 30 45.6", which need `unit` to say whether they are hours or degrees;
|
|
73
|
+
* - a trailing W or S negates.
|
|
74
|
+
*
|
|
75
|
+
* The sign applies to the whole angle ("-0:30:00" is half a degree below zero). Minutes and
|
|
76
|
+
* seconds must be under 60 (60 itself is allowed, as in Astropy), and hours within 24. The
|
|
77
|
+
* angle is in the unit the text names, else in `unit`.
|
|
78
|
+
*/
|
|
79
|
+
export function parseAngle(text, unit) {
|
|
80
|
+
const tokens = lex(text);
|
|
81
|
+
const types = tokens.map((t) => t.type).join('');
|
|
82
|
+
if (!GRAMMAR.test(types))
|
|
83
|
+
throw new QuantityParseError(`"${text}" isn't an angle Astropy would read`);
|
|
84
|
+
let sign = 1;
|
|
85
|
+
const numbers = [];
|
|
86
|
+
let found = null;
|
|
87
|
+
for (const token of tokens) {
|
|
88
|
+
if (token.type === '+' || token.type === 'E' || token.type === 'N')
|
|
89
|
+
sign *= token.value ?? 1;
|
|
90
|
+
else if (token.type === 'I' || token.type === 'F')
|
|
91
|
+
numbers.push(token.value ?? 0);
|
|
92
|
+
else if (token.type === 'H')
|
|
93
|
+
found = 'hourangle';
|
|
94
|
+
else if (token.type === 'D')
|
|
95
|
+
found = 'deg';
|
|
96
|
+
else if (token.type === 'U')
|
|
97
|
+
found ??= token.unit ?? null;
|
|
98
|
+
}
|
|
99
|
+
if (found === null) {
|
|
100
|
+
if (types.includes('M'))
|
|
101
|
+
found = 'arcmin';
|
|
102
|
+
else if (types.includes('S'))
|
|
103
|
+
found = 'arcsec';
|
|
104
|
+
}
|
|
105
|
+
const angleUnitText = found ?? unit;
|
|
106
|
+
if (angleUnitText === undefined) {
|
|
107
|
+
throw new QuantityParseError(`"${text}" names no unit: give one, such as parseAngle(text, "hourangle")`);
|
|
108
|
+
}
|
|
109
|
+
let value;
|
|
110
|
+
const [first = 0, minutes, seconds] = numbers;
|
|
111
|
+
if (minutes === undefined) {
|
|
112
|
+
value = sign * first;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
// As Astropy: the first field carries the sign, so "-0d30m" is negative.
|
|
116
|
+
const signed = sign * first;
|
|
117
|
+
if (angleUnitText === 'hourangle' && !(Math.abs(signed) <= 24))
|
|
118
|
+
throw rangeError('hours', signed, text);
|
|
119
|
+
if (!(minutes >= 0 && minutes <= 60))
|
|
120
|
+
throw rangeError('minutes', minutes, text);
|
|
121
|
+
let a = Math.abs(signed) + minutes / 60.0;
|
|
122
|
+
if (seconds !== undefined) {
|
|
123
|
+
if (!(seconds >= 0 && seconds <= 60))
|
|
124
|
+
throw rangeError('seconds', seconds, text);
|
|
125
|
+
a += seconds / 3600.0;
|
|
126
|
+
}
|
|
127
|
+
value = Object.is(signed, -0) || signed < 0 ? -a : a;
|
|
128
|
+
}
|
|
129
|
+
return new Quantity(value, angleUnit(angleUnitText));
|
|
130
|
+
}
|
|
131
|
+
function rangeError(field, value, text) {
|
|
132
|
+
return new QuantityParseError(`${value} ${field} is out of range in the angle "${text}"`);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* An angle as text, as Astropy's Angle.to_string writes it: `formatAngle(q(187.69, "deg"),
|
|
136
|
+
* { unit: "hourangle" })` is "12h30m45.6s". Rounding that reaches 60 carries into the next
|
|
137
|
+
* field, and seconds always have two digits before the point.
|
|
138
|
+
*/
|
|
139
|
+
export function formatAngle(angle, options = {}) {
|
|
140
|
+
const { decimal = false, sep = 'fromunit', precision, alwaysSign = false, pad = false, fields = 3 } = options;
|
|
141
|
+
if (decimal && sep !== 'fromunit')
|
|
142
|
+
throw new TypeError('A decimal angle has no separator');
|
|
143
|
+
const unitText = options.unit ?? (sep === 'dms' ? 'deg' : sep === 'hms' ? 'hourangle' : angle.unit.toString());
|
|
144
|
+
const unit = angleUnit(unitText);
|
|
145
|
+
const value = angle.to(unit).value;
|
|
146
|
+
const isDegrees = unit.equals(angleUnit('deg'));
|
|
147
|
+
const sexagesimal = !decimal && (isDegrees || unit.equals(angleUnit('hourangle')));
|
|
148
|
+
let text;
|
|
149
|
+
if (sexagesimal) {
|
|
150
|
+
const marks = sep === 'fromunit' ? (isDegrees ? 'dms' : 'hms') : sep;
|
|
151
|
+
text = sexagesimalString(value, precision, pad, [...marks], fields);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
text = precision === undefined ? pythonG(value) : pythonFixed(value, precision);
|
|
155
|
+
const unitString = unit.toString();
|
|
156
|
+
if (!decimal && unitString.length > 1)
|
|
157
|
+
text += ` ${unitString}`;
|
|
158
|
+
else if (!decimal)
|
|
159
|
+
text += unitString;
|
|
160
|
+
}
|
|
161
|
+
if (alwaysSign && !text.startsWith('-'))
|
|
162
|
+
text = `+${text}`;
|
|
163
|
+
return text;
|
|
164
|
+
}
|
|
165
|
+
/** Astropy's _decimal_to_sexagesimal: truncated whole fields, the sign on each, -0 kept. */
|
|
166
|
+
function sexagesimal(a) {
|
|
167
|
+
const sign = Object.is(a, -0) || a < 0 ? -1 : 1;
|
|
168
|
+
const abs = Math.abs(a);
|
|
169
|
+
const d = Math.trunc(abs);
|
|
170
|
+
const df = abs - d;
|
|
171
|
+
const m = Math.trunc(df * 60.0);
|
|
172
|
+
const mf = df * 60.0 - m;
|
|
173
|
+
const s = mf * 60.0;
|
|
174
|
+
return [Math.floor(sign * d), sign * Math.floor(m), sign * s];
|
|
175
|
+
}
|
|
176
|
+
/** Astropy's _decimal_to_sexagesimal_string, step for step. */
|
|
177
|
+
function sexagesimalString(angle, precision, pad, sepChars, fields) {
|
|
178
|
+
const parts = sexagesimal(angle);
|
|
179
|
+
const negative = Object.is(parts[0], -0) || parts[0] < 0;
|
|
180
|
+
const values = parts.map((v) => Math.abs(v));
|
|
181
|
+
let sep;
|
|
182
|
+
if (sepChars.length === 0)
|
|
183
|
+
sep = ['', '', ''];
|
|
184
|
+
else if (sepChars.length === 1) {
|
|
185
|
+
const c = sepChars[0] ?? '';
|
|
186
|
+
sep = fields === 3 ? [c, c, ''] : fields === 2 ? [c, '', ''] : ['', '', ''];
|
|
187
|
+
}
|
|
188
|
+
else if (sepChars.length === 2)
|
|
189
|
+
sep = [sepChars[0] ?? '', sepChars[1] ?? '', ''];
|
|
190
|
+
else if (sepChars.length === 3)
|
|
191
|
+
sep = [sepChars[0] ?? '', sepChars[1] ?? '', sepChars[2] ?? ''];
|
|
192
|
+
else
|
|
193
|
+
throw new TypeError('Give one, two or three separators');
|
|
194
|
+
// Rounding that reaches 60 carries upward; a hidden field rounds at its middle.
|
|
195
|
+
const ndp = precision ?? 8;
|
|
196
|
+
if (fields === 3) {
|
|
197
|
+
if (Number(pythonFixed(values[2], ndp)) >= 60.0) {
|
|
198
|
+
values[2] = 0.0;
|
|
199
|
+
values[1] += 1.0;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
else if (fields === 2) {
|
|
203
|
+
if (values[2] >= 30.0)
|
|
204
|
+
values[1] += 1.0;
|
|
205
|
+
}
|
|
206
|
+
else if (values[1] + values[2] / 60.0 >= 30.0) {
|
|
207
|
+
values[0] += 1.0;
|
|
208
|
+
}
|
|
209
|
+
if (fields >= 2 && values[1] >= 60.0) {
|
|
210
|
+
values[1] = 0.0;
|
|
211
|
+
values[0] += 1.0;
|
|
212
|
+
}
|
|
213
|
+
const whole = values[0].toFixed(0);
|
|
214
|
+
let literal = `${negative ? '-' : ''}${pad ? whole.padStart(2, '0') : whole}${sep[0]}`;
|
|
215
|
+
if (fields >= 2)
|
|
216
|
+
literal += `${String(Math.trunc(values[1])).padStart(2, '0')}${sep[1]}`;
|
|
217
|
+
if (fields === 3) {
|
|
218
|
+
let last = precision === undefined
|
|
219
|
+
? pythonFixed(values[2], 8).replace(/0+$/, '').replace(/\.$/, '')
|
|
220
|
+
: pythonFixed(values[2], precision);
|
|
221
|
+
if (last.length === 1 || last[1] === '.')
|
|
222
|
+
last = `0${last}`;
|
|
223
|
+
literal += `${last}${sep[2]}`;
|
|
224
|
+
}
|
|
225
|
+
return literal;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Python's "{:.pf}": x to p decimal places, an exact tie rounded to even (JavaScript's
|
|
229
|
+
* toFixed rounds it up), and -0 written "-0".
|
|
230
|
+
*/
|
|
231
|
+
export function pythonFixed(x, p) {
|
|
232
|
+
let text = x.toFixed(p);
|
|
233
|
+
// A tie has at most p + 1 decimals, so p + 30 places write it exactly.
|
|
234
|
+
const exact = x.toFixed(Math.min(100, p + 30));
|
|
235
|
+
const point = exact.indexOf('.');
|
|
236
|
+
const beyond = exact.slice(point + 1 + p);
|
|
237
|
+
if (/^50*$/.test(beyond)) {
|
|
238
|
+
const kept = p === 0 ? exact.slice(0, point) : exact.slice(0, point + 1 + p);
|
|
239
|
+
const lastDigit = Number(kept.at(-1));
|
|
240
|
+
if (lastDigit % 2 === 0)
|
|
241
|
+
text = kept;
|
|
242
|
+
}
|
|
243
|
+
if ((Object.is(x, -0) || (x < 0 && !text.startsWith('-'))))
|
|
244
|
+
text = `-${text}`;
|
|
245
|
+
return text;
|
|
246
|
+
}
|
|
247
|
+
/** Python's "{:g}": six significant digits, trailing zeros dropped, an exponent outside 1e-4 to 1e6. */
|
|
248
|
+
export function pythonG(x) {
|
|
249
|
+
if (x === 0)
|
|
250
|
+
return Object.is(x, -0) ? '-0' : '0';
|
|
251
|
+
const exponent = Number(x.toExponential(5).split('e')[1]);
|
|
252
|
+
if (exponent >= -4 && exponent < 6) {
|
|
253
|
+
const text = pythonFixed(x, 5 - exponent);
|
|
254
|
+
return text.includes('.') ? text.replace(/0+$/, '').replace(/\.$/, '') : text;
|
|
255
|
+
}
|
|
256
|
+
const [mantissa = '', exp = ''] = x.toExponential(5).split('e');
|
|
257
|
+
const trimmed = mantissa.includes('.') ? mantissa.replace(/0+$/, '').replace(/\.$/, '') : mantissa;
|
|
258
|
+
const digits = exp.replace(/^[+-]/, '').padStart(2, '0');
|
|
259
|
+
return `${trimmed}e${exp.startsWith('-') ? '-' : '+'}${digits}`;
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=angles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angles.js","sourceRoot":"","sources":["../src/angles.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,0FAA0F;AAC1F,4FAA4F;AAC5F,+DAA+D;AAC/D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAgBxC;;;;GAIG;AACH,MAAM,YAAY,GAA2B;IAC3C,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK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
|
|
|
1
|
+
/** Speed of light in vacuum, m/s. Exact (SI). */
|
|
2
|
+
export declare const SPEED_OF_LIGHT = 299792458;
|
|
3
|
+
/** Astronomical unit, m. Exact (IAU 2012 B2). */
|
|
4
|
+
export declare const ASTRONOMICAL_UNIT = 149597870700;
|
|
5
|
+
/** Julian year, s: 365.25 days of 86 400 s. Exact (IAU). */
|
|
6
|
+
export declare const JULIAN_YEAR = 31557600;
|
|
7
|
+
/** Light year, m: the distance light travels in a Julian year. Exact: 9 460 730 472 580 800 m. */
|
|
8
|
+
export declare const LIGHT_YEAR: number;
|
|
9
|
+
/**
|
|
10
|
+
* Newtonian constant of gravitation, m^3 kg^-1 s^-2, with its one-sigma standard uncertainty
|
|
11
|
+
* (CODATA 2018). Masses in kilograms divide a GM by it; mass ratios don't need it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const GRAVITATIONAL_CONSTANT: {
|
|
14
|
+
readonly value: 6.6743e-11;
|
|
15
|
+
readonly sigma: 1.5e-15;
|
|
16
|
+
};
|
|
17
|
+
/** Nominal solar radius, m (IAU 2015 B3). */
|
|
18
|
+
export declare const NOMINAL_SOLAR_RADIUS = 695700000;
|
|
19
|
+
/** Nominal solar luminosity, W (IAU 2015 B3). */
|
|
20
|
+
export declare const NOMINAL_SOLAR_LUMINOSITY = 3.828e+26;
|
|
21
|
+
/** Nominal total solar irradiance at 1 au, W/m^2 (IAU 2015 B3). The flux Earth receives. */
|
|
22
|
+
export declare const NOMINAL_SOLAR_IRRADIANCE = 1361;
|
|
23
|
+
/** Nominal solar effective temperature, K (IAU 2015 B3). */
|
|
24
|
+
export declare const NOMINAL_SOLAR_TEMPERATURE = 5772;
|
|
25
|
+
/** Nominal solar mass parameter GM, m^3/s^2 (IAU 2015 B3). */
|
|
26
|
+
export declare const NOMINAL_SOLAR_GM = 132712440000000000000;
|
|
27
|
+
/** Nominal equatorial radius of Earth, m (IAU 2015 B3). */
|
|
28
|
+
export declare const NOMINAL_EARTH_RADIUS = 6378100;
|
|
29
|
+
/** Nominal mass parameter GM of Earth, m^3/s^2 (IAU 2015 B3). */
|
|
30
|
+
export declare const NOMINAL_EARTH_GM = 398600400000000;
|
|
31
|
+
/** Nominal equatorial radius of Jupiter, m (IAU 2015 B3). */
|
|
32
|
+
export declare const NOMINAL_JUPITER_RADIUS = 71492000;
|
|
33
|
+
/** Nominal mass parameter GM of Jupiter, m^3/s^2 (IAU 2015 B3). */
|
|
34
|
+
export declare const NOMINAL_JUPITER_GM = 126686530000000000;
|
|
35
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAaA,iDAAiD;AACjD,eAAO,MAAM,cAAc,YAAc,CAAA;AAEzC,iDAAiD;AACjD,eAAO,MAAM,iBAAiB,eAAkB,CAAA;AAEhD,4DAA4D;AAC5D,eAAO,MAAM,WAAW,WAAa,CAAA;AAErC,kGAAkG;AAClG,eAAO,MAAM,UAAU,QAA+B,CAAA;AAEtD;;;GAGG;AACH,eAAO,MAAM,sBAAsB;aAAK,KAAK,EAAE,UAAY;aAAE,KAAK,EAAE,OAAY;CAAW,CAAA;AAE3F,6CAA6C;AAC7C,eAAO,MAAM,oBAAoB,YAAU,CAAA;AAC3C,iDAAiD;AACjD,eAAO,MAAM,wBAAwB,YAAW,CAAA;AAChD,4FAA4F;AAC5F,eAAO,MAAM,wBAAwB,OAAO,CAAA;AAC5C,4DAA4D;AAC5D,eAAO,MAAM,yBAAyB,OAAO,CAAA;AAC7C,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,wBAAiB,CAAA;AAE9C,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,UAAY,CAAA;AAC7C,iEAAiE;AACjE,eAAO,MAAM,gBAAgB,kBAAe,CAAA;AAE5C,6DAA6D;AAC7D,eAAO,MAAM,sBAAsB,WAAY,CAAA;AAC/C,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,qBAAiB,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// The constants units are defined from. Each is exact by definition, except G, which is
|
|
2
|
+
// measured and carries its standard uncertainty.
|
|
3
|
+
//
|
|
4
|
+
// Sources:
|
|
5
|
+
// - SI (2019): the speed of light is a defining constant.
|
|
6
|
+
// - IAU 2012 Resolution B2: the astronomical unit, exactly 149 597 870 700 m.
|
|
7
|
+
// - IAU 2015 Resolution B2: the parsec, exactly 648 000/pi au.
|
|
8
|
+
// - IAU 2015 Resolution B3 (Prsa et al. 2016, AJ 152, 41): nominal solar and planetary
|
|
9
|
+
// values, used as units. They are conversion constants, not measurements of the Sun,
|
|
10
|
+
// Earth or Jupiter.
|
|
11
|
+
// - CODATA 2018: the Newtonian constant of gravitation. CODATA 2022 gives the same value.
|
|
12
|
+
// - IAU: a Julian year is 365.25 days of 86 400 SI seconds.
|
|
13
|
+
/** Speed of light in vacuum, m/s. Exact (SI). */
|
|
14
|
+
export const SPEED_OF_LIGHT = 299_792_458;
|
|
15
|
+
/** Astronomical unit, m. Exact (IAU 2012 B2). */
|
|
16
|
+
export const ASTRONOMICAL_UNIT = 149_597_870_700;
|
|
17
|
+
/** Julian year, s: 365.25 days of 86 400 s. Exact (IAU). */
|
|
18
|
+
export const JULIAN_YEAR = 31_557_600;
|
|
19
|
+
/** Light year, m: the distance light travels in a Julian year. Exact: 9 460 730 472 580 800 m. */
|
|
20
|
+
export const LIGHT_YEAR = SPEED_OF_LIGHT * JULIAN_YEAR;
|
|
21
|
+
/**
|
|
22
|
+
* Newtonian constant of gravitation, m^3 kg^-1 s^-2, with its one-sigma standard uncertainty
|
|
23
|
+
* (CODATA 2018). Masses in kilograms divide a GM by it; mass ratios don't need it.
|
|
24
|
+
*/
|
|
25
|
+
export const GRAVITATIONAL_CONSTANT = { value: 6.674_30e-11, sigma: 0.000_15e-11 };
|
|
26
|
+
/** Nominal solar radius, m (IAU 2015 B3). */
|
|
27
|
+
export const NOMINAL_SOLAR_RADIUS = 6.957e8;
|
|
28
|
+
/** Nominal solar luminosity, W (IAU 2015 B3). */
|
|
29
|
+
export const NOMINAL_SOLAR_LUMINOSITY = 3.828e26;
|
|
30
|
+
/** Nominal total solar irradiance at 1 au, W/m^2 (IAU 2015 B3). The flux Earth receives. */
|
|
31
|
+
export const NOMINAL_SOLAR_IRRADIANCE = 1361;
|
|
32
|
+
/** Nominal solar effective temperature, K (IAU 2015 B3). */
|
|
33
|
+
export const NOMINAL_SOLAR_TEMPERATURE = 5772;
|
|
34
|
+
/** Nominal solar mass parameter GM, m^3/s^2 (IAU 2015 B3). */
|
|
35
|
+
export const NOMINAL_SOLAR_GM = 1.327_124_4e20;
|
|
36
|
+
/** Nominal equatorial radius of Earth, m (IAU 2015 B3). */
|
|
37
|
+
export const NOMINAL_EARTH_RADIUS = 6.378_1e6;
|
|
38
|
+
/** Nominal mass parameter GM of Earth, m^3/s^2 (IAU 2015 B3). */
|
|
39
|
+
export const NOMINAL_EARTH_GM = 3.986_004e14;
|
|
40
|
+
/** Nominal equatorial radius of Jupiter, m (IAU 2015 B3). */
|
|
41
|
+
export const NOMINAL_JUPITER_RADIUS = 7.149_2e7;
|
|
42
|
+
/** Nominal mass parameter GM of Jupiter, m^3/s^2 (IAU 2015 B3). */
|
|
43
|
+
export const NOMINAL_JUPITER_GM = 1.266_865_3e17;
|
|
44
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,iDAAiD;AACjD,EAAE;AACF,WAAW;AACX,0DAA0D;AAC1D,8EAA8E;AAC9E,+DAA+D;AAC/D,uFAAuF;AACvF,uFAAuF;AACvF,sBAAsB;AACtB,0FAA0F;AAC1F,4DAA4D;AAE5D,iDAAiD;AACjD,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAA;AAEzC,iDAAiD;AACjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAA;AAEhD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAA;AAErC,kGAAkG;AAClG,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,GAAG,WAAW,CAAA;AAEtD;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAW,CAAA;AAE3F,6CAA6C;AAC7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAA;AAC3C,iDAAiD;AACjD,MAAM,CAAC,MAAM,wBAAwB,GAAG,QAAQ,CAAA;AAChD,4FAA4F;AAC5F,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAA;AAC5C,4DAA4D;AAC5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAA;AAC7C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAA;AAE9C,2DAA2D;AAC3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAA;AAC7C,iEAAiE;AACjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAA;AAE5C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAS,CAAA;AAC/C,mEAAmE;AACnE,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAA"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { type Mat3 } from '@arcosmos/erfa';
|
|
2
|
+
import { type FormatAngleOptions } from './angles.ts';
|
|
3
|
+
import { Quantity } from './quantity.ts';
|
|
4
|
+
import { type Time } from './time.ts';
|
|
5
|
+
/** The frames a coordinate may be given in, named as Astropy names them. */
|
|
6
|
+
export type FrameName = 'icrs' | 'fk5' | 'galactic' | 'supergalactic' | 'barycentricmeanecliptic';
|
|
7
|
+
/** An equinox: "J2000", "J1975.5", "B1950", or a Julian year as a number. Read on the TT scale, as Astropy reads it. */
|
|
8
|
+
export type Equinox = string | number;
|
|
9
|
+
/** The two components of each frame, longitude then latitude, as Astropy names them. */
|
|
10
|
+
export declare const FRAME_COMPONENTS: {
|
|
11
|
+
readonly icrs: readonly ["ra", "dec"];
|
|
12
|
+
readonly fk5: readonly ["ra", "dec"];
|
|
13
|
+
readonly galactic: readonly ["l", "b"];
|
|
14
|
+
readonly supergalactic: readonly ["sgl", "sgb"];
|
|
15
|
+
readonly barycentricmeanecliptic: readonly ["lon", "lat"];
|
|
16
|
+
};
|
|
17
|
+
/** An equinox as Julian or Besselian, its year, its label ("J2000") and its TT Julian date in two parts. */
|
|
18
|
+
interface ParsedEquinox {
|
|
19
|
+
readonly label: string;
|
|
20
|
+
readonly jd: readonly [number, number];
|
|
21
|
+
}
|
|
22
|
+
/** An angle given as a quantity, or as text parseAngle reads ("12h30m45.6s", "-12d30m45s"). */
|
|
23
|
+
export type AngleInput = Quantity<'angle'> | string;
|
|
24
|
+
/**
|
|
25
|
+
* A coordinate's distance and motion, any of them optional, as Astropy's SkyCoord takes them:
|
|
26
|
+
* a distance (or a parallax), proper motions in the frame's own names, a radial velocity, and
|
|
27
|
+
* the time they hold at (`obstime`), which applySpaceMotion needs.
|
|
28
|
+
*/
|
|
29
|
+
export interface MotionInput {
|
|
30
|
+
readonly distance?: Quantity<'length'>;
|
|
31
|
+
/** In place of a distance: the distance is 1/parallax, the parallax in arcseconds giving parsecs. */
|
|
32
|
+
readonly parallax?: Quantity<'angle'>;
|
|
33
|
+
readonly radialVelocity?: Quantity<'speed'>;
|
|
34
|
+
readonly obstime?: Time;
|
|
35
|
+
}
|
|
36
|
+
/** What a coordinate is made from: its two components and proper motions, named as its frame names them. */
|
|
37
|
+
export type SkyCoordInput = MotionInput & ({
|
|
38
|
+
readonly ra: AngleInput;
|
|
39
|
+
readonly dec: AngleInput;
|
|
40
|
+
readonly frame?: 'icrs' | 'fk5';
|
|
41
|
+
readonly equinox?: Equinox;
|
|
42
|
+
readonly pmRaCosdec?: Quantity<'angular speed'>;
|
|
43
|
+
readonly pmDec?: Quantity<'angular speed'>;
|
|
44
|
+
} | {
|
|
45
|
+
readonly l: AngleInput;
|
|
46
|
+
readonly b: AngleInput;
|
|
47
|
+
readonly frame: 'galactic';
|
|
48
|
+
readonly pmLCosb?: Quantity<'angular speed'>;
|
|
49
|
+
readonly pmB?: Quantity<'angular speed'>;
|
|
50
|
+
} | {
|
|
51
|
+
readonly sgl: AngleInput;
|
|
52
|
+
readonly sgb: AngleInput;
|
|
53
|
+
readonly frame: 'supergalactic';
|
|
54
|
+
readonly pmSglCossgb?: Quantity<'angular speed'>;
|
|
55
|
+
readonly pmSgb?: Quantity<'angular speed'>;
|
|
56
|
+
} | {
|
|
57
|
+
readonly lon: AngleInput;
|
|
58
|
+
readonly lat: AngleInput;
|
|
59
|
+
readonly frame: 'barycentricmeanecliptic';
|
|
60
|
+
readonly equinox?: Equinox;
|
|
61
|
+
readonly pmLonCoslat?: Quantity<'angular speed'>;
|
|
62
|
+
readonly pmLat?: Quantity<'angular speed'>;
|
|
63
|
+
});
|
|
64
|
+
/** The two proper-motion components of each frame, as Astropy names them (pm_ra_cosdec, pm_dec...). */
|
|
65
|
+
export declare const FRAME_PROPER_MOTIONS: {
|
|
66
|
+
readonly icrs: readonly ["pmRaCosdec", "pmDec"];
|
|
67
|
+
readonly fk5: readonly ["pmRaCosdec", "pmDec"];
|
|
68
|
+
readonly galactic: readonly ["pmLCosb", "pmB"];
|
|
69
|
+
readonly supergalactic: readonly ["pmSglCossgb", "pmSgb"];
|
|
70
|
+
readonly barycentricmeanecliptic: readonly ["pmLonCoslat", "pmLat"];
|
|
71
|
+
};
|
|
72
|
+
/** How toString writes a coordinate, as Astropy's SkyCoord.to_string: degrees, sexagesimal degrees, or hours and degrees. */
|
|
73
|
+
export type SkyCoordStyle = 'decimal' | 'dms' | 'hmsdms';
|
|
74
|
+
/** A coordinate's distance and motion in the units held: pc, rad/yr, km/s. Null where not given. */
|
|
75
|
+
interface Motion {
|
|
76
|
+
readonly distancePc: number | null;
|
|
77
|
+
readonly pmLonCoslat: number | null;
|
|
78
|
+
readonly pmLat: number | null;
|
|
79
|
+
readonly rv: number | null;
|
|
80
|
+
readonly obstime: Time | null;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A direction on the sky in a frame, with its distance and motion if known:
|
|
84
|
+
* `skyCoord({ ra: q(10.684, 'deg'), dec: q(41.269, 'deg') })`. Immutable. Named after Astropy's
|
|
85
|
+
* SkyCoord, of which it is the part for directions and space motion.
|
|
86
|
+
*/
|
|
87
|
+
export declare class SkyCoord {
|
|
88
|
+
#private;
|
|
89
|
+
readonly frame: FrameName;
|
|
90
|
+
/** The equinox of FK5 and ecliptic coordinates ("J2000" by default); null for the others. */
|
|
91
|
+
readonly equinox: string | null;
|
|
92
|
+
/** @internal Longitude in radians, 0 <= lon < 2pi. */
|
|
93
|
+
readonly lonRad: number;
|
|
94
|
+
/** @internal Latitude in radians. */
|
|
95
|
+
readonly latRad: number;
|
|
96
|
+
/** @internal Distance, proper motion (rad/yr, the longitude's times cos(latitude)) and radial velocity. */
|
|
97
|
+
readonly motion: Motion;
|
|
98
|
+
/** @internal Use skyCoord(). */
|
|
99
|
+
constructor(frame: FrameName, lonRad: number, latRad: number, equinox: ParsedEquinox | null, motion?: Motion);
|
|
100
|
+
/**
|
|
101
|
+
* The longitude component (ra, l, sgl or lon), in degrees from 0 up to 360. A longitude just
|
|
102
|
+
* under 2pi can round to 360 in degrees: it wraps to 0, as Astropy's Longitude does.
|
|
103
|
+
*/
|
|
104
|
+
get lon(): Quantity<'angle'>;
|
|
105
|
+
/** The latitude component (dec, b, sgb or lat), in degrees. */
|
|
106
|
+
get lat(): Quantity<'angle'>;
|
|
107
|
+
get ra(): Quantity<'angle'>;
|
|
108
|
+
get dec(): Quantity<'angle'>;
|
|
109
|
+
get l(): Quantity<'angle'>;
|
|
110
|
+
get b(): Quantity<'angle'>;
|
|
111
|
+
get sgl(): Quantity<'angle'>;
|
|
112
|
+
get sgb(): Quantity<'angle'>;
|
|
113
|
+
/** The distance, in parsecs, or null when not known. */
|
|
114
|
+
get distance(): Quantity<'length'> | null;
|
|
115
|
+
/** The proper motion along the longitude, times cos(latitude) (pm_ra_cosdec in ICRS), in mas/yr; null when not known. */
|
|
116
|
+
get pmLonCoslat(): Quantity<'angular speed'> | null;
|
|
117
|
+
/** The proper motion along the latitude (pm_dec in ICRS), in mas/yr; null when not known. */
|
|
118
|
+
get pmLat(): Quantity<'angular speed'> | null;
|
|
119
|
+
get pmRaCosdec(): Quantity<'angular speed'> | null;
|
|
120
|
+
get pmDec(): Quantity<'angular speed'> | null;
|
|
121
|
+
get pmLCosb(): Quantity<'angular speed'> | null;
|
|
122
|
+
get pmB(): Quantity<'angular speed'> | null;
|
|
123
|
+
/** The radial velocity, in km/s, or null when not known. */
|
|
124
|
+
get radialVelocity(): Quantity<'speed'> | null;
|
|
125
|
+
/** The time the position and motion hold at, or null. */
|
|
126
|
+
get obstime(): Time | null;
|
|
127
|
+
/**
|
|
128
|
+
* The same direction in another frame: `c.transformTo('galactic')`,
|
|
129
|
+
* `c.transformTo('fk5', { equinox: 'J1975' })`. A proper motion turns with it; the distance
|
|
130
|
+
* and radial velocity don't change.
|
|
131
|
+
*/
|
|
132
|
+
transformTo(frame: FrameName, options?: {
|
|
133
|
+
readonly equinox?: Equinox;
|
|
134
|
+
}): SkyCoord;
|
|
135
|
+
get icrs(): SkyCoord;
|
|
136
|
+
/** In FK5 at J2000. */
|
|
137
|
+
get fk5(): SkyCoord;
|
|
138
|
+
get galactic(): SkyCoord;
|
|
139
|
+
get supergalactic(): SkyCoord;
|
|
140
|
+
/** In the barycentric mean ecliptic at J2000. */
|
|
141
|
+
get barycentricmeanecliptic(): SkyCoord;
|
|
142
|
+
/**
|
|
143
|
+
* Where the star is at another time, by its proper motion, and its parallax and radial
|
|
144
|
+
* velocity where known: Astropy's apply_space_motion, through ERFA's pmsafe. Give the new
|
|
145
|
+
* time (`newObstime`, which needs this coordinate's `obstime`) or the interval (`dt`; with
|
|
146
|
+
* no `obstime`, the interval is counted from J2000 and the result has none either). The
|
|
147
|
+
* motion is rigorous: along a straight line in space, with the light-time and perspective
|
|
148
|
+
* effects ERFA's starpm includes. Needs a proper motion, or as Astropy, a distance and a
|
|
149
|
+
* radial velocity (the proper motion then taken as zero).
|
|
150
|
+
*
|
|
151
|
+
* Unlike Astropy, a radial velocity that wasn't given stays unknown. Astropy reports pmsafe's,
|
|
152
|
+
* which for a star with no radial velocity comes from the distance pmsafe assumes, up to about
|
|
153
|
+
* 1 km/s, and isn't a measurement.
|
|
154
|
+
*/
|
|
155
|
+
applySpaceMotion(options: {
|
|
156
|
+
readonly newObstime?: Time;
|
|
157
|
+
readonly dt?: Quantity<'time'>;
|
|
158
|
+
}): SkyCoord;
|
|
159
|
+
/** The angle between two directions, in degrees. The other is converted to this one's frame first. */
|
|
160
|
+
separation(other: SkyCoord): Quantity<'angle'>;
|
|
161
|
+
/** The position angle of the other direction from this one, east of north, in degrees from 0 to 360. */
|
|
162
|
+
positionAngle(other: SkyCoord): Quantity<'angle'>;
|
|
163
|
+
/**
|
|
164
|
+
* The coordinate as text, as Astropy's SkyCoord.to_string writes it: "10.6847 41.2690" in
|
|
165
|
+
* the "decimal" style (with `precision: 4`), "00h42m44.3s +41d16m09s" in "hmsdms". Options
|
|
166
|
+
* are formatAngle's, applied to both components.
|
|
167
|
+
*/
|
|
168
|
+
toString(style?: SkyCoordStyle, options?: FormatAngleOptions): string;
|
|
169
|
+
/** Its frame, components and motion in the units the getters give, and `obstime` as the Time writes itself. */
|
|
170
|
+
toJSON(): Record<string, string | number | ReturnType<Time['toJSON']>>;
|
|
171
|
+
private component;
|
|
172
|
+
private properMotion;
|
|
173
|
+
private inFrameOf;
|
|
174
|
+
}
|
|
175
|
+
/** A star in ICRS as plain numbers in fixed units, for moving many at once. */
|
|
176
|
+
export interface StarAt {
|
|
177
|
+
readonly raDeg: number;
|
|
178
|
+
readonly decDeg: number;
|
|
179
|
+
/** Proper motion in RA times cos(dec), mas/yr. */
|
|
180
|
+
readonly pmRaCosdecMasYr: number;
|
|
181
|
+
readonly pmDecMasYr: number;
|
|
182
|
+
/** Null (or zero or less) when the distance isn't known. */
|
|
183
|
+
readonly parallaxMas: number | null;
|
|
184
|
+
readonly radialVelocityKmS: number | null;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Where an ICRS star is at another time: the same computation as SkyCoord.applySpaceMotion
|
|
188
|
+
* (Astropy's apply_space_motion through ERFA's pmsafe), on plain numbers, for moving many stars
|
|
189
|
+
* between the same two times without making a coordinate for each. A parallax of zero or
|
|
190
|
+
* less counts as unknown, as no distance.
|
|
191
|
+
*/
|
|
192
|
+
export declare function moveStar(star: StarAt, from: Time, to: Time): StarAt;
|
|
193
|
+
/**
|
|
194
|
+
* The rotation from one frame to another, as `transformTo` turns a direction: a vector `v`
|
|
195
|
+
* (a direction or a cartesian position) in `from` is `M v` in `to`, and the transpose turns it
|
|
196
|
+
* back. For code that turns many positions on plain numbers, where a SkyCoord each would cost
|
|
197
|
+
* too much: `frameRotation('icrs', 'galactic')` is Astropy's ICRS-to-Galactic matrix. Each
|
|
198
|
+
* equinox defaults to J2000, and only FK5 and the ecliptic take one.
|
|
199
|
+
*/
|
|
200
|
+
export declare function frameRotation(from: FrameName, to: FrameName, options?: {
|
|
201
|
+
readonly fromEquinox?: Equinox;
|
|
202
|
+
readonly toEquinox?: Equinox;
|
|
203
|
+
}): Mat3;
|
|
204
|
+
/**
|
|
205
|
+
* A direction on the sky, and its distance and motion if given: `skyCoord({ ra: q(10.684,
|
|
206
|
+
* 'deg'), dec: q(41.269, 'deg') })` (ICRS by default), `skyCoord({ ra: '00h42m44.3s', dec:
|
|
207
|
+
* '+41d16m09s' })`, `skyCoord({ l: q(121.17, 'deg'), b: q(-21.57, 'deg'), frame: 'galactic' })`.
|
|
208
|
+
* Proper motions come both or neither, named as the frame names them (`pmRaCosdec` and
|
|
209
|
+
* `pmDec` in ICRS). A latitude beyond ±90° is refused; a longitude is wrapped into 0 to 360°.
|
|
210
|
+
*/
|
|
211
|
+
export declare function skyCoord(input: SkyCoordInput): SkyCoord;
|
|
212
|
+
export {};
|
|
213
|
+
//# sourceMappingURL=coordinates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinates.d.ts","sourceRoot":"","sources":["../src/coordinates.ts"],"names":[],"mappings":"AAgBA,OAAO,EACsC,KAAK,IAAI,EACrD,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,KAAK,kBAAkB,EAA2B,MAAM,aAAa,CAAA;AAG9E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,WAAW,CAAA;AAK3C,4EAA4E;AAC5E,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,GAAG,eAAe,GAAG,yBAAyB,CAAA;AAEjG,wHAAwH;AACxH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAErC,wFAAwF;AACxF,eAAO,MAAM,gBAAgB;;;;;;CAMoC,CAAA;AAIjE,4GAA4G;AAC5G,UAAU,aAAa;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACvC;AAwFD,+FAA+F;AAC/F,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,MAAM,CAAA;AAEnD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IACtC,qGAAqG;IACrG,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IACrC,QAAQ,CAAC,c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