sweph 2.10.3-6 → 2.10.3-7
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/README.md +2 -2
- package/index.d.ts +147 -128
- package/index.mjs +1 -0
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/sweph.node +0 -0
- package/prebuilds/linux-arm64/sweph.node +0 -0
- package/prebuilds/linux-x64/sweph.node +0 -0
- package/prebuilds/win32-x64/sweph.node +0 -0
- package/src/functions/fixstar.cpp +1 -1
- package/src/functions/fixstar2.cpp +1 -1
- package/src/functions/fixstar2_ut.cpp +1 -1
- package/src/functions/fixstar_ut.cpp +1 -1
- package/src/functions/helio_cross.cpp +1 -1
- package/src/functions/helio_cross_ut.cpp +1 -1
- package/src/functions/lun_occult_when_loc.cpp +2 -2
- package/src/functions/pheno.cpp +1 -1
- package/src/functions/pheno_ut.cpp +1 -1
- package/src/functions/set_interpolate_nut.cpp +14 -0
- package/src/functions/sol_eclipse_how.cpp +1 -1
- package/src/functions/sol_eclipse_when_glob.cpp +1 -1
- package/src/functions/sol_eclipse_when_loc.cpp +1 -1
- package/src/functions/sol_eclipse_where.cpp +1 -1
- package/src/functions/vis_limit_mag.cpp +1 -1
- package/src/sweph.cpp +1 -0
- package/src/sweph.h +1 -0
package/README.md
CHANGED
|
@@ -38,8 +38,8 @@ This library is version locked to the Swiss Ephemeris in addition to its own rev
|
|
|
38
38
|
|
|
39
39
|
Updates to this library will be released under new revisions, while updates to Swiss Ephemeris will be released under matching SemVer versions.
|
|
40
40
|
|
|
41
|
-
**Current Version: 2.10.3-
|
|
42
|
-
**Equivalent to Swiss Ephemeris version: 2.10.03 revision
|
|
41
|
+
**Current Version: 2.10.3-7**
|
|
42
|
+
**Equivalent to Swiss Ephemeris version: 2.10.03 revision 7**
|
|
43
43
|
|
|
44
44
|
## Documentation
|
|
45
45
|
|
package/index.d.ts
CHANGED
|
@@ -898,7 +898,7 @@ declare module "sweph" {
|
|
|
898
898
|
/**
|
|
899
899
|
* First time object is visible:number, according to VR in JD
|
|
900
900
|
*/
|
|
901
|
-
|
|
901
|
+
TfirstVR: number,
|
|
902
902
|
/**
|
|
903
903
|
* optimum time the object is visible:number, according to VR in JD
|
|
904
904
|
*/
|
|
@@ -1118,15 +1118,15 @@ declare module "sweph" {
|
|
|
1118
1118
|
*/
|
|
1119
1119
|
equasc: number,
|
|
1120
1120
|
/**
|
|
1121
|
-
* Longitude of
|
|
1121
|
+
* Longitude of the Co-ascendant (W. Koch)
|
|
1122
1122
|
*/
|
|
1123
1123
|
coasc1: number,
|
|
1124
1124
|
/**
|
|
1125
|
-
* Longitude of
|
|
1125
|
+
* Longitude of the Co-ascendant (M. Munkasey)
|
|
1126
1126
|
*/
|
|
1127
1127
|
coasc2: number,
|
|
1128
1128
|
/**
|
|
1129
|
-
* Longitude of
|
|
1129
|
+
* Longitude of the Polar Ascendant (M. Munkasey)
|
|
1130
1130
|
*/
|
|
1131
1131
|
polasc: number
|
|
1132
1132
|
]
|
|
@@ -1204,15 +1204,15 @@ declare module "sweph" {
|
|
|
1204
1204
|
*/
|
|
1205
1205
|
equasc_speed: number,
|
|
1206
1206
|
/**
|
|
1207
|
-
* Momentary speed of
|
|
1207
|
+
* Momentary speed of the Co-ascendant (W. Koch)
|
|
1208
1208
|
*/
|
|
1209
1209
|
coasc1_speed: number,
|
|
1210
1210
|
/**
|
|
1211
|
-
* Momentary speed of
|
|
1211
|
+
* Momentary speed of the Co-ascendant (M. Munkasey)
|
|
1212
1212
|
*/
|
|
1213
1213
|
coasc2_speed: number,
|
|
1214
1214
|
/**
|
|
1215
|
-
* Momentary speed of
|
|
1215
|
+
* Momentary speed of the Polar Ascendant (M. Munkasey)
|
|
1216
1216
|
*/
|
|
1217
1217
|
polasc_speed: number
|
|
1218
1218
|
]
|
|
@@ -1734,7 +1734,11 @@ declare module "sweph" {
|
|
|
1734
1734
|
/**
|
|
1735
1735
|
* Apparent magnitude
|
|
1736
1736
|
*/
|
|
1737
|
-
magnitude: number
|
|
1737
|
+
magnitude: number,
|
|
1738
|
+
/**
|
|
1739
|
+
* Geocentric horizontal parallax (Moon only)
|
|
1740
|
+
*/
|
|
1741
|
+
parallax: number
|
|
1738
1742
|
]
|
|
1739
1743
|
|
|
1740
1744
|
export type RefracExtendedData = [
|
|
@@ -2098,13 +2102,13 @@ declare module "sweph" {
|
|
|
2098
2102
|
* ```
|
|
2099
2103
|
* string
|
|
2100
2104
|
* ```
|
|
2101
|
-
* ### Example
|
|
2102
|
-
* ```
|
|
2103
|
-
* const time = cs2timestr(2345464, ":", true); // "06:30:55"
|
|
2104
|
-
* ```
|
|
2105
|
-
*
|
|
2106
|
-
*/
|
|
2107
|
-
export function cs2timestr(csec: number, sep: string, suppresszero: boolean): string;
|
|
2105
|
+
* ### Example
|
|
2106
|
+
* ```
|
|
2107
|
+
* const time = cs2timestr(2345464, ":", true); // "06:30:55"
|
|
2108
|
+
* ```
|
|
2109
|
+
*
|
|
2110
|
+
*/
|
|
2111
|
+
export function cs2timestr(csec: number, sep: string, suppresszero: boolean): string;
|
|
2108
2112
|
|
|
2109
2113
|
/**
|
|
2110
2114
|
* ### Description
|
|
@@ -2242,16 +2246,16 @@ declare module "sweph" {
|
|
|
2242
2246
|
* Object {
|
|
2243
2247
|
* error: string // Warning message if any
|
|
2244
2248
|
* data: number // Delta T value
|
|
2245
|
-
* }
|
|
2246
|
-
* ```
|
|
2247
|
-
* ### Example
|
|
2248
|
-
* ```
|
|
2249
|
-
* const result = deltat_ex(2431232, constants.SEFLG_MOSEPH);
|
|
2250
|
-
* console.log(result.data); // 0.0003093125751840641
|
|
2251
|
-
* ```
|
|
2252
|
-
*
|
|
2253
|
-
*/
|
|
2254
|
-
export function deltat_ex(tjd: number, ephe: number): DeltaT;
|
|
2249
|
+
* }
|
|
2250
|
+
* ```
|
|
2251
|
+
* ### Example
|
|
2252
|
+
* ```
|
|
2253
|
+
* const result = deltat_ex(2431232, constants.SEFLG_MOSEPH);
|
|
2254
|
+
* console.log(result.data); // 0.0003093125751840641
|
|
2255
|
+
* ```
|
|
2256
|
+
*
|
|
2257
|
+
*/
|
|
2258
|
+
export function deltat_ex(tjd: number, ephe: number): DeltaT;
|
|
2255
2259
|
|
|
2256
2260
|
/**
|
|
2257
2261
|
* ### Description
|
|
@@ -2262,15 +2266,15 @@ declare module "sweph" {
|
|
|
2262
2266
|
* ```
|
|
2263
2267
|
* ### Returns
|
|
2264
2268
|
* ```
|
|
2265
|
-
* number // Delta T value
|
|
2266
|
-
* ```
|
|
2267
|
-
* ### Example
|
|
2268
|
-
* ```
|
|
2269
|
-
* const deltaT = deltat(2431232); // 0.0003093386847061279
|
|
2270
|
-
* ```
|
|
2271
|
-
*
|
|
2272
|
-
*/
|
|
2273
|
-
export function deltat(tjd: number): number;
|
|
2269
|
+
* number // Delta T value
|
|
2270
|
+
* ```
|
|
2271
|
+
* ### Example
|
|
2272
|
+
* ```
|
|
2273
|
+
* const deltaT = deltat(2431232); // 0.0003093386847061279
|
|
2274
|
+
* ```
|
|
2275
|
+
*
|
|
2276
|
+
*/
|
|
2277
|
+
export function deltat(tjd: number): number;
|
|
2274
2278
|
|
|
2275
2279
|
/**
|
|
2276
2280
|
* ### Description
|
|
@@ -2352,9 +2356,9 @@ declare module "sweph" {
|
|
|
2352
2356
|
*/
|
|
2353
2357
|
export function difrad2n(rad1: number, rad2: number): number;
|
|
2354
2358
|
|
|
2355
|
-
/**
|
|
2356
|
-
* ### Description
|
|
2357
|
-
* Midpoint between two points in degrees
|
|
2359
|
+
/**
|
|
2360
|
+
* ### Description
|
|
2361
|
+
* Midpoint between two points in degrees
|
|
2358
2362
|
* ### Params
|
|
2359
2363
|
* ```
|
|
2360
2364
|
* • deg1: number // First point in degrees
|
|
@@ -2368,33 +2372,33 @@ declare module "sweph" {
|
|
|
2368
2372
|
* ```
|
|
2369
2373
|
* const mid = deg_midp(10, 350); // 0
|
|
2370
2374
|
* ```
|
|
2371
|
-
*
|
|
2372
|
-
*/
|
|
2373
|
-
export function deg_midp(deg1: number, deg2: number): number;
|
|
2374
|
-
|
|
2375
|
-
/**
|
|
2376
|
-
* ### Description
|
|
2377
|
-
* Midpoint between two points in radians
|
|
2378
|
-
* ### Params
|
|
2379
|
-
* ```
|
|
2380
|
-
* • rad1: number // First point in radians
|
|
2381
|
-
* • rad2: number // Second point in radians
|
|
2382
|
-
* ```
|
|
2383
|
-
* ### Returns
|
|
2384
|
-
* ```
|
|
2385
|
-
* number // Midpoint in radians
|
|
2386
|
-
* ```
|
|
2387
|
-
* ### Example
|
|
2388
|
-
* ```
|
|
2389
|
-
* const mid = rad_midp(0.1, 6.2); // 0.00840734641020724
|
|
2390
|
-
* ```
|
|
2391
|
-
*
|
|
2392
|
-
*/
|
|
2393
|
-
export function rad_midp(rad1: number, rad2: number): number;
|
|
2394
|
-
|
|
2395
|
-
/**
|
|
2396
|
-
* ### Description
|
|
2397
|
-
* Arc distance between two points in degrees in a single direction
|
|
2375
|
+
*
|
|
2376
|
+
*/
|
|
2377
|
+
export function deg_midp(deg1: number, deg2: number): number;
|
|
2378
|
+
|
|
2379
|
+
/**
|
|
2380
|
+
* ### Description
|
|
2381
|
+
* Midpoint between two points in radians
|
|
2382
|
+
* ### Params
|
|
2383
|
+
* ```
|
|
2384
|
+
* • rad1: number // First point in radians
|
|
2385
|
+
* • rad2: number // Second point in radians
|
|
2386
|
+
* ```
|
|
2387
|
+
* ### Returns
|
|
2388
|
+
* ```
|
|
2389
|
+
* number // Midpoint in radians
|
|
2390
|
+
* ```
|
|
2391
|
+
* ### Example
|
|
2392
|
+
* ```
|
|
2393
|
+
* const mid = rad_midp(0.1, 6.2); // 0.00840734641020724
|
|
2394
|
+
* ```
|
|
2395
|
+
*
|
|
2396
|
+
*/
|
|
2397
|
+
export function rad_midp(rad1: number, rad2: number): number;
|
|
2398
|
+
|
|
2399
|
+
/**
|
|
2400
|
+
* ### Description
|
|
2401
|
+
* Arc distance between two points in degrees in a single direction
|
|
2398
2402
|
* ### Params
|
|
2399
2403
|
* ```
|
|
2400
2404
|
* • deg1: number // First point in degrees
|
|
@@ -2426,15 +2430,15 @@ declare module "sweph" {
|
|
|
2426
2430
|
* error: string, // Error message in case of ERR
|
|
2427
2431
|
* name: string, // The name of the matched star from the sefstars.txt file
|
|
2428
2432
|
* data: number // The star's magnitude value
|
|
2429
|
-
* }
|
|
2430
|
-
* ```
|
|
2431
|
-
* ### Example
|
|
2432
|
-
* ```
|
|
2433
|
-
* const result = fixstar_mag("Aldebaran");
|
|
2434
|
-
* if(result.flag !== constants.OK) { throw new Error(result.error); }
|
|
2435
|
-
* console.log(`
|
|
2436
|
-
* Star: ${result.name}
|
|
2437
|
-
* Magnitude: ${result.data}
|
|
2433
|
+
* }
|
|
2434
|
+
* ```
|
|
2435
|
+
* ### Example
|
|
2436
|
+
* ```
|
|
2437
|
+
* const result = fixstar_mag("Aldebaran");
|
|
2438
|
+
* if(result.flag !== constants.OK) { throw new Error(result.error); }
|
|
2439
|
+
* console.log(`
|
|
2440
|
+
* Star: ${result.name}
|
|
2441
|
+
* Magnitude: ${result.data}
|
|
2438
2442
|
* `)
|
|
2439
2443
|
* ```
|
|
2440
2444
|
*
|
|
@@ -2535,15 +2539,15 @@ declare module "sweph" {
|
|
|
2535
2539
|
* error: string, // Error message in case of ERR
|
|
2536
2540
|
* name: string, // The name of the matched star from the sefstars.txt file
|
|
2537
2541
|
* data: number // The star's magnitude value
|
|
2538
|
-
* }
|
|
2539
|
-
* ```
|
|
2540
|
-
* ### Example
|
|
2541
|
-
* ```
|
|
2542
|
-
* const result = fixstar2_mag("Aldebaran");
|
|
2543
|
-
* if(result.flag !== constants.OK) { throw new Error(result.error); }
|
|
2544
|
-
* console.log(`
|
|
2545
|
-
* Star: ${result.name}
|
|
2546
|
-
* Magnitude: ${result.data}
|
|
2542
|
+
* }
|
|
2543
|
+
* ```
|
|
2544
|
+
* ### Example
|
|
2545
|
+
* ```
|
|
2546
|
+
* const result = fixstar2_mag("Aldebaran");
|
|
2547
|
+
* if(result.flag !== constants.OK) { throw new Error(result.error); }
|
|
2548
|
+
* console.log(`
|
|
2549
|
+
* Star: ${result.name}
|
|
2550
|
+
* Magnitude: ${result.data}
|
|
2547
2551
|
* `)
|
|
2548
2552
|
* ```
|
|
2549
2553
|
*
|
|
@@ -2737,7 +2741,7 @@ declare module "sweph" {
|
|
|
2737
2741
|
* Get ayanamsa value from universal time without nutation
|
|
2738
2742
|
* ### Params
|
|
2739
2743
|
* ```
|
|
2740
|
-
* •
|
|
2744
|
+
* • tjd_ut: number // Julian day in universal time
|
|
2741
2745
|
* ```
|
|
2742
2746
|
* ### Returns
|
|
2743
2747
|
* ```
|
|
@@ -2921,7 +2925,7 @@ declare module "sweph" {
|
|
|
2921
2925
|
* ARCLact, // actual longitude difference between object and sun in degrees
|
|
2922
2926
|
* kact, // extinction coefficient
|
|
2923
2927
|
* minTAV, // smallest topocentric arcus visionis in degrees
|
|
2924
|
-
*
|
|
2928
|
+
* TfirstVR, // first time object is visible, according to VR in JD
|
|
2925
2929
|
* TbVR, // optimum time the object is visible, according to VR in JD
|
|
2926
2930
|
* TlastVR, // last time object is visible, according to VR in JD
|
|
2927
2931
|
* TbYallop, // best time the object is visible, according to Yallop in JD
|
|
@@ -3363,16 +3367,16 @@ declare module "sweph" {
|
|
|
3363
3367
|
* hour: number; // Hour (0-23)
|
|
3364
3368
|
* minute: number; // Minute (0-59)
|
|
3365
3369
|
* second: number; // Second including fraction (0-59.99999)
|
|
3366
|
-
* }
|
|
3367
|
-
* ```
|
|
3368
|
-
* ### Example
|
|
3369
|
-
* ```
|
|
3370
|
-
* const date = jdet_to_utc(2415423, constants.SE_GREG_CAL);
|
|
3371
|
-
* console.log(date);
|
|
3372
|
-
* ```
|
|
3373
|
-
*
|
|
3374
|
-
*/
|
|
3375
|
-
export function jdet_to_utc(tjd_et: number, gregflag: number): DateObject2;
|
|
3370
|
+
* }
|
|
3371
|
+
* ```
|
|
3372
|
+
* ### Example
|
|
3373
|
+
* ```
|
|
3374
|
+
* const date = jdet_to_utc(2415423, constants.SE_GREG_CAL);
|
|
3375
|
+
* console.log(date);
|
|
3376
|
+
* ```
|
|
3377
|
+
*
|
|
3378
|
+
*/
|
|
3379
|
+
export function jdet_to_utc(tjd_et: number, gregflag: number): DateObject2;
|
|
3376
3380
|
|
|
3377
3381
|
/**
|
|
3378
3382
|
* ### Description
|
|
@@ -3391,16 +3395,16 @@ declare module "sweph" {
|
|
|
3391
3395
|
* hour: number; // Hour (0-23)
|
|
3392
3396
|
* minute: number; // Minute (0-59)
|
|
3393
3397
|
* second: number; // Second including fraction (0-59.99999)
|
|
3394
|
-
* }
|
|
3395
|
-
* ```
|
|
3396
|
-
* ### Example
|
|
3397
|
-
* ```
|
|
3398
|
-
* const date = jdut1_to_utc(2415423, constants.SE_GREG_CAL);
|
|
3399
|
-
* console.log(date);
|
|
3400
|
-
* ```
|
|
3401
|
-
*
|
|
3402
|
-
*/
|
|
3403
|
-
export function jdut1_to_utc(tjd_ut: number, gregflag: number): DateObject2;
|
|
3398
|
+
* }
|
|
3399
|
+
* ```
|
|
3400
|
+
* ### Example
|
|
3401
|
+
* ```
|
|
3402
|
+
* const date = jdut1_to_utc(2415423, constants.SE_GREG_CAL);
|
|
3403
|
+
* console.log(date);
|
|
3404
|
+
* ```
|
|
3405
|
+
*
|
|
3406
|
+
*/
|
|
3407
|
+
export function jdut1_to_utc(tjd_ut: number, gregflag: number): DateObject2;
|
|
3404
3408
|
|
|
3405
3409
|
/**
|
|
3406
3410
|
* ### Description
|
|
@@ -4113,9 +4117,9 @@ declare module "sweph" {
|
|
|
4113
4117
|
*/
|
|
4114
4118
|
export function radnorm(drad: number): number;
|
|
4115
4119
|
|
|
4116
|
-
/**
|
|
4117
|
-
* ### Description
|
|
4118
|
-
* Calculate true altitude from the apparent altitude or apparent altitude from true altitude
|
|
4120
|
+
/**
|
|
4121
|
+
* ### Description
|
|
4122
|
+
* Calculate true altitude from the apparent altitude or apparent altitude from true altitude
|
|
4119
4123
|
* Extended function also supports negative heights and more
|
|
4120
4124
|
* ### Params
|
|
4121
4125
|
* ```
|
|
@@ -4249,17 +4253,17 @@ declare module "sweph" {
|
|
|
4249
4253
|
* flag: number, // OK, ERR or -2 if circumpolar object
|
|
4250
4254
|
* error: string, // Error message if any
|
|
4251
4255
|
* data: number // Transit time in julian days in universal time
|
|
4252
|
-
* }
|
|
4253
|
-
* ```
|
|
4254
|
-
* ### Example
|
|
4255
|
-
* ```
|
|
4256
|
-
* const result = rise_trans(2555555, constants.SE_MOON, null, constants.SEFLG_SWIEPH, constants.SE_CALC_RISE, [95,40,200], 0, 0);
|
|
4257
|
-
* if(result.flag !== constants.OK) { console.log(result.error); }
|
|
4258
|
-
* console.log(result.data);
|
|
4259
|
-
* ```
|
|
4260
|
-
*
|
|
4261
|
-
*/
|
|
4262
|
-
export function rise_trans(tjd_ut: number, ipl: number, starname: string | null, epheflag: number, rsmi: number, geopos: [longitude: number, latitude: number, elevation: number], atpress: number, attemp: number): RiseTrans;
|
|
4256
|
+
* }
|
|
4257
|
+
* ```
|
|
4258
|
+
* ### Example
|
|
4259
|
+
* ```
|
|
4260
|
+
* const result = rise_trans(2555555, constants.SE_MOON, null, constants.SEFLG_SWIEPH, constants.SE_CALC_RISE, [95,40,200], 0, 0);
|
|
4261
|
+
* if(result.flag !== constants.OK) { console.log(result.error); }
|
|
4262
|
+
* console.log(result.data);
|
|
4263
|
+
* ```
|
|
4264
|
+
*
|
|
4265
|
+
*/
|
|
4266
|
+
export function rise_trans(tjd_ut: number, ipl: number, starname: string | null, epheflag: number, rsmi: number, geopos: [longitude: number, latitude: number, elevation: number], atpress: number, attemp: number): RiseTrans;
|
|
4263
4267
|
|
|
4264
4268
|
/**
|
|
4265
4269
|
* ### Description
|
|
@@ -4294,6 +4298,21 @@ declare module "sweph" {
|
|
|
4294
4298
|
*/
|
|
4295
4299
|
export function set_ephe_path(path: string): void;
|
|
4296
4300
|
|
|
4301
|
+
/**
|
|
4302
|
+
* ### Description
|
|
4303
|
+
* Enable or disable nutation interpolation
|
|
4304
|
+
* ### Params
|
|
4305
|
+
* ```
|
|
4306
|
+
* • do_interpolate: boolean // Enable/disable nutation interpolation
|
|
4307
|
+
* ```
|
|
4308
|
+
* ### Example
|
|
4309
|
+
* ```
|
|
4310
|
+
* set_interpolate_nut(true);
|
|
4311
|
+
* ```
|
|
4312
|
+
*
|
|
4313
|
+
*/
|
|
4314
|
+
export function set_interpolate_nut(do_interpolate: boolean): void;
|
|
4315
|
+
|
|
4297
4316
|
/**
|
|
4298
4317
|
* ### Description
|
|
4299
4318
|
* Set JPL file
|
|
@@ -4511,7 +4530,7 @@ declare module "sweph" {
|
|
|
4511
4530
|
* ```
|
|
4512
4531
|
*
|
|
4513
4532
|
*/
|
|
4514
|
-
export function sol_eclipse_when_glob(tjd_start: number, ifl: number, iftype: number, backwards:
|
|
4533
|
+
export function sol_eclipse_when_glob(tjd_start: number, ifl: number, iftype: number, backwards: boolean): EclipseWhenGlob;
|
|
4515
4534
|
|
|
4516
4535
|
/**
|
|
4517
4536
|
* ### Description
|
|
@@ -4801,15 +4820,15 @@ declare module "sweph" {
|
|
|
4801
4820
|
* Get current swisseph version
|
|
4802
4821
|
* ### Returns
|
|
4803
4822
|
* ```
|
|
4804
|
-
* string // Swisseph version
|
|
4805
|
-
* ```
|
|
4806
|
-
* ### Example
|
|
4807
|
-
* ```
|
|
4808
|
-
* const currentVersion = version(); // "2.10.03"
|
|
4809
|
-
* ```
|
|
4810
|
-
*
|
|
4811
|
-
*/
|
|
4812
|
-
export function version(): string;
|
|
4823
|
+
* string // Swisseph version
|
|
4824
|
+
* ```
|
|
4825
|
+
* ### Example
|
|
4826
|
+
* ```
|
|
4827
|
+
* const currentVersion = version(); // "2.10.03"
|
|
4828
|
+
* ```
|
|
4829
|
+
*
|
|
4830
|
+
*/
|
|
4831
|
+
export function version(): string;
|
|
4813
4832
|
|
|
4814
4833
|
/**
|
|
4815
4834
|
* ### Description
|
package/index.mjs
CHANGED
|
@@ -20,6 +20,7 @@ export const constants = c;
|
|
|
20
20
|
export const close = s.close;
|
|
21
21
|
export const set_delta_t_userdef = s.set_delta_t_userdef;
|
|
22
22
|
export const set_ephe_path = s.set_ephe_path;
|
|
23
|
+
export const set_interpolate_nut = s.set_interpolate_nut;
|
|
23
24
|
export const set_jpl_file = s.set_jpl_file;
|
|
24
25
|
export const set_lapse_rate = s.set_lapse_rate;
|
|
25
26
|
export const set_sid_mode = s.set_sid_mode;
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -18,7 +18,7 @@ Napi::Value sweph_fixstar(const Napi::CallbackInfo& info) {
|
|
|
18
18
|
strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
|
|
19
19
|
int32 flag = swe_fixstar(
|
|
20
20
|
star,
|
|
21
|
-
info[1].As<Napi::Number>().
|
|
21
|
+
info[1].As<Napi::Number>().DoubleValue(),
|
|
22
22
|
info[2].As<Napi::Number>().Int32Value(),
|
|
23
23
|
xx,
|
|
24
24
|
serr
|
|
@@ -18,7 +18,7 @@ Napi::Value sweph_fixstar2(const Napi::CallbackInfo& info) {
|
|
|
18
18
|
strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
|
|
19
19
|
int32 flag = swe_fixstar2(
|
|
20
20
|
star,
|
|
21
|
-
info[1].As<Napi::Number>().
|
|
21
|
+
info[1].As<Napi::Number>().DoubleValue(),
|
|
22
22
|
info[2].As<Napi::Number>().Int32Value(),
|
|
23
23
|
xx,
|
|
24
24
|
serr
|
|
@@ -18,7 +18,7 @@ Napi::Value sweph_fixstar2_ut(const Napi::CallbackInfo& info) {
|
|
|
18
18
|
strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
|
|
19
19
|
int32 flag = swe_fixstar2_ut(
|
|
20
20
|
star,
|
|
21
|
-
info[1].As<Napi::Number>().
|
|
21
|
+
info[1].As<Napi::Number>().DoubleValue(),
|
|
22
22
|
info[2].As<Napi::Number>().Int32Value(),
|
|
23
23
|
xx,
|
|
24
24
|
serr
|
|
@@ -18,7 +18,7 @@ Napi::Value sweph_fixstar_ut(const Napi::CallbackInfo& info) {
|
|
|
18
18
|
strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
|
|
19
19
|
int32 flag = swe_fixstar_ut(
|
|
20
20
|
star,
|
|
21
|
-
info[1].As<Napi::Number>().
|
|
21
|
+
info[1].As<Napi::Number>().DoubleValue(),
|
|
22
22
|
info[2].As<Napi::Number>().Int32Value(),
|
|
23
23
|
xx,
|
|
24
24
|
serr
|
|
@@ -19,7 +19,7 @@ Napi::Value sweph_helio_cross(const Napi::CallbackInfo& info) {
|
|
|
19
19
|
int32 flag = swe_helio_cross(
|
|
20
20
|
info[0].As<Napi::Number>().Int32Value(),
|
|
21
21
|
info[1].As<Napi::Number>().DoubleValue(),
|
|
22
|
-
info[2].As<Napi::Number>().
|
|
22
|
+
info[2].As<Napi::Number>().DoubleValue(),
|
|
23
23
|
info[3].As<Napi::Number>().Int32Value(),
|
|
24
24
|
info[4].As<Napi::Number>().Int32Value(),
|
|
25
25
|
&jd_cross,
|
|
@@ -19,7 +19,7 @@ Napi::Value sweph_helio_cross_ut(const Napi::CallbackInfo& info) {
|
|
|
19
19
|
int32 flag = swe_helio_cross_ut(
|
|
20
20
|
info[0].As<Napi::Number>().Int32Value(),
|
|
21
21
|
info[1].As<Napi::Number>().DoubleValue(),
|
|
22
|
-
info[2].As<Napi::Number>().
|
|
22
|
+
info[2].As<Napi::Number>().DoubleValue(),
|
|
23
23
|
info[3].As<Napi::Number>().Int32Value(),
|
|
24
24
|
info[4].As<Napi::Number>().Int32Value(),
|
|
25
25
|
&jd_cross,
|
|
@@ -16,8 +16,8 @@ Napi::Value sweph_lun_occult_when_loc(const Napi::CallbackInfo& info) {
|
|
|
16
16
|
return env.Null();
|
|
17
17
|
}
|
|
18
18
|
double geopos [3];
|
|
19
|
-
if(!sweph_double_array_converter(geopos, 3, info[
|
|
20
|
-
Napi::TypeError::New(env, args[
|
|
19
|
+
if(!sweph_double_array_converter(geopos, 3, info[4])) {
|
|
20
|
+
Napi::TypeError::New(env, args[5].second).ThrowAsJavaScriptException();
|
|
21
21
|
return env.Null();
|
|
22
22
|
}
|
|
23
23
|
double ret [10];
|
package/src/functions/pheno.cpp
CHANGED
|
@@ -24,6 +24,6 @@ Napi::Value sweph_pheno(const Napi::CallbackInfo& info) {
|
|
|
24
24
|
Napi::Object obj = Napi::Object::New(env);
|
|
25
25
|
obj["flag"] = flag;
|
|
26
26
|
obj["error"] = serr;
|
|
27
|
-
obj["data"] = sweph_js_array_converter(attr,
|
|
27
|
+
obj["data"] = sweph_js_array_converter(attr, 6, env);
|
|
28
28
|
return obj;
|
|
29
29
|
}
|
|
@@ -24,6 +24,6 @@ Napi::Value sweph_pheno_ut(const Napi::CallbackInfo& info) {
|
|
|
24
24
|
Napi::Object obj = Napi::Object::New(env);
|
|
25
25
|
obj["flag"] = flag;
|
|
26
26
|
obj["error"] = serr;
|
|
27
|
-
obj["data"] = sweph_js_array_converter(attr,
|
|
27
|
+
obj["data"] = sweph_js_array_converter(attr, 6, env);
|
|
28
28
|
return obj;
|
|
29
29
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#include <sweph.h>
|
|
2
|
+
|
|
3
|
+
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
+
{ 1, "Expecting 1 argument: do_interpolate" },
|
|
5
|
+
{ TRUEFALSE, "Argument 1 should be a boolean - enable/disable nutation interpolation" }
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
void sweph_set_interpolate_nut(const Napi::CallbackInfo& info) {
|
|
9
|
+
if(!sweph_type_check(args, info)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
swe_set_interpolate_nut(info[0].As<Napi::Boolean>());
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
constexpr std::pair<int, const char*> args[] = {
|
|
4
4
|
{ 3, "Expecting 3 arguments: tjd_ut, ifl, geopos" },
|
|
5
5
|
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number -
|
|
6
|
+
{ NUMBER, "Argument 2 should be a number - ephemeris flag" },
|
|
7
7
|
{ ARRAY, "Argument 3 should be an array of 3 numbers - geographic coordinates [longitude, latitude, elevation]" }
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
constexpr std::pair<int, const char*> args[] = {
|
|
4
4
|
{ 4, "Expecting 4 arguments: tjd_start, ifl, ifltype, backward" },
|
|
5
5
|
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number -
|
|
6
|
+
{ NUMBER, "Argument 2 should be a number - ephemeris flag" },
|
|
7
7
|
{ NUMBER, "Argument 3 should be a number - eclipse type" },
|
|
8
8
|
{ TRUEFALSE, "Argument 4 should be a boolean - backwards search" }
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
constexpr std::pair<int, const char*> args[] = {
|
|
4
4
|
{ 4, "Expecting 4 arguments: tjd_start, ifl, geopos, backward" },
|
|
5
5
|
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number -
|
|
6
|
+
{ NUMBER, "Argument 2 should be a number - ephemeris flag" },
|
|
7
7
|
{ ARRAY, "Argument 3 should be an array of 3 numbers - geographic coordinates [longitude, latitude, elevation]" },
|
|
8
8
|
{ TRUEFALSE, "Argument 4 should be a boolean - backwards search" }
|
|
9
9
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
constexpr std::pair<int, const char*> args[] = {
|
|
4
4
|
{ 2, "Expecting 2 arguments: tjd_ut, ifl" },
|
|
5
5
|
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number -
|
|
6
|
+
{ NUMBER, "Argument 2 should be a number - ephemeris flag" }
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
Napi::Value sweph_sol_eclipse_where(const Napi::CallbackInfo& info) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
constexpr std::pair<int, const char*> args[] = {
|
|
4
4
|
{ 6, "Expecting 6 arguments: tjd_ut, dgeo, datm, dobs, objectname, helflag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number -
|
|
5
|
+
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
6
|
{ ARRAY, "Argument 2 should be an array of 3 numbers - geographic coordinates [longitude, latitude, elevation]" },
|
|
7
7
|
{ ARRAY, "Argument 3 should be an array of 4 numbers - atmospheric conditions [pressure, temperature, humidity, meteorological range]" },
|
|
8
8
|
{ ARRAY, "Argument 4 should be an array of 6 numbers - observer description [age, sellen ratio, optical type, optical magnification, optical aperture, optical transmission]" },
|
package/src/sweph.cpp
CHANGED
|
@@ -4,6 +4,7 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) {
|
|
|
4
4
|
exports["close"] = Napi::Function::New(env, sweph_close);
|
|
5
5
|
exports["set_delta_t_userdef"] = Napi::Function::New(env, sweph_set_delta_t_userdef);
|
|
6
6
|
exports["set_ephe_path"] = Napi::Function::New(env, sweph_set_ephe_path);
|
|
7
|
+
exports["set_interpolate_nut"] = Napi::Function::New(env, sweph_set_interpolate_nut);
|
|
7
8
|
exports["set_jpl_file"] = Napi::Function::New(env, sweph_set_jpl_file);
|
|
8
9
|
exports["set_lapse_rate"] = Napi::Function::New(env, sweph_set_lapse_rate);
|
|
9
10
|
exports["set_sid_mode"] = Napi::Function::New(env, sweph_set_sid_mode);
|
package/src/sweph.h
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
void sweph_close(const Napi::CallbackInfo& info);
|
|
9
9
|
void sweph_set_delta_t_userdef(const Napi::CallbackInfo& info);
|
|
10
10
|
void sweph_set_ephe_path(const Napi::CallbackInfo& info);
|
|
11
|
+
void sweph_set_interpolate_nut(const Napi::CallbackInfo& info);
|
|
11
12
|
void sweph_set_jpl_file(const Napi::CallbackInfo& info);
|
|
12
13
|
void sweph_set_lapse_rate(const Napi::CallbackInfo& info);
|
|
13
14
|
void sweph_set_sid_mode(const Napi::CallbackInfo& info);
|