Initial import of version 2.10
This commit is contained in:
71
perl/Changes
Normal file
71
perl/Changes
Normal file
@@ -0,0 +1,71 @@
|
||||
Revision history for Perl extension SwissEph.
|
||||
|
||||
First created on 3 April 2009, with Swiss Ephemeris 1.76.
|
||||
|
||||
Updated on 27 January 2011:
|
||||
- Function swe_utc_time_zone() added for Swiss Ephemeris 1.77
|
||||
- Delta t updated
|
||||
- Fixed stars: algorithm in swe_fixstar() was improved, new input file sefstars.txt was created
|
||||
|
||||
Updated on 7 September 2012:
|
||||
- Precession algorithm was updated
|
||||
- Function swe_rise_trans_true_hor() added for Swiss Ephemeris 1.78
|
||||
- several minor bug fixes (see documentation swephprg.pdf)
|
||||
|
||||
Updated on 23 April 2013, Swiss Ephemeris 1.79
|
||||
- Improved precision in eclipse calculations: 2nd and 3rd contact with solar eclipses, penumbral and partial phases with lunar eclipses.
|
||||
- Bug fix in function swe_sol_eclipse_when_loc().If the local maximum eclipse occurs at sunset or sunrise, tret[0] now gives the moment when the lower limb of the Sun touches the horizon. This was not correctly implemented in former versions
|
||||
- Bug fix in Perl functions swe_house() etc. These functions had crashed with a segmention violation if called with the house parameter ‘G’.
|
||||
- Bug fix in Perl function swe_utc_to_jd(), where gregflag had been read from the 4th instead of the 6th parameter.
|
||||
- Bug fix in Perl functions to do with date conversion. The default mechanism for gregflag was buggy.
|
||||
- For Hindu astrologers, some more ayanamshas were added that are related to Suryasiddhanta and Aryabhata and are of historical interest.
|
||||
|
||||
Updated on 31 August 2012
|
||||
- Function swe_house_name() added for Swiss Ephemeris 1.80
|
||||
|
||||
Updated on 11 February 2014, for Swiss Ephemeris 2.00:
|
||||
- Major release, Swisseph can handle JPL ephemeris DE431
|
||||
- The following functions were added:
|
||||
swe_lun_eclipse_when_loc() searches locally visible lunar eclipse
|
||||
swe_lmt_to_lat() conversion of LMT to LAT
|
||||
swe_lat_to_lmt() conversion of LAT to LMT
|
||||
|
||||
Updated on 18 March 2015, Swiss Ephemeris 2.01:
|
||||
- a few constants added to SwissEph.pm
|
||||
|
||||
Updated on 5 August 2015, Swiss Ephemeris 2.02:
|
||||
- The following functions were added:
|
||||
swe_deltat_ex() provides Delta T adjusted to ephemeris chosen
|
||||
swe_get_ayanamsa_ex() provides ayanamsa depending on ephemeris chosen
|
||||
swe_get_ayanamsa_ex_ut() provides ayanamsa depending on ephemeris chosen
|
||||
|
||||
Updated on 14 August 2015, Swiss Ephemeris 2.02.01:
|
||||
- see documentation swephprg.pdf
|
||||
|
||||
Updated on 16 Oct 2015, Swiss Ephemeris 2.03:
|
||||
- see documentation swephprg.pdf
|
||||
|
||||
Updated on 21 Oct 2015, Swiss Ephemeris 2.04:
|
||||
- see documentation swephprg.pdf
|
||||
|
||||
Updated on 26 May 2016, Swiss Ephemeris 2.05:
|
||||
- see documentation swephprg.pdf
|
||||
|
||||
Updated on 12 Jan 2018, Swiss Ephemeris 2.07:
|
||||
- see documentation swephprg.pdf
|
||||
|
||||
Updated on 19 Jun 2019, Swiss Ephemeris 2.08:
|
||||
- a few defines (constants) were added in SwissEph.pm
|
||||
|
||||
Updated on 9 Aug 2019, Swiss Ephemeris 2.08:
|
||||
- eclipse functions return saros series and eclipse numbers
|
||||
|
||||
Updated on 23 Jul 2020, Swiss Ephemeris 2.09:
|
||||
- see documentation swephprg.pdf
|
||||
|
||||
Updated on 18 Aug 2020, Swiss Ephemeris 2.09.02:
|
||||
- see documentation swephprg.pdf
|
||||
|
||||
Updated on 10 Dec 2020, Swiss Ephemeris 2.10:
|
||||
- see documentation swephprg.pdf
|
||||
|
85
perl/MANIFEST
Normal file
85
perl/MANIFEST
Normal file
@@ -0,0 +1,85 @@
|
||||
Changes
|
||||
Makefile.PL
|
||||
MANIFEST
|
||||
ppport.h
|
||||
sweodef.h
|
||||
swephexp.h
|
||||
README
|
||||
SwissEph.xs
|
||||
t/SwissEph.t
|
||||
lib/SwissEph.pm
|
||||
blib/arch/auto/SwissEph/SwissEph.so
|
||||
fix_selinux
|
||||
/usr/local/lib64/swe/libswe.so.2.04
|
||||
/usr/local/lib64/swe/libswe.so.2.05c
|
||||
/usr/local/lib64/swe/libswe.so.2.05c
|
||||
/usr/local/lib64/swe/libswe.so.2.05c
|
||||
/usr/local/lib64/swe/libswe.so.2.05
|
||||
/usr/local/lib64/swe/libswe.so.2.05.01
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b02
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b02
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b03
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b02
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b04
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b04
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b05
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b05
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b05
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b05
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b05
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b05
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b05
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b05
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b05
|
||||
/usr/local/lib64/swe/libswe.so.2.05.02b06
|
||||
/usr/local/lib64/swe/libswe.so.2.06
|
||||
/usr/local/lib64/swe/libswe.so.2.06.01b02
|
||||
/usr/local/lib64/swe/libswe.so.2.06.01b03
|
||||
/usr/local/lib64/swe/libswe.so.2.06.01b03
|
||||
/usr/local/lib64/swe/libswe.so.2.06.01b03
|
||||
/usr/local/lib64/swe/libswe.so.2.06.01b03
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07
|
||||
/usr/local/lib64/swe/libswe.so.2.07.01
|
||||
/usr/local/lib64/swe/libswe.so.2.05c
|
||||
/usr/local/lib64/swe/libswe.so.2.07.02
|
||||
/usr/local/lib64/swe/libswe.so.2.07.02
|
||||
/usr/local/lib64/swe/libswe.so.2.08
|
||||
/usr/local/lib64/swe/libswe.so.2.08
|
||||
/usr/local/lib64/swe/libswe.so.2.08
|
||||
/usr/local/lib64/swe/libswe.so.2.08
|
||||
/usr/local/lib64/swe/libswe.so.2.08
|
||||
/usr/local/lib64/swe/libswe.so.2.08
|
||||
/usr/local/lib64/swe/libswe.so.2.08.00a
|
||||
/usr/local/lib64/swe/libswe.so.2.09
|
||||
/usr/local/lib64/swe/libswe.so.2.09
|
||||
/usr/local/lib64/swe/libswe.so.2.09
|
||||
/usr/local/lib64/swe/libswe.so.2.09.01
|
||||
/usr/local/lib64/swe/libswe.so.2.09.02
|
||||
/usr/local/lib64/swe/libswe.so.2.09.03
|
||||
/usr/local/lib64/swe/libswe.so.2.10
|
||||
META.yml Module YAML meta-data (added by MakeMaker)
|
||||
META.json Module JSON meta-data (added by MakeMaker)
|
39
perl/META.json
Normal file
39
perl/META.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"abstract" : "The Swiss Ephemeris made accessible for Perl \r",
|
||||
"author" : [
|
||||
"Dieter <dieter@astro.ch>"
|
||||
],
|
||||
"dynamic_config" : 1,
|
||||
"generated_by" : "ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.120921",
|
||||
"license" : [
|
||||
"unknown"
|
||||
],
|
||||
"meta-spec" : {
|
||||
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
|
||||
"version" : "2"
|
||||
},
|
||||
"name" : "SwissEph",
|
||||
"no_index" : {
|
||||
"directory" : [
|
||||
"t",
|
||||
"inc"
|
||||
]
|
||||
},
|
||||
"prereqs" : {
|
||||
"build" : {
|
||||
"requires" : {
|
||||
"ExtUtils::MakeMaker" : "0"
|
||||
}
|
||||
},
|
||||
"configure" : {
|
||||
"requires" : {
|
||||
"ExtUtils::MakeMaker" : "0"
|
||||
}
|
||||
},
|
||||
"runtime" : {
|
||||
"requires" : {}
|
||||
}
|
||||
},
|
||||
"release_status" : "stable",
|
||||
"version" : "2.10"
|
||||
}
|
21
perl/META.yml
Normal file
21
perl/META.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
abstract: "The Swiss Ephemeris made accessible for Perl \r"
|
||||
author:
|
||||
- 'Dieter <dieter@astro.ch>'
|
||||
build_requires:
|
||||
ExtUtils::MakeMaker: 0
|
||||
configure_requires:
|
||||
ExtUtils::MakeMaker: 0
|
||||
dynamic_config: 1
|
||||
generated_by: 'ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.120921'
|
||||
license: unknown
|
||||
meta-spec:
|
||||
url: http://module-build.sourceforge.net/META-spec-v1.4.html
|
||||
version: 1.4
|
||||
name: SwissEph
|
||||
no_index:
|
||||
directory:
|
||||
- t
|
||||
- inc
|
||||
requires: {}
|
||||
version: 2.10
|
21
perl/Makefile.PL
Executable file
21
perl/Makefile.PL
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/local/bin/perl
|
||||
use 5.008007;
|
||||
use ExtUtils::MakeMaker;
|
||||
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
|
||||
# the contents of the Makefile that is written.
|
||||
WriteMakefile(
|
||||
NAME => 'SwissEph',
|
||||
VERSION_FROM => 'lib/SwissEph.pm', # finds $VERSION
|
||||
PREREQ_PM => {}, # e.g., Module::Name => 1.1
|
||||
($] >= 5.005 ? ## Add these new keywords supported since 5.005
|
||||
(ABSTRACT_FROM => 'lib/SwissEph.pm', # retrieve abstract from module
|
||||
AUTHOR => 'Dieter <dieter@astro.ch>') : ()),
|
||||
#LIBS => ['-lC:\sweph\bin\swedll32'], # e.g., '-lm'
|
||||
LIBS => ['-L/usr/local/lib64/swe -lswe'], # e.g., '-lm'
|
||||
#LIBS => ['-lswe'], # e.g., '-lm'
|
||||
DEFINE => '', # e.g., '-DHAVE_SOMETHING'
|
||||
INC => '-I.', # e.g., '-I. -I/usr/include/other'
|
||||
# DISTVNAME => 'perl_swisseph', #
|
||||
# Un-comment this if you add C files to link with later:
|
||||
# OBJECT => '$(O_FILES)', # link all the C files too
|
||||
);
|
112
perl/README
Normal file
112
perl/README
Normal file
@@ -0,0 +1,112 @@
|
||||
SwissEph version 2.056
|
||||
=====================
|
||||
|
||||
The README is used to introduce the module and provide instructions on
|
||||
how to install the module, any machine dependencies it may have (for
|
||||
example C compilers and installed libraries) and any other information
|
||||
that should be provided before the module is installed.
|
||||
|
||||
INSTALLATION
|
||||
|
||||
On Linux:
|
||||
=========
|
||||
|
||||
Before installing this module, you have to install a shared library of
|
||||
the Swiss Ephemeris functions.
|
||||
Unpack http://www.astro.com/ftp/swisseph/swe_unix_src_2.06.tar.gz
|
||||
or whatever the latest version is, or the one you want to use.
|
||||
There will be a src directory in the unpacked files. Go there
|
||||
and run
|
||||
make libswe.so to build the shared library. Copy this file to
|
||||
/usr/local/lib64/swe
|
||||
|
||||
Usually, this will also require that you create a file (as root)
|
||||
/etc/ld.so.conf.d/swisseph.conf
|
||||
with the content line
|
||||
/usr/local/lib64/swe
|
||||
|
||||
Now run ldconfig(8) (as root) in order to generate the
|
||||
symbolic links required.
|
||||
|
||||
Now you can install the Perl module for the Swiss Ephemeris.
|
||||
Type the following:
|
||||
|
||||
perl Makefile.PL
|
||||
make
|
||||
make test
|
||||
make install (requires root)
|
||||
|
||||
On Windows:
|
||||
===========
|
||||
|
||||
Before installing this module, you have to install the following things
|
||||
on your computer:
|
||||
|
||||
- the Swiss Ephemeris DLL swedll32.dll. If haven't done this yet,
|
||||
download the Swiss Ephemeris from the download area at
|
||||
www.astro.com/swisseph and unpack it.
|
||||
|
||||
- Visual C++ Express Edition, which can be downloaded for free from the
|
||||
http://www.microsoft.com/express/download/.
|
||||
|
||||
After that you can install the Perl module. In the current directory
|
||||
(where you read this README file), open the file Makefile.PL and
|
||||
fix the LIBS parameter. It must contain the directory to the Swiss Ephemeris
|
||||
DLL. After that run:
|
||||
|
||||
perl Makefile.PL
|
||||
nmake
|
||||
nmake test
|
||||
nmake install
|
||||
|
||||
|
||||
COPYRIGHT AND LICENCE
|
||||
|
||||
Copyright (C) 2017 Astrodienst, Zurich, Switzerland.
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the same terms as Perl itself, either Perl version 5.8.7 or,
|
||||
at your option, any later version of Perl 5 you may have available.
|
||||
|
||||
-----------------------
|
||||
Update 23-march-2016, example how to use PerlSwissEph-2.04.tar.gz
|
||||
|
||||
download PerlSwissEph-2.04.tar.gz
|
||||
unpack it with
|
||||
tar xzvf PerlSwissEph-2.04.tar.gz
|
||||
|
||||
it creates a directory SwissEph-2.04
|
||||
cd SwissEph-2.04
|
||||
perl Makefile.PL (to create Makefile)
|
||||
|
||||
there is a warning:
|
||||
Warning: the following files are missing in your kit:
|
||||
/usr/local/lib64/swe/libswe.so.2.04
|
||||
|
||||
The tarball contains ./usr/local/lib64/swe/libswe.so.2.04
|
||||
you must copy or move this to /usr/local/lib64/swe/libswe.so.2.04 by hand.
|
||||
|
||||
If your architecture is not 64-bit Linux, you may have to create libswe.so.2.04
|
||||
from the Swisseph C source distribution yourself, and then place it properly.
|
||||
|
||||
Then you must tell the Linux system how to find the dynamic library.
|
||||
On Redhat RHEL 6 this goes like this:
|
||||
as root, cd /etc/ld.so.conf.d
|
||||
edit or create a file swisseph.conf with this line in it
|
||||
/usr/local/lib64/swe
|
||||
|
||||
now run as root: ldconfig
|
||||
afterwards, you should find in /usr/local/lib64/swe/
|
||||
something like this
|
||||
lrwxrwxrwx. 1 root root 14 Mar 23 17:44 libswe.so -> libswe.so.2.04
|
||||
lrwxrwxrwx. 1 root root 14 Mar 23 17:43 libswe.so.1 -> libswe.so.2.04
|
||||
-rwxr-xr-x. 1 root root 847686 Mar 23 17:10 libswe.so.2.04
|
||||
|
||||
Now, as normal user, go back to
|
||||
cd SwissEph-2.04
|
||||
make
|
||||
make test
|
||||
|
||||
as root, (unless you can write in the install target directories)
|
||||
make install
|
||||
|
2833
perl/SwissEph.xs
Normal file
2833
perl/SwissEph.xs
Normal file
File diff suppressed because it is too large
Load Diff
5
perl/fix_selinux
Executable file
5
perl/fix_selinux
Executable file
@@ -0,0 +1,5 @@
|
||||
/usr/sbin/semanage fcontext -a -t textrel_shlib_t /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/SwissEph/SwissEph.so
|
||||
/sbin/restorecon -v /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/SwissEph/SwissEph.so
|
||||
/usr/sbin/semanage fcontext -a -t textrel_shlib_t /usr/lib/libswe.so.1.76.00
|
||||
/sbin/restorecon -v /usr/lib/libswe.so.1.76.00
|
||||
|
1725
perl/lib/SwissEph.pm
Normal file
1725
perl/lib/SwissEph.pm
Normal file
File diff suppressed because it is too large
Load Diff
4896
perl/ppport.h
Normal file
4896
perl/ppport.h
Normal file
File diff suppressed because it is too large
Load Diff
341
perl/sweodef.h
Normal file
341
perl/sweodef.h
Normal file
@@ -0,0 +1,341 @@
|
||||
/************************************************************
|
||||
definitions and constants for all Swiss Ephemeris source files,
|
||||
only required for compiling the libraries, not for the external
|
||||
interface of the libraries.
|
||||
|
||||
The definitions are a subset of Astrodienst's ourdef.h content
|
||||
and must be kept compatible. Everything not used in SwissEph
|
||||
has been deleted.
|
||||
|
||||
Does auto-detection of MSDOS (TURBO_C or MS_C), HPUNIX, Linux.
|
||||
Must be extended for more portability; there should be a way
|
||||
to detect byte order and file system type.
|
||||
|
||||
************************************************************/
|
||||
|
||||
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
||||
|
||||
License conditions
|
||||
------------------
|
||||
|
||||
This file is part of Swiss Ephemeris.
|
||||
|
||||
Swiss Ephemeris is distributed with NO WARRANTY OF ANY KIND. No author
|
||||
or distributor accepts any responsibility for the consequences of using it,
|
||||
or for whether it serves any particular purpose or works at all, unless he
|
||||
or she says so in writing.
|
||||
|
||||
Swiss Ephemeris is made available by its authors under a dual licensing
|
||||
system. The software developer, who uses any part of Swiss Ephemeris
|
||||
in his or her software, must choose between one of the two license models,
|
||||
which are
|
||||
a) GNU public license version 2 or later
|
||||
b) Swiss Ephemeris Professional License
|
||||
|
||||
The choice must be made before the software developer distributes software
|
||||
containing parts of Swiss Ephemeris to others, and before any public
|
||||
service using the developed software is activated.
|
||||
|
||||
If the developer choses the GNU GPL software license, he or she must fulfill
|
||||
the conditions of that license, which includes the obligation to place his
|
||||
or her whole software project under the GNU GPL or a compatible license.
|
||||
See http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
|
||||
If the developer choses the Swiss Ephemeris Professional license,
|
||||
he must follow the instructions as found in http://www.astro.com/swisseph/
|
||||
and purchase the Swiss Ephemeris Professional Edition from Astrodienst
|
||||
and sign the corresponding license contract.
|
||||
|
||||
The License grants you the right to use, copy, modify and redistribute
|
||||
Swiss Ephemeris, but only under certain conditions described in the License.
|
||||
Among other things, the License requires that the copyright notices and
|
||||
this notice be preserved on all copies.
|
||||
|
||||
Authors of the Swiss Ephemeris: Dieter Koch and Alois Treindl
|
||||
|
||||
The authors of Swiss Ephemeris have no control or influence over any of
|
||||
the derived works, i.e. over software or services created by other
|
||||
programmers which use Swiss Ephemeris functions.
|
||||
|
||||
The names of the authors or of the copyright holder (Astrodienst) must not
|
||||
be used for promoting any software, product or service which uses or contains
|
||||
the Swiss Ephemeris. This copyright notice is the ONLY place where the
|
||||
names of the authors can legally appear, except in cases where they have
|
||||
given special permission in writing.
|
||||
|
||||
The trademarks 'Swiss Ephemeris' and 'Swiss Ephemeris inside' may be used
|
||||
for promoting such software, products or services.
|
||||
*/
|
||||
|
||||
#ifndef _OURDEF_INCLUDED /* ourdef.h is a superset of sweodef.h */
|
||||
#ifndef _SWEODEF_INCLUDED /* allow multiple #includes */
|
||||
#define _SWEODEF_INCLUDED
|
||||
|
||||
# define MY_TRUE 1 /* for use in other defines, before TRUE is defined */
|
||||
# define MY_FALSE 0 /* for use in other defines, before TRUE is defined */
|
||||
|
||||
/* TLS support
|
||||
*
|
||||
* Sun Studio C/C++, IBM XL C/C++, GNU C and Intel C/C++ (Linux systems) -> __thread
|
||||
* Borland, VC++ -> __declspec(thread)
|
||||
*/
|
||||
#if !defined(TLSOFF) && !defined( __APPLE__ ) && !defined(WIN32) && !defined(DOS32)
|
||||
#if defined( __GNUC__ )
|
||||
#define TLS __thread
|
||||
#else
|
||||
#define TLS __declspec(thread)
|
||||
#endif
|
||||
#else
|
||||
#define TLS
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32 /* Microsoft VC 5.0 does not define MSDOS anymore */
|
||||
# undef MSDOS
|
||||
# define MSDOS MY_TRUE
|
||||
#include <wtypes.h>
|
||||
#include <objbase.h>
|
||||
#include <wincon.h>
|
||||
#include <winbase.h>
|
||||
#include <io.h>
|
||||
#include <windows.h>
|
||||
# define sleep(x) Sleep((x) * 1000)
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define MS_VC
|
||||
#endif
|
||||
|
||||
#ifdef WIN32 /* Microsoft VC 5.0 does not define MSDOS anymore */
|
||||
# define MSDOS MY_TRUE
|
||||
#endif
|
||||
|
||||
#ifdef MSDOS /* already defined by some DOS compilers */
|
||||
# undef MSDOS
|
||||
# define MSDOS MY_TRUE
|
||||
#endif
|
||||
|
||||
#ifdef __TURBOC__ /* defined by turboc */
|
||||
# ifndef MSDOS
|
||||
# define MSDOS MY_TRUE
|
||||
# endif
|
||||
# define TURBO_C
|
||||
#endif
|
||||
|
||||
#ifdef __SC__ /* defined by Symantec C */
|
||||
# ifndef MSDOS
|
||||
# define MSDOS MY_TRUE
|
||||
# endif
|
||||
# define SYMANTEC_C
|
||||
#endif
|
||||
|
||||
#ifdef __WATCOMC__ /* defined by WatcomC */
|
||||
# ifndef MSDOS
|
||||
# define MSDOS MY_TRUE
|
||||
# endif
|
||||
# define WATCOMC
|
||||
#endif
|
||||
|
||||
#ifdef __MWERKS__ /* defined on Macintosh CodeWarrior */
|
||||
# if macintosh && powerc
|
||||
# define MACOS MY_TRUE /* let it undefined otherwise */
|
||||
# define MSDOS MY_FALSE /* in case one above fired falsely */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef MSDOS
|
||||
# define HPUNIX MY_FALSE
|
||||
# define INTEL_BYTE_ORDER 1
|
||||
# ifndef TURBO_C
|
||||
# define MS_C /* assume Microsoft C compiler */
|
||||
# endif
|
||||
# define UNIX_FS MY_FALSE
|
||||
#else
|
||||
# ifdef MACOS
|
||||
# define HPUNIX MY_FALSE
|
||||
# define UNIX_FS MY_FALSE
|
||||
# else
|
||||
# define MSDOS MY_FALSE
|
||||
# define HPUNIX MY_TRUE
|
||||
# ifndef _HPUX_SOURCE
|
||||
# define _HPUX_SOURCE
|
||||
# endif
|
||||
# define UNIX_FS MY_TRUE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef FILE
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#if HPUNIX
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* if we have 16-bit ints, we define INT_16; we will need %ld to printf an int32
|
||||
* if we have 64-bit long, we define LONG_64
|
||||
* If none is defined, we have int = long = 32 bit, and use %d to printf an int32
|
||||
*/
|
||||
#include <limits.h>
|
||||
#if INT_MAX < 40000
|
||||
# define INT_16
|
||||
#else
|
||||
# if LONG_MAX > INT_MAX
|
||||
# define LONG_64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef BYTE_ORDER
|
||||
#ifdef LITTLE_ENDIAN
|
||||
# if BYTE_ORDER == LITTLE_ENDIAN
|
||||
# define INTEL_BYTE_ORDER
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef INT_16
|
||||
typedef long int32;
|
||||
typedef unsigned long uint32;
|
||||
typedef int int16;
|
||||
typedef double REAL8; /* real with at least 64 bit precision */
|
||||
typedef long INT4; /* signed integer with at least 32 bit precision */
|
||||
typedef unsigned long UINT4;
|
||||
/* unsigned integer with at least 32 bit precision */
|
||||
typedef int AS_BOOL;
|
||||
typedef unsigned int UINT2; /* unsigned 16 bits */
|
||||
# define ABS4 labs /* abs function for long */
|
||||
#else
|
||||
typedef int int32;
|
||||
typedef long long int64;
|
||||
typedef unsigned int uint32;
|
||||
typedef short int16;
|
||||
typedef double REAL8; /* real with at least 64 bit precision */
|
||||
typedef int INT4; /* signed integer with at least 32 bit precision */
|
||||
typedef unsigned int UINT4;
|
||||
/* unsigned integer with at least 32 bit precision */
|
||||
typedef int AS_BOOL;
|
||||
typedef unsigned short UINT2; /* unsigned 16 bits */
|
||||
# define ABS4 abs /* abs function for long */
|
||||
#endif
|
||||
|
||||
#if MSDOS
|
||||
# ifdef TURBO_C
|
||||
# include <alloc.h> /* MSC needs malloc ! */
|
||||
# else
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
# define SIGALRM SIGINT
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
# define TRUE 1
|
||||
# define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef OK
|
||||
# define OK (0)
|
||||
# define ERR (-1)
|
||||
#endif
|
||||
|
||||
/* hack because UCHAR is already used by mingw gcc */
|
||||
#ifdef __GNUC__
|
||||
#ifdef _WIN32
|
||||
#define UCHAR SWE_UCHAR
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef unsigned char UCHAR;
|
||||
#define UCP (UCHAR*)
|
||||
#define SCP (char*)
|
||||
|
||||
# define ODEGREE_STRING "°" /* degree as string, utf8 encoding */
|
||||
|
||||
|
||||
|
||||
#ifndef HUGE
|
||||
# define HUGE 1.7E+308 /* biggest value for REAL8 */
|
||||
#endif
|
||||
#ifndef M_PI
|
||||
# define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
/* #define forward static obsolete */
|
||||
|
||||
#define AS_MAXCH 256 /* used for string declarations, allowing 255 char+\0 */
|
||||
|
||||
/*
|
||||
#define DEGTORAD 0.0174532925199433
|
||||
#define RADTODEG 57.2957795130823
|
||||
*/
|
||||
#define RADTODEG (180.0 / M_PI)
|
||||
#define DEGTORAD (M_PI / 180.0)
|
||||
|
||||
typedef int32 centisec; /* centiseconds used for angles and times */
|
||||
#define CS (centisec) /* use for casting */
|
||||
#define CSEC centisec /* use for typing */
|
||||
|
||||
#define DEG 360000 /* degree expressed in centiseconds */
|
||||
#define DEG7_30 (2700000) /* 7.5 degrees */
|
||||
#define DEG15 (15 * DEG)
|
||||
#define DEG24 (24 * DEG)
|
||||
#define DEG30 (30 * DEG)
|
||||
#define DEG60 (60 * DEG)
|
||||
#define DEG90 (90 * DEG)
|
||||
#define DEG120 (120 * DEG)
|
||||
#define DEG150 (150 * DEG)
|
||||
#define DEG180 (180 * DEG)
|
||||
#define DEG270 (270 * DEG)
|
||||
#define DEG360 (360 * DEG)
|
||||
|
||||
/* #define CSTORAD 4.84813681109536E-08 centisec to rad: pi / 180 /3600/100 */
|
||||
/* #define RADTOCS 2.06264806247096E+07 rad to centisec 180*3600*100/pi */
|
||||
#define CSTORAD (DEGTORAD / 360000.0)
|
||||
#define RADTOCS (RADTODEG * 360000.0)
|
||||
|
||||
#define CS2DEG (1.0/360000.0) /* centisec to degree */
|
||||
|
||||
/* control strings for fopen() */
|
||||
#if UNIX_FS
|
||||
# define BFILE_R_ACCESS "r" /* open binary file for reading */
|
||||
# define BFILE_RW_ACCESS "r+" /* open binary file for writing and reading */
|
||||
# define BFILE_W_CREATE "w" /* create/open binary file for write*/
|
||||
# define BFILE_A_ACCESS "a+" /* create/open binary file for append*/
|
||||
# define FILE_R_ACCESS "r" /* open text file for reading */
|
||||
# define FILE_RW_ACCESS "r+" /* open text file for writing and reading */
|
||||
# define FILE_W_CREATE "w" /* create/open text file for write*/
|
||||
# define FILE_A_ACCESS "a+" /* create/open text file for append*/
|
||||
# define O_BINARY 0 /* for open(), not defined in Unix */
|
||||
# define OPEN_MODE 0666 /* default file creation mode */
|
||||
# define DIR_GLUE "/" /* glue string for directory/file */
|
||||
# define PATH_SEPARATOR ";:" /* semicolon or colon may be used */
|
||||
#else
|
||||
# define BFILE_R_ACCESS "rb" /* open binary file for reading */
|
||||
# define BFILE_RW_ACCESS "r+b" /* open binary file for writing and reading */
|
||||
# define BFILE_W_CREATE "wb" /* create/open binary file for write*/
|
||||
# define BFILE_A_ACCESS "a+b" /* create/open binary file for append*/
|
||||
# define PATH_SEPARATOR ";" /* semicolon as PATH separator */
|
||||
# define OPEN_MODE 0666 /* default file creation mode */
|
||||
# ifdef MACOS
|
||||
# define FILE_R_ACCESS "r" /* open text file for reading */
|
||||
# define FILE_RW_ACCESS "r+" /* open text file for writing and reading */
|
||||
# define FILE_W_CREATE "w" /* create/open text file for write*/
|
||||
# define FILE_A_ACCESS "a+" /* create/open text file for append*/
|
||||
# define DIR_GLUE ":" /* glue string for directory/file */
|
||||
# else
|
||||
# define FILE_R_ACCESS "rt" /* open text file for reading */
|
||||
# define FILE_RW_ACCESS "r+t" /* open text file for writing and reading */
|
||||
# define FILE_W_CREATE "wt" /* create/open text file for write*/
|
||||
# define FILE_A_ACCESS "a+t" /* create/open text file for append*/
|
||||
/* attention, all backslashes for msdos directry names must be written as \\,
|
||||
because it is the C escape character */
|
||||
# define DIR_GLUE "\\" /* glue string for directory/file */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#endif /* _SWEODEF_INCLUDED */
|
||||
#endif /* _OURDEF_INCLUDED */
|
1015
perl/swephexp.h
Normal file
1015
perl/swephexp.h
Normal file
File diff suppressed because it is too large
Load Diff
567
perl/t/SwissEph.t
Normal file
567
perl/t/SwissEph.t
Normal file
@@ -0,0 +1,567 @@
|
||||
# Before `make install' is performed this script should be runnable with
|
||||
# `make test'. After `make install' it should work as `perl SwissEph.t'
|
||||
|
||||
|
||||
use Test::More tests => 248;
|
||||
|
||||
BEGIN { use_ok("SwissEph") };
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Sun for 2451544.5 ET : Longitude should be 279.858461
|
||||
#------------------------------------------------------------------------
|
||||
my $ref;
|
||||
my $i;
|
||||
my @xx;
|
||||
my $serr="";
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Coordinate transformation
|
||||
#------------------------------------------------------------------------
|
||||
# ecliptic -> equator
|
||||
my @rade = SwissEph::swe_cotrans([80, 5, 0], -23);
|
||||
is(round_4($rade[0]), 78.7418, "swe_cotrans([80, 5, 0], -23) -> ra");
|
||||
is(round_4($rade[1]), 27.6169, "swe_cotrans([80, 5, 0], -23) -> de");
|
||||
# with speed
|
||||
@rade = SwissEph::swe_cotrans_sp([80, 5, 0, 1, 0, 0], -23);
|
||||
is(round_4($rade[0]), 78.7418, "swe_cotrans([80, 5, 0], -23) -> ra");
|
||||
is(round_4($rade[1]), 27.6169, "swe_cotrans([80, 5, 0], -23) -> de");
|
||||
is(round_4($rade[3]), 1.1210, "swe_cotrans([80, 5, 0], -23) -> ra_speed");
|
||||
is(round_4($rade[4]), 0.0763, "swe_cotrans([80, 5, 0], -23) -> de_speed");
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Function Delta T - values may change, but the seconds for 2000-1-1 are sure
|
||||
#------------------------------------------------------------------------
|
||||
is( round_4(SwissEph::swe_deltat( 2451545 )* 86400), 63.8289, "swe_deltat(1 jan 2000)");
|
||||
|
||||
$ref = SwissEph::swe_deltat_ex(2451545, SwissEph::SEFLG_MOSEPH);
|
||||
is(round_4($ref->{dt} *86400.0), 63.8289, "swe_deltat_ex(1 jan 2000)");
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Sidereal Time
|
||||
#------------------------------------------------------------------------
|
||||
is(round_4( SwissEph::swe_sidtime( 2451544.5 )), 6.6643, "swe_sidtime(1 jan 2000)");
|
||||
is(round_4( SwissEph::swe_sidtime0( 2451544.5, 23.5, 0)), 6.6645, "swe_sidtime0(1 jan 2000,23.5,0)");
|
||||
|
||||
$ref = SwissEph::swe_time_equ(2415020.5);
|
||||
is($ref->{retval}, 0, "swe_time_equ(1 jan 1900)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_time_equ(1 jan 1900)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{time_equ}), -0.0023, "swe_time_equ(1 jan 1900)->time_equ");
|
||||
|
||||
$ref = SwissEph::swe_lat_to_lmt(-146780.0, 82.2);
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_time_equ(1 jan 1900)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{tjd_lmt}), -146779.9898, "swe_lat_to_lmt(-146780.0, 82.2)->tjd_lmt");
|
||||
|
||||
$ref = SwissEph::swe_lmt_to_lat(-146779.9898, 82.2);
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_time_equ(1 jan 1900)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{tjd_lat}), -146779.9998, "swe_lmt_to_lat(-146779.986742931, 82.2)->tjd_lat");
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Calendar conversion
|
||||
#------------------------------------------------------------------------
|
||||
is( SwissEph::swe_julday(2000,1,1,0.), 2451544.5, "swe_julday() 1 jan 2000");
|
||||
is( SwissEph::swe_julday(2000,1,1,0.,1), 2451544.5, "swe_julday() 1 jan 2000, explicit greg flag");
|
||||
is( SwissEph::swe_julday(2000,1,1,0.,0), 2451557.5, "swe_julday() 1 jan 2000, explicit jul flag");
|
||||
$ref = SwissEph::swe_revjul(2436723.5888888889,1);
|
||||
is($ref->{iyar}, 1959, "swe_revjul(2436723.5888888889), year");
|
||||
is($ref->{imon}, 6, "swe_revjul(2436723.5888888889), month");
|
||||
is($ref->{iday}, 4, "swe_revjul(2436723.5888888889), day");
|
||||
is($ref->{ihou}, 2, "swe_revjul(2436723.5888888889), hour");
|
||||
is($ref->{imin}, 8, "swe_revjul(2436723.5888888889), minute");
|
||||
is($ref->{isec}, 0, "swe_revjul(2436723.5888888889), second");
|
||||
is(round_4($ref->{dhou}), 2.1333, "swe_revjul(2436723.5888888889), hour/decimal");
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Wrapper for swe_houses
|
||||
#------------------------------------------------------------------------
|
||||
$ref = SwissEph::swe_houses( 2451544.5, 52., 7., "P");
|
||||
is( round_4( $ref->{cusps}->[1] ), 191.8825, "swe_houses()->{1}");
|
||||
is( round_4( $ref->{cusps}->[2] ), 217.0327, "swe_houses()->{2}");
|
||||
is( round_4( $ref->{cusps}->[3] ), 248.4837, "swe_houses()->{3}");
|
||||
is( round_4( $ref->{cusps}->[4] ), 285.6359, "swe_houses()->{4}");
|
||||
is( round_4( $ref->{cusps}->[5] ), 321.0151, "swe_houses()->{5}");
|
||||
is( round_4( $ref->{cusps}->[6] ), 349.6374, "swe_houses()->{6}");
|
||||
is( round_4( $ref->{cusps}->[7] ), 11.8825, "swe_houses()->{7}");
|
||||
is( round_4( $ref->{cusps}->[8] ), 37.0327, "swe_houses()->{8}");
|
||||
is( round_4( $ref->{cusps}->[9] ), 68.4837, "swe_houses()->{9}");
|
||||
is( round_4( $ref->{cusps}->[10] ), 105.6359, "swe_houses()->{10}");
|
||||
is( round_4( $ref->{cusps}->[11] ), 141.0151, "swe_houses()->{11}");
|
||||
is( round_4( $ref->{cusps}->[12] ), 169.6374, "swe_houses()->{12}");
|
||||
is( round_4( $ref->{asc} ), 191.8825, "swe_houses()->{asc}");
|
||||
is( round_4( $ref->{mc} ), 105.6359, "swe_houses()->{mc}");
|
||||
is( round_4( $ref->{armc} ), 106.9642, "swe_houses()->{armc}");
|
||||
is( round_4( $ref->{vertex} ), 27.2378, "swe_houses()->{vertex}");
|
||||
is( round_4( $ref->{equasc} ), 198.3910, "swe_houses()->{equasc}");
|
||||
is( round_4( $ref->{coasc1} ), 218.3740, "swe_houses()->{coasc1}");
|
||||
is( round_4( $ref->{coasc2} ), 193.7952, "swe_houses()->{coasc2}");
|
||||
is( round_4( $ref->{polasc} ), 38.3740, "swe_houses()->{polasc}");
|
||||
|
||||
$ref = SwissEph::swe_houses_armc( 106.96424825, 52., 23.4376796111111, "P");
|
||||
is( round_4( $ref->{cusps}->[1] ), 191.8825, "swe_houses_armc()->{1}");
|
||||
is( round_4( $ref->{cusps}->[2] ), 217.0327, "swe_houses_armc()->{2}");
|
||||
is( round_4( $ref->{cusps}->[3] ), 248.4837, "swe_houses_armc()->{3}");
|
||||
is( round_4( $ref->{cusps}->[4] ), 285.6359, "swe_houses_armc()->{4}");
|
||||
is( round_4( $ref->{cusps}->[5] ), 321.0151, "swe_houses_armc()->{5}");
|
||||
is( round_4( $ref->{cusps}->[6] ), 349.6374, "swe_houses_armc()->{6}");
|
||||
is( round_4( $ref->{cusps}->[7] ), 11.8825, "swe_houses_armc()->{7}");
|
||||
is( round_4( $ref->{cusps}->[8] ), 37.0327, "swe_houses_armc()->{8}");
|
||||
is( round_4( $ref->{cusps}->[9] ), 68.4837, "swe_houses_armc()->{9}");
|
||||
is( round_4( $ref->{cusps}->[10] ), 105.6359, "swe_houses_armc()->{10}");
|
||||
is( round_4( $ref->{cusps}->[11] ), 141.0151, "swe_houses_armc()->{11}");
|
||||
is( round_4( $ref->{cusps}->[12] ), 169.6374, "swe_houses_armc()->{12}");
|
||||
is( round_4( $ref->{asc} ), 191.8825, "swe_houses_armc()->{asc}");
|
||||
is( round_4( $ref->{mc} ), 105.6359, "swe_houses_armc()->{mc}");
|
||||
is( round_4( $ref->{armc} ), 106.9642, "swe_houses_armc()->{armc}");
|
||||
is( round_4( $ref->{vertex} ), 27.2378, "swe_houses_armc()->{vertex}");
|
||||
is( round_4( $ref->{equasc} ), 198.3910, "swe_houses_armc()->{equasc}");
|
||||
is( round_4( $ref->{coasc1} ), 218.3740, "swe_houses_armc()->{coasc1}");
|
||||
is( round_4( $ref->{coasc2} ), 193.7952, "swe_houses_armc()->{coasc2}");
|
||||
is( round_4( $ref->{polasc} ), 38.3740, "swe_houses_armc()->{polasc}");
|
||||
|
||||
$ref = SwissEph::swe_houses_ex( 2451544.5, 0, 52., 7., "P");
|
||||
is( round_4( $ref->{cusps}->[1] ), 191.8825, "swe_houses_ex()->{1}");
|
||||
is( round_4( $ref->{cusps}->[2] ), 217.0327, "swe_houses_ex()->{2}");
|
||||
is( round_4( $ref->{cusps}->[3] ), 248.4837, "swe_houses_ex()->{3}");
|
||||
is( round_4( $ref->{cusps}->[4] ), 285.6359, "swe_houses_ex()->{4}");
|
||||
is( round_4( $ref->{cusps}->[5] ), 321.0151, "swe_houses_ex()->{5}");
|
||||
is( round_4( $ref->{cusps}->[6] ), 349.6374, "swe_houses_ex()->{6}");
|
||||
is( round_4( $ref->{cusps}->[7] ), 11.8825, "swe_houses_ex()->{7}");
|
||||
is( round_4( $ref->{cusps}->[8] ), 37.0327, "swe_houses_ex()->{8}");
|
||||
is( round_4( $ref->{cusps}->[9] ), 68.4837, "swe_houses_ex()->{9}");
|
||||
is( round_4( $ref->{cusps}->[10] ), 105.6359, "swe_houses_ex()->{10}");
|
||||
is( round_4( $ref->{cusps}->[11] ), 141.0151, "swe_houses_ex()->{11}");
|
||||
is( round_4( $ref->{cusps}->[12] ), 169.6374, "swe_houses_ex()->{12}");
|
||||
is( round_4( $ref->{asc} ), 191.8825, "swe_houses_ex()->{asc}");
|
||||
is( round_4( $ref->{mc} ), 105.6359, "swe_houses_ex()->{mc}");
|
||||
is( round_4( $ref->{armc} ), 106.9642, "swe_houses_ex()->{armc}");
|
||||
is( round_4( $ref->{vertex} ), 27.2378, "swe_houses_ex()->{vertex}");
|
||||
is( round_4( $ref->{equasc} ), 198.3910, "swe_houses_ex()->{equasc}");
|
||||
is( round_4( $ref->{coasc1} ), 218.3740, "swe_houses_ex()->{coasc1}");
|
||||
is( round_4( $ref->{coasc2} ), 193.7952, "swe_houses_ex()->{coasc2}");
|
||||
is( round_4( $ref->{polasc} ), 38.3740, "swe_houses_ex()->{polasc}");
|
||||
|
||||
$ref = SwissEph::swe_house_pos(290,47,23.5,"P",72,0);
|
||||
is($ref->{retval}, 0, "swe_house_pos()->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_house_pos()->serr = $ref->{serr}\n";
|
||||
}
|
||||
is($ref->{ihno}, 2, "swe_house_pos()->ihno");
|
||||
is(round_4($ref->{dhpos}), 2.1459, "swe_house_pos()->dhpos");
|
||||
is(round_4($ref->{dhpos_deg}), 34.3767, "swe_house_pos()->dhpos_deg");
|
||||
|
||||
$ref = SwissEph::swe_gauquelin_sector(2436723.5888888889,SwissEph::SE_MOON,"",0,0,[8.6,47.35,400],1013,15);
|
||||
is($ref->{retval}, 0, "swe_gauquelin_sector()->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_gauquelin_sector(1 jan 1900)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{dsector}), 36.1724, "swe_gauquelin_sector()->dsector");
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Wrapper for swe_calc
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
$ref = SwissEph::swe_calc(2415020.5, 3, 260);
|
||||
is($ref->{retval}, 260, "swe_calc(1900, Venus)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_calc(1900, Venus)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{xx}->[0]), 306.3745, "swe_calc(1900, Venus)->xx[0]");
|
||||
is(round_4($ref->{xx}->[1]), -1.6830, "swe_calc(1900, Venus)->xx[1]");
|
||||
is(round_4($ref->{xx}->[2]), 1.4646, "swe_calc(1900, Venus)->xx[2]");
|
||||
is(round_4($ref->{xx}->[3]), 1.2435, "swe_calc(1900, Venus)->xx[3]");
|
||||
|
||||
my $dt = SwissEph::swe_deltat(2415020.5);
|
||||
$ref = SwissEph::swe_calc_ut(2415020.5-$dt, 3, 260);
|
||||
is($ref->{retval}, 260, "swe_calc_ut(1900, Venus)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_calc_ut(1900, Venus)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{xx}->[0]), 306.3745, "swe_calc_ut(1900, Venus)->xx[0]");
|
||||
is(round_4($ref->{xx}->[1]), -1.6830, "swe_calc_ut(1900, Venus)->xx[1]");
|
||||
is(round_4($ref->{xx}->[2]), 1.4646, "swe_calc_ut(1900, Venus)->xx[2]");
|
||||
is(round_4($ref->{xx}->[3]), 1.2435, "swe_calc_ut(1900, Venus)->xx[3]");
|
||||
#print STDERR "swe_calc_ut $ref->{xx}->[0] $ref->{xx}->[1]\n";
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Wrapper for swe_fixstar
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
$ref = SwissEph::swe_fixstar_mag("alcyone");
|
||||
is($ref->{retval}, 0, "swe_fixstar_mag(Alcyone)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_fixstar_mag(Alcyone)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is($ref->{starname}, "Alcyone,etTau", "swe_fixstar_mag(Alcyone)->starname");
|
||||
is(round_4($ref->{dmag}), 2.87, "swe_fixstar_mag(Alcyone)->dmag");
|
||||
|
||||
$ref = SwissEph::swe_fixstar("alcyone", 2415020.5, 4);
|
||||
is($ref->{retval}, 4, "swe_fixstar(1900, Alcyone)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_fixstar(1900, Alcyone)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is($ref->{starname}, "Alcyone,etTau", "swe_fixstar(1900, Alcyone)->starname");
|
||||
is(round_4($ref->{xx}->[0]), 58.6052, "swe_fixstar(1900, Alcyone)->xx[0]");
|
||||
is(round_4($ref->{xx}->[2]), 25496153.13, "swe_fixstar(1900, Alcyone)->xx[2]");
|
||||
|
||||
$ref = SwissEph::swe_fixstar_ut("alcyone", 2415020.5-SwissEph::swe_deltat(2415020.5), 4);
|
||||
is($ref->{retval}, 4, "swe_fixstar_ut(1900, Alcyone)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_fixstar_ut(1900, Alcyone)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is($ref->{starname}, "Alcyone,etTau", "swe_fixstar_ut(1900, Alcyone)->starname");
|
||||
is(round_4($ref->{xx}->[0]), 58.6052, "swe_fixstar_ut(1900, Alcyone)->xx[0]");
|
||||
is(round_4($ref->{xx}->[2]), 25496153.13, "swe_fixstar_ut(1900, Alcyone)->xx[2]");
|
||||
|
||||
$ref = SwissEph::swe_fixstar2("alcyone", 2415020.5, 4);
|
||||
is($ref->{retval}, 4, "swe_fixstar2(1900, Alcyone)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_fixstar2(1900, Alcyone)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is($ref->{starname}, "Alcyone,etTau", "swe_fixstar2(1900, Alcyone)->starname");
|
||||
is(round_4($ref->{xx}->[0]), 58.6052, "swe_fixstar2(1900, Alcyone)->xx[0]");
|
||||
is(round_4($ref->{xx}->[2]), 25496153.13, "swe_fixstar2(1900, Alcyone)->xx[2]");
|
||||
|
||||
$ref = SwissEph::swe_fixstar2_ut("alcyone", 2415020.5-SwissEph::swe_deltat(2415020.5), 4);
|
||||
is($ref->{retval}, 4, "swe_fixstar2_ut(1900, Alcyone)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_fixstar2_ut(1900, Alcyone)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is($ref->{starname}, "Alcyone,etTau", "swe_fixstar2_ut(1900, Alcyone)->starname");
|
||||
is(round_4($ref->{xx}->[0]), 58.6052, "swe_fixstar2_ut(1900, Alcyone)->xx[0]");
|
||||
is(round_4($ref->{xx}->[2]), 25496153.13, "swe_fixstar2_ut(1900, Alcyone)->xx[2]");
|
||||
|
||||
$ref = SwissEph::swe_fixstar2_mag("alcyone");
|
||||
is($ref->{retval}, 0, "swe_fixstar2_mag(Alcyone)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_fixstar2_mag(Alcyone)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is($ref->{starname}, "Alcyone,etTau", "swe_fixstar2_mag(Alcyone)->starname");
|
||||
is(round_4($ref->{dmag}), 2.87, "swe_fixstar2_mag(Alcyone)->dmag");
|
||||
|
||||
$ref = SwissEph::swe_pheno(2415020.5, 3, 4);
|
||||
is($ref->{retval}, 4, "swe_pheno(1900, Venus)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_pheno(1900, Venus)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{phase_angle}), 36.7449, "swe_pheno(1900, Venus)->phase_angle");
|
||||
is(round_4($ref->{phase}), 0.9007, "swe_pheno(1900, Venus)->phase");
|
||||
is(round_4($ref->{elongation}), 26.2712, "swe_pheno(1900, Venus)->elongation");
|
||||
is(round_4($ref->{disc_diameter}), 0.0032, "swe_pheno(1900, Venus)->disc_diameter");
|
||||
is(round_4($ref->{magnitude}), -3.9102, "swe_pheno(1900, Venus)->magnitude");
|
||||
is(round_4($ref->{hor_parallax}), 0, "swe_pheno(1900, Venus)->hor_parallax");
|
||||
is(round_4($ref->{attr}->[0]), 36.7449, "swe_pheno(1900, Venus)->attr[0]");
|
||||
|
||||
$ref = SwissEph::swe_pheno_ut(2415020.5 - SwissEph::swe_deltat(2415020.5), 3, 4);
|
||||
is($ref->{retval}, 4, "swe_pheno_ut(1900, Venus)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_pheno_ut(1900, Venus)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{phase_angle}), 36.7449, "swe_pheno_ut(1900, Venus)->phase_angle");
|
||||
is(round_4($ref->{phase}), 0.9007, "swe_pheno_ut(1900, Venus)->phase");
|
||||
is(round_4($ref->{elongation}), 26.2712, "swe_pheno_ut(1900, Venus)->elongation");
|
||||
is(round_4($ref->{disc_diameter}), 0.0032, "swe_pheno_ut(1900, Venus)->disc_diameter");
|
||||
is(round_4($ref->{magnitude}), -3.9102, "swe_pheno_ut(1900, Venus)->magnitude");
|
||||
is(round_4($ref->{hor_parallax}), 0, "swe_pheno_ut(1900, Venus)->hor_parallax");
|
||||
is(round_4($ref->{attr}->[0]), 36.7449, "swe_pheno_ut(1900, Venus)->attr[0]");
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# ayanamsha
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
is(round_4(SwissEph::swe_get_ayanamsa(2451544.5)), 24.7403, "swe_get_ayanamsa(2000)");
|
||||
is(round_4(SwissEph::swe_get_ayanamsa_ut(2451544.5-SwissEph::swe_deltat(2451544.5))), 24.7403, "swe_get_ayanamsa(2000)");
|
||||
|
||||
$ref = SwissEph::swe_get_ayanamsa_ex(2451544.5, SwissEph::SEFLG_MOSEPH);
|
||||
is(round_4($ref->{daya}),24.7364, "swe_get_ayanamsa_ex(2000)");
|
||||
|
||||
$ref = SwissEph::swe_get_ayanamsa_ex_ut(2451544.5, SwissEph::SEFLG_MOSEPH);
|
||||
is(round_4($ref->{daya}),24.7364, "swe_get_ayanamsa_ex(2000)");
|
||||
|
||||
is(SwissEph::swe_get_ayanamsa_name(3), "Raman", "swe_get_ayanamsa(Raman)");
|
||||
|
||||
is(SwissEph::swe_get_planet_name(SwissEph::SE_VENUS), "Venus", "swe_get_planet_name(Venus)");
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# refraction, azimuth, and altitude, rise and transit
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
$ref = SwissEph::swe_refrac_extended(0.1,400,1013,15,0.02,1);
|
||||
is($ref->{retval}, 0, "swe_refrac_extended()->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_refrac_extended()->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{alt_true}), -0.4391, "swe_refrac_extended()->alt_true");
|
||||
is(round_4($ref->{alt_apparent}), 0.1, "swe_refrac_extended()->alt_apparent");
|
||||
is(round_4($ref->{refraction}), 0.5392, "swe_refrac_extended()->refraction");
|
||||
is(round_4($ref->{dip}), -0.5238, "swe_refrac_extended()->dip");
|
||||
is(round_4($ref->{dret}->[0]), -0.4391, "swe_refrac_extended()->dret[0]");
|
||||
|
||||
is(round_4(SwissEph::swe_refrac(0.6,1013,15,1)), 0.1441, "swe_refrac()");
|
||||
|
||||
@xx = SwissEph::swe_azalt(2436723.588888888,0,[8.55,47.35,0],1013,15,[252,0,1]);
|
||||
is(round_4($xx[0]), 38.9512, "swe_azalt()->azimuth");
|
||||
is(round_4($xx[1]), 10.8971, "swe_azalt()->alt_true");
|
||||
is(round_4($xx[2]), 10.9771, "swe_azalt()->alt_apparent");
|
||||
|
||||
@xx = SwissEph::swe_azalt_rev(2436723.588888888,0,[8.55,47.35,0],\@xx);
|
||||
is(round_4($xx[0]), 252, "swe_azalt_rev()->ecl_lon");
|
||||
is(round_4($xx[1]), 0, "swe_azalt_rev()->ecl_lat");
|
||||
|
||||
$ref = SwissEph::swe_rise_trans(2415020.5,3,"", 4,0,[8.55,47.23,400],1013,15);
|
||||
is($ref->{retval}, 0, "swe_rise_trans(1900, Venus)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_rise_trans(1900, Venus)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{dret}), 2415020.8696, "swe_rise_trans(1900, Venus)->dret");
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# eclipses and occultations
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
$ref = SwissEph::swe_lun_eclipse_how(2454517.643069,4,[278,0,0]);
|
||||
is($ref->{retval}, 4, "swe_lun_eclipse_how(2008)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_lun_eclipse_how(2008)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{mag_umbral}), 1.1059, "swe_lun_eclipse_how(2008)->mag_umbral");
|
||||
is(round_4($ref->{mag_penumbral}), 2.1450, "swe_lun_eclipse_how(2008)->mag_penumbral");
|
||||
is(round_4($ref->{attr}->[0]), 1.1059, "swe_lun_eclipse_how(2008)->attr[0]");
|
||||
|
||||
$ref = SwissEph::swe_sol_eclipse_how(2454503.663212,4,[-150.270493,-67.547072,0]);
|
||||
is($ref->{retval}, 137, "swe_sol_eclipse_how(2008)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_sol_eclipse_how(2008)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{disc_ratio}), 0.9658, "swe_sol_eclipse_how(2008)->disc_ratio");
|
||||
is(round_4($ref->{fraction_diameter}), 0.9808, "swe_sol_eclipse_how(2008)->fraction_diameter");
|
||||
is(round_4($ref->{fraction_disc}), 0.9327, "swe_sol_eclipse_how(2008)->fraction_disc");
|
||||
is(round_4($ref->{core_shadow_km}), 123.5327, "swe_sol_eclipse_how(2008)->core_shadow_km");
|
||||
is(round_4($ref->{sun_azimuth}), 88.5702, "swe_sol_eclipse_how(2008)->sun_azimuth");
|
||||
is(round_4($ref->{sun_alt_true}), 16.2305, "swe_sol_eclipse_how(2008)->sun_alt_true");
|
||||
is(round_4($ref->{separation_angle}), 0.0011, "swe_sol_eclipse_how(2008)->separation_angle");
|
||||
|
||||
$ref = SwissEph::swe_sol_eclipse_where(2454503.663212,4);
|
||||
is($ref->{retval}, 9, "swe_sol_eclipse_where(2008)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_sol_eclipse_where(2008)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{geopos}->[0]), -150.3452, "swe_sol_eclipse_where(2008)->geopos[0]");
|
||||
is(round_4($ref->{geopos}->[1]), -67.5477, "swe_sol_eclipse_where(2008)->geopos[1]");
|
||||
is(round_4($ref->{disc_ratio}), 0.9658, "swe_sol_eclipse_where(2008)->disc_ratio");
|
||||
is(round_4($ref->{fraction_diameter}), 0.9809, "swe_sol_eclipse_where(2008)->fraction_diameter");
|
||||
is(round_4($ref->{fraction_disc}), 0.9327, "swe_sol_eclipse_where(2008)->fraction_disc");
|
||||
is(round_4($ref->{core_shadow_km}), 123.5327, "swe_sol_eclipse_where(2008)->core_shadow_km");
|
||||
is(round_4($ref->{sun_azimuth}), 88.6393, "swe_sol_eclipse_where(2008)->sun_azimuth");
|
||||
is(round_4($ref->{sun_alt_true}), 16.2591, "swe_sol_eclipse_where(2008)->sun_alt_true");
|
||||
is(round_4($ref->{separation_angle}), 0.0011, "swe_sol_eclipse_where(2008)->separation_angle");
|
||||
|
||||
$ref = SwissEph::swe_lun_occult_where(2454531.296945,SwissEph::SE_VENUS,"",4);
|
||||
is($ref->{retval}, 5, "swe_lun_occult_where(2008)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_lun_occult_where(2008)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{geopos}->[0]), -132.4299, "swe_lun_occult_where(2008)->geopos[0]");
|
||||
is(round_4($ref->{geopos}->[1]), -3.2154, "swe_lun_occult_where(2008)->geopos[1]");
|
||||
is(round_4($ref->{disc_ratio}), 172.5202, "swe_lun_occult_where(2008)->disc_ratio");
|
||||
is(round_4($ref->{fraction_diameter}), 1, "swe_lun_occult_where(2008)->fraction_diameter");
|
||||
is(round_4($ref->{fraction_disc}), 1, "swe_lun_occult_where(2008)->fraction_disc");
|
||||
is(round_4($ref->{core_shadow_km}), -3461.9130, "swe_lun_occult_where(2008)->core_shadow_km");
|
||||
is(round_4($ref->{body_azimuth}), 336.2908, "swe_lun_occult_where(2008)->body_azimuth");
|
||||
is(round_4($ref->{body_alt_true}), 76.8443, "swe_lun_occult_where(2008)->body_alt_true");
|
||||
is(round_4($ref->{separation_angle}), 0.0000, "swe_lun_occult_where(2008)->separation_angle");
|
||||
|
||||
$ref = SwissEph::swe_lun_eclipse_when(2454466.500000,4,0,0);
|
||||
is($ref->{retval}, 4, "swe_lun_eclipse_when(2008)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_lun_eclipse_when(2008)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{ecl_maximum}), 2454517.6431, "swe_lun_eclipse_when(2008)->ecl_maximum");
|
||||
is(round_4($ref->{ecl_partial_begin}), 2454517.5717, "swe_lun_eclipse_when(2008)->partial_begin");
|
||||
is(round_4($ref->{ecl_partial_end}), 2454517.7144, "swe_lun_eclipse_when(2008)->partial_end");
|
||||
is(round_4($ref->{ecl_total_begin}), 2454517.6258, "swe_lun_eclipse_when(2008)->ecl_total_begin");
|
||||
is(round_4($ref->{ecl_total_end}), 2454517.6603, "swe_lun_eclipse_when(2008)->ecl_total_end");
|
||||
is(round_4($ref->{ecl_penumbral_begin}), 2454517.5254, "swe_lun_eclipse_when(2008)->ecl_penumbral_begin");
|
||||
is(round_4($ref->{ecl_penumbral_end}), 2454517.7609, "swe_lun_eclipse_when(2008)->ecl_penumbral_end");
|
||||
|
||||
$ref = SwissEph::swe_sol_eclipse_when_glob(2454466.500000,4,0,0);
|
||||
is($ref->{retval}, 9, "swe_sol_eclipse_when_glob(2008)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_sol_eclipse_when_glob(2008)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{ecl_maximum}), 2454503.6632, "swe_sol_eclipse_when_glob(2008)->ecl_maximum");
|
||||
is(round_4($ref->{ecl_local_noon}), 2454503.6312, "swe_sol_eclipse_when_glob(2008)->ecl_local_noon");
|
||||
is(round_4($ref->{ecl_begin}), 2454503.5686, "swe_sol_eclipse_when_glob(2008)->ecl_begin");
|
||||
is(round_4($ref->{ecl_end}), 2454503.7582, "swe_sol_eclipse_when_glob(2008)->ecl_end");
|
||||
is(round_4($ref->{ecl_total_begin}), 2454503.6388, "swe_sol_eclipse_when_glob(2008)->ecl_total_begin");
|
||||
is(round_4($ref->{ecl_total_end}), 2454503.6879, "swe_sol_eclipse_when_glob(2008)->ecl_total_end");
|
||||
is(round_4($ref->{ecl_central_begin}), 2454503.6417, "swe_sol_eclipse_when_glob(2008)->ecl_central_begin");
|
||||
is(round_4($ref->{ecl_central_end}), 2454503.6850, "swe_sol_eclipse_when_glob(2008)->ecl_central_end");
|
||||
|
||||
$ref = SwissEph::swe_lun_occult_when_glob(2454466.500000,SwissEph::SE_VENUS,"",4,0,0);
|
||||
is($ref->{retval}, 5, "swe_lun_occult_when_glob(2008, Venus)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_lun_occult_when_glob(2008 Venus)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{occ_maximum}), 2454531.2969, "swe_lun_occult_when_glob(2008 Venus)->occ_maximum");
|
||||
is(round_4($ref->{occ_local_noon}), 2454531.3051, "swe_lun_occult_when_glob(2008 Venus)->occ_local_noon");
|
||||
is(round_4($ref->{occ_begin}), 2454531.1986, "swe_lun_occult_when_glob(2008 Venus)->occ_begin");
|
||||
is(round_4($ref->{occ_end}), 2454531.3951, "swe_lun_occult_when_glob(2008 Venus)->occ_end");
|
||||
is(round_4($ref->{occ_total_begin}), 2454531.1989, "swe_lun_occult_when_glob(2008 Venus)->occ_total_begin");
|
||||
is(round_4($ref->{occ_total_end}), 2454531.3948, "swe_lun_occult_when_glob(2008 Venus)->occ_total_end");
|
||||
is(round_4($ref->{occ_central_begin}), 2454531.2206, "swe_lun_occult_when_glob(2008 Venus)->occ_central_begin");
|
||||
is(round_4($ref->{occ_central_end}), 2454531.3731, "swe_lun_occult_when_glob(2008 Venus)->occ_central_end");
|
||||
|
||||
$ref = SwissEph::swe_sol_eclipse_when_loc(2454466.500000,4,0,[8.55,47.35,400]);
|
||||
is($ref->{retval}, 5008, "swe_sol_eclipse_when_loc(2008)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_sol_eclipse_when_loc(2008)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{ecl_maximum}), 2454679.8966, "swe_sol_eclipse_when_loc(2008)->ecl_maximum");
|
||||
is(round_4($ref->{t1st_contact}), 2454679.8708, "swe_sol_eclipse_when_loc(2008)->1st_contact");
|
||||
is(round_4($ref->{t2nd_contact}), 0, "swe_sol_eclipse_when_loc(2008)->2nd_contact");
|
||||
is(round_4($ref->{t3rd_contact}), 0, "swe_sol_eclipse_when_loc(2008)->3rd_contact");
|
||||
is(round_4($ref->{t4th_contact}), 2454679.9230, "swe_sol_eclipse_when_loc(2008)->4th_contact");
|
||||
is(round_4($ref->{disc_ratio}), 1.0449, "swe_sol_eclipse_when_loc(2008)->disc_ratio");
|
||||
is(round_4($ref->{fraction_diameter}), 0.1203, "swe_sol_eclipse_when_loc(2008)->fraction_diameter");
|
||||
is(round_4($ref->{fraction_disc}), 0.0497, "swe_sol_eclipse_when_loc(2008)->fraction_disc");
|
||||
is(round_4($ref->{core_shadow_km}), -120.6315, "swe_sol_eclipse_when_loc(2008)->core_shadow_km");
|
||||
is(round_4($ref->{sun_azimuth}), 309.5993, "swe_sol_eclipse_when_loc(2008)->sun_azimuth");
|
||||
is(round_4($ref->{sun_alt_true}), 51.51, "swe_sol_eclipse_when_loc(2008)->sun_alt_true");
|
||||
is(round_4($ref->{separation_angle}), 0.4739, "swe_sol_eclipse_when_loc(2008)->separation_angle");
|
||||
|
||||
$ref = SwissEph::swe_lun_occult_when_loc(2454466.500000,SwissEph::SE_VENUS,"",4,0,[8.55,47.35,400]);
|
||||
is($ref->{retval}, 8070, "swe_lun_occult_when_loc(2008, Venus)->retval");
|
||||
if (exists($ref->{serr})) {
|
||||
print STDERR "swe_lun_occult_when_loc(2008 Venus)->serr = $ref->{serr}\n";
|
||||
}
|
||||
is(round_4($ref->{occ_maximum}), 2454802.1986, "swe_lun_occult_when_loc(2008 Venus)->occ_maximum");
|
||||
is(round_4($ref->{t1st_contact}), 2454802.1698, "swe_lun_occult_when_loc(2008 Venus)->1st_contact");
|
||||
is(round_4($ref->{t2nd_contact}), 2454802.1705, "swe_lun_occult_when_loc(2008 Venus)->2nd_contact");
|
||||
is(round_4($ref->{t3rd_contact}), 2454802.2253, "swe_lun_occult_when_loc(2008 Venus)->3rd_contact");
|
||||
is(round_4($ref->{t4th_contact}), 2454802.2259, "swe_lun_occult_when_loc(2008 Venus)->4th_contact");
|
||||
is(round_4($ref->{disc_ratio}), 106.8891, "swe_lun_occult_when_loc(2008 Venus)->disc_ratio");
|
||||
is(round_4($ref->{fraction_diameter}), 1, "swe_lun_occult_when_loc(2008 Venus)->fraction_diameter");
|
||||
is(round_4($ref->{fraction_disc}), 1, "swe_lun_occult_when_loc(2008 Venus)->fraction_disc");
|
||||
is(round_4($ref->{core_shadow_km}), -3452.9813, "swe_lun_occult_when_loc(2008 Venus)->core_shadow_km");
|
||||
is(round_4($ref->{body_azimuth}), 33.3583, "swe_lun_occult_when_loc(2008 Venus)->body_azimuth");
|
||||
is(round_4($ref->{body_alt_true}), 11.6903, "swe_lun_occult_when_loc(2008 Venus)->body_alt_true");
|
||||
is(round_4($ref->{separation_angle}), 0.0995, "swe_lun_occult_when_loc(2008 Venus)->separation_angle");
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# planetary nodes and apsides
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
$ref = SwissEph::swe_nod_aps(2436723.588888888, 9, 4, 0);
|
||||
is(round_4($ref->{xnasc}->[0]), 108.997, "swe_nod_aps(pluto)->node_asc");
|
||||
is(round_4($ref->{xndsc}->[0]), 290.9051, "swe_nod_aps(pluto)->node_dsc");
|
||||
is(round_4($ref->{xperi}->[0]), 223.3911, "swe_nod_aps(pluto)->perhelion");
|
||||
is(round_4($ref->{xaphe}->[0]), 44.9470, "swe_nod_aps(pluto)->aphelion");
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# heliacal risings
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
$ref = SwissEph::swe_heliacal_ut(2454800,[8,47,400],[1000,15,15,0.17],[23,1,0,0,0,0],"venus",1,4);
|
||||
is(round_4($ref->{topt}), 2454914.7067, "swe_heliacal_ut(2008 Venus)->topt");
|
||||
|
||||
#for (sort keys(%$ref)) {print STDERR "$_ = $ref->{$_}\n";}
|
||||
#print STDERR "d=".(-146780.0 - $ref->{time_equ})."\n";
|
||||
if (1) {
|
||||
print STDERR "\nend of official test section **************************\n";
|
||||
my $year = 0.9; my $hour = 0.7;
|
||||
my @aa = (60.0, 0, 1, 1, 0, 0);
|
||||
my $xa = -1; my $xb = -1;
|
||||
my @geopos = (8.33, 47.35,400);
|
||||
#my ($xa, $xb) = SwissEph::test1(\@aa);
|
||||
#my $ref = SwissEph::swe_houses(2436723.588888888, 47.35, 8.72, "P");
|
||||
#my $ref = SwissEph::swe_time_equ(2436723.588888888);
|
||||
#my $ref = SwissEph::swe_revjul(2436723.58888);
|
||||
#my $ref = SwissEph::swe_houses_armc($ref->{armc}, 47.35, 23.45, "P");
|
||||
#my $ref = SwissEph::swe_houses_armc_ex2($ref->{armc}, 47.35, 23.45, "P");
|
||||
#my $ref = SwissEph::swe_houses_ex(2436723.588888888, 0, 47.35, 8.72, "P");
|
||||
#my $ref = SwissEph::swe_houses_ex2(2436723.588888888, 0, 47.35, 8.72, "P");
|
||||
#my $ref = SwissEph::swe_house_pos($ref->{armc}, 47.35, 23.45, "P", 72.73, 0);
|
||||
#my $ref = SwissEph::swe_calc(2436723.588888888, 8, 256);
|
||||
#my $ref2 = SwissEph::swe_get_current_file_data(0);
|
||||
#for (sort keys(%$ref2)) {print STDERR "$_ = $ref2->{$_}\n";}
|
||||
#my $ref = SwissEph::swe_calc_ut(2436723.588888888, 8, 256);
|
||||
#my $ref = SwissEph::swe_fixstar("aldeb", 2436723.588888888, 0);
|
||||
#my $ref = SwissEph::swe_fixstar_ut("aldeb", 2436723.588888888, 0);
|
||||
#my $ref = SwissEph::swe_fixstar_mag("sirius");
|
||||
#my $ref = SwissEph::swe_gauquelin_sector(2436723.588888888,0,"sirius",0,0,\@geopos,0,0);
|
||||
#my $ref = SwissEph::swe_lun_occult_when_loc(2436723.588888888,0,"",0,0,\@geopos);
|
||||
#my $ref = SwissEph::swe_sol_eclipse_when_loc(2436723.588888888,0,0,\@geopos);
|
||||
#my $ref = SwissEph::swe_lun_occult_when_glob(2436723.588888888,0,"",0,0,0);
|
||||
#my $ref = SwissEph::swe_sol_eclipse_when_glob(2452845.588888888,0,0,0);
|
||||
#my $ref = SwissEph::swe_lun_eclipse_when(2452845.588888888,0,0,0);
|
||||
#my $ref = SwissEph::swe_lun_occult_where($ref->{ecl_maximum},0, "",0);
|
||||
#my $ref = SwissEph::swe_sol_eclipse_how($ref->{ecl_maximum},0,\@geopos);
|
||||
#my $ref = SwissEph::swe_lun_eclipse_how($ref->{ecl_maximum},0,\@geopos);
|
||||
#my $ref = SwissEph::swe_pheno(2436723.588888888,3,0);
|
||||
#my $ref = SwissEph::swe_pheno_ut(2436723.588888888,3,0);
|
||||
#my $ref = SwissEph::swe_refrac_extended(0.1,400,1013,15,0.02,1);
|
||||
#my $dref = SwissEph::swe_refrac(1,1013,15,0);
|
||||
#my $ref = SwissEph::swe_nod_aps(2436723.588888888, 9, 0, 0);
|
||||
#for (sort keys(%$ref)) {print STDERR "$_ = $ref->{$_}\n";}
|
||||
#print STDERR "@{$ref->{xaphe}}\n";
|
||||
#print STDERR "@{$ref->{xperi}}\n";
|
||||
#print STDERR "@{$ref->{xnasc}}\n";
|
||||
#print STDERR "@{$ref->{xndsc}}\n";
|
||||
#@xin = (252, 0, 1);
|
||||
#my @arf = SwissEph::swe_azalt(2436723.588888888,0,\@geopos,1013,15,\@xin);
|
||||
#my @arf = SwissEph::swe_azalt_rev(2436723.588888888,0,\@geopos,\@arf);
|
||||
#print STDERR "dref = @arf\n";
|
||||
#my $ref = SwissEph::swe_revjul($ref->{ecl_maximum});
|
||||
#for (sort keys(%$ref)) {print STDERR "$_ = $ref->{$_}\n";}
|
||||
#for (@{$ref->{cusps_speed}}) {print STDERR "xx $_\n";}
|
||||
#for (@{$ref->{tret}}) {print STDERR "xx $_\n";}
|
||||
#for (@{$ref->{attr}}) {print STDERR "xx $_\n";}
|
||||
#print STDERR "$retval\n@$cusp\n@$ascmc\n";
|
||||
#my $shnam = SwissEph::swe_house_name('c');
|
||||
#print STDERR "$shnam\n";
|
||||
#$ref = SwissEph::swe_version();
|
||||
#for (sort keys(%$ref)) {print STDERR "$_ = $ref->{$_}\n";}
|
||||
#$ref = SwissEph::swe_heliacal_ut(2454800,[8,47,400],[1000,15,15,0.17],[23,1,0,0,0,0],"venus",1,260);
|
||||
#for (sort keys(%$ref)) {print STDERR "$_ = $ref->{$_}\n";}
|
||||
#print STDERR "dret: ".join(", ", @{$ref->{dret}})."\n";
|
||||
#$ref = SwissEph::swe_vis_limit_mag(2454915.7040719,[8,47,400],[1000,15,15,0.17],[23,1,0,0,0,0],"venus",256);
|
||||
#for (sort keys(%$ref)) {print STDERR "$_ = $ref->{$_}\n";}
|
||||
#$ref = SwissEph::swe_utc_time_zone(2000,1,1,1,59,60.1,5.5);
|
||||
#for (sort keys(%$ref)) {print STDERR "$_ = $ref->{$_}\n";}
|
||||
#for (@{$ref->{dret}}) {print STDERR "$_\n";}
|
||||
#$ref = SwissEph::swe_utc_to_jd(2008,12,31,23,59,57.3);
|
||||
#for (sort keys(%$ref)) {print STDERR "$_ = $ref->{$_}\n";}
|
||||
#my $tjd0 = $ref->{tjd_et};
|
||||
#for (my $i = 0; $i < 10; $i++) {
|
||||
# $ref = SwissEph::swe_jdet_to_utc($tjd0 + $i/86400);
|
||||
# print STDERR "$ref->{iday}.$ref->{imon}.$ref->{iyar}, $ref->{ihou}:$ref->{imin}:$ref->{dsec}\n";
|
||||
#}
|
||||
#$ref = SwissEph::swe_get_orbital_elements(2436723.5, 3, 0);
|
||||
#for (sort keys(%$ref)) {print STDERR "$_ = $ref->{$_}\n";}
|
||||
#$ref = SwissEph::swe_orbit_max_min_true_distance(2436723.5, 3, 0);
|
||||
#for (sort keys(%$ref)) {print STDERR "$_ = $ref->{$_}\n";}
|
||||
#my $ref = SwissEph::swe_calc_pctr(2436723.588888888, 8, 5, 0);
|
||||
#my $pp = $ref->{xx};
|
||||
#for (sort keys(%$ref)) {print STDERR "$_ = $ref->{$_}\n";}
|
||||
#print STDERR "@$pp\n";
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Obliquity
|
||||
#------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
sub round6 {
|
||||
return sprintf( "%.0f", 1000000 * shift);
|
||||
}
|
||||
|
||||
sub round_4 {
|
||||
my $a = shift;
|
||||
$a = int(10000 * ($a + 0.00005));
|
||||
return $a / 10000.0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user