GithubHelp home page GithubHelp logo

mivion / swisseph Goto Github PK

View Code? Open in Web Editor NEW
197.0 197.0 70.0 9.29 MB

Swiss Ephemeris binding for node.js

License: GNU General Public License v2.0

JavaScript 9.08% Python 0.16% C++ 90.63% C 0.12%
ephemeris swisseph

swisseph's People

Contributors

atkit avatar bitdeli-chef avatar charandas avatar gordalina avatar jameshagerman avatar keel avatar krisztianb avatar mivion avatar myrises avatar sjp8 avatar stsmurfy avatar timotejroiko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swisseph's Issues

cannot allocate memory in static TLS block

my app is running it fine in a windows machine with node-webkit and nw-gpy. now im trying to port it into pure nodejs to use in a linux VPS.

The standard "npm install swisseph" works fine, but its version 2.02, not the latest swisseph 2.06
i tried both "npm install swisseph-new" and "npm install swisseph-zp", as well as downloading the zip package and running "node-gyp rebuild". all of them build but give the following error when running:

genesis@genesis-virtual-machine ~/astrobot $ node index.js
module.js:641
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: /home/genesis/astrobot/node_modules/swisseph-new/build/Release/swisseph.node: cannot allocate memory in static TLS block
    at Object.Module._extensions..node (module.js:641:18)
    at Module.load (module.js:531:32)
    at tryModuleLoad (module.js:494:12)
    at Function.Module._load (module.js:486:3)
    at Module.require (module.js:556:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/genesis/astrobot/node_modules/swisseph-new/lib/swisseph.js:1:78)
    at Module._compile (module.js:612:30)
    at Object.Module._extensions..js (module.js:623:10)
    at Module.load (module.js:531:32)

SWE_HOUSES calculation help

Hey Folks,

I'm riding the struggle bus, and I cant figure out why swe_houses is returning a different location for the houses than other astrology tools I'm using to check accuracy. See attached doc, but everywhere I go for this data it says 14 07'01" (near 14.1), including the chart, and yet swe_houses spits out 13.351. In this case they aren't that far off, but in another the difference puts them in different signs. I've double checked input values, and they seem to be accurate. I've been reading the docs and I don't see any setting that I'm missing. I tried swe_houses_ex and got the same result.

Anyone have experience with calculating houses? Or found house calculations differing?

relevant code:

//  julday_ut = 2445789.1666666665; //1984-03-29T16:07:00.000+00:00
        //  location = {
        //     lat : 40.97916667, // 40N 58'45"
        //     lon : -74.11694444 // 74W 7'1"
        // };

