@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
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 2, "Expecting 2 arguments: jd_et, flag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - start time in julian day in ephemeris/terrestrial time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - calculation flag" }
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
Napi::Value sweph_mooncross_node(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 xlon;
|
|
16
|
-
double xlat;
|
|
17
|
-
double jd_et = swe_mooncross_node(
|
|
18
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
19
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
20
|
-
&xlon,
|
|
21
|
-
&xlat,
|
|
22
|
-
serr
|
|
23
|
-
);
|
|
24
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
25
|
-
obj["date"] = jd_et;
|
|
26
|
-
obj["error"] = serr;
|
|
27
|
-
obj["longitude"] = xlon;
|
|
28
|
-
obj["latitude"] = xlat;
|
|
29
|
-
return obj;
|
|
30
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 2, "Expecting 2 arguments: jd_ut, flag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - start time in julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - calculation flag" }
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
Napi::Value sweph_mooncross_node_ut(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 xlon;
|
|
16
|
-
double xlat;
|
|
17
|
-
double jd_ut = swe_mooncross_node_ut(
|
|
18
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
19
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
20
|
-
&xlon,
|
|
21
|
-
&xlat,
|
|
22
|
-
serr
|
|
23
|
-
);
|
|
24
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
25
|
-
obj["date"] = jd_ut;
|
|
26
|
-
obj["error"] = serr;
|
|
27
|
-
obj["longitude"] = xlon;
|
|
28
|
-
obj["latitude"] = xlat;
|
|
29
|
-
return obj;
|
|
30
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: x2cross, jd_ut, flag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - longitude position to search for" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - start time in julian days in universal time" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - calculation flag" }
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
Napi::Value sweph_mooncross_ut(const Napi::CallbackInfo& info) {
|
|
11
|
-
Napi::Env env = info.Env();
|
|
12
|
-
if(!sweph_type_check(args, info)) {
|
|
13
|
-
return env.Null();
|
|
14
|
-
}
|
|
15
|
-
char serr [AS_MAXCH] = "";
|
|
16
|
-
double jd_ut = swe_mooncross_ut(
|
|
17
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
18
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
19
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
20
|
-
serr
|
|
21
|
-
);
|
|
22
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
23
|
-
obj["date"] = jd_ut;
|
|
24
|
-
obj["error"] = serr;
|
|
25
|
-
return obj;
|
|
26
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 4, "Expecting 4 arguments: tjd_et, ipl, iflag, method" },
|
|
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
|
-
{ NUMBER, "Argument 4 should be a number - calculation method" }
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
Napi::Value sweph_nod_aps(const Napi::CallbackInfo& info) {
|
|
12
|
-
Napi::Env env = info.Env();
|
|
13
|
-
if(!sweph_type_check(args, info)) {
|
|
14
|
-
return env.Null();
|
|
15
|
-
}
|
|
16
|
-
double asc [6];
|
|
17
|
-
double dsc [6];
|
|
18
|
-
double per [6];
|
|
19
|
-
double aph [6];
|
|
20
|
-
char serr [AS_MAXCH] = "";
|
|
21
|
-
int32 flag = swe_nod_aps(
|
|
22
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
23
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
24
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
25
|
-
info[3].As<Napi::Number>().Int32Value(),
|
|
26
|
-
asc,
|
|
27
|
-
dsc,
|
|
28
|
-
per,
|
|
29
|
-
aph,
|
|
30
|
-
serr
|
|
31
|
-
);
|
|
32
|
-
Napi::Object data = Napi::Object::New(env);
|
|
33
|
-
data["ascending"] = sweph_js_array_converter(asc, 6, env);
|
|
34
|
-
data["descending"] = sweph_js_array_converter(dsc, 6, env);
|
|
35
|
-
data["perihelion"] = sweph_js_array_converter(per, 6, env);
|
|
36
|
-
data["aphelion"] = sweph_js_array_converter(aph, 6, env);
|
|
37
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
38
|
-
obj["flag"] = flag;
|
|
39
|
-
obj["error"] = serr;
|
|
40
|
-
obj["data"] = data;
|
|
41
|
-
return obj;
|
|
42
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 4, "Expecting 4 arguments: tjd_ut, ipl, iflag, method" },
|
|
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
|
-
{ NUMBER, "Argument 4 should be a number - calculation method" }
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
Napi::Value sweph_nod_aps_ut(const Napi::CallbackInfo& info) {
|
|
12
|
-
Napi::Env env = info.Env();
|
|
13
|
-
if(!sweph_type_check(args, info)) {
|
|
14
|
-
return env.Null();
|
|
15
|
-
}
|
|
16
|
-
double asc [6];
|
|
17
|
-
double dsc [6];
|
|
18
|
-
double per [6];
|
|
19
|
-
double aph [6];
|
|
20
|
-
char serr [AS_MAXCH] = "";
|
|
21
|
-
int32 flag = swe_nod_aps_ut(
|
|
22
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
23
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
24
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
25
|
-
info[3].As<Napi::Number>().Int32Value(),
|
|
26
|
-
asc,
|
|
27
|
-
dsc,
|
|
28
|
-
per,
|
|
29
|
-
aph,
|
|
30
|
-
serr
|
|
31
|
-
);
|
|
32
|
-
Napi::Object data = Napi::Object::New(env);
|
|
33
|
-
data["ascending"] = sweph_js_array_converter(asc, 6, env);
|
|
34
|
-
data["descending"] = sweph_js_array_converter(dsc, 6, env);
|
|
35
|
-
data["perihelion"] = sweph_js_array_converter(per, 6, env);
|
|
36
|
-
data["aphelion"] = sweph_js_array_converter(aph, 6, env);
|
|
37
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
38
|
-
obj["flag"] = flag;
|
|
39
|
-
obj["error"] = serr;
|
|
40
|
-
obj["data"] = data;
|
|
41
|
-
return obj;
|
|
42
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: tjd_et, 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_orbit_max_min_true_distance(const Napi::CallbackInfo& info) {
|
|
11
|
-
Napi::Env env = info.Env();
|
|
12
|
-
if(!sweph_type_check(args, info)) {
|
|
13
|
-
return env.Null();
|
|
14
|
-
}
|
|
15
|
-
double dmax;
|
|
16
|
-
double dmin;
|
|
17
|
-
double dtrue;
|
|
18
|
-
char serr [AS_MAXCH] = "";
|
|
19
|
-
int32 flag = swe_orbit_max_min_true_distance(
|
|
20
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
21
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
22
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
23
|
-
&dmax,
|
|
24
|
-
&dmin,
|
|
25
|
-
&dtrue,
|
|
26
|
-
serr
|
|
27
|
-
);
|
|
28
|
-
Napi::Object data = Napi::Object::New(env);
|
|
29
|
-
data["max"] = dmax;
|
|
30
|
-
data["min"] = dmin;
|
|
31
|
-
data["true"] = dtrue;
|
|
32
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
33
|
-
obj["flag"] = flag;
|
|
34
|
-
obj["error"] = serr;
|
|
35
|
-
obj["data"] = data;
|
|
36
|
-
return obj;
|
|
37
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: tjd_et, 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_pheno(const Napi::CallbackInfo& info) {
|
|
11
|
-
Napi::Env env = info.Env();
|
|
12
|
-
if(!sweph_type_check(args, info)) {
|
|
13
|
-
return env.Null();
|
|
14
|
-
}
|
|
15
|
-
double attr [20];
|
|
16
|
-
char serr [AS_MAXCH] = "";
|
|
17
|
-
int32 flag = swe_pheno(
|
|
18
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
19
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
20
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
21
|
-
attr,
|
|
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(attr, 5, env);
|
|
28
|
-
return obj;
|
|
29
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: tjd_ut, 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_pheno_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 attr [20];
|
|
16
|
-
char serr [AS_MAXCH] = "";
|
|
17
|
-
int32 flag = swe_pheno_ut(
|
|
18
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
19
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
20
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
21
|
-
attr,
|
|
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(attr, 5, env);
|
|
28
|
-
return obj;
|
|
29
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 arguments: drad" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - degrees in radians" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
Napi::Value sweph_radnorm(const Napi::CallbackInfo& info) {
|
|
9
|
-
Napi::Env env = info.Env();
|
|
10
|
-
if(!sweph_type_check(args, info)) {
|
|
11
|
-
return env.Null();
|
|
12
|
-
}
|
|
13
|
-
double rad = swe_radnorm(info[0].As<Napi::Number>().DoubleValue());
|
|
14
|
-
return Napi::Number::New(env, rad);
|
|
15
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 4, "Expecting 4 arguments: inalt, atpress, attemp, calc_flag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - altitude above horizon in degrees" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - atmospheric pressure in mbar/hpa" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - atmospheric temperature in celsius" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - calculation flag" }
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
Napi::Value sweph_refrac(const Napi::CallbackInfo& info) {
|
|
12
|
-
Napi::Env env = info.Env();
|
|
13
|
-
if(!sweph_type_check(args, info)) {
|
|
14
|
-
return env.Null();
|
|
15
|
-
}
|
|
16
|
-
double out = swe_refrac(
|
|
17
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
18
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
19
|
-
info[2].As<Napi::Number>().DoubleValue(),
|
|
20
|
-
info[3].As<Napi::Number>().Int32Value()
|
|
21
|
-
);
|
|
22
|
-
return Napi::Number::New(env, out);
|
|
23
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 6, "Expecting 6 arguments: inalt, geoalt, atpress, attemp, lapse_rate, calc_flag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - altitude above horizon in degrees" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - altitude of observer in meters" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - atmospheric pressure in mbar/hpa" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - atmospheric temperature in celsius" },
|
|
9
|
-
{ NUMBER, "Argument 5 should be a number - lapse rate (attemp/geoalt) = [°K/m]" },
|
|
10
|
-
{ NUMBER, "Argument 6 should be a number - calculation flag" }
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
Napi::Value sweph_refrac_extended(const Napi::CallbackInfo& info) {
|
|
14
|
-
Napi::Env env = info.Env();
|
|
15
|
-
if(!sweph_type_check(args, info)) {
|
|
16
|
-
return env.Null();
|
|
17
|
-
}
|
|
18
|
-
double ret [20];
|
|
19
|
-
double out = swe_refrac_extended(
|
|
20
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
21
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
22
|
-
info[2].As<Napi::Number>().DoubleValue(),
|
|
23
|
-
info[3].As<Napi::Number>().DoubleValue(),
|
|
24
|
-
info[4].As<Napi::Number>().DoubleValue(),
|
|
25
|
-
info[5].As<Napi::Number>().Int32Value(),
|
|
26
|
-
ret
|
|
27
|
-
);
|
|
28
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
29
|
-
obj["data"] = out;
|
|
30
|
-
obj["extended"] = sweph_js_array_converter(ret, 4, env);
|
|
31
|
-
return obj;
|
|
32
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
5
|
-
{ 2, "Expecting 2 arguments: tjd, gregflag" },
|
|
6
|
-
{ NUMBER, "Argument 1 should be a number - julian day number" },
|
|
7
|
-
{ NUMBER, "Argument 2 should be a number - calendar system, 1 for SE_GREG_CAL, 0 for SE_JUL_CAL" }
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
Napi::Value sweph_revjul(const Napi::CallbackInfo& info) {
|
|
11
|
-
Napi::Env env = info.Env();
|
|
12
|
-
if(!sweph_type_check(args, info)) {
|
|
13
|
-
return env.Null();
|
|
14
|
-
}
|
|
15
|
-
int year;
|
|
16
|
-
int month;
|
|
17
|
-
int day;
|
|
18
|
-
double time;
|
|
19
|
-
swe_revjul(
|
|
20
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
21
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
22
|
-
&year,
|
|
23
|
-
&month,
|
|
24
|
-
&day,
|
|
25
|
-
&time
|
|
26
|
-
);
|
|
27
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
28
|
-
obj["year"] = year;
|
|
29
|
-
obj["month"] = month;
|
|
30
|
-
obj["day"] = day;
|
|
31
|
-
obj["hour"] = time;
|
|
32
|
-
return obj;
|
|
33
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 8, "Expecting 8 arguments: tjd_ut, ipl, starname, epheflag, rsmi, geopos, atpress, attemp" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day number" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - target object ID" },
|
|
7
|
-
{ STRINGNULL, "Argument 3 should be a string or NULL - target star name" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - calculation flag" },
|
|
9
|
-
{ NUMBER, "Argument 5 should be a number - transit type" },
|
|
10
|
-
{ ARRAY, "Argument 6 should be an array - geographic coordinates [longitude, latitude, elevation]" },
|
|
11
|
-
{ NUMBER, "Argument 7 should be a number - atmospheric pressure in mbar/hpa" },
|
|
12
|
-
{ NUMBER, "Argument 8 should be a number - atmospheric temperature in celsius" }
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
Napi::Value sweph_rise_trans(const Napi::CallbackInfo& info) {
|
|
16
|
-
Napi::Env env = info.Env();
|
|
17
|
-
if(!sweph_type_check(args, info)) {
|
|
18
|
-
return env.Null();
|
|
19
|
-
}
|
|
20
|
-
double geopos [3];
|
|
21
|
-
if(!sweph_double_array_converter(geopos, 3, info[5])) {
|
|
22
|
-
Napi::TypeError::New(env, args[6].second).ThrowAsJavaScriptException();
|
|
23
|
-
return env.Null();
|
|
24
|
-
}
|
|
25
|
-
double ret;
|
|
26
|
-
char serr [AS_MAXCH] = "";
|
|
27
|
-
int32 flag = swe_rise_trans(
|
|
28
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
29
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
30
|
-
info[2].IsString() ? (char*)info[2].As<Napi::String>().Utf8Value().c_str() : NULL,
|
|
31
|
-
info[3].As<Napi::Number>().Int32Value(),
|
|
32
|
-
info[4].As<Napi::Number>().Int32Value(),
|
|
33
|
-
geopos,
|
|
34
|
-
info[6].As<Napi::Number>().DoubleValue(),
|
|
35
|
-
info[7].As<Napi::Number>().DoubleValue(),
|
|
36
|
-
&ret,
|
|
37
|
-
serr
|
|
38
|
-
);
|
|
39
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
40
|
-
obj["flag"] = flag;
|
|
41
|
-
obj["error"] = serr;
|
|
42
|
-
obj["data"] = ret;
|
|
43
|
-
return obj;
|
|
44
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 9, "Expecting 9 arguments: tjd_ut, ipl, starname, epheflag, rsmi, geopos, atpress, attemp, horhgt" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day number" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - target object ID" },
|
|
7
|
-
{ STRINGNULL, "Argument 3 should be a string or NULL - target star name" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - calculation flag" },
|
|
9
|
-
{ NUMBER, "Argument 5 should be a number - transit type" },
|
|
10
|
-
{ ARRAY, "Argument 6 should be an array - geographic coordinates [longitude, latitude, elevation]" },
|
|
11
|
-
{ NUMBER, "Argument 7 should be a number - atmospheric pressure in mbar/hpa" },
|
|
12
|
-
{ NUMBER, "Argument 8 should be a number - atmospheric temperature in celsius" },
|
|
13
|
-
{ NUMBER, "Argument 9 should be a number - height of the local horizon in degrees" }
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
Napi::Value sweph_rise_trans_true_hor(const Napi::CallbackInfo& info) {
|
|
17
|
-
Napi::Env env = info.Env();
|
|
18
|
-
if(!sweph_type_check(args, info)) {
|
|
19
|
-
return env.Null();
|
|
20
|
-
}
|
|
21
|
-
double geopos [3];
|
|
22
|
-
if(!sweph_double_array_converter(geopos, 3, info[5])) {
|
|
23
|
-
Napi::TypeError::New(env, args[6].second).ThrowAsJavaScriptException();
|
|
24
|
-
return env.Null();
|
|
25
|
-
}
|
|
26
|
-
double ret;
|
|
27
|
-
char serr [AS_MAXCH] = "";
|
|
28
|
-
int32 flag = swe_rise_trans_true_hor(
|
|
29
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
30
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
31
|
-
info[2].IsString() ? (char*)info[2].As<Napi::String>().Utf8Value().c_str() : NULL,
|
|
32
|
-
info[3].As<Napi::Number>().Int32Value(),
|
|
33
|
-
info[4].As<Napi::Number>().Int32Value(),
|
|
34
|
-
geopos,
|
|
35
|
-
info[6].As<Napi::Number>().DoubleValue(),
|
|
36
|
-
info[7].As<Napi::Number>().DoubleValue(),
|
|
37
|
-
info[8].As<Napi::Number>().DoubleValue(),
|
|
38
|
-
&ret,
|
|
39
|
-
serr
|
|
40
|
-
);
|
|
41
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
42
|
-
obj["flag"] = flag;
|
|
43
|
-
obj["error"] = serr;
|
|
44
|
-
obj["data"] = ret;
|
|
45
|
-
return obj;
|
|
46
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 arguments: t_acc" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - delta T value" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
void sweph_set_delta_t_userdef(const Napi::CallbackInfo& info) {
|
|
9
|
-
if(!sweph_type_check(args, info)) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
swe_set_delta_t_userdef(info[0].As<Napi::Number>().DoubleValue());
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 arguments: path" },
|
|
5
|
-
{ STRINGNULL, "Argument 1 should be a string or NULL - path to ephemeris files" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
void sweph_set_ephe_path(const Napi::CallbackInfo& info) {
|
|
9
|
-
if(!sweph_type_check(args, info)) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
swe_set_ephe_path(info[0].IsString() ? info[0].As<Napi::String>().Utf8Value().c_str() : NULL);
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 arguments: fname" },
|
|
5
|
-
{ STRING, "Argument 1 should be a string - JPL file name" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
void sweph_set_jpl_file(const Napi::CallbackInfo& info) {
|
|
9
|
-
if(!sweph_type_check(args, info)) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
swe_set_jpl_file(info[0].As<Napi::String>().Utf8Value().c_str());
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: sid_mode, t0, ayan_t0" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - ayanamsa ID" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - reference date in julian days universal time" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - initial value in degrees" }
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
void sweph_set_sid_mode(const Napi::CallbackInfo& info) {
|
|
11
|
-
if(!sweph_type_check(args, info)) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
swe_set_sid_mode(
|
|
15
|
-
info[0].As<Napi::Number>().Int32Value(),
|
|
16
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
17
|
-
info[2].As<Napi::Number>().DoubleValue()
|
|
18
|
-
);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 arguments: t_acc" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - tidal acceleration value" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
void sweph_set_tid_acc(const Napi::CallbackInfo& info) {
|
|
9
|
-
if(!sweph_type_check(args, info)) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
swe_set_tid_acc(info[0].As<Napi::Number>().DoubleValue());
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: geolon, geolat, elevation" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - geographical longitude" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - geographical latitude" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - elevation" }
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
void sweph_set_topo(const Napi::CallbackInfo& info) {
|
|
11
|
-
if(!sweph_type_check(args, info)) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
swe_set_topo(
|
|
15
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
16
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
17
|
-
info[2].As<Napi::Number>().DoubleValue()
|
|
18
|
-
);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 arguments: tjd_ut" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
Napi::Value sweph_sidtime(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_sidtime(info[0].As<Napi::Number>().DoubleValue());
|
|
14
|
-
return Napi::Number::New(env, val);
|
|
15
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: tjd_ut, eps, nut" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - obliquity of the ecliptic" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - nutation" }
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
Napi::Value sweph_sidtime0(const Napi::CallbackInfo& info) {
|
|
11
|
-
Napi::Env env = info.Env();
|
|
12
|
-
if(!sweph_type_check(args, info)) {
|
|
13
|
-
return env.Null();
|
|
14
|
-
}
|
|
15
|
-
double time = swe_sidtime0(
|
|
16
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
17
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
18
|
-
info[2].As<Napi::Number>().DoubleValue()
|
|
19
|
-
);
|
|
20
|
-
return Napi::Number::New(env, time);
|
|
21
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: tjd_ut, ifl, geopos" },
|
|
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
|
-
{ ARRAY, "Argument 3 should be an array of 3 numbers - geographic coordinates [longitude, latitude, elevation]" }
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
Napi::Value sweph_sol_eclipse_how(const Napi::CallbackInfo& info) {
|
|
11
|
-
Napi::Env env = info.Env();
|
|
12
|
-
if(!sweph_type_check(args, info)) {
|
|
13
|
-
return env.Null();
|
|
14
|
-
}
|
|
15
|
-
double geopos [3];
|
|
16
|
-
if(!sweph_double_array_converter(geopos, 3, info[2])) {
|
|
17
|
-
Napi::TypeError::New(env, args[3].second).ThrowAsJavaScriptException();
|
|
18
|
-
return env.Null();
|
|
19
|
-
}
|
|
20
|
-
double attr [20];
|
|
21
|
-
char serr [AS_MAXCH] = "";
|
|
22
|
-
int32 flag = swe_sol_eclipse_how(
|
|
23
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
24
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
25
|
-
geopos,
|
|
26
|
-
attr,
|
|
27
|
-
serr
|
|
28
|
-
);
|
|
29
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
30
|
-
obj["flag"] = flag;
|
|
31
|
-
obj["error"] = serr;
|
|
32
|
-
obj["data"] = sweph_js_array_converter(attr, 11, env);
|
|
33
|
-
return obj;
|
|
34
|
-
}
|