@typescriptify/sweph 1.0.0 → 1.0.1
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/package.json +6 -2
- package/originalCode/.eslintrc.json +0 -124
- package/originalCode/.gitattributes +0 -2
- package/originalCode/.github/FUNDING.yml +0 -5
- package/originalCode/.github/workflows/test.yml +0 -35
- package/originalCode/LICENSE +0 -840
- package/originalCode/README.md +0 -91
- package/originalCode/binding.gyp +0 -41
- package/originalCode/constants.js +0 -366
- package/originalCode/docs.gif +0 -0
- package/originalCode/index.d.ts +0 -5115
- package/originalCode/index.js +0 -7
- package/originalCode/index.mjs +0 -109
- package/originalCode/package.json +0 -55
- package/originalCode/src/functions/azalt.cpp +0 -39
- package/originalCode/src/functions/azalt_rev.cpp +0 -35
- package/originalCode/src/functions/calc.cpp +0 -29
- package/originalCode/src/functions/calc_pctr.cpp +0 -31
- package/originalCode/src/functions/calc_ut.cpp +0 -29
- package/originalCode/src/functions/close.cpp +0 -6
- package/originalCode/src/functions/cotrans.cpp +0 -26
- package/originalCode/src/functions/cotrans_sp.cpp +0 -26
- package/originalCode/src/functions/cs2degstr.cpp +0 -19
- package/originalCode/src/functions/cs2lonlatstr.cpp +0 -23
- package/originalCode/src/functions/cs2timestr.cpp +0 -23
- package/originalCode/src/functions/csnorm.cpp +0 -15
- package/originalCode/src/functions/csroundsec.cpp +0 -15
- package/originalCode/src/functions/d2l.cpp +0 -15
- package/originalCode/src/functions/date_conversion.cpp +0 -30
- package/originalCode/src/functions/day_of_week.cpp +0 -15
- package/originalCode/src/functions/degnorm.cpp +0 -15
- package/originalCode/src/functions/deltat.cpp +0 -15
- package/originalCode/src/functions/deltat_ex.cpp +0 -24
- package/originalCode/src/functions/difcs2n.cpp +0 -19
- package/originalCode/src/functions/difcsn.cpp +0 -19
- package/originalCode/src/functions/difdeg2n.cpp +0 -19
- package/originalCode/src/functions/difdegn.cpp +0 -19
- package/originalCode/src/functions/fixstar.cpp +0 -32
- package/originalCode/src/functions/fixstar2.cpp +0 -32
- package/originalCode/src/functions/fixstar2_mag.cpp +0 -28
- package/originalCode/src/functions/fixstar2_ut.cpp +0 -32
- package/originalCode/src/functions/fixstar_mag.cpp +0 -28
- package/originalCode/src/functions/fixstar_ut.cpp +0 -32
- package/originalCode/src/functions/gauquelin_sector.cpp +0 -44
- package/originalCode/src/functions/get_ayanamsa.cpp +0 -15
- package/originalCode/src/functions/get_ayanamsa_ex.cpp +0 -27
- package/originalCode/src/functions/get_ayanamsa_ex_ut.cpp +0 -27
- package/originalCode/src/functions/get_ayanamsa_name.cpp +0 -19
- package/originalCode/src/functions/get_ayanamsa_ut.cpp +0 -15
- package/originalCode/src/functions/get_current_file_data.cpp +0 -28
- package/originalCode/src/functions/get_library_path.cpp +0 -8
- package/originalCode/src/functions/get_orbital_elements.cpp +0 -29
- package/originalCode/src/functions/get_planet_name.cpp +0 -19
- package/originalCode/src/functions/get_tid_acc.cpp +0 -7
- package/originalCode/src/functions/heliacal_pheno_ut.cpp +0 -52
- package/originalCode/src/functions/heliacal_ut.cpp +0 -52
- package/originalCode/src/functions/helio_cross.cpp +0 -33
- package/originalCode/src/functions/helio_cross_ut.cpp +0 -33
- package/originalCode/src/functions/house_name.cpp +0 -20
- package/originalCode/src/functions/house_pos.cpp +0 -36
- package/originalCode/src/functions/houses.cpp +0 -35
- package/originalCode/src/functions/houses_armc.cpp +0 -38
- package/originalCode/src/functions/houses_armc_ex2.cpp +0 -47
- package/originalCode/src/functions/houses_ex.cpp +0 -37
- package/originalCode/src/functions/houses_ex2.cpp +0 -46
- package/originalCode/src/functions/jdet_to_utc.cpp +0 -38
- package/originalCode/src/functions/jdut1_to_utc.cpp +0 -38
- package/originalCode/src/functions/julday.cpp +0 -25
- package/originalCode/src/functions/lat_to_lmt.cpp +0 -27
- package/originalCode/src/functions/lmt_to_lat.cpp +0 -27
- package/originalCode/src/functions/lun_eclipse_how.cpp +0 -34
- package/originalCode/src/functions/lun_eclipse_when.cpp +0 -31
- package/originalCode/src/functions/lun_eclipse_when_loc.cpp +0 -39
- package/originalCode/src/functions/lun_occult_when_glob.cpp +0 -35
- package/originalCode/src/functions/lun_occult_when_loc.cpp +0 -43
- package/originalCode/src/functions/lun_occult_where.cpp +0 -34
- package/originalCode/src/functions/mooncross.cpp +0 -26
- package/originalCode/src/functions/mooncross_node.cpp +0 -30
- package/originalCode/src/functions/mooncross_node_ut.cpp +0 -30
- package/originalCode/src/functions/mooncross_ut.cpp +0 -26
- package/originalCode/src/functions/nod_aps.cpp +0 -42
- package/originalCode/src/functions/nod_aps_ut.cpp +0 -42
- package/originalCode/src/functions/orbit_max_min_true_distance.cpp +0 -37
- package/originalCode/src/functions/pheno.cpp +0 -29
- package/originalCode/src/functions/pheno_ut.cpp +0 -29
- package/originalCode/src/functions/radnorm.cpp +0 -15
- package/originalCode/src/functions/refrac.cpp +0 -23
- package/originalCode/src/functions/refrac_extended.cpp +0 -32
- package/originalCode/src/functions/revjul.cpp +0 -33
- package/originalCode/src/functions/rise_trans.cpp +0 -44
- package/originalCode/src/functions/rise_trans_true_hor.cpp +0 -46
- package/originalCode/src/functions/set_delta_t_userdef.cpp +0 -14
- package/originalCode/src/functions/set_ephe_path.cpp +0 -14
- package/originalCode/src/functions/set_jpl_file.cpp +0 -14
- package/originalCode/src/functions/set_sid_mode.cpp +0 -20
- package/originalCode/src/functions/set_tid_acc.cpp +0 -14
- package/originalCode/src/functions/set_topo.cpp +0 -20
- package/originalCode/src/functions/sidtime.cpp +0 -15
- package/originalCode/src/functions/sidtime0.cpp +0 -21
- package/originalCode/src/functions/sol_eclipse_how.cpp +0 -34
- package/originalCode/src/functions/sol_eclipse_when_glob.cpp +0 -31
- package/originalCode/src/functions/sol_eclipse_when_loc.cpp +0 -39
- package/originalCode/src/functions/sol_eclipse_where.cpp +0 -30
- package/originalCode/src/functions/solcross.cpp +0 -26
- package/originalCode/src/functions/solcross_ut.cpp +0 -26
- package/originalCode/src/functions/split_deg.cpp +0 -35
- package/originalCode/src/functions/time_equ.cpp +0 -25
- package/originalCode/src/functions/utc_time_zone.cpp +0 -48
- package/originalCode/src/functions/utc_to_jd.cpp +0 -37
- package/originalCode/src/functions/version.cpp +0 -8
- package/originalCode/src/functions/vis_limit_mag.cpp +0 -50
- package/originalCode/src/sweph.cpp +0 -150
- package/originalCode/src/sweph.h +0 -119
- package/originalCode/swisseph/swecl.c +0 -6428
- package/originalCode/swisseph/swedate.c +0 -588
- package/originalCode/swisseph/swedate.h +0 -81
- package/originalCode/swisseph/swehel.c +0 -3511
- package/originalCode/swisseph/swehouse.c +0 -3143
- package/originalCode/swisseph/swehouse.h +0 -98
- package/originalCode/swisseph/swejpl.c +0 -958
- package/originalCode/swisseph/swejpl.h +0 -103
- package/originalCode/swisseph/swemmoon.c +0 -1930
- package/originalCode/swisseph/swemplan.c +0 -967
- package/originalCode/swisseph/swemptab.h +0 -10640
- package/originalCode/swisseph/swenut2000a.h +0 -2819
- package/originalCode/swisseph/sweodef.h +0 -326
- package/originalCode/swisseph/sweph.c +0 -8614
- package/originalCode/swisseph/sweph.h +0 -849
- package/originalCode/swisseph/swephexp.h +0 -1020
- package/originalCode/swisseph/swephlib.c +0 -4634
- package/originalCode/swisseph/swephlib.h +0 -189
package/originalCode/index.js
DELETED
package/originalCode/index.mjs
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "module";
|
|
2
|
-
import c from "./constants.js";
|
|
3
|
-
|
|
4
|
-
const require = createRequire(import.meta.url);
|
|
5
|
-
export const sweph = require("./build/Release/sweph.node");
|
|
6
|
-
|
|
7
|
-
sweph.constants = c;
|
|
8
|
-
sweph.sweph = sweph;
|
|
9
|
-
sweph.default = sweph;
|
|
10
|
-
|
|
11
|
-
export default sweph;
|
|
12
|
-
export const constants = sweph.constants;
|
|
13
|
-
export const close = sweph.close;
|
|
14
|
-
export const set_delta_t_userdef = sweph.set_delta_t_userdef;
|
|
15
|
-
export const set_ephe_path = sweph.set_ephe_path;
|
|
16
|
-
export const set_jpl_file = sweph.set_jpl_file;
|
|
17
|
-
export const set_sid_mode = sweph.set_sid_mode;
|
|
18
|
-
export const set_tid_acc = sweph.set_tid_acc;
|
|
19
|
-
export const set_topo = sweph.set_topo;
|
|
20
|
-
export const version = sweph.version;
|
|
21
|
-
export const get_library_path = sweph.get_library_path;
|
|
22
|
-
export const get_tid_acc = sweph.get_tid_acc;
|
|
23
|
-
export const get_planet_name = sweph.get_planet_name;
|
|
24
|
-
export const get_current_file_data = sweph.get_current_file_data;
|
|
25
|
-
export const get_orbital_elements = sweph.get_orbital_elements;
|
|
26
|
-
export const get_ayanamsa_name = sweph.get_ayanamsa_name;
|
|
27
|
-
export const get_ayanamsa_ex_ut = sweph.get_ayanamsa_ex_ut;
|
|
28
|
-
export const get_ayanamsa_ex = sweph.get_ayanamsa_ex;
|
|
29
|
-
export const get_ayanamsa_ut = sweph.get_ayanamsa_ut;
|
|
30
|
-
export const get_ayanamsa = sweph.get_ayanamsa;
|
|
31
|
-
export const calc = sweph.calc;
|
|
32
|
-
export const calc_ut = sweph.calc_ut;
|
|
33
|
-
export const calc_pctr = sweph.calc_pctr;
|
|
34
|
-
export const fixstar = sweph.fixstar;
|
|
35
|
-
export const fixstar_ut = sweph.fixstar_ut;
|
|
36
|
-
export const fixstar_mag = sweph.fixstar_mag;
|
|
37
|
-
export const fixstar2 = sweph.fixstar2;
|
|
38
|
-
export const fixstar2_ut = sweph.fixstar2_ut;
|
|
39
|
-
export const fixstar2_mag = sweph.fixstar2_mag;
|
|
40
|
-
export const nod_aps = sweph.nod_aps;
|
|
41
|
-
export const nod_aps_ut = sweph.nod_aps_ut;
|
|
42
|
-
export const orbit_max_min_true_distance = sweph.orbit_max_min_true_distance;
|
|
43
|
-
export const sol_eclipse_when_loc = sweph.sol_eclipse_when_loc;
|
|
44
|
-
export const sol_eclipse_when_glob = sweph.sol_eclipse_when_glob;
|
|
45
|
-
export const sol_eclipse_how = sweph.sol_eclipse_how;
|
|
46
|
-
export const sol_eclipse_where = sweph.sol_eclipse_where;
|
|
47
|
-
export const lun_occult_when_loc = sweph.lun_occult_when_loc;
|
|
48
|
-
export const lun_occult_when_glob = sweph.lun_occult_when_glob;
|
|
49
|
-
export const lun_occult_where = sweph.lun_occult_where;
|
|
50
|
-
export const lun_eclipse_when_loc = sweph.lun_eclipse_when_loc;
|
|
51
|
-
export const lun_eclipse_when = sweph.lun_eclipse_when;
|
|
52
|
-
export const lun_eclipse_how = sweph.lun_eclipse_how;
|
|
53
|
-
export const rise_trans = sweph.rise_trans;
|
|
54
|
-
export const rise_trans_true_hor = sweph.rise_trans_true_hor;
|
|
55
|
-
export const pheno = sweph.pheno;
|
|
56
|
-
export const pheno_ut = sweph.pheno_ut;
|
|
57
|
-
export const azalt = sweph.azalt;
|
|
58
|
-
export const azalt_rev = sweph.azalt_rev;
|
|
59
|
-
export const refrac = sweph.refrac;
|
|
60
|
-
export const refrac_extended = sweph.refrac_extended;
|
|
61
|
-
export const heliacal_ut = sweph.heliacal_ut;
|
|
62
|
-
export const vis_limit_mag = sweph.vis_limit_mag;
|
|
63
|
-
export const heliacal_pheno_ut = sweph.heliacal_pheno_ut;
|
|
64
|
-
export const julday = sweph.julday;
|
|
65
|
-
export const date_conversion = sweph.date_conversion;
|
|
66
|
-
export const revjul = sweph.revjul;
|
|
67
|
-
export const utc_time_zone = sweph.utc_time_zone;
|
|
68
|
-
export const utc_to_jd = sweph.utc_to_jd;
|
|
69
|
-
export const jdet_to_utc = sweph.jdet_to_utc;
|
|
70
|
-
export const jdut1_to_utc = sweph.jdut1_to_utc;
|
|
71
|
-
export const time_equ = sweph.time_equ;
|
|
72
|
-
export const lmt_to_lat = sweph.lmt_to_lat;
|
|
73
|
-
export const lat_to_lmt = sweph.lat_to_lmt;
|
|
74
|
-
export const deltat = sweph.deltat;
|
|
75
|
-
export const deltat_ex = sweph.deltat_ex;
|
|
76
|
-
export const house_name = sweph.house_name;
|
|
77
|
-
export const houses = sweph.houses;
|
|
78
|
-
export const houses_armc = sweph.houses_armc;
|
|
79
|
-
export const houses_armc_ex2 = sweph.houses_armc_ex2;
|
|
80
|
-
export const houses_ex = sweph.houses_ex;
|
|
81
|
-
export const houses_ex2 = sweph.houses_ex2;
|
|
82
|
-
export const house_pos = sweph.house_pos;
|
|
83
|
-
export const gauquelin_sector = sweph.gauquelin_sector;
|
|
84
|
-
export const sidtime = sweph.sidtime;
|
|
85
|
-
export const sidtime0 = sweph.sidtime0;
|
|
86
|
-
export const cotrans = sweph.cotrans;
|
|
87
|
-
export const cotrans_sp = sweph.cotrans_sp;
|
|
88
|
-
export const degnorm = sweph.degnorm;
|
|
89
|
-
export const radnorm = sweph.radnorm;
|
|
90
|
-
export const split_deg = sweph.split_deg;
|
|
91
|
-
export const csnorm = sweph.csnorm;
|
|
92
|
-
export const difcsn = sweph.difcsn;
|
|
93
|
-
export const difdegn = sweph.difdegn;
|
|
94
|
-
export const difcs2n = sweph.difcs2n;
|
|
95
|
-
export const difdeg2n = sweph.difdeg2n;
|
|
96
|
-
export const csroundsec = sweph.csroundsec;
|
|
97
|
-
export const d2l = sweph.d2l;
|
|
98
|
-
export const day_of_week = sweph.day_of_week;
|
|
99
|
-
export const cs2timestr = sweph.cs2timestr;
|
|
100
|
-
export const cs2lonlatstr = sweph.cs2lonlatstr;
|
|
101
|
-
export const cs2degstr = sweph.cs2degstr;
|
|
102
|
-
export const solcross = sweph.solcross;
|
|
103
|
-
export const solcross_ut = sweph.solcross_ut;
|
|
104
|
-
export const mooncross = sweph.mooncross;
|
|
105
|
-
export const mooncross_ut = sweph.mooncross_ut;
|
|
106
|
-
export const mooncross_node = sweph.mooncross_node;
|
|
107
|
-
export const mooncross_node_ut = sweph.mooncross_node_ut;
|
|
108
|
-
export const helio_cross = sweph.helio_cross;
|
|
109
|
-
export const helio_cross_ut = sweph.helio_cross_ut;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "sweph",
|
|
3
|
-
"version": "2.10.3-b-1",
|
|
4
|
-
"description": "The definitive Swiss Ephemeris bindings for Node.js",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"sweph",
|
|
7
|
-
"swiss",
|
|
8
|
-
"ephemeris",
|
|
9
|
-
"astrology",
|
|
10
|
-
"astronomy",
|
|
11
|
-
"swisseph",
|
|
12
|
-
"node"
|
|
13
|
-
],
|
|
14
|
-
"homepage": "https://github.com/timotejroiko/sweph",
|
|
15
|
-
"bugs": "https://github.com/timotejroiko/sweph/issues",
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/timotejroiko/sweph.git"
|
|
19
|
-
},
|
|
20
|
-
"funding": "https://github.com/timotejroiko/sweph?sponsor=1",
|
|
21
|
-
"license": "(AGPL-3.0-or-later OR LGPL-3.0-or-later)",
|
|
22
|
-
"author": "Timotej Valentin Rojko",
|
|
23
|
-
"exports": {
|
|
24
|
-
"require": "./index.js",
|
|
25
|
-
"import": "./index.mjs",
|
|
26
|
-
"types": "./index.d.ts"
|
|
27
|
-
},
|
|
28
|
-
"main": "index.js",
|
|
29
|
-
"types": "./index.d.ts",
|
|
30
|
-
"files": [
|
|
31
|
-
"./index.js",
|
|
32
|
-
"./index.mjs",
|
|
33
|
-
"./index.d.ts",
|
|
34
|
-
"./constants.js",
|
|
35
|
-
"./binding.gyp",
|
|
36
|
-
"./swisseph",
|
|
37
|
-
"./src/functions",
|
|
38
|
-
"./src/sweph.cpp",
|
|
39
|
-
"./src/sweph.h"
|
|
40
|
-
],
|
|
41
|
-
"scripts": {
|
|
42
|
-
"preinstall": "node -e \"const { readdirSync, readFileSync, writeFileSync } = require('fs'); const file = readdirSync('./src/functions').map((x,i) => readFileSync('./src/functions/' + x, 'utf8').replace(/args/g, 'args' + i).replace('#include <sweph.h>', '')).reduce((a,b) => a + b, '#include <sweph.h>'); writeFileSync('./src/functions.cpp', file, 'utf8');\"",
|
|
43
|
-
"install": "node-gyp rebuild && npm run test",
|
|
44
|
-
"test": "node -e \"const s = require('./'); const c = s.calc(2222222,0,4); console.log('OK')\""
|
|
45
|
-
},
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"node-addon-api": "^8.5.0"
|
|
48
|
-
},
|
|
49
|
-
"devDependencies": {
|
|
50
|
-
"eslint": "^9.36.0"
|
|
51
|
-
},
|
|
52
|
-
"optionalDependencies": {
|
|
53
|
-
"node-gyp": "*"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 6, "Expecting 6 arguments: tjd_ut, calc_flag, geopos, atpress, attemp, xin" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - calculation flag, 0 for SE_ECL2HOR, 1 for SE_EQU2HOR" },
|
|
7
|
-
{ ARRAY, "Argument 3 should be an array of 3 numbers - geographic coordinates [longitude, latitude, elevation]" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - atmospheric pressure in mbar/hpa" },
|
|
9
|
-
{ NUMBER, "Argument 5 should be a number - atmospheric temperature in celsius" },
|
|
10
|
-
{ ARRAY, "Argument 6 should be an array of 3 numbers - ecliptic or equatorial coordinates depending on argument 2 [lon/ra, lat/dec, distance]" }
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
Napi::Value sweph_azalt(const Napi::CallbackInfo& info) {
|
|
14
|
-
Napi::Env env = info.Env();
|
|
15
|
-
if(!sweph_type_check(args, info)) {
|
|
16
|
-
return env.Null();
|
|
17
|
-
}
|
|
18
|
-
double geopos [3];
|
|
19
|
-
if(!sweph_double_array_converter(geopos, 3, info[2])) {
|
|
20
|
-
Napi::TypeError::New(env, args[3].second).ThrowAsJavaScriptException();
|
|
21
|
-
return env.Null();
|
|
22
|
-
}
|
|
23
|
-
double xin [3];
|
|
24
|
-
if(!sweph_double_array_converter(xin, 3, info[5])) {
|
|
25
|
-
Napi::TypeError::New(env, args[6].second).ThrowAsJavaScriptException();
|
|
26
|
-
return env.Null();
|
|
27
|
-
}
|
|
28
|
-
double out [3];
|
|
29
|
-
swe_azalt(
|
|
30
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
31
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
32
|
-
geopos,
|
|
33
|
-
info[3].As<Napi::Number>().DoubleValue(),
|
|
34
|
-
info[4].As<Napi::Number>().DoubleValue(),
|
|
35
|
-
xin,
|
|
36
|
-
out
|
|
37
|
-
);
|
|
38
|
-
return sweph_js_array_converter(out, 3, env);
|
|
39
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 4, "Expecting 4 arguments: tjd_ut, calc_flag, geopos, xin" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - calculation flag, 0 for SE_HOR2ECL, 1 for SE_HOR2EQU" },
|
|
7
|
-
{ ARRAY, "Argument 3 should be an array of 3 numbers - geographic coordinates [longitude, latitude, elevation]" },
|
|
8
|
-
{ ARRAY, "Argument 4 should be an array of 2 numbers - horizontal coordinates [azimuth, true altitude]" }
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
Napi::Value sweph_azalt_rev(const Napi::CallbackInfo& info) {
|
|
12
|
-
Napi::Env env = info.Env();
|
|
13
|
-
if(!sweph_type_check(args, info)) {
|
|
14
|
-
return env.Null();
|
|
15
|
-
}
|
|
16
|
-
double geopos [3];
|
|
17
|
-
if(!sweph_double_array_converter(geopos, 3, info[2])) {
|
|
18
|
-
Napi::TypeError::New(env, args[3].second).ThrowAsJavaScriptException();
|
|
19
|
-
return env.Null();
|
|
20
|
-
}
|
|
21
|
-
double xin [2];
|
|
22
|
-
if(!sweph_double_array_converter(xin, 2, info[3])) {
|
|
23
|
-
Napi::TypeError::New(env, args[4].second).ThrowAsJavaScriptException();
|
|
24
|
-
return env.Null();
|
|
25
|
-
}
|
|
26
|
-
double out [2];
|
|
27
|
-
swe_azalt_rev(
|
|
28
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
29
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
30
|
-
geopos,
|
|
31
|
-
xin,
|
|
32
|
-
out
|
|
33
|
-
);
|
|
34
|
-
return sweph_js_array_converter(out, 2, env);
|
|
35
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: tjd, ipl, iflag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in ephemeris/terrestrial time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - target object ID" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - calculation flag" }
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
Napi::Value sweph_calc(const Napi::CallbackInfo& info) {
|
|
11
|
-
Napi::Env env = info.Env();
|
|
12
|
-
if(!sweph_type_check(args, info)) {
|
|
13
|
-
return env.Null();
|
|
14
|
-
}
|
|
15
|
-
double xx [6];
|
|
16
|
-
char serr [AS_MAXCH] = "";
|
|
17
|
-
int32 flag = swe_calc(
|
|
18
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
19
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
20
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
21
|
-
xx,
|
|
22
|
-
serr
|
|
23
|
-
);
|
|
24
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
25
|
-
obj["flag"] = flag;
|
|
26
|
-
obj["error"] = serr;
|
|
27
|
-
obj["data"] = sweph_js_array_converter(xx, 6, env);
|
|
28
|
-
return obj;
|
|
29
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 4, "Expecting 4 arguments: tjd, ipl, iplctr, iflag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in terrestrial/ephemeris time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - target object ID" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - center object ID" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - calculation flag" }
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
Napi::Value sweph_calc_pctr(const Napi::CallbackInfo& info) {
|
|
12
|
-
Napi::Env env = info.Env();
|
|
13
|
-
if(!sweph_type_check(args, info)) {
|
|
14
|
-
return env.Null();
|
|
15
|
-
}
|
|
16
|
-
double xx [6];
|
|
17
|
-
char serr [AS_MAXCH] = "";
|
|
18
|
-
int32 flag = swe_calc_pctr(
|
|
19
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
20
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
21
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
22
|
-
info[3].As<Napi::Number>().Int32Value(),
|
|
23
|
-
xx,
|
|
24
|
-
serr
|
|
25
|
-
);
|
|
26
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
27
|
-
obj["flag"] = flag;
|
|
28
|
-
obj["error"] = serr;
|
|
29
|
-
obj["data"] = sweph_js_array_converter(xx, 6, env);
|
|
30
|
-
return obj;
|
|
31
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: tjd, ipl, iflag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - target object ID" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - calculation flag" }
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
Napi::Value sweph_calc_ut(const Napi::CallbackInfo& info) {
|
|
11
|
-
Napi::Env env = info.Env();
|
|
12
|
-
if(!sweph_type_check(args, info)) {
|
|
13
|
-
return env.Null();
|
|
14
|
-
}
|
|
15
|
-
double xx [6];
|
|
16
|
-
char serr [AS_MAXCH] = "";
|
|
17
|
-
int32 flag = swe_calc_ut(
|
|
18
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
19
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
20
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
21
|
-
xx,
|
|
22
|
-
serr
|
|
23
|
-
);
|
|
24
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
25
|
-
obj["flag"] = flag;
|
|
26
|
-
obj["error"] = serr;
|
|
27
|
-
obj["data"] = sweph_js_array_converter(xx, 6, env);
|
|
28
|
-
return obj;
|
|
29
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 2, "Expecting 2 arguments: xpo, eps" },
|
|
5
|
-
{ ARRAY, "Argument 1 should be an array of 3 numbers - source coordinates [lon, lat, dist]" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - obliquity of the ecliptic in decimal degrees" }
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
Napi::Value sweph_cotrans(const Napi::CallbackInfo& info) {
|
|
10
|
-
Napi::Env env = info.Env();
|
|
11
|
-
if(!sweph_type_check(args, info)) {
|
|
12
|
-
return env.Null();
|
|
13
|
-
}
|
|
14
|
-
double in [3];
|
|
15
|
-
if(!sweph_double_array_converter(in, 3, info[0])) {
|
|
16
|
-
Napi::TypeError::New(env, args[1].second).ThrowAsJavaScriptException();
|
|
17
|
-
return env.Null();
|
|
18
|
-
}
|
|
19
|
-
double out [3];
|
|
20
|
-
swe_cotrans(
|
|
21
|
-
in,
|
|
22
|
-
out,
|
|
23
|
-
info[1].As<Napi::Number>().DoubleValue()
|
|
24
|
-
);
|
|
25
|
-
return sweph_js_array_converter(out, 3, env);
|
|
26
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 2, "Expecting 2 arguments: xpo, eps" },
|
|
5
|
-
{ ARRAY, "Argument 1 should be an array of 6 numbers - source coordinates [lon, lat, dist, lonspd, latspd, distspd]" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - obliquity of the ecliptic in decimal degrees" }
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
Napi::Value sweph_cotrans_sp(const Napi::CallbackInfo& info) {
|
|
10
|
-
Napi::Env env = info.Env();
|
|
11
|
-
if(!sweph_type_check(args, info)) {
|
|
12
|
-
return env.Null();
|
|
13
|
-
}
|
|
14
|
-
double in [6];
|
|
15
|
-
if(!sweph_double_array_converter(in, 6, info[0])) {
|
|
16
|
-
Napi::TypeError::New(env, args[1].second).ThrowAsJavaScriptException();
|
|
17
|
-
return env.Null();
|
|
18
|
-
}
|
|
19
|
-
double out [6];
|
|
20
|
-
swe_cotrans_sp(
|
|
21
|
-
in,
|
|
22
|
-
out,
|
|
23
|
-
info[1].As<Napi::Number>().DoubleValue()
|
|
24
|
-
);
|
|
25
|
-
return sweph_js_array_converter(out, 6, env);
|
|
26
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 argument: csec" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - degrees in centiseconds" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
Napi::Value sweph_cs2degstr(const Napi::CallbackInfo& info) {
|
|
9
|
-
Napi::Env env = info.Env();
|
|
10
|
-
if(!sweph_type_check(args, info)) {
|
|
11
|
-
return env.Null();
|
|
12
|
-
}
|
|
13
|
-
char out [AS_MAXCH];
|
|
14
|
-
swe_cs2degstr(
|
|
15
|
-
info[0].As<Napi::Number>().Int32Value(),
|
|
16
|
-
out
|
|
17
|
-
);
|
|
18
|
-
return Napi::String::New(env, out);
|
|
19
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: csec, pchar, mchar" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - degrees in centiseconds" },
|
|
6
|
-
{ STRING, "Argument 2 should be a string - sign character for positive values" },
|
|
7
|
-
{ STRING, "Argument 3 should be a string - sign character for negative values" }
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
Napi::Value sweph_cs2lonlatstr(const Napi::CallbackInfo& info) {
|
|
11
|
-
Napi::Env env = info.Env();
|
|
12
|
-
if(!sweph_type_check(args, info)) {
|
|
13
|
-
return env.Null();
|
|
14
|
-
}
|
|
15
|
-
char out [AS_MAXCH];
|
|
16
|
-
swe_cs2lonlatstr(
|
|
17
|
-
info[0].As<Napi::Number>().Int32Value(),
|
|
18
|
-
info[1].As<Napi::String>().Utf8Value()[0],
|
|
19
|
-
info[2].As<Napi::String>().Utf8Value()[0],
|
|
20
|
-
out
|
|
21
|
-
);
|
|
22
|
-
return Napi::String::New(env, out);
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: csec, sep, supzero" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - degrees in centiseconds" },
|
|
6
|
-
{ STRING, "Argument 2 should be a string - separator character" },
|
|
7
|
-
{ TRUEFALSE, "Argument 3 should be a boolean - omit seconds if they are zero" }
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
Napi::Value sweph_cs2timestr(const Napi::CallbackInfo& info) {
|
|
11
|
-
Napi::Env env = info.Env();
|
|
12
|
-
if(!sweph_type_check(args, info)) {
|
|
13
|
-
return env.Null();
|
|
14
|
-
}
|
|
15
|
-
char out [AS_MAXCH];
|
|
16
|
-
swe_cs2timestr(
|
|
17
|
-
info[0].As<Napi::Number>().Int32Value(),
|
|
18
|
-
int(info[1].As<Napi::String>().Utf8Value()[0]),
|
|
19
|
-
info[2].As<Napi::Boolean>(),
|
|
20
|
-
out
|
|
21
|
-
);
|
|
22
|
-
return Napi::String::New(env, out);
|
|
23
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 argument: csec" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - degrees in centiseconds" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
Napi::Value sweph_csnorm(const Napi::CallbackInfo& info) {
|
|
9
|
-
Napi::Env env = info.Env();
|
|
10
|
-
if(!sweph_type_check(args, info)) {
|
|
11
|
-
return env.Null();
|
|
12
|
-
}
|
|
13
|
-
int32 val = swe_csnorm(info[0].As<Napi::Number>().Int32Value());
|
|
14
|
-
return Napi::Number::New(env, val);
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 argument: csec" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - degrees in centiseconds" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
Napi::Value sweph_csroundsec(const Napi::CallbackInfo& info) {
|
|
9
|
-
Napi::Env env = info.Env();
|
|
10
|
-
if(!sweph_type_check(args, info)) {
|
|
11
|
-
return env.Null();
|
|
12
|
-
}
|
|
13
|
-
int32 val = swe_csroundsec(info[0].As<Napi::Number>().Int32Value());
|
|
14
|
-
return Napi::Number::New(env, val);
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 argument: double" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - double value" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
Napi::Value sweph_d2l(const Napi::CallbackInfo& info) {
|
|
9
|
-
Napi::Env env = info.Env();
|
|
10
|
-
if(!sweph_type_check(args, info)) {
|
|
11
|
-
return env.Null();
|
|
12
|
-
}
|
|
13
|
-
int32 val = swe_d2l(info[0].As<Napi::Number>().DoubleValue());
|
|
14
|
-
return Napi::Number::New(env, val);
|
|
15
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 5, "Expecting 5 arguments: year, month, day, hour, calendar" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - full year" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - month 1-12" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - day 1-31" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - hour with decimal fraction 0-23.999" },
|
|
9
|
-
{ STRING, "Argument 5 should be a string - calendar system, 'g' for gregorian calendar, 'j' for julian calendar" }
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
Napi::Value sweph_date_conversion(const Napi::CallbackInfo& info) {
|
|
13
|
-
Napi::Env env = info.Env();
|
|
14
|
-
if(!sweph_type_check(args, info)) {
|
|
15
|
-
return env.Null();
|
|
16
|
-
}
|
|
17
|
-
double ret;
|
|
18
|
-
int flag = swe_date_conversion(
|
|
19
|
-
info[0].As<Napi::Number>().Int32Value(),
|
|
20
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
21
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
22
|
-
info[3].As<Napi::Number>().DoubleValue(),
|
|
23
|
-
info[4].As<Napi::String>().Utf8Value()[0],
|
|
24
|
-
&ret
|
|
25
|
-
);
|
|
26
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
27
|
-
obj["flag"] = flag;
|
|
28
|
-
obj["data"] = ret;
|
|
29
|
-
return obj;
|
|
30
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 argument: jd" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
Napi::Value sweph_day_of_week(const Napi::CallbackInfo& info) {
|
|
9
|
-
Napi::Env env = info.Env();
|
|
10
|
-
if(!sweph_type_check(args, info)) {
|
|
11
|
-
return env.Null();
|
|
12
|
-
}
|
|
13
|
-
int val = swe_day_of_week(info[0].As<Napi::Number>().DoubleValue());
|
|
14
|
-
return Napi::Number::New(env, val);
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 argument: deg" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number: decimal degrees" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
Napi::Value sweph_degnorm(const Napi::CallbackInfo& info) {
|
|
9
|
-
Napi::Env env = info.Env();
|
|
10
|
-
if(!sweph_type_check(args, info)) {
|
|
11
|
-
return env.Null();
|
|
12
|
-
}
|
|
13
|
-
double val = swe_degnorm(info[0].As<Napi::Number>().DoubleValue());
|
|
14
|
-
return Napi::Number::New(env, val);
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 argument: tjd" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
Napi::Value sweph_deltat(const Napi::CallbackInfo& info) {
|
|
9
|
-
Napi::Env env = info.Env();
|
|
10
|
-
if(!sweph_type_check(args, info)) {
|
|
11
|
-
return env.Null();
|
|
12
|
-
}
|
|
13
|
-
double delta = swe_deltat(info[0].As<Napi::Number>().DoubleValue());
|
|
14
|
-
return Napi::Number::New(env, delta);
|
|
15
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 2, "Expecting 2 arguments: tjd, ephe" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - ephemeris flag" }
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
Napi::Value sweph_deltat_ex(const Napi::CallbackInfo& info) {
|
|
10
|
-
Napi::Env env = info.Env();
|
|
11
|
-
if(!sweph_type_check(args, info)) {
|
|
12
|
-
return env.Null();
|
|
13
|
-
}
|
|
14
|
-
char serr [AS_MAXCH] = "";
|
|
15
|
-
double delta = swe_deltat_ex(
|
|
16
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
17
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
18
|
-
serr
|
|
19
|
-
);
|
|
20
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
21
|
-
obj["error"] = serr;
|
|
22
|
-
obj["data"] = delta;
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 2, "Expecting 2 arguments: csec, csec" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - degrees in centiseconds" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - degrees in centiseconds" }
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
Napi::Value sweph_difcs2n(const Napi::CallbackInfo& info) {
|
|
10
|
-
Napi::Env env = info.Env();
|
|
11
|
-
if(!sweph_type_check(args, info)) {
|
|
12
|
-
return env.Null();
|
|
13
|
-
}
|
|
14
|
-
int32 dif = swe_difcs2n(
|
|
15
|
-
info[0].As<Napi::Number>().Int32Value(),
|
|
16
|
-
info[1].As<Napi::Number>().Int32Value()
|
|
17
|
-
);
|
|
18
|
-
return Napi::Number::New(env, dif);
|
|
19
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 2, "Expecting 2 arguments: csec, csec" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - degrees in centiseconds" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - degrees in centiseconds" }
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
Napi::Value sweph_difcsn(const Napi::CallbackInfo& info) {
|
|
10
|
-
Napi::Env env = info.Env();
|
|
11
|
-
if(!sweph_type_check(args, info)) {
|
|
12
|
-
return env.Null();
|
|
13
|
-
}
|
|
14
|
-
int32 dif = swe_difcsn(
|
|
15
|
-
info[0].As<Napi::Number>().Int32Value(),
|
|
16
|
-
info[1].As<Napi::Number>().Int32Value()
|
|
17
|
-
);
|
|
18
|
-
return Napi::Number::New(env, dif);
|
|
19
|
-
}
|