swisseph.swe_houses(julday_ut, location.lat, location.lon, 'P', function (result) {
            //etc
}

image

swe_gauquelin_sector() crashes the program

just a heads up:

Using swe_gauquelin_sector() with methods 0 or 1 crashes the program. Methods 2, 3, 4 and 5 are not affected, however using stars does not work.

tests (using node v12):

  • using method 0/1 with valid star without setting ephe path (error star not found)
  • using method 0/1 with valid star with correct ephe path (crash)
  • using method 0/1 with empty star string without setting ephe path (crash)
  • using method 0/1 with empty star string with correct ephe path (crash)
  • using method 2/3/4/5 without setting ephe path (planet works, star is always ignored)
  • using method 2/3/4/5 with correct ephe path (planet works, star is always ignored)

The function should prioritize stars if a star string is present and it should fallback to planets if an empty star string is given. I have attempted to fix this problem without success.

This issue is not important as swe_house_pos() can be used as a replacement, and in most cases, using swe_houses_pos() should be more appropriate anyway.

something is missing in the "eclipse.cc"

firstly, method swe_lun_eclipse_when_loc missing in the src/eclipse.h and src/eclipse.cc
(see http://www.astro.com/swisseph/swephprg.htm#_Toc433200779).

secondary, property retFlag is not present in the result of calls of this module.
but this value is very important for eclipses and occultations detail!

/* retflag -1 (ERR) on error (e.g. if swe_calc() for sun or moon fails)
   SE_ECL_TOTAL or SE_ECL_ANNULAR or SE_ECL_PARTIAL or SE_ECL_ANNULAR_TOTAL
   SE_ECL_CENTRAL
   SE_ECL_NONCENTRAL
   SE_ECL_VISIBLE,
   SE_ECL_MAX_VISIBLE,
   SE_ECL_1ST_VISIBLE, SE_ECL_2ND_VISIBLE
   SE_ECL_3ST_VISIBLE, SE_ECL_4ND_VISIBLE
  ... etc. etc.

probably this is already will be fixed in the next build?

swisseph.wasm

Hi, Mivion!
What do you think about WebAssembly module of SwissEph API?
It is make possible calculating directly in browser, I think!

Can't install

I followed the instructions
npm install and I get an error

node: 8.94
windows 7
visual studion 2017 community edition
I have .net sdk2.

 swisseph@0.5.8 install c:\baps\node_all\swissephem\swisseph
> node-gyp rebuild


c:\baps\node_all\swissephem\swisseph>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere.  [c:\baps\node_all\swissephem\swisseph\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\baps\node_all\swissephem\swisseph
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! swisseph@0.5.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the swisseph@0.5.8 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\steve\AppData\Roaming\npm-cache\_logs\2018-02-19T16_15_54_699Z-debug.log

Was compiled against a different Node.js version

After upgrading to Node 8, getting the errors:
Error: The module '/Users/user/projects/microcosm_alpha/web/node_modules/swisseph/build/Release/swisseph.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 48. This version of Node.js requires NODE_MODULE_VERSION 57. Please try re-compiling or re-installing.
Seems the bindings need to be recompiled against the recent node versions

call swe_set_ephe_path(NULL)

Even if you don’t want to set an ephemeris path and use the Moshier ephemeris, it is nevertheless recommended to call swe_set_ephe_path(NULL), because this function makes important initializations. If you don’t do that, the Swiss Ephemeris may work, but the results may be not 100% consistent.
on run this code
eph.swe_set_ephe_path(null)

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.
 1: 00007FF6DEEBF0DF napi_wrap+121039
 2: 00007FF6DEE651D6 v8::base::CPU::has_sse+34470
 3: 00007FF6DEE65E96 v8::base::CPU::has_sse+37734
 4: 00007FF6DF6617D5 v8::V8::ToLocalEmpty+53
 5: 00007FFE5D813DFD node_swe_set_ephe_path+397 [d:\git\node_modules\swisseph\src\pos.cc]:L645
 6: 00007FFE5D801767 Nan::imp::FunctionCallbackWrapper+231 [d:\git\node_modules\nan\nan_callbacks_12_inl.h]:L177
 7: 00007FF6DF4A4B80 v8::internal::StubCache::Set+1600
 8: 00007FF6DF60C4A2 v8::internal::Builtins::builtin_handle+331970
 9: 00007FF6DF60C7E8 v8::internal::Builtins::builtin_handle+332808
10: 00007FF6DF60C5EE v8::internal::Builtins::builtin_handle+332302
11: 00007FF6DFA7234D v8::internal::SetupIsolateDelegate::SetupHeap+575821
12: 00007FF6DF9EFCFC v8::internal::SetupIsolateDelegate::SetupHeap+41724
13: 00007FF6DF9EFCFC v8::internal::SetupIsolateDelegate::SetupHeap+41724
14: 00007FF6DF9EFCFC v8::internal::SetupIsolateDelegate::SetupHeap+41724
15: 00007FF6DF9EFCFC v8::internal::SetupIsolateDelegate::SetupHeap+41724
16: 00007FF6DF9EFCFC v8::internal::SetupIsolateDelegate::SetupHeap+41724
17: 00007FF6DF9EFCFC v8::internal::SetupIsolateDelegate::SetupHeap+41724
18: 00007FF6DF9EFCFC v8::internal::SetupIsolateDelegate::SetupHeap+41724
19: 00007FF6DF9ED651 v8::internal::SetupIsolateDelegate::SetupHeap+31825
20: 00007FF6DF9ED23C v8::internal::SetupIsolateDelegate::SetupHeap+30780
21: 00007FF6DF56654C v8::internal::StackGuard::InitThread+972
22: 00007FF6DF565236 v8::internal::Execution::Call+182
23: 00007FF6DF6375BB v8::Function::Call+603
24: 00007FF6DEE89FCE node::Start+1150
25: 00007FF6DEE8A277 node::Start+1831
26: 00007FF6DEE8914A node::LoadEnvironment+26
27: 00007FF6DEE2E135 v8::internal::AsmJsScanner::GetIdentifierString+28981
28: 00007FF6DEE89C63 node::Start+275
29: 00007FF6DED4C91C AES_cbc_encrypt+15180
30: 00007FF6DFB20218 v8::internal::SetupIsolateDelegate::SetupHeap+1288216
31: 00007FFE973D7BD4 BaseThreadInitThunk+20
32: 00007FFE97A6CE71 RtlUserThreadStart+33

in original library this null path replaced by DIR_GLUE ("/")

README links

minor, but the URL for swisseph-api is incorrect in the README

Error when installing swisseph with Meteor 1.8 and node v8.1.2

Hi
I'm using meteor 1.8
and node v8.1.2

When I run

meteor npm install --save swisseph

I get the following error:

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

[email protected] install /Users/bliss/Documents/Coder/ReactMeteor/new/node_modules/swisseph
node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/bliss/anaconda/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:275:12)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:346:11)
gyp ERR! stack at emitOne (events.js:116:13)
gyp ERR! stack at Socket.emit (events.js:211:7)
gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:557:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/Users/bliss/.meteor/packages/meteor-tool/.1.8.0.13gd4dz.15ig++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node" "/Users/bliss/.meteor/packages/meteor-tool/.1.8.0.13gd4dz.15ig++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/bliss/Documents/Coder/ReactMeteor/new/node_modules/swisseph
gyp ERR! node -v v8.11.4
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/bliss/.npm/_logs/2018-11-03T15_33_53_276Z-debug.log

"Can't find variable: __dirname" when using in React-Native

npm version: 4.1.2
node version: 7.7.4 or 0.12.8
React-Native version: 0.42

Hi mivion. I have encountered an error after Installing and using swisseph module in a React-Native project. The message is "Can't find variable: __dirname"

Could you give me some suggestion?

error C2995: function template has already been defined

I am facing compilation issues when npm installing swisseph for a node project. Apparently, some files are compiled properly, then it fails:

...
swemplan.c
sweph.c
swephlib.c
win_delay_load_hook.c
swissephz.vcxproj -> C:\... \node_modules\swisseph\build\Release\\swissephz.lib
util.cc
date.cc
C:\... \node_modules\swisseph\node_modules\nan\nan.h(326): error C2995: 'v8::Local<T> Nan::imp::NanEnsureHandleOrPersistent(const v8::Local<T> &)' : function template has already been defined (..\src\date.cc) [C:\... \node_modules\swisseph\build\swisseph.vcxproj]
      C:\... \node_modules\swisseph\node_modules\nan\nan.h(319) : see declaration of 'Nan::imp::NanEnsureHandleOrPersistent'
C:\... \node_modules\swisseph\node_modules\nan\nan.h(346): error C2995: 'v8::Local<T> Nan::imp::NanEnsureLocal(const v8::Local<T> &)' : function template has already been defined (..\src\date.cc) [C:\... \node_modules\swisseph\build\swisseph.vcxproj]
      C:\... \node_modules\swisseph\node_modules\nan\nan.h(334) : see declaration of 'Nan::imp::NanEnsureLocal'
C:\... \node_modules\swisseph\node_modules\nan\nan.h(326): error C2995: 'v8::Local<T> Nan::imp::NanEnsureHandleOrPersistent(const v8::Local<T> &)' : function template has already been defined (..\src\util.cc) [C:\... \node_modules\swisseph\build\swisseph.vcxproj]
      C:\... \node_modules\swisseph\node_modules\nan\nan.h(319) : see declaration of 'Nan::imp::NanEnsureHandleOrPersistent'
C:\... \node_modules\swisseph\node_modules\nan\nan.h(757): error C3083: 'smalloc': the symbol to the left of a '::' must be a type (..\src\date.cc) [C:\... \node_modules\swisseph\build\swisseph.vcxproj]
C:\... \node_modules\swisseph\node_modules\nan\nan.h(346): error C2995: 'v8::Local<T> Nan::imp::NanEnsureLocal(const v8::Local<T> &)' : function template has already been defined (..\src\util.cc) [C:\... \node_modules\swisseph\build\swisseph.vcxproj]
...

I am on node 4.1.1 and npm 2.14.4 and node-gyp 3.0.3. I have Microsoft Visual Express 2013 for Desktop installed on my PC (Windows 10 - 32 bits).

swe_rise_trans Inaccuracy

Hi,
The C version's result for swe_rise_trans for the same input and the Javascript Wrapper version's result for swe_rise_trans is off by 2 minutes.

Here is an actual example.
In C to calculate the sunrise of the julian day = 2444663.309024 one would use this:

    double geopos1[3] = {121.133333, 14.550000};
    double sunriseBeforeBirth1[10];

    swe_rise_trans(2444663.309024, //julian date
                   SE_SUN, //planet num
                   starname, //starname
                   2, // 2
                   SE_CALC_RISE, //SE_CALC_RISE OR SE_CALC_SET
                   geopos1, //geopos
                   1013.25, //1013.25
                   10, //10
                   sunriseBeforeBirth1, //return value
                   serr); //serr

The result of this is in sunriseBeforeBirth1[0] and the value is 2444663.425763

In Javascript for the same julian day 2444663.309024 with the same input:

swisseph.swe_rise_trans(
                    2444663.309024,//julday_ut - 1,
                    swisseph.SE_SUN,//
                    '',//starname
                    swisseph.SEFLG_MOSEPH,
                    swisseph.SE_CALC_RISE,  //rsmi
                    121.133333, //longitude
                    14.550000, //latitude
                    1013.25,  //height
                    10,  //atpress=0.0
                    26,//attemp
                    function(result){
                      console.log('xxx');
                      console.log(result);
                    });

The result gives: { name: '', transitTime: 2444663.4275476774 }

In summary, the first line below is the result of swe_rise_trans from C and the second line is from Javascript for the same inputs(parameters).
2444663.425763
2444663.4275476774
From above, the third decimal place number is different and it is causing a 2 minute difference.

What's the reason for this?
Can this be fixed?
I would have expected it to have the same result since it is essentially the same API....
Thank you...

Failed to fetch Chiron data

Updated node_modules and started to get the error for Chiron: error: 'SwissEph file \'seas_18.se1\' not found in PATH \'/Users/user/projects/microcosm_alpha/app/node_modules/swisseph/ephe/\''. All other planets are ok!

I'd need swe_azalt()

Hi!

For what I want to do, I need to calculate the azimuth. AFAICT, that function is not available. Are there any plans to include it? Is there any way I could help?

I could try to make a PR based on the other function bindings. I think I understand most of it.

Support iojs by first moving to nan@2, and thereby support electron

Hi there,

I forked swisseph today to start migrating the code to nan@2. It compiles with node 0.12+ and the tests pass, but I cannot get it to build with electron's iojs.

Its boiling down to L8, I want to ask what exactly are we saving into argv[1], what do the curly braces do, and do you see any incomplete type information being passed to the templating engine given nan2 docs. Iojs node-gyp build is reporting incomplete type info here.

Any help is appreciated. Cannot wait to run swisseph directly from the browser with electron taking care of the remote calls.

using swisseph for application

Hi,
i'm thinking of using this package for making a desktop application. does this package have all the features the original c/c++ library supports?

SEFLG_EQUATORIAL and SEFLG_XYZ positions are not reported properly

While performing the following test:

var swisseph = require("swisseph");
var assert = require("assert");

// Test date 
var date = {year: 2012, month: 1, day: 1, hour: 0};
console.log("Test date:", date);

var flag = swisseph.SEFLG_MOSEPH;

var julday_ut = swisseph.swe_julday(date.year, date.month, date.day, date.hour, swisseph.SE_GREG_CAL);

assert.equal(julday_ut, 2455927.5);
console.log("Julian UT day for date:", julday_ut);

// Sun position 
var body = swisseph.swe_calc_ut(julday_ut, swisseph.SE_SUN, flag);
assert(!body.error, body.error);
console.log("Sun position:", body);

var flag2 = swisseph.SEFLG_EQUATORIAL | swisseph.SEFLG_MOSEPH;

// Sun position 
var body2 = swisseph.swe_calc_ut(julday_ut, swisseph.SE_SUN, flag2);
assert(!body2.error, body2.error);
console.log("Sun position 2:", body2);

I have noticed it returns longitude and latitude:

Julian UT day for date: 2455927.5
Sun position: { longitude: 279.95830174524593,
  latitude: 0.0002633192811012996,
  distance: 0.9833296457898204,
  longitudeSpeed: 0,
  latitudeSpeed: 0,
  distanceSpeed: 0,
  rflag: 4 }
Sun position 2: { longitude: 280.83338002747627,
  latitude: -23.062912656952832,
  distance: 0.9833296457898204,
  longitudeSpeed: 0,
  latitudeSpeed: 0,
  distanceSpeed: 0,
  rflag: 4 }

instead of rectascension, declination, etc... as mentioned in the swisseph documentation: http://www.astro.com/swisseph/swephprg.htm#_Toc433200761

The same issue happens with SEFLG_ZYX. It does not return x, y, z, dx, dy, dz...

cannot convert from 'initializer list' to 'v8::String::Utf8Value'

When I try to install swisseph I get the following error:

c:\dev\astro\swisseph\src\pos.cc(656): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'v8::String::Utf8Value' [C:\dev\astro\swisseph\build\swisseph.vcxproj]

Please assist?

Calculation of lunar days

Calculation of lunar days
Greetings.
I've done this before in Java, here is a piece of code
public static double[] moon_Rise(SwissEph sw, SweDate sd, double lat, double lon, double tzOffset) { double[] md; ArrayList<Double> moondays = new ArrayList(); if (sw == null) { sw = new SwissEph("./ephe"); } double date = sd.getJulDay(); sd.makeValidDate(); int fl = SweConst.SEFLG_SWIEPH | SweConst.SEFLG_TRANSIT_LONGITUDE; TransitCalculator tc = new TCPlanetPlanet( sw, SweConst.SE_MOON, SweConst.SE_SUN, fl, 0); boolean backwards = true; double previousTransitUT = sw.getTransitUT(tc, sd.getJulDay(), backwards);//forward double nextTransitUT = sw.getTransitUT(tc, sd.getJulDay(), false);//forward int pl = SweConst.SE_MOON; fl = SweConst.SEFLG_SWIEPH | SweConst.SEFLG_TRANSIT_LONGITUDE | SweConst.SEFLG_TRANSIT_SPEED; int rsmi = 0; double[] geopos = {lon, lat, 0}; DblObj tret = new DblObj(); StringBuffer serr = new StringBuffer(); date = previousTransitUT; moondays.add(previousTransitUT); double monday = sd.getJulDay(); while (date < nextTransitUT) { sw.swe_rise_trans(date, pl, null, fl, SweConst.SE_CALC_RISE, geopos, 0, 0, tret, serr); monday = tret.val + 0.1; if (date > tret.val) { continue; } if (nextTransitUT < tret.val) { break; } moondays.add(tret.val); sw.swe_rise_trans(sd.getJulDay(), pl, null, fl, SweConst.SE_CALC_SET, geopos, 0, 0, tret, serr); date = monday; } moondays.add(nextTransitUT); md = new double[moondays.size()]; for (int i = 0; i < md.length; i++) { md[i] = moondays.get(i); } return md; }

Can you tell me how to do this in Javascript, the same Transit calculator, the previous aspect, the next aspect?

error MSB8007: The Platform for project XXX is invalid. Platform='x64'

Hi, I have recently switched from a 32 bits PC to a 64 bits PC and the C++ compilation process does not work anymore. I have described this in a StackOverflow question.

The main error message is:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Targets(23,7):
error MSB8007: The Platform for project 'swissephz.vcxproj' is invalid.  Platform='x64'.

The full error message is available in the StackOverflow question. How can we solve this?

NPM Install: Failed at the [email protected] install script 'node-gyp rebuild'

Hi, I want to develop a small node.js application based on swisseph. After adding the dependency in my package.json, I ran npm install (as usual). Unfortunately, the installation fails and I get the following error message:

image

Not really sure what this means. I am on Windows 10 (32 bits). Microsoft .NET v4 is installed on my PC. Any idea how to solve this issue?

NAN

Do you have any plans on using NAN?
I could easily create a PR for this, it would allow the library to be used with any node version.
Let me know your thougts

enter

Hello, I've successfully installed and running swisseph, tho am confused by the index.html. Says "Help: enter a value and press to make calculations" tho pressing Enter does nothing. What is missing?

Erro while building during install

Hi,

First I need to do: '''npm install swiseph --python'''

Because I have Python 3.3 installed.

But with this, I'm get this error:
LINK : fatal error LNK1149: output filename matches input filename 'C:\Projeto
testes\node_modules\swisseph\build\Release\swisseph.lib' [C:\Projeto\testes\nod
e_modules\swisseph\build\swisseph.vcxproj]

image

Chiron position calculation is giving error

while running the code
swisseph.swe_calc_ut (julday_ut, swisseph.SE_CHIRON, flag, function (body) {
assert (!body.error, body.error);
console.log ('Chiron position:', body);
});

giving me error as follow
SwissEph file 'seas_18.se1' not found in PATH.....

How can I call getTransitUt from original swisseph

Hi!

We need to calculate 2 things:

  • retrograde shift dates

  • longitude return points.

I've looked around and saw the getTransitUt method in the original swisseph implementation.

How can I include a binding for node.js in node-swisseph for getTransitUt?

Great work on this node package! Thank you!

This is a quote from using TCPlanet in the original documentation.

You would create a TransitCalculator from this class and use the SwissEph.getTransit() methods to actually calculate a transit, e.g.:

SwissEph sw = new SwissEph(...);
...
int flags = SweConst.SEFLG_SWIEPH |
SweConst.SEFLG_TRANSIT_LONGITUDE |
SweConst.SEFLG_TRANSIT_SPEED;
boolean backwards = false;

TransitCalculator tc = new TCPlanet(
sw,
SweConst.SE_SATURN,
flags,
0);
...
double nextTransitET = sw.getTransitET(tc, jdET, backwards);

This would calculate the (ET-) date, when the Saturn will change from retrograde to direct movement or vice versa.

Can't install swisseph (NaN dependency)

After updating node to v4.2.x, errors occur when making the c code in npm install.

Updating package.json to the following latest dependency versions fixed the error, in my own repository.

Here are the errors. It seems that the nan module is mainly to blame, but have not isolated it.

../node_modules/nan/nan.h:324:27: error: redefinition of
      'NanEnsureHandleOrPersistent'
  NAN_INLINE v8::Local<T> NanEnsureHandleOrPersistent(const v8::Local<T> &val) {
                          ^
../node_modules/nan/nan.h:319:17: note: previous definition is here
  v8::Handle<T> NanEnsureHandleOrPersistent(const v8::Handle<T> &val) {
                ^
../node_modules/nan/nan.h:344:27: error: redefinition of 'NanEnsureLocal'
  NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Handle<T> &val) {
../node_modules/nan/nan.h:779:26: error: no member named 'Use' in namespace
      'node::Buffer'
    return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
../node_modules/nan/nan.h:772:12: error: no viable conversion from
      'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object>'
    return node::Buffer::New(v8::Isolate::GetCurrent(), size);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thanks!

Electron app

Hi!

I'm thinking about learning to program with Electron to make a desktop astrological app. This is the project I'd need to use to make the calculations inside Electron, isn't it?

Thank you for your efforts!!

David

Can't install swisseph

Dear I have got this msg when i try install swisseph on Centos 7, python 2.7, nodejs 4.2.1, npm 2.14.7
How do I fix this

make: Leaving directory /home/user/node_modules/swisseph/build' gyp ERR! build error gyp ERR! stack Error:make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.10.0-229.14.1.el7.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/user/node_modules/swisseph
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Linux 3.10.0-229.14.1.el7.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "swisseph"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the swisseph package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls swisseph
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/user/npm-debug.log

node-gyp rebuild failed on Node 4.4.3

I am getting the following error when npm installing swisseph on Node version 4.4.3 (Mac OS Maverick):

ld: library not found for -lgcc_s.10.5 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Release/swisseph.node] Error 1 gyp ERR! build error gyp ERR! stack Error:make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/chandan/Projects/node-express-boilerplate/node_modules/swisseph
gyp ERR! node -v v4.4.3
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "swisseph" "--save"
npm ERR! node v4.4.3
npm ERR! npm v3.9.0
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the swisseph package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs swisseph
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls swisseph
npm ERR! There is likely additional logging output above.`

julianDayUT and julianDayET are mixed up in swe_utc_to_jd results

var swisseph = require('swisseph');

var jd = swisseph.swe_utc_to_jd(2015, 10, 18, 12, 0, 0, 0, swisseph.SE_GREG_CAL);
var ut = swisseph.swe_jdut1_to_utc(jd.julianDayUT, swisseph.SE_GREG_CAL);
console.log(ut.second == 0);
var et = swisseph.swe_jdet_to_utc(jd.julianDayET, swisseph.SE_GREG_CAL);
console.log(et.second == 0);

Failed at the [email protected] install script 'node-gyp rebuild'.

Updated to node v5.7.0
Windows 10 64bit
reinstalled node-gyp - No problem
npm-debug.txt

C:\Users\Jack\Documents\nodejs\astronode>npm install swisseph
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
\

[email protected] install C:\Users\Jack\Documents\nodejs\astronode\node_modules\swisseph
node-gyp rebuild

C:\Users\Jack\Documents\nodejs\astronode\node_modules\swisseph>if not defined npm_config_node_gyp (node "C:\Us
ers\Jack\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" r
ebuild ) else (node rebuild )
gyp: C:\Users\Jack.node-gyp\5.7.0\common.gypi not found (cwd: C:\Users\Jack\Documents\nodejs\astronode\node_m
odules\swisseph) while reading includes of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\Jack\AppData\Roaming\npm\node_modules\npm\node_modules\n
ode-gyp\lib\configure.js:355:16)
gyp ERR! stack at emitTwo (events.js:100:13)
gyp ERR! stack at ChildProcess.emit (events.js:185:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Jack\AppData\Roaming\npm\node_modules
npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Jack\Documents\nodejs\astronode\node_modules\swisseph
gyp ERR! node -v v5.7.0
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Jack\AppData\Roaming\npm\node_modules\npm
\bin\npm-cli.js" "install" "swisseph"
npm ERR! node v5.7.0
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the swisseph package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls swisseph
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Jack\Documents\nodejs\astronode\npm-debug.log

C:\Users\Jack\Documents\nodejs\astronode>

update to swisseph 2.07.01

Hello,

would it be possible to update to swisseph 2.07.01 and add the new functions for fixed stars:
swe_fixstar2() and swe_fixstar2_ut()

they have much greater performance according to the docs.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.