siderust-js 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/.github/workflows/ci.yml +166 -0
- package/.gitmodules +9 -0
- package/CHANGELOG.md +26 -0
- package/LICENSE +661 -0
- package/README.md +138 -0
- package/package.json +12 -0
- package/qtty-js/.github/workflows/ci.yml +151 -0
- package/qtty-js/.gitmodules +3 -0
- package/qtty-js/CHANGELOG.md +31 -0
- package/qtty-js/LICENSE +661 -0
- package/qtty-js/README.md +132 -0
- package/qtty-js/package.json +20 -0
- package/qtty-js/qtty/.github/workflows/ci.yml +155 -0
- package/qtty-js/qtty/CHANGELOG.md +120 -0
- package/qtty-js/qtty/Cargo.lock +1462 -0
- package/qtty-js/qtty/Cargo.toml +12 -0
- package/qtty-js/qtty/LICENSE +661 -0
- package/qtty-js/qtty/README.md +9 -0
- package/qtty-js/qtty/qtty/Cargo.toml +41 -0
- package/qtty-js/qtty/qtty/README.md +8 -0
- package/qtty-js/qtty/qtty/examples/angles.rs +14 -0
- package/qtty-js/qtty/qtty/examples/astronomy.rs +17 -0
- package/qtty-js/qtty/qtty/examples/dimensional_arithmetic.rs +83 -0
- package/qtty-js/qtty/qtty/examples/python_integration.rs +61 -0
- package/qtty-js/qtty/qtty/examples/quickstart.rs +15 -0
- package/qtty-js/qtty/qtty/examples/ratios.rs +12 -0
- package/qtty-js/qtty/qtty/examples/serde_with_unit.rs +234 -0
- package/qtty-js/qtty/qtty/examples/serialization.rs +141 -0
- package/qtty-js/qtty/qtty/examples/serialization_advanced.rs +155 -0
- package/qtty-js/qtty/qtty/src/f32.rs +108 -0
- package/qtty-js/qtty/qtty/src/f64.rs +30 -0
- package/qtty-js/qtty/qtty/src/i128.rs +111 -0
- package/qtty-js/qtty/qtty/src/i16.rs +111 -0
- package/qtty-js/qtty/qtty/src/i32.rs +111 -0
- package/qtty-js/qtty/qtty/src/i64.rs +111 -0
- package/qtty-js/qtty/qtty/src/i8.rs +111 -0
- package/qtty-js/qtty/qtty/src/lib.rs +238 -0
- package/qtty-js/qtty/qtty/tests/fixtures/qtty-vec-no-std/Cargo.lock +83 -0
- package/qtty-js/qtty/qtty/tests/fixtures/qtty-vec-no-std/Cargo.toml +10 -0
- package/qtty-js/qtty/qtty/tests/fixtures/qtty-vec-no-std/src/lib.rs +7 -0
- package/qtty-js/qtty/qtty/tests/fixtures/qtty-vec-no-std-alloc/Cargo.lock +83 -0
- package/qtty-js/qtty/qtty/tests/fixtures/qtty-vec-no-std-alloc/Cargo.toml +10 -0
- package/qtty-js/qtty/qtty/tests/fixtures/qtty-vec-no-std-alloc/src/lib.rs +7 -0
- package/qtty-js/qtty/qtty/tests/fixtures/qtty-vec-std/Cargo.lock +83 -0
- package/qtty-js/qtty/qtty/tests/fixtures/qtty-vec-std/Cargo.toml +10 -0
- package/qtty-js/qtty/qtty/tests/fixtures/qtty-vec-std/src/lib.rs +5 -0
- package/qtty-js/qtty/qtty/tests/integration_tests.rs +529 -0
- package/qtty-js/qtty/qtty/tests/qtty_vec_feature_matrix.rs +58 -0
- package/qtty-js/qtty/qtty-core/Cargo.toml +41 -0
- package/qtty-js/qtty/qtty-core/README.md +8 -0
- package/qtty-js/qtty/qtty-core/examples/diesel_integration.rs +145 -0
- package/qtty-js/qtty/qtty-core/examples/quantity_db_serde.rs +215 -0
- package/qtty-js/qtty/qtty-core/src/dimension.rs +249 -0
- package/qtty-js/qtty/qtty-core/src/feature_diesel.rs +318 -0
- package/qtty-js/qtty/qtty-core/src/feature_pyo3.rs +27 -0
- package/qtty-js/qtty/qtty-core/src/feature_serde.rs +203 -0
- package/qtty-js/qtty/qtty-core/src/feature_tiberius.rs +28 -0
- package/qtty-js/qtty/qtty-core/src/lib.rs +744 -0
- package/qtty-js/qtty/qtty-core/src/macros.rs +93 -0
- package/qtty-js/qtty/qtty-core/src/quantity.rs +810 -0
- package/qtty-js/qtty/qtty-core/src/scalar.rs +1742 -0
- package/qtty-js/qtty/qtty-core/src/unit.rs +332 -0
- package/qtty-js/qtty/qtty-core/src/units/angular.rs +1228 -0
- package/qtty-js/qtty/qtty-core/src/units/area.rs +243 -0
- package/qtty-js/qtty/qtty-core/src/units/frequency.rs +179 -0
- package/qtty-js/qtty/qtty-core/src/units/length.rs +1270 -0
- package/qtty-js/qtty/qtty-core/src/units/mass.rs +488 -0
- package/qtty-js/qtty/qtty-core/src/units/mod.rs +26 -0
- package/qtty-js/qtty/qtty-core/src/units/power.rs +324 -0
- package/qtty-js/qtty/qtty-core/src/units/time.rs +667 -0
- package/qtty-js/qtty/qtty-core/src/units/unitless.rs +212 -0
- package/qtty-js/qtty/qtty-core/src/units/velocity.rs +210 -0
- package/qtty-js/qtty/qtty-core/src/units/volume.rs +269 -0
- package/qtty-js/qtty/qtty-core/tests/core.rs +628 -0
- package/qtty-js/qtty/qtty-core/tests/diesel.rs +461 -0
- package/qtty-js/qtty/qtty-core/tests/integers.rs +632 -0
- package/qtty-js/qtty/qtty-core/tests/no_cross_unit_ops.rs +35 -0
- package/qtty-js/qtty/qtty-core/tests/pyo3.rs +334 -0
- package/qtty-js/qtty/qtty-core/tests/quantity_f32.rs +276 -0
- package/qtty-js/qtty/qtty-core/tests/scalar_decimal.rs +258 -0
- package/qtty-js/qtty/qtty-core/tests/scalar_f32.rs +286 -0
- package/qtty-js/qtty/qtty-core/tests/scalar_f64_real.rs +287 -0
- package/qtty-js/qtty/qtty-core/tests/scalar_rational.rs +260 -0
- package/qtty-js/qtty/qtty-core/tests/serde.rs +256 -0
- package/qtty-js/qtty/qtty-core/tests/tiberius.rs +208 -0
- package/qtty-js/qtty/qtty-derive/Cargo.toml +23 -0
- package/qtty-js/qtty/qtty-derive/README.md +8 -0
- package/qtty-js/qtty/qtty-derive/src/lib.rs +340 -0
- package/qtty-js/qtty/qtty-ffi/ARCHITECTURE.md +3 -0
- package/qtty-js/qtty/qtty-ffi/Cargo.toml +31 -0
- package/qtty-js/qtty/qtty-ffi/README.md +9 -0
- package/qtty-js/qtty/qtty-ffi/build.rs +326 -0
- package/qtty-js/qtty/qtty-ffi/cbindgen.toml +105 -0
- package/qtty-js/qtty/qtty-ffi/include/qtty_ffi.h +1126 -0
- package/qtty-js/qtty/qtty-ffi/src/ffi.rs +1251 -0
- package/qtty-js/qtty/qtty-ffi/src/ffi_serde.rs +294 -0
- package/qtty-js/qtty/qtty-ffi/src/helpers.rs +310 -0
- package/qtty-js/qtty/qtty-ffi/src/lib.rs +229 -0
- package/qtty-js/qtty/qtty-ffi/src/macros.rs +121 -0
- package/qtty-js/qtty/qtty-ffi/src/registry.rs +274 -0
- package/qtty-js/qtty/qtty-ffi/src/types.rs +620 -0
- package/qtty-js/qtty/qtty-ffi/tests/integration_tests.rs +842 -0
- package/qtty-js/qtty/qtty-ffi/units.csv +156 -0
- package/qtty-js/qtty/qtty-ffi/units.csv.md +3 -0
- package/qtty-js/qtty-node/.prettierignore +6 -0
- package/qtty-js/qtty-node/.prettierrc.json +6 -0
- package/qtty-js/qtty-node/README.md +250 -0
- package/qtty-js/qtty-node/c8.config.json +11 -0
- package/qtty-js/qtty-node/eslint.config.js +31 -0
- package/qtty-js/qtty-node/examples/arithmetic.mjs +64 -0
- package/qtty-js/qtty-node/examples/astronomy.mjs +90 -0
- package/qtty-js/qtty-node/examples/quickstart.mjs +36 -0
- package/qtty-js/qtty-node/examples/serialization.mjs +125 -0
- package/qtty-js/qtty-node/examples/unit_factories.mjs +74 -0
- package/qtty-js/qtty-node/index.d.ts +219 -0
- package/qtty-js/qtty-node/index.js +323 -0
- package/qtty-js/qtty-node/lib/DerivedQuantity.js +122 -0
- package/qtty-js/qtty-node/lib/Quantity.js +151 -0
- package/qtty-js/qtty-node/lib/backend.js +25 -0
- package/qtty-js/qtty-node/native.cjs +306 -0
- package/qtty-js/qtty-node/package-lock.json +3223 -0
- package/qtty-js/qtty-node/package.json +70 -0
- package/qtty-js/qtty-node/units.d.ts +299 -0
- package/qtty-js/qtty-node/units.js +210 -0
- package/qtty-js/qtty-web/Cargo.lock +767 -0
- package/qtty-js/qtty-web/Cargo.toml +21 -0
- package/qtty-js/qtty-web/index.d.ts +140 -0
- package/qtty-js/qtty-web/index.js +20 -0
- package/qtty-js/qtty-web/lib/DerivedQuantity.js +58 -0
- package/qtty-js/qtty-web/lib/Quantity.js +75 -0
- package/qtty-js/qtty-web/lib/backend.js +80 -0
- package/qtty-js/qtty-web/package.json +45 -0
- package/qtty-js/qtty-web/src/lib.rs +111 -0
- package/qtty-js/scripts/ci.sh +73 -0
- package/scripts/ci.sh +123 -0
- package/siderust-core/Cargo.lock +787 -0
- package/siderust-core/Cargo.toml +18 -0
- package/siderust-core/DEDUPLICATION.md +124 -0
- package/siderust-core/src/body.rs +120 -0
- package/siderust-core/src/events.rs +184 -0
- package/siderust-core/src/lib.rs +20 -0
- package/siderust-core/src/observer.rs +55 -0
- package/siderust-core/src/position.rs +213 -0
- package/siderust-node/.prettierignore +7 -0
- package/siderust-node/.prettierrc.json +6 -0
- package/siderust-node/Cargo.lock +906 -0
- package/siderust-node/Cargo.toml +29 -0
- package/siderust-node/README.md +109 -0
- package/siderust-node/__test__/index.test.mjs +248 -0
- package/siderust-node/build.rs +5 -0
- package/siderust-node/c8.config.json +3 -0
- package/siderust-node/eslint.config.js +31 -0
- package/siderust-node/examples/01_basic_coordinates.mjs +24 -0
- package/siderust-node/examples/02_coordinate_transformations.mjs +25 -0
- package/siderust-node/examples/03_all_frames_conversions.mjs +26 -0
- package/siderust-node/examples/04_all_center_conversions.mjs +24 -0
- package/siderust-node/examples/05_target_tracking.mjs +22 -0
- package/siderust-node/examples/06_night_events.mjs +18 -0
- package/siderust-node/examples/07_moon_properties.mjs +21 -0
- package/siderust-node/examples/08_solar_system.mjs +19 -0
- package/siderust-node/examples/09_star_observability.mjs +22 -0
- package/siderust-node/examples/10_time_periods.mjs +9 -0
- package/siderust-node/examples/11_serialization.mjs +31 -0
- package/siderust-node/examples/12_runtime_ephemeris.mjs +27 -0
- package/siderust-node/examples/13_coordinate_operations.mjs +20 -0
- package/siderust-node/index.d.ts +623 -0
- package/siderust-node/index.js +79 -0
- package/siderust-node/lib/Observer.js +112 -0
- package/siderust-node/lib/Star.js +118 -0
- package/siderust-node/lib/backend.js +63 -0
- package/siderust-node/lib/wrappers.js +566 -0
- package/siderust-node/main.js +20 -0
- package/siderust-node/native.cjs +360 -0
- package/siderust-node/package-lock.json +3261 -0
- package/siderust-node/package.json +71 -0
- package/siderust-node/src/body.rs +74 -0
- package/siderust-node/src/coordinates.rs +372 -0
- package/siderust-node/src/ephemeris.rs +462 -0
- package/siderust-node/src/events.rs +577 -0
- package/siderust-node/src/lib.rs +43 -0
- package/siderust-node/src/observer.rs +132 -0
- package/siderust-node/src/phase.rs +218 -0
- package/siderust-node/src/position.rs +292 -0
- package/siderust-node/src/star.rs +200 -0
- package/siderust-web/Cargo.lock +855 -0
- package/siderust-web/Cargo.toml +34 -0
- package/siderust-web/README.md +100 -0
- package/siderust-web/__test__/index.test.mjs +118 -0
- package/siderust-web/examples/github-pages/README.md +31 -0
- package/siderust-web/examples/github-pages/index.html +135 -0
- package/siderust-web/index.d.ts +311 -0
- package/siderust-web/index.js +66 -0
- package/siderust-web/lib/Observer.js +103 -0
- package/siderust-web/lib/Star.js +116 -0
- package/siderust-web/lib/backend.js +400 -0
- package/siderust-web/lib/wrappers.js +512 -0
- package/siderust-web/package.json +55 -0
- package/siderust-web/src/body.rs +69 -0
- package/siderust-web/src/coordinates.rs +302 -0
- package/siderust-web/src/ephemeris.rs +456 -0
- package/siderust-web/src/events.rs +520 -0
- package/siderust-web/src/lib.rs +51 -0
- package/siderust-web/src/observer.rs +117 -0
- package/siderust-web/src/phase.rs +190 -0
- package/siderust-web/src/position.rs +291 -0
- package/siderust-web/src/star.rs +178 -0
- package/tempoch-js/.github/workflows/ci.yml +142 -0
- package/tempoch-js/.gitmodules +3 -0
- package/tempoch-js/CHANGELOG.md +25 -0
- package/tempoch-js/LICENSE +661 -0
- package/tempoch-js/README.md +126 -0
- package/tempoch-js/package.json +20 -0
- package/tempoch-js/scripts/ci.sh +73 -0
- package/tempoch-js/tempoch/.github/workflows/ci.yml +113 -0
- package/tempoch-js/tempoch/CHANGELOG.md +82 -0
- package/tempoch-js/tempoch/Cargo.lock +947 -0
- package/tempoch-js/tempoch/Cargo.toml +3 -0
- package/tempoch-js/tempoch/LICENSE +661 -0
- package/tempoch-js/tempoch/README.md +76 -0
- package/tempoch-js/tempoch/tempoch/Cargo.toml +27 -0
- package/tempoch-js/tempoch/tempoch/examples/periods.rs +45 -0
- package/tempoch-js/tempoch/tempoch/examples/quickstart.rs +13 -0
- package/tempoch-js/tempoch/tempoch/src/lib.rs +49 -0
- package/tempoch-js/tempoch/tempoch/tests/integration.rs +57 -0
- package/tempoch-js/tempoch/tempoch-core/Cargo.toml +24 -0
- package/tempoch-js/tempoch/tempoch-core/src/delta_t.rs +345 -0
- package/tempoch-js/tempoch/tempoch-core/src/instant.rs +811 -0
- package/tempoch-js/tempoch/tempoch-core/src/julian_date_ext.rs +142 -0
- package/tempoch-js/tempoch/tempoch-core/src/lib.rs +81 -0
- package/tempoch-js/tempoch/tempoch-core/src/period.rs +1168 -0
- package/tempoch-js/tempoch/tempoch-core/src/scales.rs +779 -0
- package/tempoch-js/tempoch/tempoch-ffi/Cargo.lock +889 -0
- package/tempoch-js/tempoch/tempoch-ffi/Cargo.toml +26 -0
- package/tempoch-js/tempoch/tempoch-ffi/build.rs +24 -0
- package/tempoch-js/tempoch/tempoch-ffi/cbindgen.toml +30 -0
- package/tempoch-js/tempoch/tempoch-ffi/src/error.rs +19 -0
- package/tempoch-js/tempoch/tempoch-ffi/src/lib.rs +82 -0
- package/tempoch-js/tempoch/tempoch-ffi/src/period.rs +101 -0
- package/tempoch-js/tempoch/tempoch-ffi/src/time.rs +711 -0
- package/tempoch-js/tempoch/tempoch-ffi/tests/ffi.rs +265 -0
- package/tempoch-js/tempoch-node/.prettierignore +6 -0
- package/tempoch-js/tempoch-node/.prettierrc.json +6 -0
- package/tempoch-js/tempoch-node/Cargo.lock +496 -0
- package/tempoch-js/tempoch-node/Cargo.toml +29 -0
- package/tempoch-js/tempoch-node/README.md +265 -0
- package/tempoch-js/tempoch-node/__test__/index.test.mjs +598 -0
- package/tempoch-js/tempoch-node/build.rs +5 -0
- package/tempoch-js/tempoch-node/c8.config.json +3 -0
- package/tempoch-js/tempoch-node/eslint.config.js +31 -0
- package/tempoch-js/tempoch-node/examples/periods.mjs +79 -0
- package/tempoch-js/tempoch-node/examples/quickstart.mjs +71 -0
- package/tempoch-js/tempoch-node/examples/timescales.mjs +92 -0
- package/tempoch-js/tempoch-node/index.d.ts +280 -0
- package/tempoch-js/tempoch-node/index.js +32 -0
- package/tempoch-js/tempoch-node/lib/JulianDate.js +176 -0
- package/tempoch-js/tempoch-node/lib/ModifiedJulianDate.js +156 -0
- package/tempoch-js/tempoch-node/lib/Period.js +133 -0
- package/tempoch-js/tempoch-node/lib/backend.js +38 -0
- package/tempoch-js/tempoch-node/lib/qttyCompat.js +92 -0
- package/tempoch-js/tempoch-node/native.cjs +317 -0
- package/tempoch-js/tempoch-node/package-lock.json +3223 -0
- package/tempoch-js/tempoch-node/package.json +56 -0
- package/tempoch-js/tempoch-node/src/lib.rs +573 -0
- package/tempoch-js/tempoch-web/Cargo.toml +23 -0
- package/tempoch-js/tempoch-web/index.d.ts +95 -0
- package/tempoch-js/tempoch-web/index.js +27 -0
- package/tempoch-js/tempoch-web/lib/JulianDate.js +170 -0
- package/tempoch-js/tempoch-web/lib/ModifiedJulianDate.js +145 -0
- package/tempoch-js/tempoch-web/lib/Period.js +121 -0
- package/tempoch-js/tempoch-web/lib/backend.js +118 -0
- package/tempoch-js/tempoch-web/package.json +46 -0
- package/tempoch-js/tempoch-web/src/lib.rs +184 -0
|
@@ -0,0 +1,623 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/* auto-generated by NAPI-RS */
|
|
5
|
+
|
|
6
|
+
/** Physical parameters of a solar-system planet. */
|
|
7
|
+
export interface PlanetInfo {
|
|
8
|
+
/** Planet name. */
|
|
9
|
+
name: string
|
|
10
|
+
/** Mass in kilograms. */
|
|
11
|
+
massKg: number
|
|
12
|
+
/** Mean equatorial radius in kilometres. */
|
|
13
|
+
radiusKm: number
|
|
14
|
+
/** Semi-major axis in AU. */
|
|
15
|
+
semiMajorAxisAu: number
|
|
16
|
+
/** Orbital eccentricity. */
|
|
17
|
+
eccentricity: number
|
|
18
|
+
/** Orbital inclination in degrees. */
|
|
19
|
+
inclinationDeg: number
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get physical parameters for a named planet.
|
|
23
|
+
*
|
|
24
|
+
* Valid names: `"Mercury"`, `"Venus"`, `"Earth"`, `"Mars"`, `"Jupiter"`,
|
|
25
|
+
* `"Saturn"`, `"Uranus"`, `"Neptune"`.
|
|
26
|
+
*
|
|
27
|
+
* ```js
|
|
28
|
+
* const { getPlanet } = require('@siderust/siderust');
|
|
29
|
+
* const mars = getPlanet('Mars');
|
|
30
|
+
* console.log(mars.massKg, mars.radiusKm);
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function getPlanet(name: string): PlanetInfo
|
|
34
|
+
/** List the names of all available solar-system bodies for altitude/azimuth queries. */
|
|
35
|
+
export declare function listBodies(): Array<string>
|
|
36
|
+
/** A spherical direction (two angles in degrees) with a frame label. */
|
|
37
|
+
export interface SphericalDirection {
|
|
38
|
+
/** First angle in degrees (Dec / polar / altitude). */
|
|
39
|
+
polarDeg: number
|
|
40
|
+
/** Second angle in degrees (RA / azimuth / longitude). */
|
|
41
|
+
azimuthDeg: number
|
|
42
|
+
/** Reference frame name. */
|
|
43
|
+
frame: string
|
|
44
|
+
}
|
|
45
|
+
/** Cartesian ECEF coordinates in metres. */
|
|
46
|
+
export interface CartesianEcef {
|
|
47
|
+
/** X coordinate in metres. */
|
|
48
|
+
x: number
|
|
49
|
+
/** Y coordinate in metres. */
|
|
50
|
+
y: number
|
|
51
|
+
/** Z coordinate in metres. */
|
|
52
|
+
z: number
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Transform a spherical direction between celestial reference frames.
|
|
56
|
+
*
|
|
57
|
+
* Supported source and destination frames: `"ICRS"`, `"EclipticMeanJ2000"`,
|
|
58
|
+
* `"EquatorialMeanJ2000"`, `"EquatorialMeanOfDate"`, `"EquatorialTrueOfDate"`.
|
|
59
|
+
*
|
|
60
|
+
* @param polarDeg — Declination / polar angle in degrees.
|
|
61
|
+
* @param azimuthDeg — Right ascension / longitude in degrees.
|
|
62
|
+
* @param srcFrame — Source frame name.
|
|
63
|
+
* @param dstFrame — Destination frame name.
|
|
64
|
+
* @param jd — Julian Date (needed for of-date frames; use J2000 = 2451545.0 for epoch-independent frames).
|
|
65
|
+
*
|
|
66
|
+
* ```js
|
|
67
|
+
* const { transformDirection } = require('@siderust/siderust');
|
|
68
|
+
* const result = transformDirection(38.78, 279.23, 'EquatorialMeanJ2000', 'EclipticMeanJ2000', 2451545.0);
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare function transformDirection(polarDeg: number, azimuthDeg: number, srcFrame: string, dstFrame: string, jd: number): SphericalDirection
|
|
72
|
+
/**
|
|
73
|
+
* Transform a spherical direction to the local Horizontal frame.
|
|
74
|
+
*
|
|
75
|
+
* @returns `{ polarDeg, azimuthDeg, frame }` where polarDeg is altitude
|
|
76
|
+
* and azimuthDeg is azimuth (N=0° E=90°).
|
|
77
|
+
*/
|
|
78
|
+
export declare function directionToHorizontal(polarDeg: number, azimuthDeg: number, srcFrame: string, jd: number, observer: JsObserver): SphericalDirection
|
|
79
|
+
/**
|
|
80
|
+
* Convert a geodetic position (WGS84) to ECEF Cartesian coordinates.
|
|
81
|
+
*
|
|
82
|
+
* @param observer — Observer with lon/lat/height.
|
|
83
|
+
* @returns `{ x, y, z }` in metres.
|
|
84
|
+
*/
|
|
85
|
+
export declare function geodeticToEcef(observer: JsObserver): CartesianEcef
|
|
86
|
+
/**
|
|
87
|
+
* Compute the angular separation between two spherical directions (Vincenty formula).
|
|
88
|
+
*
|
|
89
|
+
* Both directions must be in the same reference frame.
|
|
90
|
+
*
|
|
91
|
+
* @param polar1Deg — Declination / polar angle of first direction in degrees.
|
|
92
|
+
* @param azimuth1Deg — RA / azimuth of first direction in degrees.
|
|
93
|
+
* @param polar2Deg — Declination / polar angle of second direction in degrees.
|
|
94
|
+
* @param azimuth2Deg — RA / azimuth of second direction in degrees.
|
|
95
|
+
* @param frame — Reference frame (both directions must share the same frame).
|
|
96
|
+
* @returns Angular separation in degrees.
|
|
97
|
+
*
|
|
98
|
+
* ```js
|
|
99
|
+
* const { angularSeparation } = require('@siderust/siderust');
|
|
100
|
+
* const sep = angularSeparation(89.26, 37.95, -16.72, 101.29, 'EquatorialMeanJ2000');
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare function angularSeparation(polar1Deg: number, azimuth1Deg: number, polar2Deg: number, azimuth2Deg: number, frame: string): number
|
|
104
|
+
/**
|
|
105
|
+
* Compute the Euclidean distance between two 3D Cartesian positions.
|
|
106
|
+
*
|
|
107
|
+
* The positions must be in the same frame and center. Units follow input.
|
|
108
|
+
*
|
|
109
|
+
* @returns Distance in the same units as the input coordinates.
|
|
110
|
+
*/
|
|
111
|
+
export declare function cartesianDistance(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number): number
|
|
112
|
+
/**
|
|
113
|
+
* Compute the magnitude (distance from origin) of a 3D Cartesian vector.
|
|
114
|
+
*
|
|
115
|
+
* @returns Distance from origin in the same units.
|
|
116
|
+
*/
|
|
117
|
+
export declare function cartesianMagnitude(x: number, y: number, z: number): number
|
|
118
|
+
/**
|
|
119
|
+
* Compute the dot product of two 3D Cartesian vectors.
|
|
120
|
+
*
|
|
121
|
+
* @returns The scalar dot product.
|
|
122
|
+
*/
|
|
123
|
+
export declare function dotProduct(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number): number
|
|
124
|
+
/**
|
|
125
|
+
* Convert a direction (unit vector) from spherical to Cartesian.
|
|
126
|
+
*
|
|
127
|
+
* @param polarDeg — Declination / polar angle in degrees.
|
|
128
|
+
* @param azimuthDeg — RA / azimuth in degrees.
|
|
129
|
+
* @returns `{ x, y, z }` unit vector.
|
|
130
|
+
*/
|
|
131
|
+
export declare function directionToCartesian(polarDeg: number, azimuthDeg: number): CartesianEcef
|
|
132
|
+
/** A 3D Cartesian position with frame and center metadata. */
|
|
133
|
+
export interface CartesianPosition {
|
|
134
|
+
/** X coordinate (AU for solar-system, km for Moon geocentric). */
|
|
135
|
+
x: number
|
|
136
|
+
/** Y coordinate. */
|
|
137
|
+
y: number
|
|
138
|
+
/** Z coordinate. */
|
|
139
|
+
z: number
|
|
140
|
+
/** Reference frame (e.g. `"EclipticMeanJ2000"`). */
|
|
141
|
+
frame: string
|
|
142
|
+
/** Reference center (e.g. `"Heliocentric"`, `"Barycentric"`, `"Geocentric"`). */
|
|
143
|
+
center: string
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Compute the heliocentric ecliptic position of a planet via VSOP87 (Series A).
|
|
147
|
+
*
|
|
148
|
+
* Returns Cartesian coordinates in AU, in the EclipticMeanJ2000 frame,
|
|
149
|
+
* centered on the Sun.
|
|
150
|
+
*
|
|
151
|
+
* @param body — Planet name: Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune.
|
|
152
|
+
* @param jd — Julian Date of the epoch.
|
|
153
|
+
*
|
|
154
|
+
* ```js
|
|
155
|
+
* const { vsop87Heliocentric } = require('@siderust/siderust');
|
|
156
|
+
* const mars = vsop87Heliocentric('Mars', 2451545.0);
|
|
157
|
+
* console.log(mars.x, mars.y, mars.z);
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
export declare function vsop87Heliocentric(body: string, jd: number): CartesianPosition
|
|
161
|
+
/**
|
|
162
|
+
* Compute the barycentric ecliptic position of a planet via VSOP87 (Series E).
|
|
163
|
+
*
|
|
164
|
+
* Returns Cartesian coordinates in AU, in the EclipticMeanJ2000 frame,
|
|
165
|
+
* centered on the solar-system barycentre.
|
|
166
|
+
*
|
|
167
|
+
* @param body — Planet name or `"Sun"`.
|
|
168
|
+
* @param jd — Julian Date of the epoch.
|
|
169
|
+
*/
|
|
170
|
+
export declare function vsop87Barycentric(body: string, jd: number): CartesianPosition
|
|
171
|
+
/**
|
|
172
|
+
* Get the Sun's barycentric position via VSOP87.
|
|
173
|
+
*
|
|
174
|
+
* @param jd — Julian Date.
|
|
175
|
+
* @returns Cartesian position in AU (EclipticMeanJ2000, Barycentric).
|
|
176
|
+
*/
|
|
177
|
+
export declare function vsop87SunBarycentric(jd: number): CartesianPosition
|
|
178
|
+
/**
|
|
179
|
+
* Get the Earth's barycentric position via VSOP87.
|
|
180
|
+
*
|
|
181
|
+
* @param jd — Julian Date.
|
|
182
|
+
* @returns Cartesian position in AU (EclipticMeanJ2000, Barycentric).
|
|
183
|
+
*/
|
|
184
|
+
export declare function vsop87EarthBarycentric(jd: number): CartesianPosition
|
|
185
|
+
/**
|
|
186
|
+
* Get the Earth's heliocentric position via VSOP87.
|
|
187
|
+
*
|
|
188
|
+
* @param jd — Julian Date.
|
|
189
|
+
* @returns Cartesian position in AU (EclipticMeanJ2000, Heliocentric).
|
|
190
|
+
*/
|
|
191
|
+
export declare function vsop87EarthHeliocentric(jd: number): CartesianPosition
|
|
192
|
+
/**
|
|
193
|
+
* Get the Moon's geocentric position via ELP2000.
|
|
194
|
+
*
|
|
195
|
+
* @param jd — Julian Date.
|
|
196
|
+
* @returns Cartesian position in **km** (EclipticMeanJ2000, Geocentric).
|
|
197
|
+
*/
|
|
198
|
+
export declare function vsop87MoonGeocentric(jd: number): CartesianPosition
|
|
199
|
+
/**
|
|
200
|
+
* Transform a Cartesian position from one reference center to another.
|
|
201
|
+
*
|
|
202
|
+
* Stays in the EclipticMeanJ2000 frame (the natural VSOP87 frame).
|
|
203
|
+
* Units are AU (except Geocentric Moon which is km).
|
|
204
|
+
*
|
|
205
|
+
* Supported center pairs: Heliocentric ↔ Geocentric, Heliocentric ↔ Barycentric,
|
|
206
|
+
* Geocentric ↔ Barycentric.
|
|
207
|
+
*
|
|
208
|
+
* @param x, y, z — Cartesian coordinates.
|
|
209
|
+
* @param srcCenter — Source center: `"Heliocentric"`, `"Barycentric"`, `"Geocentric"`.
|
|
210
|
+
* @param dstCenter — Destination center.
|
|
211
|
+
* @param jd — Julian Date.
|
|
212
|
+
*
|
|
213
|
+
* ```js
|
|
214
|
+
* const mars = vsop87Heliocentric('Mars', 2451545.0);
|
|
215
|
+
* const marsGeo = transformPositionCenter(mars.x, mars.y, mars.z, 'Heliocentric', 'Geocentric', 2451545.0);
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
export declare function transformPositionCenter(x: number, y: number, z: number, srcCenter: string, dstCenter: string, jd: number): CartesianPosition
|
|
219
|
+
/**
|
|
220
|
+
* Transform a Cartesian position between celestial reference frames.
|
|
221
|
+
*
|
|
222
|
+
* Stays in the same center. Coordinates are in AU.
|
|
223
|
+
*
|
|
224
|
+
* Supported frames: `"ICRS"`, `"EclipticMeanJ2000"`, `"EquatorialMeanJ2000"`.
|
|
225
|
+
*
|
|
226
|
+
* @param x, y, z — Cartesian coordinates in AU.
|
|
227
|
+
* @param srcFrame — Source frame name.
|
|
228
|
+
* @param dstFrame — Destination frame name.
|
|
229
|
+
* @param jd — Julian Date.
|
|
230
|
+
*/
|
|
231
|
+
export declare function transformPositionFrame(x: number, y: number, z: number, srcFrame: string, dstFrame: string, jd: number): CartesianPosition
|
|
232
|
+
/**
|
|
233
|
+
* Compute the orbital period of a named planet in days (Keplerian).
|
|
234
|
+
*
|
|
235
|
+
* @param name — Planet name.
|
|
236
|
+
* @returns Orbital period in days.
|
|
237
|
+
*/
|
|
238
|
+
export declare function orbitalPeriodDays(name: string): number
|
|
239
|
+
/** A threshold-crossing event (rise or set). */
|
|
240
|
+
export interface CrossingEvent {
|
|
241
|
+
/** Time of the crossing (Modified Julian Date). */
|
|
242
|
+
mjd: number
|
|
243
|
+
/** Direction: `"rising"` or `"setting"`. */
|
|
244
|
+
direction: string
|
|
245
|
+
}
|
|
246
|
+
/** A culmination event (local altitude extremum). */
|
|
247
|
+
export interface CulminationEvent {
|
|
248
|
+
/** Time of the culmination (Modified Julian Date). */
|
|
249
|
+
mjd: number
|
|
250
|
+
/** Altitude at the extremum in degrees. */
|
|
251
|
+
altitudeDeg: number
|
|
252
|
+
/** Kind: `"max"` (upper culmination) or `"min"` (lower culmination). */
|
|
253
|
+
kind: string
|
|
254
|
+
}
|
|
255
|
+
/** A time period (MJD interval). */
|
|
256
|
+
export interface MjdPeriod {
|
|
257
|
+
/** Start of the period (Modified Julian Date). */
|
|
258
|
+
startMjd: number
|
|
259
|
+
/** End of the period (Modified Julian Date). */
|
|
260
|
+
endMjd: number
|
|
261
|
+
}
|
|
262
|
+
/** An azimuth-crossing event. */
|
|
263
|
+
export interface AzimuthCrossingEvent {
|
|
264
|
+
/** Time of the event (Modified Julian Date). */
|
|
265
|
+
mjd: number
|
|
266
|
+
/** Crossing direction: `"rising"` or `"setting"`. */
|
|
267
|
+
direction: string
|
|
268
|
+
}
|
|
269
|
+
/** An azimuth extremum (local max or min bearing). */
|
|
270
|
+
export interface AzimuthExtremum {
|
|
271
|
+
/** Time of the extremum (Modified Julian Date). */
|
|
272
|
+
mjd: number
|
|
273
|
+
/** Azimuth at the extremum in degrees. */
|
|
274
|
+
azimuthDeg: number
|
|
275
|
+
/** Kind: `"max"` or `"min"`. */
|
|
276
|
+
kind: string
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Compute the altitude of a solar-system body at a single instant.
|
|
280
|
+
*
|
|
281
|
+
* @param body — Body name (e.g. `"Sun"`, `"Moon"`, `"Mars"`).
|
|
282
|
+
* @param observer — Observer location.
|
|
283
|
+
* @param mjd — Modified Julian Date of the instant.
|
|
284
|
+
* @returns Altitude in degrees.
|
|
285
|
+
*
|
|
286
|
+
* ```js
|
|
287
|
+
* const { Observer, bodyAltitudeAt } = require('@siderust/siderust');
|
|
288
|
+
* const obs = Observer.roqueDeLasMuchachos();
|
|
289
|
+
* const alt = bodyAltitudeAt('Sun', obs, 60000.0);
|
|
290
|
+
* ```
|
|
291
|
+
*/
|
|
292
|
+
export declare function bodyAltitudeAt(body: string, observer: JsObserver, mjd: number): number
|
|
293
|
+
/**
|
|
294
|
+
* Compute the azimuth of a solar-system body at a single instant.
|
|
295
|
+
*
|
|
296
|
+
* @returns Azimuth in degrees (north = 0°, east = 90°).
|
|
297
|
+
*/
|
|
298
|
+
export declare function bodyAzimuthAt(body: string, observer: JsObserver, mjd: number): number
|
|
299
|
+
/**
|
|
300
|
+
* Find threshold-crossing events (rise/set) for a solar-system body.
|
|
301
|
+
*
|
|
302
|
+
* @param body — Body name.
|
|
303
|
+
* @param observer — Observer location.
|
|
304
|
+
* @param startMjd — Window start (MJD).
|
|
305
|
+
* @param endMjd — Window end (MJD).
|
|
306
|
+
* @param thresholdDeg — Altitude threshold in degrees (e.g. 0 for horizon).
|
|
307
|
+
* @returns Array of crossing events `{ mjd, direction }`.
|
|
308
|
+
*/
|
|
309
|
+
export declare function bodyCrossings(body: string, observer: JsObserver, startMjd: number, endMjd: number, thresholdDeg: number): Array<CrossingEvent>
|
|
310
|
+
/**
|
|
311
|
+
* Find culmination events (altitude local extrema) for a solar-system body.
|
|
312
|
+
*
|
|
313
|
+
* @returns Array of culmination events `{ mjd, altitudeDeg, kind }`.
|
|
314
|
+
*/
|
|
315
|
+
export declare function bodyCulminations(body: string, observer: JsObserver, startMjd: number, endMjd: number): Array<CulminationEvent>
|
|
316
|
+
/**
|
|
317
|
+
* Find periods where a body's altitude is above a threshold.
|
|
318
|
+
*
|
|
319
|
+
* @returns Array of MJD periods `{ startMjd, endMjd }`.
|
|
320
|
+
*/
|
|
321
|
+
export declare function bodyAboveThreshold(body: string, observer: JsObserver, startMjd: number, endMjd: number, thresholdDeg: number): Array<MjdPeriod>
|
|
322
|
+
/**
|
|
323
|
+
* Find periods where a body's altitude is below a threshold.
|
|
324
|
+
*
|
|
325
|
+
* @returns Array of MJD periods `{ startMjd, endMjd }`.
|
|
326
|
+
*/
|
|
327
|
+
export declare function bodyBelowThreshold(body: string, observer: JsObserver, startMjd: number, endMjd: number, thresholdDeg: number): Array<MjdPeriod>
|
|
328
|
+
/**
|
|
329
|
+
* Find azimuth-crossing events for a body.
|
|
330
|
+
*
|
|
331
|
+
* @param bearingDeg — Target azimuth bearing in degrees.
|
|
332
|
+
* @returns Array of azimuth crossing events `{ mjd, direction }`.
|
|
333
|
+
*/
|
|
334
|
+
export declare function bodyAzimuthCrossings(body: string, observer: JsObserver, startMjd: number, endMjd: number, bearingDeg: number): Array<AzimuthCrossingEvent>
|
|
335
|
+
/**
|
|
336
|
+
* Find azimuth extrema (max/min bearing) for a body.
|
|
337
|
+
*
|
|
338
|
+
* @returns Array of azimuth extrema `{ mjd, azimuthDeg, kind }`.
|
|
339
|
+
*/
|
|
340
|
+
export declare function bodyAzimuthExtrema(body: string, observer: JsObserver, startMjd: number, endMjd: number): Array<AzimuthExtremum>
|
|
341
|
+
/**
|
|
342
|
+
* Compute the altitude of a catalog or custom star at a single instant.
|
|
343
|
+
*
|
|
344
|
+
* @returns Altitude in degrees.
|
|
345
|
+
*/
|
|
346
|
+
export declare function starAltitudeAt(star: JsStar, observer: JsObserver, mjd: number): number
|
|
347
|
+
/**
|
|
348
|
+
* Compute the azimuth of a star at a single instant.
|
|
349
|
+
*
|
|
350
|
+
* @returns Azimuth in degrees.
|
|
351
|
+
*/
|
|
352
|
+
export declare function starAzimuthAt(star: JsStar, observer: JsObserver, mjd: number): number
|
|
353
|
+
/** Find threshold-crossing events for a star. */
|
|
354
|
+
export declare function starCrossings(star: JsStar, observer: JsObserver, startMjd: number, endMjd: number, thresholdDeg: number): Array<CrossingEvent>
|
|
355
|
+
/** Find culmination events for a star. */
|
|
356
|
+
export declare function starCulminations(star: JsStar, observer: JsObserver, startMjd: number, endMjd: number): Array<CulminationEvent>
|
|
357
|
+
/** Find periods where a star's altitude is above a threshold. */
|
|
358
|
+
export declare function starAboveThreshold(star: JsStar, observer: JsObserver, startMjd: number, endMjd: number, thresholdDeg: number): Array<MjdPeriod>
|
|
359
|
+
/** Find periods where a star's altitude is below a threshold. */
|
|
360
|
+
export declare function starBelowThreshold(star: JsStar, observer: JsObserver, startMjd: number, endMjd: number, thresholdDeg: number): Array<MjdPeriod>
|
|
361
|
+
/**
|
|
362
|
+
* Find azimuth-crossing events for a star.
|
|
363
|
+
*
|
|
364
|
+
* @param bearingDeg — Target azimuth bearing in degrees.
|
|
365
|
+
* @returns Array of azimuth crossing events `{ mjd, direction }`.
|
|
366
|
+
*/
|
|
367
|
+
export declare function starAzimuthCrossings(star: JsStar, observer: JsObserver, startMjd: number, endMjd: number, bearingDeg: number): Array<AzimuthCrossingEvent>
|
|
368
|
+
/**
|
|
369
|
+
* Find azimuth extrema (max/min bearing) for a star.
|
|
370
|
+
*
|
|
371
|
+
* @returns Array of azimuth extrema `{ mjd, azimuthDeg, kind }`.
|
|
372
|
+
*/
|
|
373
|
+
export declare function starAzimuthExtrema(star: JsStar, observer: JsObserver, startMjd: number, endMjd: number): Array<AzimuthExtremum>
|
|
374
|
+
/**
|
|
375
|
+
* Intersect two lists of MJD periods, returning only overlapping intervals.
|
|
376
|
+
*
|
|
377
|
+
* This is useful for combining altitude and azimuth constraints, or
|
|
378
|
+
* combining target visibility with astronomical night periods.
|
|
379
|
+
*
|
|
380
|
+
* @param periods1 — First list of MJD periods.
|
|
381
|
+
* @param periods2 — Second list of MJD periods.
|
|
382
|
+
* @returns Array of MJD periods representing the intersection.
|
|
383
|
+
*
|
|
384
|
+
* ```js
|
|
385
|
+
* const altPeriods = starAboveThreshold(star, obs, mjd0, mjd1, 25);
|
|
386
|
+
* const azPeriods = bodyAboveThreshold('Sun', obs, mjd0, mjd1, -18); // dark sky
|
|
387
|
+
* const observable = intersectPeriods(altPeriods, azPeriods);
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
390
|
+
export declare function intersectPeriods(periods1: Array<MjdPeriod>, periods2: Array<MjdPeriod>): Array<MjdPeriod>
|
|
391
|
+
/** Moon phase geometry at a single instant. */
|
|
392
|
+
export interface MoonPhase {
|
|
393
|
+
/** Phase angle in degrees (Sun-Moon-Earth/observer angle). */
|
|
394
|
+
phaseAngleDeg: number
|
|
395
|
+
/** Fraction of the disk illuminated [0, 1]. */
|
|
396
|
+
illuminatedFraction: number
|
|
397
|
+
/** Elongation in degrees (eastward from the Sun). */
|
|
398
|
+
elongationDeg: number
|
|
399
|
+
/** Whether the Moon is waxing. */
|
|
400
|
+
waxing: boolean
|
|
401
|
+
/** Named phase label (e.g. `"FullMoon"`, `"WaxingCrescent"`). */
|
|
402
|
+
label: string
|
|
403
|
+
}
|
|
404
|
+
/** A principal lunar phase event (New Moon, First Quarter, Full Moon, Last Quarter). */
|
|
405
|
+
export interface PhaseEvent {
|
|
406
|
+
/** Time of the event (Modified Julian Date). */
|
|
407
|
+
mjd: number
|
|
408
|
+
/** Phase kind: `"NewMoon"`, `"FirstQuarter"`, `"FullMoon"`, `"LastQuarter"`. */
|
|
409
|
+
kind: string
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Compute geocentric Moon phase geometry at a Julian Date.
|
|
413
|
+
*
|
|
414
|
+
* @param jd — Julian Date.
|
|
415
|
+
* @returns Phase geometry including illumination, elongation, and named label.
|
|
416
|
+
*
|
|
417
|
+
* ```js
|
|
418
|
+
* const { moonPhase } = require('@siderust/siderust');
|
|
419
|
+
* const phase = moonPhase(2451545.0);
|
|
420
|
+
* console.log(phase.label, phase.illuminatedFraction);
|
|
421
|
+
* ```
|
|
422
|
+
*/
|
|
423
|
+
export declare function moonPhase(jd: number): MoonPhase
|
|
424
|
+
/**
|
|
425
|
+
* Compute topocentric Moon phase geometry at a Julian Date for an observer.
|
|
426
|
+
*
|
|
427
|
+
* @param jd — Julian Date.
|
|
428
|
+
* @param observer — Observer location on Earth.
|
|
429
|
+
*/
|
|
430
|
+
export declare function moonPhaseTopocentric(jd: number, observer: Observer): MoonPhase
|
|
431
|
+
/**
|
|
432
|
+
* Find all principal lunar phase events in a time window.
|
|
433
|
+
*
|
|
434
|
+
* @param startMjd — Window start (MJD).
|
|
435
|
+
* @param endMjd — Window end (MJD).
|
|
436
|
+
* @returns Sorted array of `{ mjd, kind }` events.
|
|
437
|
+
*
|
|
438
|
+
* ```js
|
|
439
|
+
* const { findPhaseEvents } = require('@siderust/siderust');
|
|
440
|
+
* const events = findPhaseEvents(60000.0, 60030.0); // ~1 month
|
|
441
|
+
* events.forEach(e => console.log(e.kind, e.mjd));
|
|
442
|
+
* ```
|
|
443
|
+
*/
|
|
444
|
+
export declare function findPhaseEvents(startMjd: number, endMjd: number): Array<PhaseEvent>
|
|
445
|
+
/**
|
|
446
|
+
* Find periods where geocentric Moon illumination is above `kMin` ∈ [0, 1].
|
|
447
|
+
*
|
|
448
|
+
* @param startMjd — Window start (MJD).
|
|
449
|
+
* @param endMjd — Window end (MJD).
|
|
450
|
+
* @param kMin — Minimum illumination fraction.
|
|
451
|
+
* @returns Array of MJD periods.
|
|
452
|
+
*/
|
|
453
|
+
export declare function moonIlluminationAbove(startMjd: number, endMjd: number, kMin: number): Array<MjdPeriod>
|
|
454
|
+
/** Find periods where geocentric Moon illumination is below `kMax` ∈ [0, 1]. */
|
|
455
|
+
export declare function moonIlluminationBelow(startMjd: number, endMjd: number, kMax: number): Array<MjdPeriod>
|
|
456
|
+
/** Find periods where geocentric Moon illumination is in `[kMin, kMax]`. */
|
|
457
|
+
export declare function moonIlluminationRange(startMjd: number, endMjd: number, kMin: number, kMax: number): Array<MjdPeriod>
|
|
458
|
+
/** List all catalog star names. */
|
|
459
|
+
export declare function listCatalogStars(): Array<string>
|
|
460
|
+
/** Return the siderust-node version string. */
|
|
461
|
+
export declare function version(): string
|
|
462
|
+
export type JsObserver = Observer
|
|
463
|
+
/**
|
|
464
|
+
* A geodetic observer location on the Earth's surface (WGS84 ellipsoid).
|
|
465
|
+
*
|
|
466
|
+
* Used as the reference site for all topocentric computations: altitude,
|
|
467
|
+
* azimuth, crossings, culminations, and coordinate transforms to the
|
|
468
|
+
* Horizontal frame.
|
|
469
|
+
*
|
|
470
|
+
* ```js
|
|
471
|
+
* const { Observer } = require('@siderust/siderust');
|
|
472
|
+
*
|
|
473
|
+
* // Custom site
|
|
474
|
+
* const obs = new Observer(-17.8925, 28.7543, 2396);
|
|
475
|
+
*
|
|
476
|
+
* // Preset observatory
|
|
477
|
+
* const orm = Observer.roqueDeLasMuchachos();
|
|
478
|
+
* ```
|
|
479
|
+
*/
|
|
480
|
+
export declare class Observer {
|
|
481
|
+
/**
|
|
482
|
+
* Create an observer at a geodetic position.
|
|
483
|
+
*
|
|
484
|
+
* @param lonDeg — Longitude in degrees (east positive).
|
|
485
|
+
* @param latDeg — Latitude in degrees (north positive).
|
|
486
|
+
* @param heightM — Height above WGS84 ellipsoid in metres.
|
|
487
|
+
*/
|
|
488
|
+
constructor(lonDeg: number, latDeg: number, heightM: number)
|
|
489
|
+
/**
|
|
490
|
+
* Roque de los Muchachos Observatory (La Palma, Spain).
|
|
491
|
+
*
|
|
492
|
+
* Longitude −17.8925°, Latitude +28.7543°, Altitude 2396 m.
|
|
493
|
+
*/
|
|
494
|
+
static roqueDeLasMuchachos(): JsObserver
|
|
495
|
+
/**
|
|
496
|
+
* Paranal Observatory (ESO, Chile).
|
|
497
|
+
*
|
|
498
|
+
* Longitude −70.4043°, Latitude −24.6272°, Altitude 2635 m.
|
|
499
|
+
*/
|
|
500
|
+
static elParanal(): JsObserver
|
|
501
|
+
/**
|
|
502
|
+
* Mauna Kea Observatory (Hawaiʻi, USA).
|
|
503
|
+
*
|
|
504
|
+
* Longitude −155.4681°, Latitude +19.8207°, Altitude 4207 m.
|
|
505
|
+
*/
|
|
506
|
+
static maunaKea(): JsObserver
|
|
507
|
+
/**
|
|
508
|
+
* La Silla Observatory (ESO, Chile).
|
|
509
|
+
*
|
|
510
|
+
* Longitude −70.7346°, Latitude −29.2584°, Altitude 2400 m.
|
|
511
|
+
*/
|
|
512
|
+
static laSilla(): JsObserver
|
|
513
|
+
/** Longitude in degrees (east positive). */
|
|
514
|
+
get lonDeg(): number
|
|
515
|
+
/** Latitude in degrees (north positive). */
|
|
516
|
+
get latDeg(): number
|
|
517
|
+
/** Height above the WGS84 ellipsoid in metres. */
|
|
518
|
+
get heightM(): number
|
|
519
|
+
/** Human-readable string representation. */
|
|
520
|
+
format(): string
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* A 3D cartesian position with frame, center, and unit metadata.
|
|
524
|
+
*
|
|
525
|
+
* This mirrors the Python `Position` type for API parity.
|
|
526
|
+
*/
|
|
527
|
+
export declare class Position {
|
|
528
|
+
/** Create a new position with explicit coordinates, frame, center, and unit. */
|
|
529
|
+
constructor(x: number, y: number, z: number, frame: string, center: string, unit: string)
|
|
530
|
+
/** X coordinate. */
|
|
531
|
+
get x(): number
|
|
532
|
+
/** Y coordinate. */
|
|
533
|
+
get y(): number
|
|
534
|
+
/** Z coordinate. */
|
|
535
|
+
get z(): number
|
|
536
|
+
/** Reference frame (e.g., "EclipticMeanJ2000", "ICRS"). */
|
|
537
|
+
get frame(): string
|
|
538
|
+
/** Coordinate center (e.g., "Barycentric", "Heliocentric", "Geocentric"). */
|
|
539
|
+
get center(): string
|
|
540
|
+
/** Distance unit ("au" or "km"). */
|
|
541
|
+
get unit(): string
|
|
542
|
+
/** Euclidean distance from origin. */
|
|
543
|
+
magnitude(): number
|
|
544
|
+
/** Subtract another position to get a displacement vector. */
|
|
545
|
+
subtract(other: Position): Displacement
|
|
546
|
+
/** Add a displacement to get a new position. */
|
|
547
|
+
addDisplacement(d: Displacement): Position
|
|
548
|
+
}
|
|
549
|
+
/** A displacement vector (difference between two positions). */
|
|
550
|
+
export declare class Displacement {
|
|
551
|
+
/** Create a new displacement. */
|
|
552
|
+
constructor(dx: number, dy: number, dz: number, frame: string, unit: string)
|
|
553
|
+
/** X component of displacement. */
|
|
554
|
+
get dx(): number
|
|
555
|
+
/** Y component of displacement. */
|
|
556
|
+
get dy(): number
|
|
557
|
+
/** Z component of displacement. */
|
|
558
|
+
get dz(): number
|
|
559
|
+
/** Reference frame. */
|
|
560
|
+
get frame(): string
|
|
561
|
+
/** Distance unit. */
|
|
562
|
+
get unit(): string
|
|
563
|
+
/** Euclidean magnitude. */
|
|
564
|
+
magnitude(): number
|
|
565
|
+
/** Scale displacement by a factor. */
|
|
566
|
+
scale(factor: number): Displacement
|
|
567
|
+
/** Add another displacement. */
|
|
568
|
+
add(other: Displacement): Displacement
|
|
569
|
+
}
|
|
570
|
+
export type JsStar = Star
|
|
571
|
+
/**
|
|
572
|
+
* A star with physical parameters and sky coordinates.
|
|
573
|
+
*
|
|
574
|
+
* Use the factory methods to look up well-known stars from the built-in
|
|
575
|
+
* catalog, or the constructor to define custom stars.
|
|
576
|
+
*
|
|
577
|
+
* ```js
|
|
578
|
+
* const { Star } = require('@siderust/siderust');
|
|
579
|
+
*
|
|
580
|
+
* // Catalog look-up
|
|
581
|
+
* const vega = Star.catalog('Vega');
|
|
582
|
+
*
|
|
583
|
+
* // Custom star
|
|
584
|
+
* const custom = new Star('MyStar', 100, 1.5, 1.2, 3.0, 200.0, 45.0);
|
|
585
|
+
* ```
|
|
586
|
+
*/
|
|
587
|
+
export declare class Star {
|
|
588
|
+
/**
|
|
589
|
+
* Create a custom star.
|
|
590
|
+
*
|
|
591
|
+
* @param name — Display name.
|
|
592
|
+
* @param distanceLy — Distance in light-years.
|
|
593
|
+
* @param massSolar — Mass in solar masses (M☉).
|
|
594
|
+
* @param radiusSolar — Radius in solar radii (R☉).
|
|
595
|
+
* @param luminositySolar — Luminosity in solar luminosities (L☉).
|
|
596
|
+
* @param raDeg — Right ascension at J2000.0 in degrees.
|
|
597
|
+
* @param decDeg — Declination at J2000.0 in degrees.
|
|
598
|
+
*/
|
|
599
|
+
constructor(name: string, distanceLy: number, massSolar: number, radiusSolar: number, luminositySolar: number, raDeg: number, decDeg: number)
|
|
600
|
+
/**
|
|
601
|
+
* Look up a star from the built-in catalog by name.
|
|
602
|
+
*
|
|
603
|
+
* Supported names (case-insensitive): Vega, Sirius, Polaris, Canopus,
|
|
604
|
+
* Arcturus, Rigel, Betelgeuse, Procyon, Aldebaran, Altair.
|
|
605
|
+
*/
|
|
606
|
+
static catalog(name: string): JsStar
|
|
607
|
+
/** Star name. */
|
|
608
|
+
get name(): string
|
|
609
|
+
/** Distance in light-years. */
|
|
610
|
+
get distanceLy(): number
|
|
611
|
+
/** Mass in solar masses (M☉). */
|
|
612
|
+
get massSolar(): number
|
|
613
|
+
/** Radius in solar radii (R☉). */
|
|
614
|
+
get radiusSolar(): number
|
|
615
|
+
/** Luminosity in solar luminosities (L☉). */
|
|
616
|
+
get luminositySolar(): number
|
|
617
|
+
/** Right ascension at J2000.0 in degrees. */
|
|
618
|
+
get raDeg(): number
|
|
619
|
+
/** Declination at J2000.0 in degrees. */
|
|
620
|
+
get decDeg(): number
|
|
621
|
+
/** Human-readable representation. */
|
|
622
|
+
format(): string
|
|
623
|
+
}
|