Compare commits
33 Commits
timestamp-
...
testing
Author | SHA1 | Date | |
---|---|---|---|
e08e6c6821 | |||
f9db50919f | |||
617d293358 | |||
aa6a489f34 | |||
c25f650755 | |||
2ab696906c | |||
61de67efa4 | |||
e44480cb21 | |||
b6d8ca18c9 | |||
132a7aaac3 | |||
c0711d512d | |||
aed102ea11 | |||
ae1ba0a5e9 | |||
b3d335259c | |||
eedcc3fb3a | |||
b3345b1cd7 | |||
230ec75043 | |||
da90330152 | |||
92f3b7e957 | |||
f4b6bfe37d | |||
7b3a1ddeaf | |||
e394ffa15e | |||
dbfb734b1f | |||
a006498281 | |||
258dcc8356 | |||
9da6941f0a | |||
d87f5e98f7 | |||
e854485da3 | |||
5dc7240420 | |||
93d0fd68aa | |||
064d39b970 | |||
0886396879 | |||
27338c465f |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -57,9 +57,11 @@ Makefile.in
|
||||
/tests/*-test
|
||||
/tests/*-test.log
|
||||
/tests/*-test.trs
|
||||
/tests/test-suite.log
|
||||
/swe-glib-lcov*
|
||||
test-suite.log
|
||||
/tests/gswe-timestamp-test.gc??
|
||||
*.gcno
|
||||
*.gcda
|
||||
*.gcov
|
||||
|
||||
# Translation related files
|
||||
/ABOUT-NLS
|
||||
|
20
.travis.yml
20
.travis.yml
@@ -1,3 +1,19 @@
|
||||
sudo: false
|
||||
language: c
|
||||
install: sudo apt-get install libglib2.0-dev gobject-introspection gnome-common && ./autogen.sh
|
||||
script: make && make check
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libglib2.0-dev
|
||||
- gobject-introspection
|
||||
- gnome-common
|
||||
- autopoint
|
||||
- lcov
|
||||
before_script: ./autogen.sh --enable-coverage
|
||||
script:
|
||||
- make
|
||||
- make check
|
||||
before_install:
|
||||
- pip install --user codecov
|
||||
after_success:
|
||||
- find -type f -name '*.gcno'
|
||||
- codecov --gcov-root src
|
||||
|
81
README.md
81
README.md
@@ -1,22 +1,37 @@
|
||||
# SWE-GLib
|
||||
|
||||
SWE-GLib is a GLib style wrapper library around Astrodienst's [Swiss Ephemeris library](http://www.astro.com/swisseph/).
|
||||
[](https://travis-ci.org/gergelypolonkai/swe-glib)
|
||||
[](https://codecov.io/github/gergelypolonkai/swe-glib?branch=master)
|
||||
|
||||
The source tree contains Astrodienst's ephemeride files, as requested by Alois Treindl of Astrodienst in a mail written to me on 24 July, 2013.
|
||||
SWE-GLib is a GLib style wrapper library around Astrodienst's
|
||||
[Swiss Ephemeris library](http://www.astro.com/swisseph/).
|
||||
|
||||
The source tree contains Astrodienst's ephemeride files, as requested
|
||||
by Alois Treindl of Astrodienst in a mail written to me on 24 July,
|
||||
2013.
|
||||
|
||||
## GTK-Doc
|
||||
|
||||
The project utilizes [GTK-Doc](http://www.gtk.org/gtk-doc/), requiring version 1.19 or later. Although the generated documentation is a bit messy (not everything is documented, and there are some unresolved variables, like [SERVER] on the generated index page.
|
||||
The project utilizes [GTK-Doc](http://www.gtk.org/gtk-doc/), requiring
|
||||
version 1.19 or later. Although the generated documentation is a bit
|
||||
messy (not everything is documented, and there are some unresolved
|
||||
variables, like [SERVER] on the generated index page.
|
||||
|
||||
Still, the documentation generates well, and at least gives a clue about object usage.
|
||||
Still, the documentation generates well, and at least gives a clue
|
||||
about object usage.
|
||||
|
||||
## Bindings
|
||||
|
||||
SWE-GLib utilizes [GObject Introspection](https://wiki.gnome.org/GObjectIntrospection), which means it is available for many languages. Check out the [examples](examples) directory for some sample code!
|
||||
SWE-GLib utilizes
|
||||
[GObject Introspection](https://wiki.gnome.org/GObjectIntrospection),
|
||||
which means it is available for many languages. Check out the
|
||||
[examples](examples) directory for some sample code!
|
||||
|
||||
## Usage
|
||||
|
||||
Many functions return non-opaque C structs; their documentation can be found inline, and in the generated GTK-Doc. Unless otherwise stated, the returned values should never be freed.
|
||||
Many functions return non-opaque C structs; their documentation can be
|
||||
found inline, and in the generated GTK-Doc. Unless otherwise stated,
|
||||
the returned values should never be freed.
|
||||
|
||||
### Creating the required objects
|
||||
|
||||
@@ -67,11 +82,13 @@ GList *sun_aspects = gswe_moment_get_planet_aspects(moment, GSWE_PLANET_SUN);
|
||||
GList *sun_antiscia = gswe_moment_get_planet_antiscia(moment, GSWE_PLANET_SUN);
|
||||
```
|
||||
|
||||
The returned GList objects hold zero or more `GsweAspectData` or `GsweAntiscionData` objects, respectively.
|
||||
The returned GList objects hold zero or more `GsweAspectData` or
|
||||
`GsweAntiscionData` objects, respectively.
|
||||
|
||||
### Getting the Moon phase
|
||||
|
||||
Last, but not least, SWE-GLib can calculate Moon's phase at the given moment. For that, you have to call `gswe_moment_get_moon_phase()`:
|
||||
Last, but not least, SWE-GLib can calculate Moon's phase at the given
|
||||
moment. For that, you have to call `gswe_moment_get_moon_phase()`:
|
||||
|
||||
```c
|
||||
GsweMoonPhaseData *moon_phase = gswe_moment_get_moon_phase(moment);
|
||||
@@ -79,34 +96,60 @@ GsweMoonPhaseData *moon_phase = gswe_moment_get_moon_phase(moment);
|
||||
|
||||
### About altitude
|
||||
|
||||
The Swiss Ephemeris library requires the altitude value to be specified for several calculations. It also notifies how important it is:
|
||||
The Swiss Ephemeris library requires the altitude value to be
|
||||
specified for several calculations. It also notifies how important it
|
||||
is:
|
||||
|
||||
> the altitude above sea must be in meters. Neglecting the altitude can result in an error of about 2 arc seconds with the moon and at an altitude 3000m.
|
||||
> the altitude above sea must be in meters. Neglecting the altitude
|
||||
> can result in an error of about 2 arc seconds with the moon and at
|
||||
> an altitude 3000m.
|
||||
|
||||
2 arc seconds is about 0.000555 degrees of error, which is, well, kind of small. Of course, if you need very precise horoscopes or need planetary positions for a totally different thing, you should really provide a (close to) exact value; otherwise, it is safe to pass any value (well, which seems logical: the average level of all dry lands is about 840 meters; the average level of the whole planet Earth (including oceans and seas) is around 280 meters. Providing a value of ~400 should be OK most of the time).
|
||||
2 arc seconds is about 0.000555 degrees of error, which is, well, kind
|
||||
of small. Of course, if you need very precise horoscopes or need
|
||||
planetary positions for a totally different thing, you should really
|
||||
provide a (close to) exact value; otherwise, it is safe to pass any
|
||||
value (well, which seems logical: the average level of all dry lands
|
||||
is about 840 meters; the average level of the whole planet Earth
|
||||
(including oceans and seas) is around 280 meters. Providing a value of
|
||||
~400 should be OK most of the time).
|
||||
|
||||
## API stability
|
||||
|
||||
The project is currently transitioning to 2.0. master is a bit fragile at the moment, 1.x versions are considered to be stable (although see commit 8f52aba about a huge typo-bug).
|
||||
The project is currently transitioning to 2.0. master is a bit fragile
|
||||
at the moment, 1.x versions are considered to be stable (although see
|
||||
commit 8f52aba about a huge typo-bug).
|
||||
|
||||
## Limitations
|
||||
|
||||
### Topocentric calculations only
|
||||
|
||||
Although the original Swiss Ephemeris library supports it, SWE-GLib can't do Heliocentric, nor Geocentric (as seen from the center of Earth) calculations, only Topocentric (as seen from a given point on Earth"s surface) calculations yet.
|
||||
Although the original Swiss Ephemeris library supports it, SWE-GLib
|
||||
can't do Heliocentric, nor Geocentric (as seen from the center of
|
||||
Earth) calculations, only Topocentric (as seen from a given point on
|
||||
Earth’s surface) calculations yet.
|
||||
|
||||
### Database size
|
||||
|
||||
The size of all data files provided by Astrodienst is around 40MB. Although it should not be a problem with today's home hardware, it can be a hard requirement on embedded systems. For basic calculations, keeping the following files under $(datadir)/swe-glib is usually enough:
|
||||
The size of all data files provided by Astrodienst is around
|
||||
40MB. Although it should not be a problem with today's home hardware,
|
||||
it can be a hard requirement on embedded systems. For basic
|
||||
calculations, keeping the following files under $(datadir)/swe-glib is
|
||||
usually enough:
|
||||
|
||||
* seas_18.se1
|
||||
* semo_18.se1
|
||||
* sepl_18.se1
|
||||
* `seas_18.se1`
|
||||
* `semo_18.se1`
|
||||
* `sepl_18.se1`
|
||||
|
||||
### Fixed stars are not known yet
|
||||
|
||||
Although Swiss Ephemeris has the functionality to calculate the position of fixed stars, SWE-GLib doesn't provide such functionality. This, however, is a planned feature for the close future.
|
||||
Although Swiss Ephemeris has the functionality to calculate the
|
||||
position of fixed stars, SWE-GLib doesn't provide such
|
||||
functionality. This, however, is a planned feature for the close
|
||||
future.
|
||||
|
||||
## Licencing
|
||||
|
||||
As the underlying Swiss Ephemeris is published under GPL (or a commercial license I can not afford), SWE-GLib is also uses that. This means that you can currently use SWE-GLib in software published under the GNU GPL v3.
|
||||
As the underlying Swiss Ephemeris is published under GPL (or a
|
||||
commercial license I can not afford), SWE-GLib is also uses that. This
|
||||
means that you can currently use SWE-GLib in software published under
|
||||
the GNU GPL v3 (or, at your option, any later version).
|
||||
|
@@ -107,7 +107,7 @@ AS_IF([ test "x$use_gcov" = "xyes"], [
|
||||
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
|
||||
|
||||
AS_IF([ test "$LTP" ], [
|
||||
AC_CACHE_CHECK([for ltp version], sw_glib_cv_ltp_version, [
|
||||
AC_CACHE_CHECK([for ltp version], swe_glib_cv_ltp_version, [
|
||||
swe_glib_cv_ltp_version=invalid
|
||||
ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
|
||||
for ltp_check_version in $ltp_version_list; do
|
||||
|
@@ -27,3 +27,5 @@
|
||||
20051231
|
||||
20081231
|
||||
20120630
|
||||
20150630
|
||||
20161231
|
||||
|
@@ -25,11 +25,10 @@
|
||||
# e.g. number of Kronos is ipl = 39 + 4 = 43
|
||||
#
|
||||
# Witte/Sieggruen planets, refined by James Neely
|
||||
#2456200.5, J2000, 143.49291, 1.4579341, 0.2225740, 178.78899, 304.33810, 10.82816, Eros # 1
|
||||
J1900, J1900, 163.7409, 40.99837, 0.00460, 171.4333, 129.8325, 1.0833, Cupido # 1
|
||||
J1900, J1900, 27.6496, 50.66744, 0.00245, 148.1796, 161.3339, 1.0500, Hades # 2
|
||||
J1900, J1900, 165.1232, 59.21436, 0.00120, 299.0440, 0.0000, 0.0000, Zeus # 3
|
||||
J1900, J1900, 169.0193, 64.81960, 0.00305, 208.8801, 0.0000, 0.0000, Kronos # 4
|
||||
J1900, J1900, 169.0193, 64.81690, 0.00305, 208.8801, 0.0000, 0.0000, Kronos # 4
|
||||
J1900, J1900, 138.0533, 70.29949, 0.00000, 0.0000, 0.0000, 0.0000, Apollon # 5
|
||||
J1900, J1900, 351.3350, 73.62765, 0.00000, 0.0000, 0.0000, 0.0000, Admetos # 6
|
||||
J1900, J1900, 55.8983, 77.25568, 0.00000, 0.0000, 0.0000, 0.0000, Vulcanus # 7
|
||||
@@ -67,7 +66,7 @@ J1900,JDATE, 170.73, 79.225630, 0, 0, 0, 0, Proserpina #18
|
||||
# Neither Swisseph nor Solar fire elements agree with Delphine Jay's ephemeris,
|
||||
# which is obviously wrong.
|
||||
2414290.95827875,2414290.95827875, 70.3407215 + 109023.2634989 * T, 0.0068400705250028, 0.1587, 8.14049594 + 2393.47417444 * T, 136.24878256 - 1131.71719709 * T, 2.5, Waldemath, geo # 19
|
||||
##############################################
|
||||
#
|
||||
# The following elements are for test only
|
||||
# (Selena without T)
|
||||
J2000,JDATE, 242.2205555, 0.05279142865925, 0.0, 0.0, 0.0, 0.0, Selena/White Moon, geo # 17
|
||||
|
@@ -1012,6 +1012,12 @@ gswe_moment_calculate_planet(GsweMoment *moment,
|
||||
);
|
||||
}
|
||||
|
||||
// The south node is actually on the opposite side of the chart,
|
||||
// so let’s invert the position.
|
||||
if (planet == GSWE_PLANET_MOON_SOUTH_NODE) {
|
||||
x2[0] = fmod(x2[0] + 180.0, 180.0);
|
||||
}
|
||||
|
||||
calculate_data_by_position(moment, planet, x2[0], &calc_err);
|
||||
|
||||
if (calc_err != NULL) {
|
||||
|
@@ -488,10 +488,13 @@ gswe_timestamp_set_property(GObject *object,
|
||||
|
||||
break;
|
||||
|
||||
/* LCOV_EXCL_START Unless a property ID is missing from above,
|
||||
* we will never arrive here */
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
||||
|
||||
break;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -585,10 +588,13 @@ gswe_timestamp_get_property(
|
||||
|
||||
break;
|
||||
|
||||
/* LCOV_EXCL_START Unless a property ID is missing from above,
|
||||
* we will never arrive here */
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
||||
|
||||
break;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1701,9 +1707,11 @@ gswe_timestamp_new_from_gregorian_full(
|
||||
GsweTimestamp *
|
||||
gswe_timestamp_new_from_julian_day(gdouble julian_day)
|
||||
{
|
||||
GsweTimestamp *timestamp = gswe_timestamp_new();
|
||||
GsweTimestamp *timestamp;
|
||||
|
||||
gswe_timestamp_set_julian_day_et(timestamp, julian_day, NULL);
|
||||
timestamp = GSWE_TIMESTAMP(g_object_new(GSWE_TYPE_TIMESTAMP,
|
||||
"julian-day", julian_day,
|
||||
NULL));
|
||||
|
||||
return timestamp;
|
||||
}
|
||||
@@ -1738,7 +1746,7 @@ gswe_timestamp_set_now_local(GsweTimestamp *timestamp,
|
||||
minute = g_date_time_get_minute(datetime);
|
||||
seconds = g_date_time_get_seconds(datetime);
|
||||
microsec = g_date_time_get_microsecond(datetime);
|
||||
timezone = (gdouble)g_date_time_get_utc_offset(datetime) / 3600.0;
|
||||
timezone = (gdouble)g_date_time_get_utc_offset(datetime) / 3600000000.0;
|
||||
g_date_time_unref(datetime);
|
||||
|
||||
gswe_timestamp_set_gregorian_full(
|
||||
|
@@ -39,6 +39,7 @@
|
||||
* @GSWE_PLANET_VERTEX: the Vertex (the point where the ecliptic meats the
|
||||
* primal vertical)
|
||||
* @GSWE_PLANET_MOON_NODE: the mean ascending (north) Moon node
|
||||
* @GSWE_PLANET_MOON_SOUTH_NODE: the mean descending (south) Moon node
|
||||
* @GSWE_PLANET_MOON_APOGEE: the mean Moon apogee (sometimes called Dark Moon,
|
||||
* or Lilith)
|
||||
* @GSWE_PLANET_SUN: the Sun
|
||||
@@ -78,6 +79,7 @@ typedef enum {
|
||||
GSWE_PLANET_VERTEX,
|
||||
GSWE_PLANET_MOON_NODE,
|
||||
GSWE_PLANET_MOON_APOGEE,
|
||||
GSWE_PLANET_MOON_SOUTH_NODE,
|
||||
|
||||
/* Actual astrological planets */
|
||||
GSWE_PLANET_SUN = 11,
|
||||
|
@@ -202,6 +202,13 @@ void gswe_init_with_dir(gchar *directory)
|
||||
2.0,
|
||||
1
|
||||
);
|
||||
ADD_PLANET(gswe_planet_info_table, planet_info,
|
||||
GSWE_PLANET_MOON_SOUTH_NODE,
|
||||
SE_MEAN_NODE,
|
||||
TRUE,
|
||||
_("Descending Moon Node"),
|
||||
2.0,
|
||||
0);
|
||||
ADD_PLANET(gswe_planet_info_table, planet_info,
|
||||
GSWE_PLANET_MOON_APOGEE,
|
||||
SE_MEAN_APOG,
|
||||
|
55
swe-glib.mk
55
swe-glib.mk
@@ -1,4 +1,7 @@
|
||||
# SWE-GLib - GLib wrapper around the Swiss Ephemeris library
|
||||
#
|
||||
# Most of this file is got from GLib, especially the code coverage measurement
|
||||
# parts
|
||||
|
||||
GTESTER = gtester
|
||||
GTESTER_REPORT = gtester-report
|
||||
@@ -7,7 +10,7 @@ NULL =
|
||||
# initialize variables for unconditional += appending
|
||||
BUILT_SOURCES =
|
||||
BUILT_EXTRA_DIST =
|
||||
CLEANFILES = *.log *.trs
|
||||
CLEANFILES = *.log *.trs *.gcda
|
||||
DISTCLEANFILES =
|
||||
MAINTAINERCLEANFILES =
|
||||
EXTRA_DIST =
|
||||
@@ -33,9 +36,7 @@ else
|
||||
test-nonrecursive:
|
||||
endif
|
||||
|
||||
.PHONY: test-nonrecursive
|
||||
|
||||
.PHONY: lcov genlcov lcov-clean
|
||||
.PHONY: test-nonrecursive lcov genlcov lcov-clean
|
||||
# use recursive makes in order to ignore errors during check
|
||||
lcov:
|
||||
-$(MAKE) $(AM_MAKEFLAGS) -k check
|
||||
@@ -45,9 +46,8 @@ lcov:
|
||||
# placing the objects files in the .libs/ directory separate from the *.c
|
||||
# we also have to delete tests/.libs/libmoduletestplugin_*.gcda
|
||||
genlcov:
|
||||
$(AM_V_GEN) rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda; \
|
||||
$(LTP) --quiet --directory $(top_builddir) --capture --output-file swe-glib-lcov.info --test-name SWE_GLIB_PERF --no-checksum --compat-libtool --ignore-errors source; \
|
||||
$(LTP) --quiet --output-file swe-glib-lcov.info --remove swe-glib-lcov.info docs/reference/\* /tmp/\* gio/tests/gdbus-object-manager-example/\* ; \
|
||||
$(AM_V_GEN) $(LTP) --quiet --directory $(top_builddir) --capture --output-file swe-glib-lcov.info --test-name SWE_GLIB_PERF --no-checksum --compat-libtool --ignore-errors source; \
|
||||
$(LTP) --quiet --output-file swe-glib-lcov.info --remove swe-glib-lcov.info docs/reference/\* /tmp/\* ; \
|
||||
LANG=C $(LTP_GENHTML) --quiet --prefix $(top_builddir) --output-directory swe-glib-lcov --title "SWE-GLib Code Coverage" --legend --frames --show-details swe-glib-lcov.info --ignore-errors source
|
||||
@echo "file://$(abs_top_builddir)/swe-glib-lcov/index.html"
|
||||
|
||||
@@ -59,47 +59,6 @@ lcov-clean:
|
||||
# run tests in cwd as part of make check
|
||||
check-local: test-nonrecursive
|
||||
|
||||
# We support a fairly large range of possible variables. It is expected that all types of files in a test suite
|
||||
# will belong in exactly one of the following variables.
|
||||
#
|
||||
# First, we support the usual automake suffixes, but in lowercase, with the customary meaning:
|
||||
#
|
||||
# test_programs, test_scripts, test_data, test_ltlibraries
|
||||
#
|
||||
# The above are used to list files that are involved in both uninstalled and installed testing. The
|
||||
# test_programs and test_scripts are taken to be actual testcases and will be run as part of the test suite.
|
||||
# Note that _data is always used with the nobase_ automake variable name to ensure that installed test data is
|
||||
# installed in the same way as it appears in the package layout.
|
||||
#
|
||||
# In order to mark a particular file as being only for one type of testing, use 'installed' or 'uninstalled',
|
||||
# like so:
|
||||
#
|
||||
# installed_test_programs, uninstalled_test_programs
|
||||
# installed_test_scripts, uninstalled_test_scripts
|
||||
# installed_test_data, uninstalled_test_data
|
||||
# installed_test_ltlibraries, uninstalled_test_ltlibraries
|
||||
#
|
||||
# Additionally, we support 'extra' infixes for programs and scripts. This is used for support programs/scripts
|
||||
# that should not themselves be run as testcases (but exist to be used from other testcases):
|
||||
#
|
||||
# test_extra_programs, installed_test_extra_programs, uninstalled_test_extra_programs
|
||||
# test_extra_scripts, installed_test_extra_scripts, uninstalled_test_extra_scripts
|
||||
#
|
||||
# Additionally, for _scripts and _data, we support the customary dist_ prefix so that the named script or data
|
||||
# file automatically end up in the tarball.
|
||||
#
|
||||
# dist_test_scripts, dist_test_data, dist_test_extra_scripts
|
||||
# dist_installed_test_scripts, dist_installed_test_data, dist_installed_test_extra_scripts
|
||||
# dist_uninstalled_test_scripts, dist_uninstalled_test_data, dist_uninstalled_test_extra_scripts
|
||||
#
|
||||
# Note that no file is automatically disted unless it appears in one of the dist_ variables. This follows the
|
||||
# standard automake convention of not disting programs scripts or data by default.
|
||||
#
|
||||
# test_programs, test_scripts, uninstalled_test_programs and uninstalled_test_scripts (as well as their disted
|
||||
# variants) will be run as part of the in-tree 'make check'. These are all assumed to be runnable under
|
||||
# gtester. That's a bit strange for scripts, but it's possible.
|
||||
|
||||
# we use test -z "$(TEST_PROGS)" above, so make sure we have no extra whitespace...
|
||||
TEST_PROGS += $(strip $(test_programs) $(test_scripts) $(uninstalled_test_programs) $(uninstalled_test_scripts) \
|
||||
$(dist_test_scripts) $(dist_uninstalled_test_scripts))
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -7,6 +7,7 @@ EXTRA_DIST = \
|
||||
LICENSE \
|
||||
README \
|
||||
swemptab.c \
|
||||
swemptab.h \
|
||||
swedate.h \
|
||||
swedll.h \
|
||||
swehouse.h \
|
||||
|
@@ -1,4 +1,5 @@
|
||||
Aldebaran ,alTau,ICRS,04,35,55.2387,+16,30,33.485,62.78,-189.35,54.26,50.09,0.985, 16, 629
|
||||
Rohini ,alTau,ICRS,04,35,55.2387,+16,30,33.485,62.78,-189.35,54.26,50.09,0.985, 16, 629
|
||||
Algol ,bePer,ICRS,03,08,10.1315,+40,57,20.332,2.39,-1.44,4.0,35.14,2.12, 40, 673
|
||||
Antares ,alSco,ICRS,16,29,24.4609,-26,25,55.209,-10.16,-23.21,-3.4,5.40,1.09,-26,11359
|
||||
Regulus ,alLeo,ICRS,10,08,22.4593,+11,58,01.9027,-248.73,5.59,5.9,42.09,1.35, 12, 2149
|
||||
@@ -21,6 +22,7 @@ Praesepe Cluster,M44,2000,08,40,6.000,19,59,0.00,0.000, 0.00, 0.0,0.0000,3.7,
|
||||
Praesepe Cluster,M44,2000,08,40,6.000,19,59,0.00,0.000, 0.00, 0.0,0.0000,3.7, 0, 0
|
||||
# moved this to top of file, otherwise Polaris Australis will be found
|
||||
Polaris ,alUMi,ICRS,02,31,49.0837,+89,15,50.794,44.22,-11.75,-17.4,7.56,2.005, 88, 8
|
||||
Sanduleak ,SN1987A,ICRS,05,35,28.020,-69,16,11.07,0.0,0.0,0.0,0.0,4.81, 0, 0
|
||||
#
|
||||
# Fixed stars brighter than Magnitude 5
|
||||
# This file is based on data provided by S. Moshier.
|
||||
@@ -66,6 +68,7 @@ Deneb Adige ,alCyg,ICRS,20,41,25.9147,+45,16,49.217,1.56,1.55,-4.5,1.01,1.25, 44
|
||||
Rigel ,beOri,ICRS,05,14,32.2723,-08,12,05.906,1.87,-0.56,20.7,4.22,0.12,-08, 1063
|
||||
Mira ,omiCet,ICRS,02,19,20.7927,-02,58,39.513,10.33,-239.48,63.8,7.79,3.04,-03, 353
|
||||
Ain ,epTau,ICRS,04,28,36.9995,+19,10,49.554,107.23,-36.77,38.15,21.04,3.540, 18, 640
|
||||
Segin ,epCas,ICRS,01,54,23.7255,+63,40,12.365,31.98,-18.66,-8.1,7.38,3.342, 62, 320
|
||||
#
|
||||
# Andromeda
|
||||
Alpheratz ,alAnd,ICRS,00,08,23.2586,+29,05,25.555,135.68,-162.95,-11.7,33.60,2.06, 28, 4
|
||||
@@ -106,6 +109,7 @@ Andromeda Galaxy,M31,ICRS,00,42,44.330,+41,16,07.50,-35.99,-12.92,-301,,3.44, 0
|
||||
,ka-1Aps,ICRS,15,31,30.8214,-73,23,22.527,0.38,-18.28,62,3.20,5.49,-72, 1802
|
||||
# Aquila
|
||||
Altair ,alAql,ICRS,19,50,46.9990,+08,52,05.959,536.87,385.57,-26.1,194.45,0.77, 08, 4236
|
||||
Shravana ,alAql,ICRS,19,50,46.9990,+08,52,05.959,536.87,385.57,-26.1,194.45,0.77, 08, 4236
|
||||
Alshain ,beAql,ICRS,19,55,18.7934,+06,24,24.348,46.35,-481.35,-39.8,72.95,3.710, 06, 4357
|
||||
Tarazed ,gaAql,ICRS,19,46,15.5795,+10,36,47.740,15.72,-3.08,-2.79,7.08,2.724, 10, 4043
|
||||
Al Mizan ,deAql,ICRS,19,25,29.9005,+03,06,53.191,253.07,80.67,-30.1,65.05,3.40, 02, 3879
|
||||
@@ -138,6 +142,7 @@ Ancha ,thAqr,ICRS,22,16,50.0364,-07,46,59.845,118.95,-21.91,-14.7,17.04,4
|
||||
Situla ,kaAqr,ICRS,22,37,45.3810,-04,13,41.001,-68.36,-120.47,8.2,13.92,5.040,-04, 5716
|
||||
Hydor ,laAqr,ICRS,22,52,36.8759,-07,34,46.557,19.51,32.71,-8.8,8.33,3.766,-08, 5968
|
||||
Ekkhysis ,laAqr,ICRS,22,52,36.8759,-07,34,46.557,19.51,32.71,-8.8,8.33,3.766,-08, 5968
|
||||
Shatabhishaj ,laAqr,ICRS,22,52,36.8759,-07,34,46.557,19.51,32.71,-8.8,8.33,3.766,-08, 5968
|
||||
,muAqr,ICRS,20,52,39.2336,-08,58,59.944,47.06,-32.91,-9.1,21.01,4.723,-09, 5598
|
||||
Albulaan ,nuAqr,ICRS,21,09,35.6477,-11,22,18.095,92.31,-15.76,-11.8,19.93,4.519,-11, 5538
|
||||
Seat ,piAqr,ICRS,22,25,16.6232,+01,22,38.642,18.38,3.35,4,2.96,4.794, 00, 4872
|
||||
@@ -164,6 +169,7 @@ Ara ,alAra,ICRS,17,31,50.4933,-49,52,34.121,-31.27,-67.15,0,13.46,2.836
|
||||
# Aries
|
||||
Hamal ,alAri,ICRS,02,07,10.4071,+23,27,44.723,190.73,-145.77,-14.64,49.48,2.00, 22, 306
|
||||
Sheratan ,beAri,ICRS,01,54,38.4091,+20,48,28.926,96.32,-108.80,-1.9,54.74,2.64, 20, 306
|
||||
Ashvini ,beAri,ICRS,01,54,38.4091,+20,48,28.926,96.32,-108.80,-1.9,54.74,2.64, 20, 306
|
||||
Mesarthim ,gaAri,ICRS,01,53,31.8143,+19,17,37.866,79.43,-99.10,,15.96,3.88, 18, 243
|
||||
Botein ,deAri,ICRS,03,11,37.7655,+19,43,36.039,154.61,-8.39,23.05,19.44,4.350, 19, 477
|
||||
,zeAri,ICRS,03,14,54.0961,+21,02,39.988,-29.83,-77.15,7,9.59,4.880, 20, 527
|
||||
@@ -172,6 +178,7 @@ Botein ,deAri,ICRS,03,11,37.7655,+19,43,36.039,154.61,-8.39,23.05,19.44,4.
|
||||
,siAri,ICRS,02,51,29.5869,+15,04,55.454,31.26,-23.29,17.0,6.80,5.514, 14, 480
|
||||
,ta-1Ari,ICRS,03,21,13.6245,+21,08,49.510,21.68,-22.41,13.9,7.06,5.301, 20, 543
|
||||
,41Ari,ICRS,02,49,59.0323,+27,15,37.825,65.47,-116.59,4,20.45,3.606, 20, 543
|
||||
Bharani ,41Ari,ICRS,02,49,59.0323,+27,15,37.825,65.47,-116.59,4,20.45,3.606, 20, 543
|
||||
# Auriga
|
||||
Capella ,alAur,ICRS,05,16,41.3591,+45,59,52.768,75.52,-427.11,30.2,77.29,0.08, 45, 1077
|
||||
Menkalinan ,beAur,ICRS,05,59,31.7229,+44,56,50.758,-56.41,-0.88,-18.2,39.72,1.896, 44, 1328
|
||||
@@ -199,6 +206,7 @@ Al Khabdhilinan,ioAur,ICRS,04,56,59.6187,+33,09,57.925,3.63,-18.54,17.78,6.37,2.
|
||||
,ps-6Aur,ICRS,06,47,39.5761,+48,47,22.115,-5.25,6.40,-7.7,7.69,5.222, 48, 1436
|
||||
# Bootes
|
||||
Arcturus ,alBoo,ICRS,14,15,39.6720,+19,10,56.677,-1093.43,-1999.43,-5.2,88.85,-0.04, 19, 2777
|
||||
Svati ,alBoo,ICRS,14,15,39.6720,+19,10,56.677,-1093.43,-1999.43,-5.2,88.85,-0.04, 19, 2777
|
||||
Nekkar ,beBoo,ICRS,15,01,56.7623,+40,23,26.036,-40.20,-29.22,-19.9,14.91,3.488, 40, 2840
|
||||
Seginus ,gaBoo,ICRS,14,32,04.6719,+38,18,29.709,-115.55,151.87,-36.5,38.29,3.00, 38, 2565
|
||||
Haris ,gaBoo,ICRS,14,32,04.6719,+38,18,29.709,-115.55,151.87,-36.5,38.29,3.00, 38, 2565
|
||||
@@ -392,6 +400,7 @@ Acubens ,alCnc,ICRS,08,58,29.2217,+11,51,27.723,41.45,-29.22,-13.8,18.79,4.
|
||||
Al Tarf ,beCnc,ICRS,08,16,30.9206,+09,11,07.961,-46.80,-48.65,22.94,11.23,3.520, 09, 1917
|
||||
Asellus Borealis ,gaCnc,ICRS,08,43,17.1461,+21,28,06.602,-106.94,-39.25,28.7,20.58,4.668, 21, 1895
|
||||
Asellus Australis,deCnc,ICRS,08,44,41.0996,+18,09,15.511,-17.10,-228.46,17.14,23.97,3.94, 18, 2027
|
||||
Pushya ,deCnc,ICRS,08,44,41.0996,+18,09,15.511,-17.10,-228.46,17.14,23.97,3.94, 18, 2027
|
||||
Tegmen ,zeCnc,ICRS,08,12,12.851,+17,38,52.75,74.3,-119.0,-5.7,,5.05, 18, 1867
|
||||
Tegmine ,zeCnc,ICRS,08,12,12.851,+17,38,52.75,74.3,-119.0,-5.7,,5.05, 18, 1867
|
||||
,etCnc,ICRS,08,32,42.4969,+20,26,28.183,-44.65,-44.71,22.46,10.46,5.343, 20, 2109
|
||||
@@ -449,6 +458,8 @@ Alchita ,alCrv,ICRS,12,08,24.8170,-24,43,43.952,100.18,-39.33,4.4,67.71,4.0
|
||||
Kraz ,beCrv,ICRS,12,34,23.2346,-23,23,48.333,0.86,-56.00,-7.6,23.34,2.65,-22, 3401
|
||||
Gienah Corvi ,gaCrv,ICRS,12,15,48.3702,-17,32,30.946,-159.58,22.31,-4.2,19.78,2.59,-16, 3424
|
||||
Algorab ,deCrv,ICRS,12,29,51.8554,-16,30,55.557,-209.97,-139.30,9,37.11,2.95,-15, 3482
|
||||
Algorab ,deCrv,ICRS,12,29,51.8554,-16,30,55.557,-209.97,-139.30,9,37.11,2.95,-15, 3482
|
||||
Hasta ,deCrv,ICRS,12,29,51.8554,-16,30,55.557,-209.97,-139.30,9,37.11,2.95,-15, 3482
|
||||
Minkar ,epCrv,ICRS,12,10,07.4807,-22,37,11.159,-71.52,10.55,4.9,10.75,3.017,-21, 3487
|
||||
Avis Satyra ,etCrv,ICRS,12,32,04.2270,-16,11,45.627,-424.37,-58.41,-3.5,54.92,4.31,0, 0
|
||||
# Canes Venatici
|
||||
@@ -485,6 +496,8 @@ Ruchbah II ,ome-2Cyg,ICRS,20,31,18.8163,+49,13,13.070,8.79,-31.28,-64.15,8.07,5.
|
||||
# Delphinus
|
||||
Sualocin ,alDel,ICRS,20,39,38.2874,+15,54,43.459,54.14,7.91,-3.4,13.55,3.800, 15, 4222
|
||||
Rotanev ,beDel,ICRS,20,37,32.9411,+14,35,42.313,118.28,-47.65,-22.7,33.49,3.632, 14, 4369
|
||||
Dhanishtha ,beDel,ICRS,20,37,32.9411,+14,35,42.313,118.28,-47.65,-22.7,33.49,3.632, 14, 4369
|
||||
Shravishtha ,beDel,ICRS,20,37,32.9411,+14,35,42.313,118.28,-47.65,-22.7,33.49,3.632, 14, 4369
|
||||
,ga-2Del,ICRS,20,46,39.5023,+16,07,27.466,-25.88,-196.27,-6.41,32.14,4.27, 15, 4255
|
||||
,deDel,ICRS,20,43,27.5339,+15,04,28.491,-19.61,-41.74,9.3,16.03,4.434, 14, 4403
|
||||
Deneb Dulphim,epDel,ICRS,20,33,12.7712,+11,18,11.746,10.75,-28.54,-19.3,9.09,4.032, 10, 4321
|
||||
@@ -569,6 +582,7 @@ Fornacis ,alFor,ICRS,03,12,04.5277,-28,59,15.425,371.49,612.28,-20.5,70.86,3
|
||||
# Gemini
|
||||
Castor ,alGem,ICRS,07,34,35.8628,+31,53,17.795,-206.33,-148.18,,63.27,1.59, 32, 1581
|
||||
Pollux ,beGem,ICRS,07,45,18.9503,+28,01,34.315,-625.69,-45.96,3.23,96.74,1.15, 28, 1463
|
||||
Pushya ,beGem,ICRS,07,45,18.9503,+28,01,34.315,-625.69,-45.96,3.23,96.74,1.15, 28, 1463
|
||||
Alhena ,gaGem,ICRS,06,37,42.7011,+16,23,57.308,-2.04,-66.92,-12.5,31.12,1.90, 16, 1223
|
||||
Almeisan ,gaGem,ICRS,06,37,42.7011,+16,23,57.308,-2.04,-66.92,-12.5,31.12,1.90, 16, 1223
|
||||
Wasat ,deGem,ICRS,07,20,07.3775,+21,58,56.354,-18.72,-7.76,4.1,55.45,3.53, 22, 1645
|
||||
@@ -686,10 +700,13 @@ Ukdah ,ta-2Hya,ICRS,09,31,58.9281,-01,11,04.790,-11.42,-3.87,5.6,7.11,4.555
|
||||
,beLac,ICRS,22,23,33.6235,+52,13,44.567,-13.56,-186.37,-10.4,19.21,4.43, 51, 3358
|
||||
# Leo
|
||||
Regulus ,alLeo,ICRS,10,08,22.4593,+11,58,01.9027,-248.73,5.59,5.9,42.09,1.35, 12, 2149
|
||||
Magha ,alLeo,ICRS,10,08,22.4593,+11,58,01.9027,-248.73,5.59,5.9,42.09,1.35, 12, 2149
|
||||
Denebola ,beLeo,ICRS,11,49,03.5776,+14,34,19.417,-499.02,-113.78,-0.2,90.16,2.14, 15, 2383
|
||||
Uttaraphalguni,beLeo,ICRS,11,49,03.5776,+14,34,19.417,-499.02,-113.78,-0.2,90.16,2.14, 15, 2383
|
||||
Algieba ,ga-1Leo,ICRS,10,19,58.427,+19,50,28.53,294.9,-154.0,-36.7,25.96,2.12, 20, 2467
|
||||
Dhur ,deLeo,ICRS,11,14,06.5013,+20,31,25.381,143.31,-130.43,-20.2,56.52,2.56, 21, 2298
|
||||
Zosma ,deLeo,ICRS,11,14,06.5013,+20,31,25.381,143.31,-130.43,-20.2,56.52,2.56, 21, 2298
|
||||
Purvaphalguni,deLeo,ICRS,11,14,06.5013,+20,31,25.381,143.31,-130.43,-20.2,56.52,2.56, 21, 2298
|
||||
Ras Elased Australis,epLeo,ICRS,09,45,51.0730,+23,46,27.317,-46.09,-9.57,4.3,13.01,2.975, 24, 2129
|
||||
Adhafera ,zeLeo,ICRS,10,16,41.4169,+23,25,02.318,19.84,-7.30,-15.6,12.56,3.443, 24, 2209
|
||||
Algieba ,etLeo,ICRS,10,07,19.9523,+16,45,45.592,-1.94,-0.53,3.3,1.53,3.511, 17, 2171
|
||||
@@ -737,6 +754,7 @@ Zubenelakribi,deLib,ICRS,15,00,58.3486,-08,31,08.195,-66.20,-3.40,-38.7,10.72,4.
|
||||
Zuben Elakribi,deLib,ICRS,15,00,58.3486,-08,31,08.195,-66.20,-3.40,-38.7,10.72,4.95,-07, 3938
|
||||
,ze-1Lib,ICRS,15,28,15.4082,-16,42,59.343,16.66,-33.36,-21.4,3.59,5.656,-16, 4089
|
||||
,io-1Lib,ICRS,15,12,13.2901,-19,47,30.158,-35.59,-32.55,-11.6,8.66,4.54,-19, 4047
|
||||
Vishakha ,io-1Lib,ICRS,15,12,13.2901,-19,47,30.158,-35.59,-32.55,-11.6,8.66,4.54,-19, 4047
|
||||
,kaLib,ICRS,15,41,56.7981,-19,40,43.781,-33.21,-104.33,-3.8,8.16,4.765,-19, 4188
|
||||
,laLib,ICRS,15,53,20.0586,-20,10,01.345,-3.61,-19.00,6,9.15,5.029,-19, 4249
|
||||
Zubenhakrabi ,nuLib,ICRS,15,06,37.5962,-16,15,24.544,-36.41,-23.28,-15.1,4.26,5.202,-15, 4026
|
||||
@@ -771,6 +789,7 @@ Maculosa ,38Lyn,ICRS,09,18,50.6436,+36,48,09.348,-32.61,-123.78,4.0,26.75,3.
|
||||
Maculata ,38Lyn,ICRS,09,18,50.6436,+36,48,09.348,-32.61,-123.78,4.0,26.75,3.82, 0, 0
|
||||
# Lyra
|
||||
Vega ,alLyr,ICRS,18,36,56.3364,+38,47,01.291,201.03,287.47,-13.9,128.93,0.03, 38, 3238
|
||||
Abhijit ,alLyr,ICRS,18,36,56.3364,+38,47,01.291,201.03,287.47,-13.9,128.93,0.03, 38, 3238
|
||||
Sheliak ,beLyr,ICRS,18,50,04.7947,+33,21,45.601,1.10,-4.46,-19.2,3.70,3.52, 33, 3223
|
||||
Sulaphat ,gaLyr,ICRS,18,58,56.6227,+32,41,22.407,-2.76,1.77,-21.1,5.14,3.250, 32, 3286
|
||||
Sulafat ,gaLyr,ICRS,18,58,56.6227,+32,41,22.407,-2.76,1.77,-21.1,5.14,3.250, 32, 3286
|
||||
@@ -845,6 +864,7 @@ Barnard's star,V2500 Oph,ICRS,17,57,48.96543,+04,40,05.8361,-798.58,10328.12,-10
|
||||
# Orion
|
||||
Betelgeuse ,alOri,ICRS,05,55,10.3053,+07,24,25.426,27.33,10.86,21.91,7.63,0.42, 07, 1055
|
||||
Beteigeuse ,alOri,ICRS,05,55,10.3053,+07,24,25.426,27.33,10.86,21.91,7.63,0.42, 07, 1055
|
||||
Punarvasu ,alOri,ICRS,05,55,10.3053,+07,24,25.426,27.33,10.86,21.91,7.63,0.42, 07, 1055
|
||||
Rigel ,beOri,ICRS,05,14,32.2723,-08,12,05.906,1.87,-0.56,20.7,4.22,0.12,-08, 1063
|
||||
Bellatrix ,gaOri,ICRS,05,25,07.8631,+06,20,58.928,-8.75,-13.28,18.2,13.42,1.64, 06, 919
|
||||
Mintaka ,deOri,ICRS,05,32, 0.4007,-00,17,56.731,1.67,-0.56,16.0,3.56,2.23,-00, 983
|
||||
@@ -856,6 +876,7 @@ Nair al Saif ,ioOri,ICRS,05,35,25.9825,-05,54,35.645,2.27,-0.62,21.5,2.46,2.77,-
|
||||
Saiph ,kaOri,ICRS,05,47,45.3889,-09,40,10.577,1.55,-1.20,20.5,4.52,2.049,-09, 1235
|
||||
Heka ,laOri,ICRS,05,35,08.2771,+09,56,02.970,-1.03,-1.86,,3.09,3.39, 09, 879
|
||||
Meissa ,laOri,ICRS,05,35,08.2771,+09,56,02.970,-1.03,-1.86,,3.09,3.39, 09, 879
|
||||
Mrgashirsha ,laOri,ICRS,05,35,08.2771,+09,56,02.970,-1.03,-1.86,,3.09,3.39, 09, 879
|
||||
,muOri,ICRS,06,02,22.9988,+09,38,50.196,14.19,-37.44,45,21.49,4.130, 14, 1152
|
||||
,nuOri,ICRS,06,07,34.3249,+14,46,06.498,4.95,-21.18,24.1,6.10,4.403, 0, 0
|
||||
,xiOri,ICRS,06,11,56.3958,+14,12,31.554,-1.59,-20.23,24,5.14,4.442, 0, 0
|
||||
@@ -900,8 +921,10 @@ Ankaa ,alPhe,ICRS,00,26,17.0509,-42,18,21.533,232.75,-353.62,74.6,42.14,2
|
||||
,omePhe,ICRS,01,02, 1.8208,-57,00, 8.601, 0.0442667, 1.653, 13.0,0.00886, 6.109,-57, 220
|
||||
# Pegasus
|
||||
Markab ,alPeg,ICRS,23,04,45.6538,+15,12,18.952,61.10,-42.56,-3.5,23.36,2.49, 14, 4926
|
||||
Purvabhadra ,alPeg,ICRS,23,04,45.6538,+15,12,18.952,61.10,-42.56,-3.5,23.36,2.49, 14, 4926
|
||||
Scheat ,bePeg,ICRS,23,03,46.4575,+28,04,58.041,187.76,137.61,8.01,16.37,2.42, 27, 4480
|
||||
Algenib ,gaPeg,ICRS,00,13,14.1528,+15,11,00.945,4.70,-8.24,4.1,9.79,2.83, 14, 14
|
||||
Uttarabhadra ,gaPeg,ICRS,00,13,14.1528,+15,11,00.945,4.70,-8.24,4.1,9.79,2.83, 14, 14
|
||||
Enif ,epPeg,ICRS,21,44,11.1581,+09,52,30.041,30.02,1.38,3.39,4.85,2.404, 09, 4891
|
||||
Homam ,zePeg,ICRS,22,41,27.7208,+10,49,52.912,77.38,-10.98,7,15.64,3.40, 10, 4797
|
||||
Matar ,etPeg,ICRS,22,43,00.1374,+30,13,16.483,13.11,-26.11,4.3,15.18,2.948, 29, 4741
|
||||
@@ -969,6 +992,7 @@ Simmah ,gaPsc,ICRS,23,17,09.9379,+03,16,56.240,760.35,17.96,-13.6,24.92,3.
|
||||
Linteum ,dePsc,ICRS,00,48,40.9443,+07,35,06.285,83.14,-50.48,32.40,10.69,4.439, 06, 107
|
||||
Kaht ,epPsc,ICRS,01,02,56.6084,+07,53,24.488,-80.57,25.88,7.47,17.14,4.28, 07, 153
|
||||
,zePsc,ICRS,01,13,43.8857, 07,34,31.274,141.66,-55.62,0.0,22.09, 5.204, 06, 174
|
||||
Revati ,zePsc,ICRS,01,13,43.8857, 07,34,31.274,141.66,-55.62,0.0,22.09, 5.204, 06, 174
|
||||
Al Pherg ,etPsc,ICRS,01,31,29.0094,+15,20,44.963,25.73,-3.29,14.8,11.09,3.620, 14, 231
|
||||
,thPsc,ICRS,23,27,58.0951,+06,22,44.372,-123.83,-43.26,6.05,20.54,4.280, 05, 5173
|
||||
,ioPsc,ICRS,23,39,57.0409,+05,37,34.650,376.32,-437.00,5.0,72.51,4.120, 04, 5035
|
||||
@@ -1022,6 +1046,7 @@ Anazitisi ,taPup,ICRS,06,49,56.1683,-50,36,52.415,34.23,-65.85,36.4,17.85,2.9
|
||||
,siScl,ICRS,01,02,26.4332,-31,33,07.218,81.00,15.25,-8,14.39,5.509,-32, 410
|
||||
# Scorpius
|
||||
Antares ,alSco,ICRS,16,29,24.4609,-26,25,55.209,-10.16,-23.21,-3.4,5.40,1.09,-26,11359
|
||||
Jyeshtha ,alSco,ICRS,16,29,24.4609,-26,25,55.209,-10.16,-23.21,-3.4,5.40,1.09,-26,11359
|
||||
Graffias ,be-1Sco,ICRS,16,05,26.5538,-19,48,06.696,-34.59,-7.47,-3.6,2.88,4.89,-19, 4307
|
||||
Akrab ,be-1Sco,ICRS,16,05,26.5538,-19,48,06.696,-34.59,-7.47,-3.6,2.88,4.89,-19, 4307
|
||||
Acrab ,be-1Sco,ICRS,16,05,26.5538,-19,48,06.696,-34.59,-7.47,-3.6,2.88,4.89,-19, 4307
|
||||
@@ -1032,6 +1057,7 @@ Aculeus ,M6,ICRS,17,40,18.0,-32,12,0.0,-2.38,-07.19,-11.50,0.0, 4.2,0, 0 #
|
||||
#Acumen ,M7,2000,17,53,54.0,-34,49,0.0,2.58,-4.54,-14.21,0.0, 3.3,0, 0 # NGC 6475, from Starlight
|
||||
Acumen ,M7,ICRS,17,53,48.0,-34,47,0.0,2.58,-4.54,-14.21,0.0, 3.3,0, 0 # NGC 6475
|
||||
Dschubba ,deSco,ICRS,16,00,20.0063,-22,37,18.156,-8.67,-36.90,-7,8.12,2.291,-22, 4068
|
||||
Anuradha ,deSco,ICRS,16,00,20.0063,-22,37,18.156,-8.67,-36.90,-7,8.12,2.291,-22, 4068
|
||||
Wei ,epSco,ICRS,16,50,09.8130,-34,17,35.634,-611.84,-255.86,-2.5,49.85,2.29,-34,11285
|
||||
,ze-2Sco,ICRS,16,54,35.0053,-42,21,40.726,-126.55,-227.77,-18.7,21.67,3.62,0, 0
|
||||
,etSco,ICRS,17,12,09.1935,-43,14,21.080,22.01,-287.42,-27.0,45.56,3.33,-43,11485
|
||||
@@ -1039,6 +1065,7 @@ Sargas ,thSco,ICRS,17,37,19.1306,-42,59,52.166,6.06,-0.95,1.4,11.99,1.862,
|
||||
,io-1Sco,ICRS,17,47,35.0815,-40,07,37.191,0.44,-6.40,-27.6,1.82,3.020,-40,11838
|
||||
Girtab ,kaSco,ICRS,17,42,29.2749,-39,01,47.939,-6.49,-25.55,-14.0,7.03,2.375,-38,12137
|
||||
Shaula ,laSco,ICRS,17,33,36.520,-37,06,13.76,-8.90,-29.95,-3,4.64,1.62,-37,11673
|
||||
Mula ,laSco,ICRS,17,33,36.520,-37,06,13.76,-8.90,-29.95,-3,4.64,1.62,-37,11673
|
||||
,mu-1Sco,ICRS,16,51,52.2323,-38,02,50.567,-8.84,-21.60,-25,3.97,2.98,-37,11033
|
||||
Jabbah ,nuSco,ICRS,16,11,59.7345,-19,27,38.550, -9.70,-25.25,2.4,7.47, 4.00,-19, 4333
|
||||
Grafias ,xiSco,ICRS,16,04,22.191,-11,22,22.60,-63.2,-27.0,-36.33,,4.17,-10, 4237
|
||||
@@ -1089,6 +1116,7 @@ Alnasl ,ga-2Sgr,ICRS,18,05,48.4869,-30,25,26.729,-55.75,-181.53,22.0,33.94,2
|
||||
Nash ,ga-2Sgr,ICRS,18,05,48.4869,-30,25,26.729,-55.75,-181.53,22.0,33.94,2.99,-30,15215
|
||||
Kaus Medis ,deSgr,ICRS,18,20,59.6417,-29,49,41.172,29.96,-26.38,-19.9,10.67,2.710,-29,14834
|
||||
Kaus Meridionalis,deSgr,ICRS,18,20,59.6417,-29,49,41.172,29.96,-26.38,-19.9,10.67,2.710,-29,14834
|
||||
Purvashadha ,deSgr,ICRS,18,20,59.6417,-29,49,41.172,29.96,-26.38,-19.9,10.67,2.710,-29,14834
|
||||
Kaus Australis,epSgr,ICRS,18,24,10.3183,-34,23,04.618,-39.61,-124.05,-15,22.55,1.80,-34, 12784
|
||||
Ascella ,zeSgr,ICRS,19,02,36.7139,-29,52,48.379,-14.10,3.66,22,36.61,2.607,-30,16575
|
||||
Sephdar ,etSgr,ICRS,18,17,37.6351,-36,45,42.070,-129.27,-166.61,0.5,21.87,3.11,-36,12423
|
||||
@@ -1104,6 +1132,7 @@ Ain al Rami,nu-1Sgr,ICRS,18,54,10.1771,-22,44,41.403,2.95,-5.70,-12.1,1.76,4.859
|
||||
Manubrium ,omiSgr,ICRS,19,04,40.9817,-21,44,29.384,76.26,-58.08,25.2,23.49,3.771,-21, 5237
|
||||
Albaldah ,piSgr,ICRS,19,09,45.8331,-21,01,25.013,-1.17,-36.83,-9.8,7.41,2.89,-21, 5275
|
||||
Nunki ,siSgr,ICRS,18,55,15.9257,-26,17,48.200,13.87,-52.65,-11.2,14.54,2.058,-26,13595
|
||||
Uttarashadha ,siSgr,ICRS,18,55,15.9257,-26,17,48.200,13.87,-52.65,-11.2,14.54,2.058,-26,13595
|
||||
Hecatebolus ,taSgr,ICRS,19,06,56.4089,-27,40,13.523,-50.79,-250.50,45.4,27.09,3.32,-27,13564
|
||||
Nanto ,phSgr,ICRS,18,45,39.3865,-26,59,26.802,51.15,0.45,21.5,14.14,3.161,-27,13170
|
||||
,upSgr,ICRS,19,21,43.615,-15,57,17.76,1.79,-6.27,8.9,1.95,4.578,-16, 5283
|
||||
@@ -1126,6 +1155,7 @@ Hyadum II ,de-1Tau,ICRS,04,22,56.0933,+17,32,33.051,107.75,-28.84,38.8,21.29,3.
|
||||
Ain ,epTau,ICRS,04,28,36.9995,+19,10,49.554,107.23,-36.77,38.15,21.04,3.540, 18, 640
|
||||
Al Hecka ,zeTau,ICRS,05,37,38.6858,+21,08,33.177,2.39,-18.04,20,7.82,3.03, 21, 908
|
||||
Alcyone ,etTau,ICRS,03,47,29.0765,+24,06,18.494,19.35,-43.11,10.1,8.87,2.873, 23, 541
|
||||
Krttika ,etTau,ICRS,03,47,29.0765,+24,06,18.494,19.35,-43.11,10.1,8.87,2.873, 23, 541
|
||||
Phaeo ,th-1Tau,ICRS,04,28,34.4959,+15,57,43.851,104.76,-15.01,39.8,20.66,3.840, 0, 0
|
||||
Phaesula ,th-2Tau,ICRS,04,28,39.7408,+15,52,15.178,108.66,-26.39,39.5,21.89,3.410, 21, 751
|
||||
,ioTau,ICRS,05,03,05.7473,+21,35,23.865,68.94,-40.85,40.6,20.01,4.626, 21, 751
|
||||
@@ -1221,6 +1251,7 @@ Xestus ,omiVel,ICRS,08,40,17.5854,-52,55,18.794,-24.62,35.09,16.1,6.59,3.63
|
||||
Tseen Ke ,phVel,ICRS,09,56,51.7417,-54,34,04.046,-13.13,2.83,13.9,1.69,3.50,-53, 3075
|
||||
# Virgo
|
||||
Spica ,alVir,ICRS,13,25,11.5793,-11,09,40.759,-42.50,-31.73,1.0,12.44,1.04,-10, 3672
|
||||
Citra ,alVir,ICRS,13,25,11.5793,-11,09,40.759,-42.50,-31.73,1.0,12.44,1.04,-10, 3672
|
||||
Zavijava ,beVir,ICRS,11,50,41.7185,+01,45,52.985,740.95,-271.18,4.6,91.74,3.61, 02, 2489
|
||||
Alaraph ,beVir,ICRS,11,50,41.7185,+01,45,52.985,740.95,-271.18,4.6,91.74,3.61, 02, 2489
|
||||
Porrima ,gaVir,ICRS,12,41,39.642,-01,26,57.75,-616.66,60.66, 0.0,84.53, 2.74,-00, 2601
|
||||
@@ -1256,3 +1287,4 @@ Anser ,alVul,ICRS,19,28,42.3299,+24,39,53.657,-126.45,-106.99,-85.53,11.0
|
||||
#
|
||||
# test star from Astronomica Almanac 2011
|
||||
AA11_page_B73, ,ICRS,14,39,36.4958,-60,50, 2.309,-3678.06, 482.87, -21.6,742,0 , 0, 0
|
||||
GCRS00, ,ICRS,0,0,0.0,0,0, 0.0,0.0, 0.0, 0.0,0,0 , 0, 0
|
||||
|
@@ -25,11 +25,10 @@
|
||||
# e.g. number of Kronos is ipl = 39 + 4 = 43
|
||||
#
|
||||
# Witte/Sieggruen planets, refined by James Neely
|
||||
#2456200.5, J2000, 143.49291, 1.4579341, 0.2225740, 178.78899, 304.33810, 10.82816, Eros # 1
|
||||
J1900, J1900, 163.7409, 40.99837, 0.00460, 171.4333, 129.8325, 1.0833, Cupido # 1
|
||||
J1900, J1900, 27.6496, 50.66744, 0.00245, 148.1796, 161.3339, 1.0500, Hades # 2
|
||||
J1900, J1900, 165.1232, 59.21436, 0.00120, 299.0440, 0.0000, 0.0000, Zeus # 3
|
||||
J1900, J1900, 169.0193, 64.81960, 0.00305, 208.8801, 0.0000, 0.0000, Kronos # 4
|
||||
J1900, J1900, 169.0193, 64.81690, 0.00305, 208.8801, 0.0000, 0.0000, Kronos # 4
|
||||
J1900, J1900, 138.0533, 70.29949, 0.00000, 0.0000, 0.0000, 0.0000, Apollon # 5
|
||||
J1900, J1900, 351.3350, 73.62765, 0.00000, 0.0000, 0.0000, 0.0000, Admetos # 6
|
||||
J1900, J1900, 55.8983, 77.25568, 0.00000, 0.0000, 0.0000, 0.0000, Vulcanus # 7
|
||||
@@ -67,10 +66,9 @@ J1900,JDATE, 170.73, 79.225630, 0, 0, 0, 0, Proserpina #18
|
||||
# Neither Swisseph nor Solar fire elements agree with Delphine Jay's ephemeris,
|
||||
# which is obviously wrong.
|
||||
2414290.95827875,2414290.95827875, 70.3407215 + 109023.2634989 * T, 0.0068400705250028, 0.1587, 8.14049594 + 2393.47417444 * T, 136.24878256 - 1131.71719709 * T, 2.5, Waldemath, geo # 19
|
||||
##############################################
|
||||
#
|
||||
# The following elements are for test only
|
||||
# (Selena without T)
|
||||
2454000.5,J2000,268.05505,57.3693459,0.1104221,284.48762,252.36907,46.75377,2004XR190
|
||||
J2000,JDATE, 242.2205555, 0.05279142865925, 0.0, 0.0, 0.0, 0.0, Selena/White Moon, geo # 17
|
||||
# (Selena with T, gives exactly the same position)
|
||||
J2000,JDATE, 242.2205555 + 5143.5418158 * T, 0.05279142865925, 0.0, 0.0, 0.0, 0.0, Selena/White Moon with T Terms, geo # 17
|
||||
|
612
swe/src/swecl.c
612
swe/src/swecl.c
File diff suppressed because it is too large
Load Diff
@@ -86,10 +86,10 @@
|
||||
# include "swephexp.h"
|
||||
# include "sweph.h"
|
||||
|
||||
static AS_BOOL init_leapseconds_done = FALSE;
|
||||
static TLS AS_BOOL init_leapseconds_done = FALSE;
|
||||
|
||||
|
||||
int FAR PASCAL_CONV swe_date_conversion(int y,
|
||||
int CALL_CONV swe_date_conversion(int y,
|
||||
int m,
|
||||
int d, /* day, month, year */
|
||||
double uttime, /* UT in hours (decimal) */
|
||||
@@ -161,7 +161,7 @@ int FAR PASCAL_CONV swe_date_conversion(int y,
|
||||
and notifies errors like 32 January.
|
||||
****************************************************************/
|
||||
|
||||
double FAR PASCAL_CONV swe_julday(int year, int month, int day, double hour, int gregflag)
|
||||
double CALL_CONV swe_julday(int year, int month, int day, double hour, int gregflag)
|
||||
{
|
||||
double jd;
|
||||
double u,u0,u1,u2;
|
||||
@@ -202,7 +202,7 @@ double FAR PASCAL_CONV swe_julday(int year, int month, int day, double hour, int
|
||||
Original author Mark Pottenger, Los Angeles.
|
||||
with bug fix for year < -4711 16-aug-88 Alois Treindl
|
||||
*************************************************************************/
|
||||
void FAR PASCAL_CONV swe_revjul (double jd, int gregflag,
|
||||
void CALL_CONV swe_revjul (double jd, int gregflag,
|
||||
int *jyear, int *jmon, int *jday, double *jut)
|
||||
{
|
||||
double u0,u1,u2,u3,u4;
|
||||
@@ -236,7 +236,7 @@ void FAR PASCAL_CONV swe_revjul (double jd, int gregflag,
|
||||
* For conversion from local time to utc, use +d_timezone.
|
||||
* For conversion from utc to local time, use -d_timezone.
|
||||
*/
|
||||
void FAR PASCAL_CONV swe_utc_time_zone(
|
||||
void CALL_CONV swe_utc_time_zone(
|
||||
int32 iyear, int32 imonth, int32 iday,
|
||||
int32 ihour, int32 imin, double dsec,
|
||||
double d_timezone,
|
||||
@@ -276,9 +276,9 @@ void FAR PASCAL_CONV swe_utc_time_zone(
|
||||
*/
|
||||
|
||||
/* Leap seconds were inserted at the end of the following days:*/
|
||||
#define NLEAP_SECONDS 24
|
||||
#define NLEAP_SECONDS 26
|
||||
#define NLEAP_SECONDS_SPACE 100
|
||||
static int leap_seconds[NLEAP_SECONDS_SPACE] = {
|
||||
static TLS int leap_seconds[NLEAP_SECONDS_SPACE] = {
|
||||
19720630,
|
||||
19721231,
|
||||
19731231,
|
||||
@@ -303,6 +303,8 @@ static int leap_seconds[NLEAP_SECONDS_SPACE] = {
|
||||
19981231,
|
||||
20051231,
|
||||
20081231,
|
||||
20120630,
|
||||
20150630,
|
||||
0 /* keep this 0 as end mark */
|
||||
};
|
||||
#define J1972 2441317.5
|
||||
@@ -374,7 +376,7 @@ static int init_leapsec(void)
|
||||
* the leap seconds table (or the Swiss Ephemeris version) is not updated
|
||||
* for a long time.
|
||||
*/
|
||||
int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32 ihour, int32 imin, double dsec, int32 gregflag, double *dret, char *serr)
|
||||
int32 CALL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32 ihour, int32 imin, double dsec, int32 gregflag, double *dret, char *serr)
|
||||
{
|
||||
double tjd_ut1, tjd_et, tjd_et_1972, dhour, d;
|
||||
int iyear2, imonth2, iday2;
|
||||
@@ -403,7 +405,7 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
|
||||
*/
|
||||
if (tjd_ut1 < J1972) {
|
||||
dret[1] = swe_julday(iyear, imonth, iday, dhour, gregflag);
|
||||
dret[0] = dret[1] + swe_deltat(dret[1]);
|
||||
dret[0] = dret[1] + swe_deltat_ex(dret[1], -1, NULL);
|
||||
return OK;
|
||||
}
|
||||
/*
|
||||
@@ -430,10 +432,10 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
|
||||
* input time as UT1, not as UTC. How do we find out?
|
||||
* Check, if delta_t - nleap - 32.184 > 0.9
|
||||
*/
|
||||
d = swe_deltat(tjd_ut1) * 86400.0;
|
||||
d = swe_deltat_ex(tjd_ut1, -1, NULL) * 86400.0;
|
||||
if (d - (double) nleap - 32.184 >= 1.0) {
|
||||
dret[1] = tjd_ut1 + dhour / 24.0;
|
||||
dret[0] = dret[1] + swe_deltat(dret[1]);
|
||||
dret[0] = dret[1] + swe_deltat_ex(dret[1], -1, NULL);
|
||||
return OK;
|
||||
}
|
||||
/*
|
||||
@@ -463,8 +465,9 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
|
||||
/* ET (TT) */
|
||||
tjd_et_1972 = J1972 + (32.184 + NLEAP_INIT) / 86400.0;
|
||||
tjd_et = tjd_et_1972 + d + ((double) (nleap - NLEAP_INIT)) / 86400.0;
|
||||
d = swe_deltat(tjd_et);
|
||||
tjd_ut1 = tjd_et - swe_deltat(tjd_et - d);
|
||||
d = swe_deltat_ex(tjd_et, -1, NULL);
|
||||
tjd_ut1 = tjd_et - swe_deltat_ex(tjd_et - d, -1, NULL);
|
||||
tjd_ut1 = tjd_et - swe_deltat_ex(tjd_ut1, -1, NULL);
|
||||
dret[0] = tjd_et;
|
||||
dret[1] = tjd_ut1;
|
||||
return OK;
|
||||
@@ -484,7 +487,7 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
|
||||
* the leap seconds table (or the Swiss Ephemeris version) has not been
|
||||
* updated for a long time.
|
||||
*/
|
||||
void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear, int32 *imonth, int32 *iday, int32 *ihour, int32 *imin, double *dsec)
|
||||
void CALL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear, int32 *imonth, int32 *iday, int32 *ihour, int32 *imin, double *dsec)
|
||||
{
|
||||
int i;
|
||||
int second_60 = 0;
|
||||
@@ -494,8 +497,9 @@ void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear
|
||||
* if tjd_et is before 1 jan 1972 UTC, return UT1
|
||||
*/
|
||||
tjd_et_1972 = J1972 + (32.184 + NLEAP_INIT) / 86400.0;
|
||||
d = swe_deltat(tjd_et);
|
||||
tjd_ut = tjd_et - swe_deltat(tjd_et - d);
|
||||
d = swe_deltat_ex(tjd_et, -1, NULL);
|
||||
tjd_ut = tjd_et - swe_deltat_ex(tjd_et - d, -1, NULL);
|
||||
tjd_ut = tjd_et - swe_deltat_ex(tjd_ut, -1, NULL);
|
||||
if (tjd_et < tjd_et_1972) {
|
||||
swe_revjul(tjd_ut, gregflag, iyear, imonth, iday, &d);
|
||||
*ihour = (int32) d;
|
||||
@@ -550,8 +554,8 @@ void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear
|
||||
* input time as UT1, not as UTC. How do we find out?
|
||||
* Check, if delta_t - nleap - 32.184 > 0.9
|
||||
*/
|
||||
d = swe_deltat(tjd_et);
|
||||
d = swe_deltat(tjd_et - d);
|
||||
d = swe_deltat_ex(tjd_et, -1, NULL);
|
||||
d = swe_deltat_ex(tjd_et - d, -1, NULL);
|
||||
if (d * 86400.0 - (double) (nleap + NLEAP_INIT) - 32.184 >= 1.0) {
|
||||
swe_revjul(tjd_et - d, SE_GREG_CAL, iyear, imonth, iday, &d);
|
||||
*ihour = (int32) d;
|
||||
@@ -580,8 +584,9 @@ void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear
|
||||
* the leap seconds table (or the Swiss Ephemeris version) has not been
|
||||
* updated for a long time.
|
||||
*/
|
||||
void FAR PASCAL_CONV swe_jdut1_to_utc(double tjd_ut, int32 gregflag, int32 *iyear, int32 *imonth, int32 *iday, int32 *ihour, int32 *imin, double *dsec)
|
||||
void CALL_CONV swe_jdut1_to_utc(double tjd_ut, int32 gregflag, int32 *iyear, int32 *imonth, int32 *iday, int32 *ihour, int32 *imin, double *dsec)
|
||||
{
|
||||
double tjd_et = tjd_ut + swe_deltat(tjd_ut);
|
||||
double tjd_et = tjd_ut + swe_deltat_ex(tjd_ut, -1, NULL);
|
||||
swe_jdet_to_utc(tjd_et, gregflag, iyear, imonth, iday, ihour, imin, dsec);
|
||||
}
|
||||
|
||||
|
@@ -62,17 +62,17 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _SWEDLL_H
|
||||
extern EXP32 int FAR PASCAL_CONV EXP16 swe_date_conversion (
|
||||
extern EXP32 int swe_date_conversion (
|
||||
int y , int m , int d , /* year, month, day */
|
||||
double utime, /* universal time in hours (decimal) */
|
||||
char c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
||||
double *tgmt);
|
||||
|
||||
extern EXP32 double *FAR PASCAL_CONV EXP16 swe_julday(
|
||||
extern EXP32 double *swe_julday(
|
||||
int year, int month, int day, double hour,
|
||||
int gregflag);
|
||||
|
||||
extern EXP32 void FAR PASCAL_CONV EXP16 swe_revjul (
|
||||
extern EXP32 void swe_revjul (
|
||||
double jd,
|
||||
int gregflag,
|
||||
int *jyear, int *jmon, int *jday, double *jut);
|
||||
|
283
swe/src/swedll.h
283
swe/src/swedll.h
@@ -81,127 +81,138 @@ extern "C" {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
DllImport int32 FAR PASCAL swe_heliacal_ut(double JDNDaysUTStart, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 iflag, double *dret, char *serr);
|
||||
DllImport int32 FAR PASCAL swe_heliacal_pheno_ut(double JDNDaysUT, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 helflag, double *darr, char *serr);
|
||||
DllImport int32 FAR PASCAL swe_vis_limit_mag(double tjdut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 helflag, double *dret, char *serr);
|
||||
#if defined (PASCAL) || defined(__stdcall)
|
||||
#define CALL_CONV_IMP __stdcall
|
||||
#else
|
||||
#define CALL_CONV_IMP
|
||||
#endif
|
||||
|
||||
DllImport int32 CALL_CONV_IMP swe_heliacal_ut(double JDNDaysUTStart, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 iflag, double *dret, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_heliacal_pheno_ut(double JDNDaysUT, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 helflag, double *darr, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_vis_limit_mag(double tjdut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 helflag, double *dret, char *serr);
|
||||
/* the following are secret, for Victor Reijs' */
|
||||
DllImport int32 FAR PASCAL swe_heliacal_angle(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
|
||||
DllImport int32 FAR PASCAL swe_topo_arcus_visionis(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double alt_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_heliacal_angle(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_topo_arcus_visionis(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double alt_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
|
||||
|
||||
DllImport double FAR PASCAL swe_degnorm(double deg);
|
||||
DllImport double CALL_CONV_IMP swe_degnorm(double deg);
|
||||
|
||||
DllImport char * FAR PASCAL swe_version(char *);
|
||||
DllImport char * CALL_CONV_IMP swe_version(char *);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_calc(
|
||||
DllImport int32 CALL_CONV_IMP swe_calc(
|
||||
double tjd, int ipl, int32 iflag,
|
||||
double *xx,
|
||||
char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_calc_ut(
|
||||
DllImport int32 CALL_CONV_IMP swe_calc_ut(
|
||||
double tjd_ut, int32 ipl, int32 iflag,
|
||||
double *xx,
|
||||
char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_fixstar(
|
||||
DllImport int32 CALL_CONV_IMP swe_fixstar(
|
||||
char *star, double tjd, int32 iflag,
|
||||
double *xx,
|
||||
char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_fixstar_ut(
|
||||
DllImport int32 CALL_CONV_IMP swe_fixstar_ut(
|
||||
char *star, double tjd_ut, int32 iflag,
|
||||
double *xx,
|
||||
char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_fixstar_mag(
|
||||
DllImport int32 CALL_CONV_IMP swe_fixstar_mag(
|
||||
char *star, double *xx, char *serr);
|
||||
|
||||
DllImport double FAR PASCAL swe_sidtime0(double tjd_ut, double ecl, double nut);
|
||||
DllImport double FAR PASCAL swe_sidtime(double tjd_ut);
|
||||
DllImport double CALL_CONV_IMP swe_sidtime0(double tjd_ut, double ecl, double nut);
|
||||
DllImport double CALL_CONV_IMP swe_sidtime(double tjd_ut);
|
||||
|
||||
DllImport double FAR PASCAL swe_deltat(double tjd);
|
||||
DllImport double CALL_CONV_IMP swe_deltat_ex(double tjd, int32 iflag, char *serr);
|
||||
DllImport double CALL_CONV_IMP swe_deltat(double tjd);
|
||||
|
||||
DllImport int FAR PASCAL swe_houses(
|
||||
DllImport int CALL_CONV_IMP swe_houses(
|
||||
double tjd_ut, double geolat, double geolon, int hsys,
|
||||
double *hcusps, double *ascmc);
|
||||
|
||||
DllImport int FAR PASCAL swe_houses_ex(
|
||||
DllImport int CALL_CONV_IMP swe_houses_ex(
|
||||
double tjd_ut, int32 iflag, double geolat, double geolon, int hsys,
|
||||
double *hcusps, double *ascmc);
|
||||
|
||||
DllImport int FAR PASCAL swe_houses_armc(
|
||||
DllImport int CALL_CONV_IMP swe_houses_armc(
|
||||
double armc, double geolat, double eps, int hsys,
|
||||
double *hcusps, double *ascmc);
|
||||
|
||||
DllImport double FAR PASCAL swe_house_pos(
|
||||
DllImport double CALL_CONV_IMP swe_house_pos(
|
||||
double armc, double geolon, double eps, int hsys, double *xpin, char *serr);
|
||||
|
||||
DllImport char * FAR PASCAL swe_house_name(int hsys);
|
||||
DllImport char * CALL_CONV_IMP swe_house_name(int hsys);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_gauquelin_sector(
|
||||
DllImport int32 CALL_CONV_IMP swe_gauquelin_sector(
|
||||
double t_ut, int32 ipl, char *starname, int32 iflag, int32 imeth, double *geopos, double atpress, double attemp, double *dgsect, char *serr);
|
||||
|
||||
DllImport void FAR PASCAL swe_set_sid_mode(
|
||||
DllImport void CALL_CONV_IMP swe_set_sid_mode(
|
||||
int32 sid_mode, double t0, double ayan_t0);
|
||||
|
||||
DllImport double FAR PASCAL swe_get_ayanamsa(double tjd_et);
|
||||
DllImport int32 CALL_CONV_IMP swe_get_ayanamsa_ex(double tjd_et, int32 iflag, double *daya, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_get_ayanamsa_ex_ut(double tjd_ut, int32 iflag, double *daya, char *serr);
|
||||
|
||||
DllImport double FAR PASCAL swe_get_ayanamsa_ut(double tjd_ut);
|
||||
DllImport double CALL_CONV_IMP swe_get_ayanamsa(double tjd_et);
|
||||
DllImport double CALL_CONV_IMP swe_get_ayanamsa_ut(double tjd_ut);
|
||||
|
||||
DllImport char *FAR PASCAL swe_get_ayanamsa_name(int32 isidmode);
|
||||
DllImport char * CALL_CONV_IMP swe_get_ayanamsa_name(int32 isidmode);
|
||||
|
||||
DllImport int FAR PASCAL swe_date_conversion(
|
||||
DllImport int CALL_CONV_IMP swe_date_conversion(
|
||||
int y , int m , int d , /* year, month, day */
|
||||
double utime, /* universal time in hours (decimal) */
|
||||
char c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
||||
double *tjd);
|
||||
|
||||
DllImport double FAR PASCAL swe_julday(
|
||||
DllImport double CALL_CONV_IMP swe_julday(
|
||||
int year, int mon, int mday,
|
||||
double hour,
|
||||
int gregflag);
|
||||
|
||||
DllImport void FAR PASCAL swe_revjul(
|
||||
DllImport void CALL_CONV_IMP swe_revjul(
|
||||
double jd, int gregflag,
|
||||
int *year, int *mon, int *mday,
|
||||
double *hour);
|
||||
|
||||
DllImport void FAR PASCAL swe_utc_time_zone(
|
||||
DllImport void CALL_CONV_IMP swe_utc_time_zone(
|
||||
int32 iyear, int32 imonth, int32 iday,
|
||||
int32 ihour, int32 imin, double dsec,
|
||||
double d_timezone,
|
||||
int32 *iyear_out, int32 *imonth_out, int32 *iday_out,
|
||||
int32 *ihour_out, int32 *imin_out, double *dsec_out);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_utc_to_jd(
|
||||
DllImport int32 CALL_CONV_IMP swe_utc_to_jd(
|
||||
int32 iyear, int32 imonth, int32 iday,
|
||||
int32 ihour, int32 imin, double dsec,
|
||||
int32 gregflag, double *dret, char *serr);
|
||||
|
||||
DllImport void FAR PASCAL swe_jdet_to_utc(
|
||||
DllImport void CALL_CONV_IMP swe_jdet_to_utc(
|
||||
double tjd_et, int32 gregflag,
|
||||
int32 *iyear, int32 *imonth, int32 *iday,
|
||||
int32 *ihour, int32 *imin, double *dsec);
|
||||
|
||||
DllImport void FAR PASCAL swe_jdut1_to_utc(
|
||||
DllImport void CALL_CONV_IMP swe_jdut1_to_utc(
|
||||
double tjd_ut, int32 gregflag,
|
||||
int32 *iyear, int32 *imonth, int32 *iday,
|
||||
int32 *ihour, int32 *imin, double *dsec);
|
||||
|
||||
DllImport int FAR PASCAL swe_time_equ(
|
||||
DllImport int CALL_CONV_IMP swe_time_equ(
|
||||
double tjd, double *e, char *serr);
|
||||
DllImport int FAR PASCAL swe_lmt_to_lat(double tjd_lmt, double geolon, double *tjd_lat, char *serr);
|
||||
DllImport int FAR PASCAL swe_lat_to_lmt(double tjd_lat, double geolon, double *tjd_lmt, char *serr);
|
||||
DllImport int CALL_CONV_IMP swe_lmt_to_lat(double tjd_lmt, double geolon, double *tjd_lat, char *serr);
|
||||
DllImport int CALL_CONV_IMP swe_lat_to_lmt(double tjd_lat, double geolon, double *tjd_lmt, char *serr);
|
||||
|
||||
DllImport double FAR PASCAL swe_get_tid_acc(void);
|
||||
DllImport void FAR PASCAL swe_set_tid_acc(double tidacc);
|
||||
DllImport void FAR PASCAL swe_set_ephe_path(char *path);
|
||||
DllImport void FAR PASCAL swe_set_jpl_file(char *fname);
|
||||
DllImport void FAR PASCAL swe_close(void);
|
||||
DllImport char *FAR PASCAL swe_get_planet_name(int ipl, char *spname);
|
||||
DllImport void FAR PASCAL swe_cotrans(double *xpo, double *xpn, double eps);
|
||||
DllImport void FAR PASCAL swe_cotrans_sp(double *xpo, double *xpn, double eps);
|
||||
DllImport double CALL_CONV_IMP swe_get_tid_acc(void);
|
||||
DllImport void CALL_CONV_IMP swe_set_tid_acc(double tidacc);
|
||||
DllImport void CALL_CONV_IMP swe_set_ephe_path(char *path);
|
||||
DllImport void CALL_CONV_IMP swe_set_jpl_file(char *fname);
|
||||
DllImport void CALL_CONV_IMP swe_close(void);
|
||||
DllImport char * CALL_CONV_IMP swe_get_planet_name(int ipl, char *spname);
|
||||
DllImport void CALL_CONV_IMP swe_cotrans(double *xpo, double *xpn, double eps);
|
||||
DllImport void CALL_CONV_IMP swe_cotrans_sp(double *xpo, double *xpn, double eps);
|
||||
|
||||
DllImport void FAR PASCAL swe_set_topo(double geolon, double geolat, double height);
|
||||
DllImport void CALL_CONV_IMP swe_set_topo(double geolon, double geolat, double height);
|
||||
|
||||
DllImport void CALL_CONV_IMP swe_set_astro_models(int32 *imodel);
|
||||
|
||||
/****************************
|
||||
* from swecl.c
|
||||
@@ -209,43 +220,43 @@ DllImport void FAR PASCAL swe_set_topo(double geolon, double geolat, double heig
|
||||
|
||||
/* computes geographic location and attributes of solar
|
||||
* eclipse at a given tjd */
|
||||
DllImport int32 FAR PASCAL swe_sol_eclipse_where(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_where(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_lun_occult_where(double tjd, int32 ipl, char *starname, int32 ifl, double *geopos, double *attr, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_lun_occult_where(double tjd, int32 ipl, char *starname, int32 ifl, double *geopos, double *attr, char *serr);
|
||||
|
||||
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */
|
||||
DllImport int32 FAR PASCAL swe_sol_eclipse_how(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_how(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
|
||||
|
||||
/* finds time of next local eclipse */
|
||||
DllImport int32 FAR PASCAL swe_sol_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_lun_occult_when_loc(double tjd_start, int32 ipl, char *starname, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_lun_occult_when_loc(double tjd_start, int32 ipl, char *starname, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
|
||||
|
||||
/* finds time of next eclipse globally */
|
||||
DllImport int32 FAR PASCAL swe_sol_eclipse_when_glob(double tjd_start, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_when_glob(double tjd_start, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
|
||||
|
||||
/* finds time of next occultation globally */
|
||||
DllImport int32 FAR PASCAL swe_lun_occult_when_glob(double tjd_start, int32 ipl, char *starname, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_lun_occult_when_glob(double tjd_start, int32 ipl, char *starname, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
|
||||
|
||||
/* computes attributes of a lunar eclipse for given tjd */
|
||||
DllImport int32 FAR PASCAL swe_lun_eclipse_how(
|
||||
DllImport int32 CALL_CONV_IMP swe_lun_eclipse_how(
|
||||
double tjd_ut,
|
||||
int32 ifl,
|
||||
double *geopos,
|
||||
double *attr,
|
||||
char *serr);
|
||||
DllImport int32 FAR PASCAL swe_lun_eclipse_when(double tjd_start, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
|
||||
DllImport int32 FAR PASCAL swe_lun_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_lun_eclipse_when(double tjd_start, int32 ifl, int32 ifltype, double *tret, int32 backward, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_lun_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
|
||||
/* planetary phenomena */
|
||||
DllImport int32 FAR PASCAL swe_pheno(double tjd, int32 ipl, int32 iflag, double *attr, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_pheno(double tjd, int32 ipl, int32 iflag, double *attr, char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_pheno_ut(double tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_pheno_ut(double tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
|
||||
|
||||
DllImport double FAR PASCAL swe_refrac(double inalt, double atpress, double attemp, int32 calc_flag);
|
||||
DllImport double FAR PASCAL swe_refrac_extended(double inalt, double geoalt, double atpress, double attemp, double lapse_rate, int32 calc_flag, double *dret);
|
||||
DllImport void FAR PASCAL swe_set_lapse_rate(double lapse_rate);
|
||||
DllImport double CALL_CONV_IMP swe_refrac(double inalt, double atpress, double attemp, int32 calc_flag);
|
||||
DllImport double CALL_CONV_IMP swe_refrac_extended(double inalt, double geoalt, double atpress, double attemp, double lapse_rate, int32 calc_flag, double *dret);
|
||||
DllImport void CALL_CONV_IMP swe_set_lapse_rate(double lapse_rate);
|
||||
|
||||
DllImport void FAR PASCAL swe_azalt(
|
||||
DllImport void CALL_CONV_IMP swe_azalt(
|
||||
double tjd_ut,
|
||||
int32 calc_flag,
|
||||
double *geopos,
|
||||
@@ -254,14 +265,14 @@ DllImport void FAR PASCAL swe_azalt(
|
||||
double *xin,
|
||||
double *xaz);
|
||||
|
||||
DllImport void FAR PASCAL swe_azalt_rev(
|
||||
DllImport void CALL_CONV_IMP swe_azalt_rev(
|
||||
double tjd_ut,
|
||||
int32 calc_flag,
|
||||
double *geopos,
|
||||
double *xin,
|
||||
double *xout);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_rise_trans(
|
||||
DllImport int32 CALL_CONV_IMP swe_rise_trans(
|
||||
double tjd_ut, int32 ipl, char *starname,
|
||||
int32 epheflag, int32 rsmi,
|
||||
double *geopos,
|
||||
@@ -269,7 +280,7 @@ DllImport int32 FAR PASCAL swe_rise_trans(
|
||||
double *tret,
|
||||
char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_rise_trans_true_hor(
|
||||
DllImport int32 CALL_CONV_IMP swe_rise_trans_true_hor(
|
||||
double tjd_ut, int32 ipl, char *starname,
|
||||
int32 epheflag, int32 rsmi,
|
||||
double *geopos,
|
||||
@@ -278,22 +289,18 @@ DllImport int32 FAR PASCAL swe_rise_trans_true_hor(
|
||||
double *tret,
|
||||
char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
|
||||
DllImport int32 CALL_CONV_IMP swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
|
||||
int32 method,
|
||||
double *xnasc, double *xndsc,
|
||||
double *xperi, double *xaphe,
|
||||
char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
|
||||
DllImport int32 CALL_CONV_IMP swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
|
||||
int32 method,
|
||||
double *xnasc, double *xndsc,
|
||||
double *xperi, double *xaphe,
|
||||
char *serr);
|
||||
|
||||
/*DllImport int32 FAR PASCAL HeliacalAngle(double Magn, double Age, int SN, double AziO, double AltM, double AziM, double JDNDaysUT, double AziS, double Lat, double HeightEye, double Temperature, double Pressure, double RH, double VR, double *dangret, char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL HeliacalJDut(double JDNDaysUTStart, double Age, int SN, double Lat, double Longitude, double HeightEye, double Temperature, double Pressure, double RH, double VR, char *ObjectName, int TypeEvent, char *AVkind, double *dret, char *serr);*/
|
||||
|
||||
/*******************************************************
|
||||
* other functions from swephlib.c;
|
||||
* they are not needed for Swiss Ephemeris,
|
||||
@@ -301,39 +308,39 @@ DllImport int32 FAR PASCAL HeliacalJDut(double JDNDaysUTStart, double Age, int S
|
||||
********************************************************/
|
||||
|
||||
/* normalize argument into interval [0..DEG360] */
|
||||
DllImport centisec FAR PASCAL swe_csnorm(centisec p);
|
||||
DllImport centisec CALL_CONV_IMP swe_csnorm(centisec p);
|
||||
|
||||
/* distance in centisecs p1 - p2 normalized to [0..360[ */
|
||||
DllImport centisec FAR PASCAL swe_difcsn (centisec p1, centisec p2);
|
||||
DllImport centisec CALL_CONV_IMP swe_difcsn (centisec p1, centisec p2);
|
||||
|
||||
DllImport double FAR PASCAL swe_difdegn (double p1, double p2);
|
||||
DllImport double CALL_CONV_IMP swe_difdegn (double p1, double p2);
|
||||
|
||||
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
|
||||
DllImport centisec FAR PASCAL swe_difcs2n(centisec p1, centisec p2);
|
||||
DllImport centisec CALL_CONV_IMP swe_difcs2n(centisec p1, centisec p2);
|
||||
|
||||
DllImport double FAR PASCAL swe_difdeg2n(double p1, double p2);
|
||||
DllImport double CALL_CONV_IMP swe_difdeg2n(double p1, double p2);
|
||||
|
||||
DllImport double FAR PASCAL swe_difdeg2n(double p1, double p2);
|
||||
DllImport double FAR PASCAL swe_difrad2n(double p1, double p2);
|
||||
DllImport double FAR PASCAL swe_rad_midp(double x1, double x0);
|
||||
DllImport double FAR PASCAL swe_deg_midp(double x1, double x0);
|
||||
DllImport double CALL_CONV_IMP swe_difdeg2n(double p1, double p2);
|
||||
DllImport double CALL_CONV_IMP swe_difrad2n(double p1, double p2);
|
||||
DllImport double CALL_CONV_IMP swe_rad_midp(double x1, double x0);
|
||||
DllImport double CALL_CONV_IMP swe_deg_midp(double x1, double x0);
|
||||
|
||||
/* round second, but at 29.5959 always down */
|
||||
DllImport centisec FAR PASCAL swe_csroundsec(centisec x);
|
||||
DllImport centisec CALL_CONV_IMP swe_csroundsec(centisec x);
|
||||
|
||||
/* double to int32 with rounding, no overflow check */
|
||||
DllImport int32 FAR PASCAL swe_d2l(double x);
|
||||
DllImport int32 CALL_CONV_IMP swe_d2l(double x);
|
||||
|
||||
DllImport void FAR PASCAL swe_split_deg(double ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
|
||||
DllImport void CALL_CONV_IMP swe_split_deg(double ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
|
||||
|
||||
/* monday = 0, ... sunday = 6 */
|
||||
DllImport int FAR PASCAL swe_day_of_week(double jd);
|
||||
DllImport int CALL_CONV_IMP swe_day_of_week(double jd);
|
||||
|
||||
DllImport char *FAR PASCAL swe_cs2timestr(CSEC t, int sep, AS_BOOL suppressZero, char *a);
|
||||
DllImport char * CALL_CONV_IMP swe_cs2timestr(CSEC t, int sep, AS_BOOL suppressZero, char *a);
|
||||
|
||||
DllImport char *FAR PASCAL swe_cs2lonlatstr(CSEC t, char pchar, char mchar, char *s);
|
||||
DllImport char * CALL_CONV_IMP swe_cs2lonlatstr(CSEC t, char pchar, char mchar, char *s);
|
||||
|
||||
DllImport char *FAR PASCAL swe_cs2degstr(CSEC t, char *a);
|
||||
DllImport char * CALL_CONV_IMP swe_cs2degstr(CSEC t, char *a);
|
||||
|
||||
|
||||
/* additional functions for antiquated GFA basic DLL interface.
|
||||
@@ -342,115 +349,115 @@ DllImport char *FAR PASCAL swe_cs2degstr(CSEC t, char *a);
|
||||
* void -> int
|
||||
*/
|
||||
|
||||
DllImport int32 FAR PASCAL swe_calc_d(
|
||||
DllImport int32 CALL_CONV_IMP swe_calc_d(
|
||||
double *tjd, int ipl, int32 iflag,
|
||||
double *x,
|
||||
char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_calc_ut_d(
|
||||
DllImport int32 CALL_CONV_IMP swe_calc_ut_d(
|
||||
double *tjd, int16 ipl, int32 iflag,
|
||||
double *x,
|
||||
char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_fixstar_d(
|
||||
DllImport int32 CALL_CONV_IMP swe_fixstar_d(
|
||||
char *star, double *tjd, int32 iflag,
|
||||
double *x,
|
||||
char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_fixstar_ut_d(
|
||||
DllImport int32 CALL_CONV_IMP swe_fixstar_ut_d(
|
||||
char *star, double *tjd, int32 iflag,
|
||||
double *x,
|
||||
char *serr);
|
||||
|
||||
DllImport int FAR PASCAL swe_close_d(int ivoid);
|
||||
DllImport int CALL_CONV_IMP swe_close_d(int ivoid);
|
||||
|
||||
DllImport int FAR PASCAL swe_set_ephe_path_d(char *path);
|
||||
DllImport int CALL_CONV_IMP swe_set_ephe_path_d(char *path);
|
||||
|
||||
DllImport int FAR PASCAL swe_set_jpl_file_d(char *fname);
|
||||
DllImport int CALL_CONV_IMP swe_set_jpl_file_d(char *fname);
|
||||
|
||||
DllImport char *FAR PASCAL swe_get_planet_name_d(int ipl, char *spname);
|
||||
DllImport char * CALL_CONV_IMP swe_get_planet_name_d(int ipl, char *spname);
|
||||
|
||||
DllImport int FAR PASCAL swe_deltat_d(double *tjd, double *deltat);
|
||||
DllImport int CALL_CONV_IMP swe_deltat_d(double *tjd, double *deltat);
|
||||
|
||||
DllImport int FAR PASCAL swe_sidtime0_d(double *tjd_ut, double *eps,
|
||||
DllImport int CALL_CONV_IMP swe_sidtime0_d(double *tjd_ut, double *eps,
|
||||
double *nut, double *sidt);
|
||||
DllImport int FAR PASCAL swe_sidtime_d(double *tjd_ut, double *sidt);
|
||||
DllImport int CALL_CONV_IMP swe_sidtime_d(double *tjd_ut, double *sidt);
|
||||
|
||||
DllImport int FAR PASCAL swe_set_sid_mode_d(
|
||||
DllImport int CALL_CONV_IMP swe_set_sid_mode_d(
|
||||
int32 sid_mode, double *t0, double *ayan_t0);
|
||||
|
||||
DllImport int FAR PASCAL swe_get_ayanamsa_d(double *tjd_et, double *ayan);
|
||||
DllImport int FAR PASCAL swe_get_ayanamsa_ut_d(double *tjd_et, double *ayan);
|
||||
DllImport int CALL_CONV_IMP swe_get_ayanamsa_d(double *tjd_et, double *ayan);
|
||||
DllImport int CALL_CONV_IMP swe_get_ayanamsa_ut_d(double *tjd_et, double *ayan);
|
||||
|
||||
DllImport int FAR PASCAL swe_cotrans_d(double *xpo, double *xpn, double *eps);
|
||||
DllImport int FAR PASCAL swe_cotrans_sp_d(double *xpo, double *xpn, double *eps);
|
||||
DllImport int CALL_CONV_IMP swe_cotrans_d(double *xpo, double *xpn, double *eps);
|
||||
DllImport int CALL_CONV_IMP swe_cotrans_sp_d(double *xpo, double *xpn, double *eps);
|
||||
|
||||
DllImport int FAR PASCAL swe_set_topo_d(double *geolon, double *geolat, double *height);
|
||||
DllImport int CALL_CONV_IMP swe_set_topo_d(double *geolon, double *geolat, double *height);
|
||||
|
||||
DllImport int FAR PASCAL swe_get_tid_acc_d(double *t_acc);
|
||||
DllImport int FAR PASCAL swe_set_tid_acc_d(double *t_acc);
|
||||
DllImport int CALL_CONV_IMP swe_get_tid_acc_d(double *t_acc);
|
||||
DllImport int CALL_CONV_IMP swe_set_tid_acc_d(double *t_acc);
|
||||
|
||||
DllImport int FAR PASCAL swe_degnorm_d(double *x);
|
||||
DllImport int CALL_CONV_IMP swe_degnorm_d(double *x);
|
||||
|
||||
DllImport int FAR PASCAL swe_date_conversion_d(
|
||||
DllImport int CALL_CONV_IMP swe_date_conversion_d(
|
||||
int y , int m , int d , /* year, month, day */
|
||||
double *utime, /* universal time in hours (decimal) */
|
||||
char *c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
||||
double *tjd);
|
||||
|
||||
DllImport int FAR PASCAL swe_julday_d(
|
||||
DllImport int CALL_CONV_IMP swe_julday_d(
|
||||
int year, int month, int day, double *hour,
|
||||
int gregflag, double *tjd);
|
||||
|
||||
DllImport int FAR PASCAL swe_revjul_d(
|
||||
DllImport int CALL_CONV_IMP swe_revjul_d(
|
||||
double *tjd,
|
||||
int gregflag,
|
||||
int *jyear, int *jmon, int *jday, double *jut);
|
||||
|
||||
DllImport int FAR PASCAL swe_houses_d(
|
||||
DllImport int CALL_CONV_IMP swe_houses_d(
|
||||
double *tjd, double *geolat, double *geolon, int hsys,
|
||||
double *hcusps, double *ascmc);
|
||||
|
||||
DllImport int FAR PASCAL swe_houses_ex_d(
|
||||
DllImport int CALL_CONV_IMP swe_houses_ex_d(
|
||||
double *tjd_ut, int32 iflag, double *geolat, double *geolon, int hsys,
|
||||
double *hcusps, double *ascmc);
|
||||
|
||||
DllImport int FAR PASCAL swe_houses_armc_d(
|
||||
DllImport int CALL_CONV_IMP swe_houses_armc_d(
|
||||
double *armc, double *geolat, double *eps, int hsys,
|
||||
double *hcusps, double *ascmc);
|
||||
|
||||
DllImport int FAR PASCAL swe_house_pos_d(
|
||||
DllImport int CALL_CONV_IMP swe_house_pos_d(
|
||||
double *armc, double *geolon, double *eps, int hsys, double *xpin, double *hpos, char *serr);
|
||||
|
||||
/* normalize argument into interval [0..DEG360] */
|
||||
DllImport centisec FAR PASCAL swe_csnorm_d(centisec p);
|
||||
DllImport centisec CALL_CONV_IMP swe_csnorm_d(centisec p);
|
||||
|
||||
/* distance in centisecs p1 - p2 normalized to [0..360[ */
|
||||
DllImport centisec FAR PASCAL swe_difcsn_d(centisec p1, centisec p2);
|
||||
DllImport centisec CALL_CONV_IMP swe_difcsn_d(centisec p1, centisec p2);
|
||||
|
||||
DllImport int FAR PASCAL swe_difdegn_d(double *p1, double *p2, double *diff);
|
||||
DllImport int CALL_CONV_IMP swe_difdegn_d(double *p1, double *p2, double *diff);
|
||||
|
||||
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
|
||||
DllImport centisec FAR PASCAL swe_difcs2n_d(centisec p1, centisec p2);
|
||||
DllImport centisec CALL_CONV_IMP swe_difcs2n_d(centisec p1, centisec p2);
|
||||
|
||||
DllImport int FAR PASCAL swe_difdeg2n_d(double *p1, double *p2, double *diff);
|
||||
DllImport int CALL_CONV_IMP swe_difdeg2n_d(double *p1, double *p2, double *diff);
|
||||
|
||||
/* round second, but at 29.5959 always down */
|
||||
DllImport centisec FAR PASCAL swe_csroundsec_d(centisec x);
|
||||
DllImport centisec CALL_CONV_IMP swe_csroundsec_d(centisec x);
|
||||
|
||||
/* double to int32 with rounding, no overflow check */
|
||||
DllImport int32 FAR PASCAL swe_d2l_d(double *x);
|
||||
DllImport int32 CALL_CONV_IMP swe_d2l_d(double *x);
|
||||
|
||||
DllImport int FAR PASCAL swe_split_deg_d(double *ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
|
||||
DllImport int CALL_CONV_IMP swe_split_deg_d(double *ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
|
||||
|
||||
/* monday = 0, ... sunday = 6 */
|
||||
DllImport int FAR PASCAL swe_day_of_week_d(double *jd);
|
||||
DllImport int CALL_CONV_IMP swe_day_of_week_d(double *jd);
|
||||
|
||||
DllImport char *FAR PASCAL swe_cs2timestr_d(CSEC t, int sep, AS_BOOL suppressZero, char *a);
|
||||
DllImport char * CALL_CONV_IMP swe_cs2timestr_d(CSEC t, int sep, AS_BOOL suppressZero, char *a);
|
||||
|
||||
DllImport char *FAR PASCAL swe_cs2lonlatstr_d(CSEC t, char *pchar, char *mchar, char *s);
|
||||
DllImport char * CALL_CONV_IMP swe_cs2lonlatstr_d(CSEC t, char *pchar, char *mchar, char *s);
|
||||
|
||||
DllImport char *FAR PASCAL swe_cs2degstr_d(CSEC t, char *a);
|
||||
DllImport char * CALL_CONV_IMP swe_cs2degstr_d(CSEC t, char *a);
|
||||
|
||||
/****************************
|
||||
* from swecl.c
|
||||
@@ -458,35 +465,35 @@ DllImport char *FAR PASCAL swe_cs2degstr_d(CSEC t, char *a);
|
||||
|
||||
/* computes geographic location and attributes of solar
|
||||
* eclipse at a given tjd */
|
||||
DllImport int32 FAR PASCAL swe_sol_eclipse_where_d(double *tjd_ut, int32 ifl, double *geopos, double *attr, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_where_d(double *tjd_ut, int32 ifl, double *geopos, double *attr, char *serr);
|
||||
|
||||
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */
|
||||
DllImport int32 FAR PASCAL swe_sol_eclipse_how_d(double *tjd_ut, int32 ifl, double geolon, double geolat, double geohgt, double *attr, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_how_d(double *tjd_ut, int32 ifl, double geolon, double geolat, double geohgt, double *attr, char *serr);
|
||||
|
||||
/* finds time of next local eclipse */
|
||||
DllImport int32 FAR PASCAL swe_sol_eclipse_when_loc_d(double *tjd_start, int32 ifl, double *geopos, double *tret, double *attr, AS_BOOL backward, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_when_loc_d(double *tjd_start, int32 ifl, double *geopos, double *tret, double *attr, AS_BOOL backward, char *serr);
|
||||
|
||||
/* finds time of next eclipse globally */
|
||||
DllImport int32 FAR PASCAL swe_sol_eclipse_when_glob_d(double *tjd_start, int32 ifl, int32 ifltype,
|
||||
DllImport int32 CALL_CONV_IMP swe_sol_eclipse_when_glob_d(double *tjd_start, int32 ifl, int32 ifltype,
|
||||
double *tret, AS_BOOL backward, char *serr);
|
||||
|
||||
/* computes attributes of a lunar eclipse for given tjd */
|
||||
DllImport int32 FAR PASCAL swe_lun_eclipse_how_d(
|
||||
DllImport int32 CALL_CONV_IMP swe_lun_eclipse_how_d(
|
||||
double *tjd_ut,
|
||||
int32 ifl,
|
||||
double *attr,
|
||||
char *serr);
|
||||
DllImport int32 FAR PASCAL swe_lun_eclipse_when_d(double *tjd_start, int32 ifl, int32 ifltype,
|
||||
DllImport int32 CALL_CONV_IMP swe_lun_eclipse_when_d(double *tjd_start, int32 ifl, int32 ifltype,
|
||||
double *tret, AS_BOOL backward, char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_pheno_d(double *tjd, int32 ipl, int32 iflag,
|
||||
DllImport int32 CALL_CONV_IMP swe_pheno_d(double *tjd, int32 ipl, int32 iflag,
|
||||
double *attr, char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_pheno_ut_d(double *tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
|
||||
DllImport int32 CALL_CONV_IMP swe_pheno_ut_d(double *tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
|
||||
|
||||
DllImport int FAR PASCAL swe_refrac_d(double *inalt, double *atpress, double *attemp, int32 calc_flag, double *retalt);
|
||||
DllImport int CALL_CONV_IMP swe_refrac_d(double *inalt, double *atpress, double *attemp, int32 calc_flag, double *retalt);
|
||||
|
||||
DllImport int FAR PASCAL swe_azalt_d(
|
||||
DllImport int CALL_CONV_IMP swe_azalt_d(
|
||||
double *tjd_ut,
|
||||
int32 calc_flag,
|
||||
double *geopos,
|
||||
@@ -495,14 +502,14 @@ DllImport int FAR PASCAL swe_azalt_d(
|
||||
double *xin,
|
||||
double *xaz);
|
||||
|
||||
DllImport int FAR PASCAL swe_azalt_rev_d(
|
||||
DllImport int CALL_CONV_IMP swe_azalt_rev_d(
|
||||
double *tjd_ut,
|
||||
int32 calc_flag,
|
||||
double *geopos,
|
||||
double *xin,
|
||||
double *xout);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_rise_trans_d(
|
||||
DllImport int32 CALL_CONV_IMP swe_rise_trans_d(
|
||||
double *tjd_ut, int32 ipl, char *starname,
|
||||
int32 epheflag, int32 rsmi,
|
||||
double *geopos,
|
||||
@@ -510,13 +517,13 @@ DllImport int32 FAR PASCAL swe_rise_trans_d(
|
||||
double *tret,
|
||||
char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_nod_aps_d(double *tjd_et, int32 ipl, int32 iflag,
|
||||
DllImport int32 CALL_CONV_IMP swe_nod_aps_d(double *tjd_et, int32 ipl, int32 iflag,
|
||||
int32 method,
|
||||
double *xnasc, double *xndsc,
|
||||
double *xperi, double *xaphe,
|
||||
char *serr);
|
||||
|
||||
DllImport int32 FAR PASCAL swe_nod_aps_ut_d(double *tjd_ut, int32 ipl, int32 iflag,
|
||||
DllImport int32 CALL_CONV_IMP swe_nod_aps_ut_d(double *tjd_ut, int32 ipl, int32 iflag,
|
||||
int32 method,
|
||||
double *xnasc, double *xndsc,
|
||||
double *xperi, double *xaphe,
|
||||
|
234
swe/src/swehel.c
234
swe/src/swehel.c
@@ -93,7 +93,6 @@
|
||||
#define M2S 60.0 /*[sec]*/
|
||||
|
||||
/* Determines which algorimths are used*/
|
||||
#define USE_DELTA_T_VR 0
|
||||
#define REFR_SINCLAIR 0
|
||||
#define REFR_BENNETTH 1
|
||||
#define FormAstroRefrac REFR_SINCLAIR /*for Astronomical refraction can be "bennetth" or "sinclair"*/
|
||||
@@ -321,9 +320,9 @@ int32 call_swe_calc(double tjd, int32 ipl, int32 iflag, double *x, char *serr)
|
||||
{
|
||||
int32 retval = OK, ipli, i;
|
||||
double dtjd;
|
||||
static double tjdsv[3];
|
||||
static double xsv[3][6];
|
||||
static int32 iflagsv[3];
|
||||
static TLS double tjdsv[3];
|
||||
static TLS double xsv[3][6];
|
||||
static TLS int32 iflagsv[3];
|
||||
ipli = ipl;
|
||||
if (ipli > SE_MOON)
|
||||
ipli = 2;
|
||||
@@ -361,8 +360,8 @@ int32 call_swe_fixstar_mag(char *star, double *mag, char *serr)
|
||||
{
|
||||
int32 retval;
|
||||
char star2[AS_MAXCH];
|
||||
static double dmag;
|
||||
static char star_save[AS_MAXCH];
|
||||
static TLS double dmag;
|
||||
static TLS char star_save[AS_MAXCH];
|
||||
if (strcmp(star, star_save) == 0) {
|
||||
*mag = dmag;
|
||||
return OK;
|
||||
@@ -402,6 +401,7 @@ static int32 calc_rise_and_set(double tjd_start, int32 ipl, double *dgeo, double
|
||||
double tjd0 = tjd_start, tjdrise;
|
||||
double tjdnoon = (int) tjd0 - dgeo[0] / 15.0 / 24.0;
|
||||
int32 iflag = helflag & (SEFLG_JPLEPH|SEFLG_SWIEPH|SEFLG_MOSEPH);
|
||||
int32 epheflag = iflag;
|
||||
iflag |= SEFLG_EQUATORIAL;
|
||||
if (!(helflag & SE_HELFLAG_HIGH_PRECISION))
|
||||
iflag |= SEFLG_NONUT|SEFLG_TRUEPOS;
|
||||
@@ -460,14 +460,16 @@ else
|
||||
/* now calculate more accurate rising and setting times.
|
||||
* use vertical speed in order to determine crossing of the horizon
|
||||
* refraction of 34' and solar disk diameter of 16' = 50' = 0.84 deg */
|
||||
iflag = SEFLG_SPEED|SEFLG_EQUATORIAL;
|
||||
iflag = epheflag|SEFLG_SPEED|SEFLG_EQUATORIAL;
|
||||
if (ipl == SE_MOON)
|
||||
iflag |= SEFLG_TOPOCTR;
|
||||
if (!(helflag & SE_HELFLAG_HIGH_PRECISION))
|
||||
iflag |= SEFLG_NONUT|SEFLG_TRUEPOS;
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (swe_calc_ut(tjdrise, ipl, iflag, xx, serr) == ERR)
|
||||
if (swe_calc_ut(tjdrise, ipl, iflag, xx, serr) == ERR) {
|
||||
/*fprintf(stderr, "hev4 tjd=%f, ipl=%d, iflag=%d\n", tjdrise, ipl, iflag);*/
|
||||
return ERR;
|
||||
}
|
||||
swe_azalt(tjdrise, SE_EQU2HOR, dgeo, datm[0], datm[1], xx, xaz);
|
||||
xx[0] -= xx[3] * dfac;
|
||||
xx[1] -= xx[4] * dfac;
|
||||
@@ -528,8 +530,8 @@ static double SunRA(double JDNDaysUT, int32 helflag, char *serr)
|
||||
{
|
||||
int imon, iday, iyar, calflag = SE_GREG_CAL;
|
||||
double dut;
|
||||
static double tjdlast;
|
||||
static double ralast;
|
||||
static TLS double tjdlast;
|
||||
static TLS double ralast;
|
||||
if (JDNDaysUT == tjdlast)
|
||||
return ralast;
|
||||
#ifndef SIMULATE_VICTORVB
|
||||
@@ -539,7 +541,7 @@ static double SunRA(double JDNDaysUT, int32 helflag, char *serr)
|
||||
int32 epheflag = helflag & (SEFLG_JPLEPH|SEFLG_SWIEPH|SEFLG_MOSEPH);
|
||||
int32 iflag = epheflag | SEFLG_EQUATORIAL;
|
||||
iflag |= SEFLG_NONUT | SEFLG_TRUEPOS;
|
||||
tjd_tt = JDNDaysUT + swe_deltat(JDNDaysUT);
|
||||
tjd_tt = JDNDaysUT + swe_deltat_ex(JDNDaysUT, epheflag, serr);
|
||||
if (swe_calc(tjd_tt, SE_SUN, iflag, x, serr) != ERR) {
|
||||
ralast = x[0];
|
||||
tjdlast = JDNDaysUT;
|
||||
@@ -643,60 +645,6 @@ static double HourAngle(double TopoAlt, double TopoDecl, double Lat)
|
||||
return acos(ha) / DEGTORAD / 15.0;
|
||||
}
|
||||
|
||||
/*###################################################################
|
||||
' JDNDays [Days]
|
||||
' COD [msec/cy]
|
||||
' DeltaTSE [Sec]
|
||||
*/
|
||||
static double DeltaTSE(double JDNDays, int COD)
|
||||
{
|
||||
double OffSetYear;
|
||||
int gregflag = SE_GREG_CAL;
|
||||
if (StartYear < 1583)
|
||||
gregflag = SE_JUL_CAL;
|
||||
/* from Swiss Emphemeris */
|
||||
if (COD != 0) {
|
||||
/* Determined by V. Reijs*/
|
||||
OffSetYear = (swe_julday((int) StartYear, 1, 1, 0, gregflag) - JDNDays) / 365.25;
|
||||
return (OffSetYear * OffSetYear / 100.0 / 2.0 * COD * Y2D) / 1000.0;
|
||||
}
|
||||
return swe_deltat(JDNDays) * D2S;
|
||||
}
|
||||
|
||||
/*###################################################################
|
||||
' JDNDays [Day]
|
||||
' COD [msec/cy]
|
||||
' DeltaTVR [Sec]
|
||||
*/
|
||||
static double DeltaTVR(double JDNDays, int COD)
|
||||
{
|
||||
/* Determined by V. Reijs */
|
||||
double DeltaTVR;
|
||||
int gregflag = SE_GREG_CAL;
|
||||
double OffSetYear;
|
||||
if (StartYear < 1583)
|
||||
gregflag = SE_JUL_CAL;
|
||||
OffSetYear = (swe_julday((int) StartYear, 1, 1, 0, gregflag) - JDNDays) / 365.25;
|
||||
if (COD == 0) {
|
||||
DeltaTVR = (OffSetYear * OffSetYear / 100.0 / 2.0 * Average + Periodicy / 2.0 / PI * Amplitude * (cos((2 * PI * OffSetYear / Periodicy)) - 1)) * Y2D;
|
||||
} else {
|
||||
DeltaTVR = OffSetYear * OffSetYear / 100.0 / 2.0 * COD * Y2D;
|
||||
}
|
||||
return DeltaTVR / 1000.0;
|
||||
}
|
||||
|
||||
/*###################################################################
|
||||
' JDNDays [Days]
|
||||
' COD [msec/cy]
|
||||
' DeltaT [Sec]
|
||||
*/
|
||||
static double DeltaT(double JDNDays, int COD)
|
||||
{
|
||||
if (USE_DELTA_T_VR)
|
||||
return DeltaTVR(JDNDays, COD);
|
||||
return DeltaTSE(JDNDays, COD);
|
||||
}
|
||||
|
||||
/*###################################################################
|
||||
' JDNDaysUT [Days]
|
||||
' dgeo [array: longitude, latitude, eye height above sea m]
|
||||
@@ -718,7 +666,7 @@ static int32 ObjectLoc(double JDNDaysUT, double *dgeo, double *datm, char *Objec
|
||||
iflag |= SEFLG_NONUT | SEFLG_TRUEPOS;
|
||||
if (Angle < 5) iflag = iflag | SEFLG_TOPOCTR;
|
||||
if (Angle == 7) Angle = 0;
|
||||
tjd_tt = JDNDaysUT + DeltaT(JDNDaysUT, 0) / D2S;
|
||||
tjd_tt = JDNDaysUT + swe_deltat_ex(JDNDaysUT, epheflag, serr);
|
||||
Planet = DeterObject(ObjectName);
|
||||
if (Planet != -1) {
|
||||
if (swe_calc(tjd_tt, Planet, iflag, x, serr) == ERR)
|
||||
@@ -771,7 +719,7 @@ static int32 azalt_cart(double JDNDaysUT, double *dgeo, double *datm, char *Obje
|
||||
if (!(helflag & SE_HELFLAG_HIGH_PRECISION))
|
||||
iflag |= SEFLG_NONUT | SEFLG_TRUEPOS;
|
||||
iflag = iflag | SEFLG_TOPOCTR;
|
||||
tjd_tt = JDNDaysUT + DeltaT(JDNDaysUT, 0) / D2S;
|
||||
tjd_tt = JDNDaysUT + swe_deltat_ex(JDNDaysUT, epheflag, serr);
|
||||
Planet = DeterObject(ObjectName);
|
||||
if (Planet != -1) {
|
||||
if (swe_calc(tjd_tt, Planet, iflag, x, serr) == ERR)
|
||||
@@ -841,7 +789,7 @@ static double kW(double HeightEye, double TempS, double RH)
|
||||
static double kOZ(double AltS, double sunra, double Lat)
|
||||
{
|
||||
double CHANGEKO, OZ, LT, kOZret;
|
||||
static double koz_last, alts_last, sunra_last;
|
||||
static TLS double koz_last, alts_last, sunra_last;
|
||||
if (AltS == alts_last && sunra == sunra_last)
|
||||
return koz_last;
|
||||
alts_last = AltS; sunra_last = sunra;
|
||||
@@ -901,7 +849,7 @@ static double ka(double AltS, double sunra, double Lat, double HeightEye, double
|
||||
/* depending on day/night vision (altitude of sun < start astronomical twilight),
|
||||
* lambda eye sensibility changes
|
||||
* see extinction section of Vistas in Astronomy page 343 */
|
||||
static double alts_last, sunra_last, ka_last;
|
||||
static TLS double alts_last, sunra_last, ka_last;
|
||||
if (AltS == alts_last && sunra == sunra_last)
|
||||
return ka_last;
|
||||
alts_last = AltS; sunra_last = sunra;
|
||||
@@ -1053,7 +1001,7 @@ static double Deltam(double AltO, double AltS, double sunra, double Lat, double
|
||||
double TempE = TempEfromTempS(datm[1], HeightEye, LapseSA);
|
||||
double AppAltO = AppAltfromTopoAlt(AltO, TempE, PresE, helflag);
|
||||
double deltam;
|
||||
static double alts_last, alto_last, sunra_last, deltam_last;
|
||||
static TLS double alts_last, alto_last, sunra_last, deltam_last;
|
||||
if (AltS == alts_last && AltO == alto_last && sunra == sunra_last)
|
||||
return deltam_last;
|
||||
alts_last = AltS; alto_last = AltO; sunra_last = sunra;
|
||||
@@ -1147,9 +1095,9 @@ static int32 fast_magnitude(double tjd, double *dgeo, char *ObjectName, int32 he
|
||||
{
|
||||
int32 retval = OK, ipl, ipli;
|
||||
double dtjd;
|
||||
static double tjdsv[3];
|
||||
static double dmagsv[3];
|
||||
static int32 helflagsv[3];
|
||||
static TLS double tjdsv[3];
|
||||
static TLS double dmagsv[3];
|
||||
static TLS int32 helflagsv[3];
|
||||
ipl = DeterObject(ObjectName);
|
||||
ipli = ipl;
|
||||
if (ipli > SE_MOON)
|
||||
@@ -1428,19 +1376,28 @@ static double VisLimMagn(double *dobs, double AltO, double AziO, double AltM, do
|
||||
* |1 OK, scotopic vision
|
||||
* |2 OK, near limit photopic/scotopic
|
||||
*/
|
||||
int32 FAR PASCAL_CONV swe_vis_limit_mag(double tjdut, double *dgeo, double *datm, double *dobs, char *ObjectName, int32 helflag, double *dret, char *serr)
|
||||
int32 CALL_CONV swe_vis_limit_mag(double tjdut, double *dgeo, double *datm, double *dobs, char *ObjectName, int32 helflag, double *dret, char *serr)
|
||||
{
|
||||
int32 retval = OK, i, scotopic_flag = 0;
|
||||
double AltO, AziO, AltM, AziM, AltS, AziS;
|
||||
double sunra = SunRA(tjdut, helflag, serr);
|
||||
default_heliacal_parameters(datm, dgeo, dobs, helflag);
|
||||
swe_set_topo(dgeo[0], dgeo[1], dgeo[2]);
|
||||
double sunra;
|
||||
for (i = 0; i < 7; i++)
|
||||
dret[i] = 0;
|
||||
if (DeterObject(ObjectName) == SE_SUN) {
|
||||
if (serr != NULL) {
|
||||
strcpy(serr, "it makes no sense to call swe_vis_limit_mag() for the Sun");
|
||||
}
|
||||
return ERR;
|
||||
}
|
||||
swi_set_tid_acc(tjdut, helflag, 0, serr);
|
||||
sunra = SunRA(tjdut, helflag, serr);
|
||||
default_heliacal_parameters(datm, dgeo, dobs, helflag);
|
||||
swe_set_topo(dgeo[0], dgeo[1], dgeo[2]);
|
||||
if (ObjectLoc(tjdut, dgeo, datm, ObjectName, 0, helflag, &AltO, serr) == ERR)
|
||||
return ERR;
|
||||
if (AltO < 0 && serr != NULL) {
|
||||
strcpy(serr, "object is below local horizon");
|
||||
if (AltO < 0) {
|
||||
if (serr != NULL)
|
||||
strcpy(serr, "object is below local horizon");
|
||||
*dret = -100;
|
||||
return -2;
|
||||
}
|
||||
@@ -1555,9 +1512,11 @@ static int32 TopoArcVisionis(double Magn, double *dobs, double AltO, double AziO
|
||||
return OK;
|
||||
}
|
||||
|
||||
int32 FAR PASCAL_CONV swe_topo_arcus_visionis(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double alt_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr)
|
||||
int32 CALL_CONV swe_topo_arcus_visionis(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double alt_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr)
|
||||
{
|
||||
double sunra = SunRA(tjdut, helflag, serr);
|
||||
double sunra;
|
||||
swi_set_tid_acc(tjdut, helflag, 0, serr);
|
||||
sunra = SunRA(tjdut, helflag, serr);
|
||||
if (serr != NULL && *serr != '\0')
|
||||
return ERR;
|
||||
return TopoArcVisionis(mag, dobs, alt_obj, azi_obj, alt_moon, azi_moon, tjdut, azi_sun, sunra, dgeo[1], dgeo[2], datm, helflag, dret, serr);
|
||||
@@ -1646,8 +1605,14 @@ static int32 HeliacalAngle(double Magn, double *dobs, double AziO, double AltM,
|
||||
return OK;
|
||||
}
|
||||
|
||||
int32 FAR PASCAL_CONV swe_heliacal_angle(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr)
|
||||
int32 CALL_CONV swe_heliacal_angle(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr)
|
||||
{
|
||||
if (dgeo[2] < SEI_ECL_GEOALT_MIN || dgeo[2] > SEI_ECL_GEOALT_MAX) {
|
||||
if (serr != NULL)
|
||||
sprintf(serr, "location for heliacal events must be between %.0f and %.0f m above sea", SEI_ECL_GEOALT_MIN, SEI_ECL_GEOALT_MAX);
|
||||
return ERR;
|
||||
}
|
||||
swi_set_tid_acc(tjdut, helflag, 0, serr);
|
||||
return HeliacalAngle(mag, dobs, azi_obj, alt_moon, azi_moon, tjdut, azi_sun, dgeo, datm, helflag, dret, serr);
|
||||
}
|
||||
|
||||
@@ -1803,7 +1768,7 @@ static void strcpy_VBsafe(char *sout, char *sin)
|
||||
'28=CVAact [deg] 'new
|
||||
'29=MSk [-]
|
||||
*/
|
||||
int32 FAR PASCAL_CONV swe_heliacal_pheno_ut(double JDNDaysUT, double *dgeo, double *datm, double *dobs, char *ObjectNameIn, int32 TypeEvent, int32 helflag, double *darr, char *serr)
|
||||
int32 CALL_CONV swe_heliacal_pheno_ut(double JDNDaysUT, double *dgeo, double *datm, double *dobs, char *ObjectNameIn, int32 TypeEvent, int32 helflag, double *darr, char *serr)
|
||||
{
|
||||
double AziS, AltS, AltS2, AziO, AltO, AltO2, GeoAltO, AppAltO, DAZact, TAVact, ParO, MagnO;
|
||||
double ARCVact, ARCLact, kact, WMoon, LMoon = 0, qYal, qCrit;
|
||||
@@ -1815,8 +1780,15 @@ int32 FAR PASCAL_CONV swe_heliacal_pheno_ut(double JDNDaysUT, double *dgeo, doub
|
||||
int32 retval = OK, RS, Planet;
|
||||
AS_BOOL noriseO = FALSE;
|
||||
char ObjectName[AS_MAXCH];
|
||||
double sunra = SunRA(JDNDaysUT, helflag, serr);
|
||||
double sunra;
|
||||
int32 iflag = helflag & (SEFLG_JPLEPH|SEFLG_SWIEPH|SEFLG_MOSEPH);
|
||||
if (dgeo[2] < SEI_ECL_GEOALT_MIN || dgeo[2] > SEI_ECL_GEOALT_MAX) {
|
||||
if (serr != NULL)
|
||||
sprintf(serr, "location for heliacal events must be between %.0f and %.0f m above sea", SEI_ECL_GEOALT_MIN, SEI_ECL_GEOALT_MAX);
|
||||
return ERR;
|
||||
}
|
||||
swi_set_tid_acc(JDNDaysUT, helflag, 0, serr);
|
||||
sunra = SunRA(JDNDaysUT, helflag, serr);
|
||||
/* note, the fixed stars functions rewrite the star name. The input string
|
||||
may be too short, so we have to make sure we have enough space */
|
||||
strcpy_VBsafe(ObjectName, ObjectNameIn);
|
||||
@@ -2010,7 +1982,7 @@ output_heliacal_pheno:
|
||||
}
|
||||
|
||||
#if 0
|
||||
int32 FAR PASCAL_CONV HeliacalJDut(double JDNDaysUTStart, double Age, double SN, double Lat, double Longitude, double HeightEye, double Temperature, double Pressure, double RH, double VR, char *ObjectName, int TypeEvent, char *AVkind, double *dret, char *serr)
|
||||
int32 HeliacalJDut(double JDNDaysUTStart, double Age, double SN, double Lat, double Longitude, double HeightEye, double Temperature, double Pressure, double RH, double VR, char *ObjectName, int TypeEvent, char *AVkind, double *dret, char *serr)
|
||||
{
|
||||
double dgeo[3], datm[4], dobs[6];
|
||||
int32 helflag = SE_HELFLAG_HIGH_PRECISION;
|
||||
@@ -2230,7 +2202,7 @@ static int32 heliacal_ut_arc_vis(double JDNDaysUTStart, double *dgeo, double *da
|
||||
if ((retval = my_rise_trans(JDNDaysUTstep, SE_SUN, "", eventtype, helflag, dgeo, datm, &tret, serr)) == ERR)
|
||||
goto swe_heliacal_err;
|
||||
/* determine time compensation to get Sun's altitude at heliacal rise */
|
||||
tjd_tt = tret + DeltaT(tret, 0) / D2S;
|
||||
tjd_tt = tret + swe_deltat_ex(tret, epheflag, serr);
|
||||
if ((retval = swe_calc(tjd_tt, SE_SUN, iflag, x, serr)) == ERR)
|
||||
goto swe_heliacal_err;
|
||||
xin[0] = x[0];
|
||||
@@ -2245,7 +2217,7 @@ static int32 heliacal_ut_arc_vis(double JDNDaysUTStart, double *dgeo, double *da
|
||||
if (TypeEvent == 2 || TypeEvent== 3) Tdelta = -Tdelta;
|
||||
/* determine appr.time when sun is at the wanted Sun's altitude */
|
||||
JDNarcvisUT = tret - Tdelta / 24;
|
||||
tjd_tt = JDNarcvisUT + DeltaT(JDNarcvisUT, 0) / D2S;
|
||||
tjd_tt = JDNarcvisUT + swe_deltat_ex(JDNarcvisUT, epheflag, serr);
|
||||
/* determine Sun's position */
|
||||
if ((retval = swe_calc(tjd_tt, SE_SUN, iflag, x, serr)) == ERR)
|
||||
goto swe_heliacal_err;
|
||||
@@ -2357,7 +2329,7 @@ static int32 heliacal_ut_arc_vis(double JDNDaysUTStart, double *dgeo, double *da
|
||||
do {
|
||||
OudeDatum = JDNarcvisUT;
|
||||
JDNarcvisUT = JDNarcvisUT - direct;
|
||||
tjd_tt = JDNarcvisUT + DeltaT(JDNarcvisUT, 0) / D2S;
|
||||
tjd_tt = JDNarcvisUT + swe_deltat_ex(JDNarcvisUT, epheflag, serr);
|
||||
if (Planet != -1) {
|
||||
if ((retval = swe_calc(tjd_tt, Planet, iflag, x, serr)) == ERR)
|
||||
goto swe_heliacal_err;
|
||||
@@ -2499,7 +2471,7 @@ static int32 get_asc_obl_diff_old(double tjd, int32 ipl, char *star, int32 iflag
|
||||
* - superior and inferior conjunction (Mercury and Venus)
|
||||
* - conjunction and opposition (ipl >= Mars)
|
||||
*/
|
||||
static double tcon[] =
|
||||
static const double tcon[] =
|
||||
{
|
||||
0, 0,
|
||||
2451550, 2451550, /* Moon */
|
||||
@@ -2753,8 +2725,9 @@ static int32 get_heliacal_day(double tjd, double *dgeo, double *datm, double *do
|
||||
break;
|
||||
case -1:
|
||||
ndays = 300;
|
||||
if (call_swe_fixstar_mag(ObjectName, &dmag, serr) == ERR)
|
||||
if (call_swe_fixstar_mag(ObjectName, &dmag, serr) == ERR) {
|
||||
return ERR;
|
||||
}
|
||||
daystep = 15;
|
||||
tfac = 10;
|
||||
if (dmag > 2) {
|
||||
@@ -2776,8 +2749,9 @@ static int32 get_heliacal_day(double tjd, double *dgeo, double *datm, double *do
|
||||
(direct_day > 0 && tday < tend) || (direct_day < 0 && tday > tend);
|
||||
tday += daystep * direct_day) {
|
||||
vdelta = -100;
|
||||
if ((retval = my_rise_trans(tday, SE_SUN, "", is_rise_or_set, helflag, dgeo, datm, &tret, serr)) == ERR)
|
||||
if ((retval = my_rise_trans(tday, SE_SUN, "", is_rise_or_set, helflag, dgeo, datm, &tret, serr)) == ERR) {
|
||||
return ERR;
|
||||
}
|
||||
/* sun does not rise: try next day */
|
||||
if (retval == -2) {
|
||||
retval_old = retval;
|
||||
@@ -2835,65 +2809,6 @@ static int32 get_heliacal_day(double tjd, double *dgeo, double *datm, double *do
|
||||
return -2;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int32 get_acronychal_day_new(double tjd, double *dgeo, double *datm, double *dobs, char *ObjectName, int32 helflag, int32 TypeEvent, double *thel, char *serr) {
|
||||
double tjdc = tjd, tret, x[6], xaz[6], AltO = -10;
|
||||
int32 retval, is_rise_or_set, iter_day;
|
||||
int32 ipl = DeterObject(ObjectName);
|
||||
int32 epheflag = helflag & (SEFLG_JPLEPH|SEFLG_SWIEPH|SEFLG_MOSEPH);
|
||||
int32 iflag = epheflag | SEFLG_EQUATORIAL | SEFLG_TOPOCTR;
|
||||
if ((retval = my_rise_trans(tret, 0, ObjectName, SE_CALC_RISE, helflag, dgeo, datm, &tret, serr)) == ERR) return ERR;
|
||||
trise = tret;
|
||||
tret += 0.01
|
||||
if ((retval = my_rise_trans(tret, 0, ObjectName, SE_CALC_SET, helflag, dgeo, datm, &tret, serr)) == ERR) return ERR;
|
||||
trise = tset;
|
||||
|
||||
*thel = tret;
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
static int32 get_acronychal_day_old(double tjd, double *dgeo, double *datm, double *dobs, char *ObjectName, int32 helflag, int32 TypeEvent, double *thel, char *serr) {
|
||||
double tjdc = tjd, tret, x[6], xaz[6], AltO = -10;
|
||||
int32 retval, is_rise_or_set, iter_day;
|
||||
int32 ipl = DeterObject(ObjectName);
|
||||
int32 epheflag = helflag & (SEFLG_JPLEPH|SEFLG_SWIEPH|SEFLG_MOSEPH);
|
||||
int32 iflag = epheflag | SEFLG_EQUATORIAL | SEFLG_TOPOCTR;
|
||||
if (TypeEvent == 3) {
|
||||
is_rise_or_set = SE_CALC_SET;
|
||||
tret = tjdc - 3;
|
||||
if (ipl >= SE_MARS)
|
||||
tret = tjdc - 3;
|
||||
iter_day = 1;
|
||||
} else {
|
||||
is_rise_or_set = SE_CALC_RISE;
|
||||
tret = tjdc + 3;
|
||||
if (ipl >= SE_MARS)
|
||||
tret = tjdc + 3;
|
||||
iter_day = -1;
|
||||
}
|
||||
while (AltO < 0) {
|
||||
tret += 0.3 * iter_day;
|
||||
if (iter_day == -1)
|
||||
tret -= 1;
|
||||
retval = my_rise_trans(tret, SE_SUN, "", is_rise_or_set, helflag, dgeo, datm, &tret, serr);
|
||||
if (retval != OK)
|
||||
return retval;
|
||||
/* determine object's position */
|
||||
if (ipl == -1)
|
||||
retval = call_swe_fixstar(ObjectName, tret+swe_deltat(tret), iflag, x, serr);
|
||||
else
|
||||
retval = swe_calc(tret+swe_deltat(tret), ipl, iflag, x, serr);
|
||||
if (retval == ERR) return ERR;
|
||||
swe_azalt(tret, SE_EQU2HOR, dgeo, datm[0], datm[1], x, xaz);
|
||||
AltO = xaz[2];
|
||||
}
|
||||
*thel = tret;
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int32 time_optimum_visibility(double tjd, double *dgeo, double *datm, double *dobs, char *ObjectName, int32 helflag, double *tret, char *serr)
|
||||
{
|
||||
int32 retval, retval_sv, i;
|
||||
@@ -3016,9 +2931,11 @@ static int32 get_acronychal_day(double tjd, double *dgeo, double *datm, double *
|
||||
retval = my_rise_trans(tjd, ipl, ObjectName, is_rise_or_set, helflag, dgeo, datm, &tjd, serr);
|
||||
if (retval == ERR) return ERR;
|
||||
retval = swe_vis_limit_mag(tjd, dgeo, datm, dobs, ObjectName, helflag, darr, serr);
|
||||
if (retval == ERR) return ERR;
|
||||
while(darr[0] < darr[7]) {
|
||||
tjd += 10.0 / 1440.0 * -direct;
|
||||
retval = swe_vis_limit_mag(tjd, dgeo, datm, dobs, ObjectName, helflag, darr, serr);
|
||||
if (retval == ERR) return ERR;
|
||||
}
|
||||
retval = time_limit_invisible(tjd, dgeo, datm, dobs, ObjectName, helflag | SE_HELFLAG_VISLIM_DARK, direct, &tret_dark, serr);
|
||||
if (retval == ERR) return ERR;
|
||||
@@ -3137,8 +3054,9 @@ static int32 heliacal_ut_vis_lim(double tjd_start, double *dgeo, double *datm, d
|
||||
goto swe_heliacal_err; /* retval may be -2 or ERR */
|
||||
} else {
|
||||
/* find date of conjunction of object with sun */
|
||||
if ((retval = find_conjunct_sun(tjd, ipl, helflag, TypeEvent, &tjd, serr)) == ERR)
|
||||
if ((retval = find_conjunct_sun(tjd, ipl, helflag, TypeEvent, &tjd, serr)) == ERR) {
|
||||
goto swe_heliacal_err;
|
||||
}
|
||||
}
|
||||
/* find the day and minute on which the object becomes visible */
|
||||
retval = get_heliacal_day(tjd, dgeo, datm, dobs, ObjectName, helflag2, TypeEvent, &tday, serr);
|
||||
@@ -3319,13 +3237,19 @@ static int32 heliacal_ut(double JDNDaysUTStart, double *dgeo, double *datm, doub
|
||||
' dret[2]: end of visibility (Julian day number; 0 if SE_HELFLAG_AV)
|
||||
' see http://www.iol.ie/~geniet/eng/atmoastroextinction.htm
|
||||
*/
|
||||
int32 FAR PASCAL_CONV swe_heliacal_ut(double JDNDaysUTStart, double *dgeo, double *datm, double *dobs, char *ObjectNameIn, int32 TypeEvent, int32 helflag, double *dret, char *serr_ret)
|
||||
int32 CALL_CONV swe_heliacal_ut(double JDNDaysUTStart, double *dgeo, double *datm, double *dobs, char *ObjectNameIn, int32 TypeEvent, int32 helflag, double *dret, char *serr_ret)
|
||||
{
|
||||
int32 retval, Planet, itry;
|
||||
char ObjectName[AS_MAXCH], serr[AS_MAXCH], s[AS_MAXCH];
|
||||
double tjd0 = JDNDaysUTStart, tjd, dsynperiod, tjdmax, tadd;
|
||||
int32 MaxCountSynodicPeriod = MAX_COUNT_SYNPER;
|
||||
char *sevent[7] = {"", "morning first", "evening last", "evening first", "morning last", "acronychal rising", "acronychal setting"};
|
||||
if (dgeo[2] < SEI_ECL_GEOALT_MIN || dgeo[2] > SEI_ECL_GEOALT_MAX) {
|
||||
if (serr_ret != NULL)
|
||||
sprintf(serr_ret, "location for heliacal events must be between %.0f and %.0f m above sea\n", SEI_ECL_GEOALT_MIN, SEI_ECL_GEOALT_MAX);
|
||||
return ERR;
|
||||
}
|
||||
swi_set_tid_acc(JDNDaysUTStart, helflag, 0, serr);
|
||||
if (helflag & SE_HELFLAG_LONG_SEARCH)
|
||||
MaxCountSynodicPeriod = MAX_COUNT_SYNPER_MAX;
|
||||
/* if (helflag & SE_HELFLAG_SEARCH_1_PERIOD)
|
||||
@@ -3339,6 +3263,12 @@ int32 FAR PASCAL_CONV swe_heliacal_ut(double JDNDaysUTStart, double *dgeo, doubl
|
||||
default_heliacal_parameters(datm, dgeo, dobs, helflag);
|
||||
swe_set_topo(dgeo[0], dgeo[1], dgeo[2]);
|
||||
Planet = DeterObject(ObjectName);
|
||||
if (Planet == SE_SUN) {
|
||||
if (serr_ret != NULL) {
|
||||
strcpy(serr_ret, "the sun has no heliacal rising or setting\n");
|
||||
}
|
||||
return ERR;
|
||||
}
|
||||
/*
|
||||
* Moon events
|
||||
*/
|
||||
|
@@ -112,7 +112,7 @@ static int sidereal_houses_ssypl(double tjde,
|
||||
* ascmc[6] = coasc2 * "co-ascendant" (M. Munkasey) *
|
||||
* ascmc[7] = polasc * "polar ascendant" (M. Munkasey) *
|
||||
*/
|
||||
int FAR PASCAL_CONV swe_houses(double tjd_ut,
|
||||
int CALL_CONV swe_houses(double tjd_ut,
|
||||
double geolat,
|
||||
double geolon,
|
||||
int hsys,
|
||||
@@ -121,7 +121,7 @@ int FAR PASCAL_CONV swe_houses(double tjd_ut,
|
||||
{
|
||||
int i, retc = 0;
|
||||
double armc, eps, nutlo[2];
|
||||
double tjde = tjd_ut + swe_deltat(tjd_ut);
|
||||
double tjde = tjd_ut + swe_deltat_ex(tjd_ut, -1, NULL);
|
||||
eps = swi_epsiln(tjde, 0) * RADTODEG;
|
||||
swi_nutation(tjde, 0, nutlo);
|
||||
for (i = 0; i < 2; i++)
|
||||
@@ -162,7 +162,7 @@ int FAR PASCAL_CONV swe_houses(double tjd_ut,
|
||||
* ascmc[6] = coasc2 * "co-ascendant" (M. Munkasey) *
|
||||
* ascmc[7] = polasc * "polar ascendant" (M. Munkasey) *
|
||||
*/
|
||||
int FAR PASCAL_CONV swe_houses_ex(double tjd_ut,
|
||||
int CALL_CONV swe_houses_ex(double tjd_ut,
|
||||
int32 iflag,
|
||||
double geolat,
|
||||
double geolon,
|
||||
@@ -172,7 +172,7 @@ int FAR PASCAL_CONV swe_houses_ex(double tjd_ut,
|
||||
{
|
||||
int i, retc = 0;
|
||||
double armc, eps_mean, nutlo[2];
|
||||
double tjde = tjd_ut + swe_deltat(tjd_ut);
|
||||
double tjde = tjd_ut + swe_deltat_ex(tjd_ut, iflag, NULL);
|
||||
struct sid_data *sip = &swed.sidd;
|
||||
int ito;
|
||||
if (toupper(hsys) == 'G')
|
||||
@@ -497,7 +497,7 @@ static int sidereal_houses_trad(double tjde,
|
||||
* ascmc[6] = coasc2 * "co-ascendant" (M. Munkasey) *
|
||||
* ascmc[7] = polasc * "polar ascendant" (M. Munkasey) *
|
||||
*/
|
||||
int FAR PASCAL_CONV swe_houses_armc(
|
||||
int CALL_CONV swe_houses_armc(
|
||||
double armc,
|
||||
double geolat,
|
||||
double eps,
|
||||
@@ -556,7 +556,7 @@ int FAR PASCAL_CONV swe_houses_armc(
|
||||
fprintf(swi_fp_trace_out, "swe_houses_armc: %f\t%f\t%f\t%c\t\n", armc, geolat, eps, hsys);
|
||||
fprintf(swi_fp_trace_out, "retc = %d\n", retc);
|
||||
fputs("cusp:\n", swi_fp_trace_out);
|
||||
for (i = 0; i < 12; i++)
|
||||
for (i = 1; i <= 12; i++)
|
||||
fprintf(swi_fp_trace_out, " %d\t%f\n", i, cusp[i]);
|
||||
fputs("ascmc:\n", swi_fp_trace_out);
|
||||
for (i = 0; i < 10; i++)
|
||||
@@ -617,7 +617,7 @@ static double apc_sector(int n, double ph, double e, double az)
|
||||
return dret;
|
||||
}
|
||||
|
||||
char *FAR PASCAL_CONV swe_house_name(int hsys)
|
||||
char *CALL_CONV swe_house_name(int hsys)
|
||||
{
|
||||
switch (toupper(hsys)) {
|
||||
case 'A': return "equal";
|
||||
@@ -1376,7 +1376,7 @@ static double Asc2 (double x, double f, double sine, double cose)
|
||||
* equal, Porphyry, Alcabitius, Koch, Krusinski (all others should work).
|
||||
* The Swiss Ephemeris currently does not handle these cases.
|
||||
*/
|
||||
double FAR PASCAL_CONV swe_house_pos(
|
||||
double CALL_CONV swe_house_pos(
|
||||
double armc, double geolat, double eps, int hsys, double *xpin, char *serr)
|
||||
{
|
||||
double xp[6], xeq[6], ra, de, mdd, mdn, sad, san;
|
||||
|
@@ -4,10 +4,8 @@
|
||||
|
|
||||
| Subroutines for reading JPL ephemerides.
|
||||
| derived from testeph.f as contained in DE403 distribution July 1995.
|
||||
| works with DE200, DE102, DE403, DE404, DE405, DE406.
|
||||
| (attention, DE102 has 1950 reference frame and also DE4* has slightly
|
||||
| different reference frame from DE200. With DE4*, use routine
|
||||
| IERS_FK5().)
|
||||
| works with DE200, DE102, DE403, DE404, DE405, DE406, DE431
|
||||
| (attention, these ephemerides do not have exactly the same reference frame)
|
||||
|
||||
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
||||
|
||||
@@ -66,6 +64,10 @@
|
||||
for promoting such software, products or services.
|
||||
*/
|
||||
|
||||
#if MSDOS
|
||||
#else
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include "swephexp.h"
|
||||
@@ -79,14 +81,12 @@
|
||||
#define FSEEK _fseeki64
|
||||
#define FTELL _ftelli64
|
||||
#else
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#define FSEEK fseeko
|
||||
#define FTELL ftello
|
||||
#endif
|
||||
|
||||
#define DEBUG_DO_SHOW FALSE
|
||||
|
||||
#ifndef NO_JPL
|
||||
/*
|
||||
* local globals
|
||||
*/
|
||||
@@ -106,11 +106,11 @@ struct jpl_save {
|
||||
short do_km;
|
||||
};
|
||||
|
||||
static struct jpl_save *FAR js;
|
||||
static TLS struct jpl_save *js;
|
||||
|
||||
static int state (double et, int32 *list, int do_bary,
|
||||
double *pv, double *pvsun, double *nut, char *serr);
|
||||
static int interp(double FAR *buf, double t, double intv, int32 ncfin,
|
||||
static int interp(double *buf, double t, double intv, int32 ncfin,
|
||||
int32 ncmin, int32 nain, int32 ifl, double *pv);
|
||||
static int32 fsizer(char *serr);
|
||||
static void reorder(char *x, int size, int number);
|
||||
@@ -349,8 +349,8 @@ int swi_pleph(double et, int ntarg, int ncent, double *rrd, char *serr)
|
||||
{
|
||||
int i, retc;
|
||||
int32 list[12];
|
||||
double FAR *pv = js->pv;
|
||||
double FAR *pvsun = js->pvsun;
|
||||
double *pv = js->pv;
|
||||
double *pvsun = js->pvsun;
|
||||
for (i = 0; i < 6; ++i)
|
||||
rrd[i] = 0.0;
|
||||
if (ntarg == ncent)
|
||||
@@ -455,18 +455,18 @@ int swi_pleph(double et, int ntarg, int ncent, double *rrd, char *serr)
|
||||
* pv d.p. interpolated quantities requested.
|
||||
* assumed dimension is pv(ncm,fl).
|
||||
*/
|
||||
static int interp(double FAR *buf, double t, double intv, int32 ncfin,
|
||||
static int interp(double *buf, double t, double intv, int32 ncfin,
|
||||
int32 ncmin, int32 nain, int32 ifl, double *pv)
|
||||
{
|
||||
/* Initialized data */
|
||||
static int FAR np, nv;
|
||||
static int FAR nac;
|
||||
static int FAR njk;
|
||||
static double FAR twot = 0.;
|
||||
double FAR *pc = js->pc;
|
||||
double FAR *vc = js->vc;
|
||||
double FAR *ac = js->ac;
|
||||
double FAR *jc = js->jc;
|
||||
static TLS int np, nv;
|
||||
static TLS int nac;
|
||||
static TLS int njk;
|
||||
static TLS double twot = 0.;
|
||||
double *pc = js->pc;
|
||||
double *vc = js->vc;
|
||||
double *ac = js->ac;
|
||||
double *jc = js->jc;
|
||||
int ncf = (int) ncfin;
|
||||
int ncm = (int) ncmin;
|
||||
int na = (int) nain;
|
||||
@@ -641,15 +641,15 @@ static int state(double et, int32 *list, int do_bary,
|
||||
int i, j, k;
|
||||
int32 nseg;
|
||||
off_t flen, nb;
|
||||
double FAR *buf = js->buf;
|
||||
double *buf = js->buf;
|
||||
double aufac, s, t, intv, ts[4];
|
||||
int32 nrecl, ksize;
|
||||
int32 nr;
|
||||
double et_mn, et_fr;
|
||||
int32 FAR *ipt = js->eh_ipt;
|
||||
int32 *ipt = js->eh_ipt;
|
||||
char ch_ttl[252];
|
||||
static int32 irecsz;
|
||||
static int32 nrl, lpt[3], ncoeffs;
|
||||
static TLS int32 irecsz;
|
||||
static TLS int32 nrl, lpt[3], ncoeffs;
|
||||
if (js->jplfptr == NULL) {
|
||||
ksize = fsizer(serr); /* the number of single precision words in a record */
|
||||
nrecl = 4;
|
||||
@@ -723,10 +723,6 @@ static int state(double et, int32 *list, int do_bary,
|
||||
nb *= 8;
|
||||
/* add size of header and constants section */
|
||||
nb += 2 * ksize * nrecl;
|
||||
#if 0
|
||||
printf("hallo %d %d\n", nb, flen);
|
||||
printf("hallo %d %d\n", nb-flen, ksize);
|
||||
#endif
|
||||
if (flen != nb
|
||||
/* some of our files are one record too long */
|
||||
&& flen - nb != ksize * nrecl
|
||||
@@ -843,7 +839,7 @@ static int read_const_jpl(double *ss, char *serr)
|
||||
ss[i] = js->eh_ss[i];
|
||||
#if DEBUG_DO_SHOW
|
||||
{
|
||||
static char FAR *bname[] = {
|
||||
static const char *bname[] = {
|
||||
"Mercury", "Venus", "EMB", "Mars", "Jupiter", "Saturn",
|
||||
"Uranus", "Neptune", "Pluto", "Moon", "SunBary", "Nut", "Libr"};
|
||||
int j, k;
|
||||
@@ -932,5 +928,4 @@ int32 swi_get_jpl_denum()
|
||||
{
|
||||
return js->eh_denum;
|
||||
}
|
||||
#endif /* NO_JPL */
|
||||
|
||||
|
@@ -187,7 +187,7 @@ static void mean_elements(void);
|
||||
static void mean_elements_pl(void);
|
||||
static double mods3600(double x);
|
||||
static void ecldat_equ2000(double tjd, double *xpm);
|
||||
static void chewm(short *pt, int nlines, int nangles,
|
||||
static void chewm(const short *pt, int nlines, int nangles,
|
||||
int typflg, double *ans );
|
||||
static void sscc(int k, double arg, int n );
|
||||
static void moon1(void);
|
||||
@@ -203,7 +203,7 @@ static void moon4(void);
|
||||
* See references to the array z[] later on in the program.
|
||||
* The 71 coefficients were estimated from 42,529 Lunar positions.
|
||||
*/
|
||||
static double z[] = {
|
||||
static const double z[] = {
|
||||
-1.225346551567e+001, /* F, t^2 */
|
||||
-1.096676093208e-003, /* F, t^3 */
|
||||
-2.165750777942e-006, /* F, t^4 */
|
||||
@@ -282,7 +282,7 @@ static double z[] = {
|
||||
* interval from -3000 to +3000.
|
||||
* The coefficients were estimated from 34,247 Lunar positions.
|
||||
*/
|
||||
static double FAR z[] = {
|
||||
static const double z[] = {
|
||||
/* The following are scaled in arc seconds, time in Julian centuries.
|
||||
They replace the corresponding terms in the mean elements. */
|
||||
-1.312045233711e+01, /* F, t^2 */
|
||||
@@ -317,7 +317,7 @@ static double FAR z[] = {
|
||||
/* Perturbation tables
|
||||
*/
|
||||
#define NLR 118
|
||||
static short FAR LR[8*NLR] = {
|
||||
static const short LR[8*NLR] = {
|
||||
/*
|
||||
Longitude Radius
|
||||
D l' l F 1" .0001" 1km .0001km */
|
||||
@@ -445,7 +445,7 @@ static short FAR LR[8*NLR] = {
|
||||
|
||||
#ifdef MOSH_MOON_200
|
||||
#define NMB 56
|
||||
static short FAR MB[6*NMB] = {
|
||||
static const short MB[6*NMB] = {
|
||||
/*
|
||||
Latitude
|
||||
D l' l F 1" .0001" */
|
||||
@@ -509,7 +509,7 @@ static short FAR MB[6*NMB] = {
|
||||
};
|
||||
#else
|
||||
#define NMB 77
|
||||
static short FAR MB[6*NMB] = {
|
||||
static const short MB[6*NMB] = {
|
||||
/*
|
||||
Latitude
|
||||
D l' l F 1" .0001" */
|
||||
@@ -595,7 +595,7 @@ static short FAR MB[6*NMB] = {
|
||||
#endif /* ! MOSH_MOON_200 */
|
||||
|
||||
#define NLRT 38
|
||||
static short FAR LRT[8*NLRT] = {
|
||||
static const short LRT[8*NLRT] = {
|
||||
/*
|
||||
Multiply by T
|
||||
Longitude Radius
|
||||
@@ -642,7 +642,7 @@ Multiply by T
|
||||
};
|
||||
|
||||
#define NBT 16
|
||||
static short FAR BT[5*NBT] = {
|
||||
static const short BT[5*NBT] = {
|
||||
/*
|
||||
Multiply by T
|
||||
Latitude
|
||||
@@ -667,7 +667,7 @@ Multiply by T
|
||||
};
|
||||
|
||||
#define NLRT2 25
|
||||
static short FAR LRT2[6*NLRT2] = {
|
||||
static const short LRT2[6*NLRT2] = {
|
||||
/*
|
||||
Multiply by T^2
|
||||
Longitude Radius
|
||||
@@ -701,7 +701,7 @@ Multiply by T^2
|
||||
};
|
||||
|
||||
#define NBT2 12
|
||||
static short FAR BT2[5*NBT2] = {
|
||||
static const short BT2[5*NBT2] = {
|
||||
/*
|
||||
Multiply by T^2
|
||||
Latitiude
|
||||
@@ -723,7 +723,7 @@ Multiply by T^2
|
||||
|
||||
/* corrections for mean lunar node in degrees, from -13100 to 17200,
|
||||
* in 100-year steps. corrections are set to 0 between the years 0 and 3000 */
|
||||
static double mean_node_corr[] = {
|
||||
static const double mean_node_corr[] = {
|
||||
-2.56,
|
||||
-2.473, -2.392347, -2.316425, -2.239639, -2.167764, -2.095100, -2.024810, -1.957622, -1.890097, -1.826389,
|
||||
-1.763335, -1.701047, -1.643016, -1.584186, -1.527309, -1.473352, -1.418917, -1.367736, -1.317202, -1.267269,
|
||||
@@ -765,7 +765,7 @@ static double mean_node_corr[] = {
|
||||
|
||||
/* corrections for mean lunar apsides in degrees, from -13100 to 17200,
|
||||
* in 100-year steps. corrections are set to 0 between the years 0 and 3000 */
|
||||
static double mean_apsis_corr[] = {
|
||||
static const double mean_apsis_corr[] = {
|
||||
7.525,
|
||||
7.290, 7.057295, 6.830813, 6.611723, 6.396775, 6.189569, 5.985968, 5.788342, 5.597304, 5.410167,
|
||||
5.229946, 5.053389, 4.882187, 4.716494, 4.553532, 4.396734, 4.243718, 4.094282, 3.950865, 3.810366,
|
||||
@@ -809,39 +809,39 @@ static double mean_apsis_corr[] = {
|
||||
* to the same instant. The distinction between them
|
||||
* is required by altaz().
|
||||
*/
|
||||
static double FAR ss[5][8];
|
||||
static double FAR cc[5][8];
|
||||
static TLS double ss[5][8];
|
||||
static TLS double cc[5][8];
|
||||
|
||||
static double l; /* Moon's ecliptic longitude */
|
||||
static double B; /* Ecliptic latitude */
|
||||
static TLS double l; /* Moon's ecliptic longitude */
|
||||
static TLS double B; /* Ecliptic latitude */
|
||||
|
||||
static double moonpol[3];
|
||||
static TLS double moonpol[3];
|
||||
|
||||
/* Orbit calculation begins.
|
||||
*/
|
||||
static double SWELP;
|
||||
static double M;
|
||||
static double MP;
|
||||
static double D;
|
||||
static double NF;
|
||||
static double T;
|
||||
static double T2;
|
||||
static TLS double SWELP;
|
||||
static TLS double M;
|
||||
static TLS double MP;
|
||||
static TLS double D;
|
||||
static TLS double NF;
|
||||
static TLS double T;
|
||||
static TLS double T2;
|
||||
|
||||
static double T3;
|
||||
static double T4;
|
||||
static double f;
|
||||
static double g;
|
||||
static double Ve;
|
||||
static double Ea;
|
||||
static double Ma;
|
||||
static double Ju;
|
||||
static double Sa;
|
||||
static double cg;
|
||||
static double sg;
|
||||
static double l1;
|
||||
static double l2;
|
||||
static double l3;
|
||||
static double l4;
|
||||
static TLS double T3;
|
||||
static TLS double T4;
|
||||
static TLS double f;
|
||||
static TLS double g;
|
||||
static TLS double Ve;
|
||||
static TLS double Ea;
|
||||
static TLS double Ma;
|
||||
static TLS double Ju;
|
||||
static TLS double Sa;
|
||||
static TLS double cg;
|
||||
static TLS double sg;
|
||||
static TLS double l1;
|
||||
static TLS double l2;
|
||||
static TLS double l3;
|
||||
static TLS double l4;
|
||||
|
||||
/* Calculate geometric coordinates of Moon
|
||||
* without light time or nutation correction.
|
||||
@@ -1626,7 +1626,7 @@ int swi_mean_apog(double J, double *pol, char *serr)
|
||||
|
||||
/* Program to step through the perturbation table
|
||||
*/
|
||||
static void chewm(short *pt, int nlines, int nangles, int typflg, double *ans )
|
||||
static void chewm(const short *pt, int nlines, int nangles, int typflg, double *ans )
|
||||
{
|
||||
int i, j, k, k1, m;
|
||||
double cu, su, cv, sv, ff;
|
||||
|
@@ -63,7 +63,7 @@
|
||||
#include "swephexp.h"
|
||||
#include "sweph.h"
|
||||
#include "swephlib.h"
|
||||
#include "swemptab.c"
|
||||
#include "swemptab.h"
|
||||
|
||||
#define TIMESCALE 3652500.0
|
||||
|
||||
@@ -82,11 +82,11 @@ static int read_elements_file(int32 ipl, double tjd,
|
||||
double *parg, double *node, double *incl,
|
||||
char *pname, int32 *fict_ifl, char *serr);
|
||||
|
||||
static int pnoint2msh[] = {2, 2, 0, 1, 3, 4, 5, 6, 7, 8, };
|
||||
static const int pnoint2msh[] = {2, 2, 0, 1, 3, 4, 5, 6, 7, 8, };
|
||||
|
||||
|
||||
/* From Simon et al (1994) */
|
||||
static double freqs[] =
|
||||
static const double freqs[] =
|
||||
{
|
||||
/* Arc sec per 10000 Julian years. */
|
||||
53810162868.8982,
|
||||
@@ -100,7 +100,7 @@ static double freqs[] =
|
||||
52272245.1795
|
||||
};
|
||||
|
||||
static double phases[] =
|
||||
static const double phases[] =
|
||||
{
|
||||
/* Arc sec. */
|
||||
252.25090552 * 3600.,
|
||||
@@ -114,7 +114,7 @@ static double phases[] =
|
||||
860492.1546,
|
||||
};
|
||||
|
||||
static struct plantbl *planets[] =
|
||||
static const struct plantbl *planets[] =
|
||||
{
|
||||
&mer404,
|
||||
&ven404,
|
||||
@@ -127,19 +127,19 @@ static struct plantbl *planets[] =
|
||||
&plu404
|
||||
};
|
||||
|
||||
static double FAR ss[9][24];
|
||||
static double FAR cc[9][24];
|
||||
static TLS double ss[9][24];
|
||||
static TLS double cc[9][24];
|
||||
|
||||
static void sscc (int k, double arg, int n);
|
||||
|
||||
int swi_moshplan2 (double J, int iplm, double *pobj)
|
||||
{
|
||||
int i, j, k, m, k1, ip, np, nt;
|
||||
signed char FAR *p;
|
||||
double FAR *pl, *pb, *pr;
|
||||
signed char *p;
|
||||
double *pl, *pb, *pr;
|
||||
double su, cu, sv, cv, T;
|
||||
double t, sl, sb, sr;
|
||||
struct plantbl *plan = planets[iplm];
|
||||
const struct plantbl *plan = planets[iplm];
|
||||
|
||||
T = (J - J2000) / TIMESCALE;
|
||||
/* Calculate sin( i*MM ), etc. for needed multiple angles. */
|
||||
@@ -504,7 +504,7 @@ static void embofs_mosh(double tjd, double *xemb)
|
||||
*/
|
||||
#define SE_NEELY /* use James Neely's revised elements
|
||||
* of Uranian planets*/
|
||||
static char *plan_fict_nam[SE_NFICT_ELEM] =
|
||||
static const char *plan_fict_nam[SE_NFICT_ELEM] =
|
||||
{"Cupido", "Hades", "Zeus", "Kronos",
|
||||
"Apollon", "Admetos", "Vulkanus", "Poseidon",
|
||||
"Isis-Transpluto", "Nibiru", "Harrington",
|
||||
@@ -520,7 +520,7 @@ char *swi_get_fict_name(int32 ipl, char *snam)
|
||||
return snam;
|
||||
}
|
||||
|
||||
static double plan_oscu_elem[SE_NFICT_ELEM][8] = {
|
||||
static const double plan_oscu_elem[SE_NFICT_ELEM][8] = {
|
||||
#ifdef SE_NEELY
|
||||
{J1900, J1900, 163.7409, 40.99837, 0.00460, 171.4333, 129.8325, 1.0833},/* Cupido Neely */
|
||||
{J1900, J1900, 27.6496, 50.66744, 0.00245, 148.1796, 161.3339, 1.0500},/* Hades Neely */
|
||||
@@ -759,7 +759,7 @@ static int read_elements_file(int32 ipl, double tjd,
|
||||
if (serr != NULL) {
|
||||
sprintf(serr, "%s nine elements required", serri);
|
||||
}
|
||||
return ERR;
|
||||
goto return_err;
|
||||
}
|
||||
iplan++;
|
||||
if (iplan != ipl)
|
||||
|
10641
swe/src/swemptab.h
Normal file
10641
swe/src/swemptab.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -69,7 +69,7 @@
|
||||
#define NPL 687
|
||||
/* Luni-Solar argument multipliers
|
||||
L L' F D Om */
|
||||
static int16 nls[] = {
|
||||
static const int16 nls[] = {
|
||||
0, 0, 0, 0, 1,
|
||||
0, 0, 2, -2, 2,
|
||||
0, 0, 2, 0, 2,
|
||||
@@ -752,7 +752,7 @@ static int16 nls[] = {
|
||||
|
||||
/* Luni-Solar nutation coefficients, unit 1e-7 arcsec
|
||||
* longitude (sin, t*sin, cos), obliquity (cos, t*cos, sin) */
|
||||
static int32 cls[] = {
|
||||
static const int32 cls[] = {
|
||||
-172064161, -174666, 33386, 92052331, 9086, 15377,
|
||||
-13170906, -1675, -13696, 5730336, -3015, -4587,
|
||||
-2276413, -234, 2796, 978459, -485, 1374,
|
||||
@@ -1433,10 +1433,10 @@ static int32 cls[] = {
|
||||
-3, 0, 0, 2, 0, 0,
|
||||
};
|
||||
|
||||
#if NUT_IAU_2000A
|
||||
/*#if NUT_IAU_2000A*/
|
||||
/* Planetary argument multipliers
|
||||
* L L' F D Om Me Ve E Ma Ju Sa Ur Ne pre */
|
||||
static int16 npl[] = {
|
||||
static const int16 npl[] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 8,-16, 4, 5, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -8, 16, -4, -5, 0, 0, 2,
|
||||
0, 0, 0, 0, 0, 0, 0, 8,-16, 4, 5, 0, 0, 2,
|
||||
@@ -2128,7 +2128,7 @@ static int16 npl[] = {
|
||||
|
||||
/* Planetary nutation coefficients, unit 1e-7 arcsec
|
||||
* longitude (sin, cos), obliquity (sin, cos) */
|
||||
static int16 icpl[] = {
|
||||
static const int16 icpl[] = {
|
||||
1440, 0, 0, 0,
|
||||
56, -117, -42, -40,
|
||||
125, -43, 0, -54,
|
||||
@@ -2817,4 +2817,4 @@ static int16 icpl[] = {
|
||||
3, 0, 0, -1,
|
||||
3, 0, 0, -1,
|
||||
};
|
||||
#endif /* NUT_IAU_2000A */
|
||||
/*#endif * NUT_IAU_2000A */
|
||||
|
@@ -75,6 +75,20 @@
|
||||
# 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( __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
|
||||
@@ -135,12 +149,10 @@
|
||||
# ifndef TURBO_C
|
||||
# define MS_C /* assume Microsoft C compiler */
|
||||
# endif
|
||||
# define MYFAR far
|
||||
# define UNIX_FS MY_FALSE
|
||||
#else
|
||||
# ifdef MACOS
|
||||
# define HPUNIX MY_FALSE
|
||||
# define MYFAR
|
||||
# define UNIX_FS MY_FALSE
|
||||
# else
|
||||
# define MSDOS MY_FALSE
|
||||
@@ -148,7 +160,6 @@
|
||||
# ifndef _HPUX_SOURCE
|
||||
# define _HPUX_SOURCE
|
||||
# endif
|
||||
# define MYFAR
|
||||
# define UNIX_FS MY_TRUE
|
||||
# endif
|
||||
#endif
|
||||
@@ -251,7 +262,7 @@ typedef unsigned char UCHAR;
|
||||
# define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
#define forward static
|
||||
/* #define forward static obsolete */
|
||||
|
||||
#define AS_MAXCH 256 /* used for string declarations, allowing 255 char+\0 */
|
||||
|
||||
|
@@ -80,13 +80,13 @@ Placalc compatibility interface for Swiss Ephemeris.
|
||||
local globals, not exported
|
||||
************************************************************/
|
||||
|
||||
static int plac2swe[] = {SE_SUN, SE_MOON, SE_MERCURY, SE_VENUS, SE_MARS, SE_JUPITER, SE_SATURN, SE_URANUS, SE_NEPTUNE, SE_PLUTO, SE_MEAN_NODE, SE_TRUE_NODE, SE_CHIRON, SE_MEAN_APOG, SE_CERES, SE_PALLAS, SE_JUNO, SE_VESTA,};
|
||||
static const int plac2swe[] = {SE_SUN, SE_MOON, SE_MERCURY, SE_VENUS, SE_MARS, SE_JUPITER, SE_SATURN, SE_URANUS, SE_NEPTUNE, SE_PLUTO, SE_MEAN_NODE, SE_TRUE_NODE, SE_CHIRON, SE_MEAN_APOG, SE_CERES, SE_PALLAS, SE_JUNO, SE_VESTA,};
|
||||
|
||||
/* If there occurs an internal error in placalc, a message is
|
||||
* written into the string variable perrtx.
|
||||
* The message can be read with placalc_get_errtext();
|
||||
*/
|
||||
static char perrtx[AS_MAXCH];
|
||||
static TLS char perrtx[AS_MAXCH];
|
||||
static double ekl, nut;
|
||||
|
||||
/*
|
||||
@@ -94,7 +94,7 @@ static double ekl, nut;
|
||||
* required for relative distances rgeo, where the distance is given
|
||||
* as 100 when a planet is closest and as 0 when farthest from earth.
|
||||
*/
|
||||
static double rmima[CALC_N][2] = {
|
||||
static const double rmima[CALC_N][2] = {
|
||||
{ 0.98296342, 1.01704665},
|
||||
{ 0.00238267, 0.00271861},
|
||||
{ 0.54900496, 1.45169607},
|
||||
@@ -497,7 +497,7 @@ char *planet2abbr3(int planet)
|
||||
|
||||
char *placalc_set_ephepath(char *path)
|
||||
{
|
||||
static char *epath;
|
||||
static TLS char *epath;
|
||||
if (path == NULL) return epath;
|
||||
if (epath != NULL)
|
||||
free((void *) epath);
|
||||
|
733
swe/src/sweph.c
733
swe/src/sweph.c
File diff suppressed because it is too large
Load Diff
@@ -63,7 +63,7 @@
|
||||
* move over from swephexp.h
|
||||
*/
|
||||
|
||||
#define SE_VERSION "2.00.00"
|
||||
#define SE_VERSION "2.04"
|
||||
|
||||
#define J2000 2451545.0 /* 2000 January 1.5 */
|
||||
#define B1950 2433282.42345905 /* 1950 January 0.923 */
|
||||
@@ -119,23 +119,6 @@
|
||||
#define SE_NAME_VULCAN "Vulcan"
|
||||
#define SE_NAME_WHITE_MOON "White Moon"
|
||||
|
||||
/* for delta t: intrinsic tidal acceleration in the mean motion of the moon,
|
||||
* not given in the parameters list of the ephemeris files but computed
|
||||
* by Chapront/Chapront-Touzé/Francou A&A 387 (2002), p. 705.
|
||||
*/
|
||||
#define SE_TIDAL_DE200 (-23.8946)
|
||||
#define SE_TIDAL_DE403 (-25.580) /* was (-25.8) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE404 (-25.580) /* was (-25.8) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE405 (-25.826) /* was (-25.7376) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE406 (-25.826) /* was (-25.7376) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE421 (-25.85) /* JPL Interoffice Memorandum 14-mar-2008 on DE421 Lunar Orbit */
|
||||
#define SE_TIDAL_DE430 (-25.82) /* JPL Interoffice Memorandum 9-jul-2013 on DE430 Lunar Orbit */
|
||||
#define SE_TIDAL_DE431 (-25.82) /* waiting for information */
|
||||
|
||||
#define SE_TIDAL_26 (-26.0)
|
||||
|
||||
#define SE_TIDAL_DEFAULT SE_TIDAL_DE431
|
||||
|
||||
/*
|
||||
* earlier content
|
||||
*/
|
||||
@@ -209,13 +192,18 @@
|
||||
|
||||
#define SEI_NEPHFILES 7
|
||||
#define SEI_CURR_FPOS -1
|
||||
#define SEI_NMODELS 20
|
||||
|
||||
#define SEI_ECL_GEOALT_MAX 25000.0
|
||||
#define SEI_ECL_GEOALT_MIN (-500.0)
|
||||
|
||||
/* Chiron's orbit becomes chaotic
|
||||
* before 720 AD and after 4606 AD, because of close encounters
|
||||
* with Saturn. Accepting a maximum error of 5 degrees,
|
||||
* the ephemeris is good between the following dates:
|
||||
*/
|
||||
#define CHIRON_START 1958470.5 /* 1.1.650 */
|
||||
/*#define CHIRON_START 1958470.5 * 1.1.650 old limit until v. 2.00 */
|
||||
#define CHIRON_START 1967601.5 /* 1.1.675 */
|
||||
#define CHIRON_END 3419437.5 /* 1.1.4650 */
|
||||
|
||||
/* Pholus's orbit is unstable as well, because he sometimes
|
||||
@@ -223,7 +211,9 @@
|
||||
* Accepting a maximum error of 5 degrees,
|
||||
* the ephemeris is good after the following date:
|
||||
*/
|
||||
#define PHOLUS_START 314845.5 /* 1.1.-3850 */
|
||||
/* #define PHOLUS_START 314845.5 * 1.1.-3850 old limit until v. 2.00 */
|
||||
#define PHOLUS_START 640648.5 /* 1.1.-2958 jul */
|
||||
#define PHOLUS_END 4390617.5 /* 1.1.7309 */
|
||||
|
||||
#define MOSHPLEPH_START 625000.5
|
||||
#define MOSHPLEPH_END 2818000.5
|
||||
@@ -273,6 +263,9 @@
|
||||
#define SUN_EARTH_MRAT 332946.050895 /* Su / (Ea only) AA 2006 K7 */
|
||||
#define EARTH_MOON_MRAT (1 / 0.0123000383) /* AA 2006, K7 */
|
||||
#if 0
|
||||
#define EARTH_MOON_MRAT 81.30056907419062 /* de431 */
|
||||
#endif
|
||||
#if 0
|
||||
#define EARTH_MOON_MRAT 81.30056 /* de406 */
|
||||
#endif
|
||||
#define AUNIT 1.49597870691e+11 /* au in meters, AA 2006 K6 */
|
||||
@@ -384,9 +377,9 @@ static const struct aya_init ayanamsa[] = {
|
||||
{1903396.7895321,-0.23763238},/*24: Aryabhata, analogous 22 */
|
||||
{1903396.8128654,-0.79167046},/*25: SS, Revati/zePsc at polar long. 359°50'*/
|
||||
{1903396.8128654, 2.11070444},/*26: SS, Citra/Spica at polar long. 180° */
|
||||
{0, 0}, /*27: True Citra (Spica always exactly at 0 Libra) */
|
||||
{0, 0}, /*28: True Revati (zeta Psc always exactly at 0 Aries) */
|
||||
{0, 0}, /*29: - */
|
||||
{0, 0}, /*27: True Citra (Spica exactly at 0 Libra) */
|
||||
{0, 0}, /*28: True Revati (zeta Psc exactly at 0 Aries) */
|
||||
{0, 0}, /*29: True Pushya (delta Cnc exactly a 16 Cancer */
|
||||
{0, 0}, /*30: - */
|
||||
};
|
||||
|
||||
@@ -469,6 +462,9 @@ extern int swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret, do
|
||||
extern int swi_moshplan2(double J, int iplm, double *pobj);
|
||||
extern int swi_osc_el_plan(double tjd, double *xp, int ipl, int ipli, double *xearth, double *xsun, char *serr);
|
||||
extern FILE *swi_fopen(int ifno, char *fname, char *ephepath, char *serr);
|
||||
extern int32 swi_init_swed_if_start(void);
|
||||
extern int32 swi_set_tid_acc(double tjd_ut, int32 iflag, int32 denum, char *serr);
|
||||
extern int32 swi_get_tid_acc(double tjd_ut, int32 iflag, int32 denum, int32 *denumret, double *tid_acc, char *serr);
|
||||
|
||||
/* nutation */
|
||||
struct nut {
|
||||
@@ -551,21 +547,29 @@ struct sid_data {
|
||||
double t0;
|
||||
};
|
||||
|
||||
/* dpsi and deps loaded for 100 years after 1962 */
|
||||
#define SWE_DATA_DPSI_DEPS 36525
|
||||
|
||||
/* if this is changed, then also update initialisation in sweph.c */
|
||||
struct swe_data {
|
||||
AS_BOOL ephe_path_is_set;
|
||||
short jpl_file_is_open;
|
||||
FILE *fixfp; /* fixed stars file pointer */
|
||||
char ephepath[AS_MAXCH];
|
||||
char jplfnam[AS_MAXCH];
|
||||
short jpldenum;
|
||||
int32 jpldenum;
|
||||
int32 last_epheflag;
|
||||
AS_BOOL geopos_is_set;
|
||||
AS_BOOL ayana_is_set;
|
||||
AS_BOOL is_old_starfile;
|
||||
double eop_tjd_beg;
|
||||
double eop_tjd_beg_horizons;
|
||||
double eop_tjd_end;
|
||||
double eop_tjd_end_add;
|
||||
int eop_dpsi_loaded;
|
||||
AS_BOOL geopos_is_set;
|
||||
AS_BOOL ayana_is_set;
|
||||
AS_BOOL is_old_starfile;
|
||||
double tid_acc;
|
||||
AS_BOOL is_tid_acc_manual;
|
||||
AS_BOOL init_dt_done;
|
||||
struct file_data fidat[SEI_NEPHFILES];
|
||||
struct gen_const gcdat;
|
||||
struct plan_data pldat[SEI_NPLANETS];
|
||||
@@ -588,8 +592,12 @@ struct swe_data {
|
||||
double ast_diam;
|
||||
int i_saved_planet_name;
|
||||
char saved_planet_name[80];
|
||||
double dpsi[36525]; /* works for 100 years after 1962 */
|
||||
double deps[36525];
|
||||
//double dpsi[36525]; /* works for 100 years after 1962 */
|
||||
//double deps[36525];
|
||||
double *dpsi;
|
||||
double *deps;
|
||||
int32 astro_models[SEI_NMODELS];
|
||||
int32 timeout;
|
||||
};
|
||||
|
||||
extern struct swe_data FAR swed;
|
||||
extern TLS struct swe_data swed;
|
||||
|
@@ -240,9 +240,10 @@ extern "C" {
|
||||
#define SE_SIDM_SS_CITRA 26
|
||||
#define SE_SIDM_TRUE_CITRA 27
|
||||
#define SE_SIDM_TRUE_REVATI 28
|
||||
#define SE_SIDM_TRUE_PUSHYA 29
|
||||
#define SE_SIDM_USER 255
|
||||
|
||||
#define SE_NSIDM_PREDEF 29
|
||||
#define SE_NSIDM_PREDEF 30
|
||||
|
||||
/* used for swe_nod_aps(): */
|
||||
#define SE_NODBIT_MEAN 1 /* mean nodes/apsides */
|
||||
@@ -347,11 +348,7 @@ extern "C" {
|
||||
|
||||
#ifndef SE_EPHE_PATH
|
||||
#if MSDOS
|
||||
#ifdef PAIR_SWEPH
|
||||
# define SE_EPHE_PATH "\\pair\\ephe\\"
|
||||
#else
|
||||
# define SE_EPHE_PATH "\\sweph\\ephe\\"
|
||||
#endif
|
||||
#else
|
||||
# ifdef MACOS
|
||||
# define SE_EPHE_PATH ":ephe:"
|
||||
@@ -423,19 +420,119 @@ extern "C" {
|
||||
#define SE_SCOTOPIC_FLAG 1
|
||||
#define SE_MIXEDOPIC_FLAG 2
|
||||
|
||||
/*
|
||||
* by compiling with -DPAIR_SWEPH in the compiler options it
|
||||
* is possible to create a more compact version of SwissEph which
|
||||
* contains no code for the JPL ephemeris file and for the builtin
|
||||
* Moshier ephemeris.
|
||||
* This is quite useful for MSDOS real mode applications which need to
|
||||
* run within 640 kb.
|
||||
* The option is called PAIR_SWEPH because it was introduced for
|
||||
* Astrodienst's partner software PAIR.
|
||||
/* for swe_set_tid_acc() and ephemeris-dependent delta t:
|
||||
* intrinsic tidal acceleration in the mean motion of the moon,
|
||||
* not given in the parameters list of the ephemeris files but computed
|
||||
* by Chapront/Chapront-Touzé/Francou A&A 387 (2002), p. 705.
|
||||
*/
|
||||
#ifdef PAIR_SWEPH
|
||||
# define NO_JPL
|
||||
#endif
|
||||
#define SE_TIDAL_DE200 (-23.8946)
|
||||
#define SE_TIDAL_DE403 (-25.580) /* was (-25.8) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE404 (-25.580) /* was (-25.8) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE405 (-25.826) /* was (-25.7376) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE406 (-25.826) /* was (-25.7376) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE421 (-25.85) /* JPL Interoffice Memorandum 14-mar-2008 on DE421 Lunar Orbit */
|
||||
#define SE_TIDAL_DE422 (-25.85) /* JPL Interoffice Memorandum 14-mar-2008 on DE421 (sic!) Lunar Orbit */
|
||||
#define SE_TIDAL_DE430 (-25.82) /* JPL Interoffice Memorandum 9-jul-2013 on DE430 Lunar Orbit */
|
||||
#define SE_TIDAL_DE431 (-25.80) /* IPN Progress Report 42-196 • February 15, 2014, p. 15; was (-25.82) in V. 2.00.00 */
|
||||
#define SE_TIDAL_26 (-26.0)
|
||||
#define SE_TIDAL_DEFAULT SE_TIDAL_DE431
|
||||
#define SE_TIDAL_AUTOMATIC 999999
|
||||
#define SE_TIDAL_MOSEPH SE_TIDAL_DE404
|
||||
#define SE_TIDAL_SWIEPH SE_TIDAL_DEFAULT
|
||||
#define SE_TIDAL_JPLEPH SE_TIDAL_DEFAULT
|
||||
|
||||
#define SE_MODEL_PREC_LONGTERM 0
|
||||
#define SE_MODEL_PREC_SHORTTERM 1
|
||||
#define SE_MODEL_NUT 2
|
||||
#define SE_MODEL_SIDT 3
|
||||
#define SE_MODEL_BIAS 4
|
||||
#define SE_MODEL_JPLHOR_MODE 5
|
||||
#define SE_MODEL_JPLHORA_MODE 6
|
||||
#define SE_MODEL_DELTAT 7
|
||||
|
||||
/* precession models */
|
||||
#define SEMOD_PREC_IAU_1976 1
|
||||
#define SEMOD_PREC_IAU_2000 2
|
||||
#define SEMOD_PREC_IAU_2006 3
|
||||
#define SEMOD_PREC_BRETAGNON_2003 4
|
||||
#define SEMOD_PREC_LASKAR_1986 5
|
||||
#define SEMOD_PREC_SIMON_1994 6
|
||||
#define SEMOD_PREC_WILLIAMS_1994 7
|
||||
#define SEMOD_PREC_VONDRAK_2011 8
|
||||
#define SEMOD_PREC_DEFAULT SEMOD_PREC_VONDRAK_2011
|
||||
/* former implementations of the used
|
||||
* IAU 1976, 2000 and 2006 for a limited time range
|
||||
* in combination with a different model for
|
||||
* long term precession.
|
||||
#define SEMOD_PREC_DEFAULT_SHORT SEMOD_PREC_IAU_2000
|
||||
*/
|
||||
#define SEMOD_PREC_DEFAULT_SHORT SEMOD_PREC_VONDRAK_2011
|
||||
|
||||
/* nutation models */
|
||||
#define SEMOD_NUT_IAU_1980 1
|
||||
#define SEMOD_NUT_IAU_CORR_1987 2 /* Herring's (1987) corrections to IAU 1980
|
||||
* nutation series. AA (1996) neglects them.*/
|
||||
#define SEMOD_NUT_IAU_2000A 3 /* very time consuming ! */
|
||||
#define SEMOD_NUT_IAU_2000B 4 /* fast, but precision of milli-arcsec */
|
||||
#define SEMOD_NUT_DEFAULT SEMOD_NUT_IAU_2000B /* fast, but precision of milli-arcsec */
|
||||
|
||||
/* methods for sidereal time */
|
||||
#define SEMOD_SIDT_LONGTERM 1
|
||||
#define SEMOD_SIDT_IERS_CONV_2010 2
|
||||
#define SEMOD_SIDT_PREC_MODEL 3
|
||||
#define SEMOD_SIDT_IAU_1976 4
|
||||
#define SEMOD_SIDT_DEFAULT SEMOD_SIDT_LONGTERM
|
||||
//#define SEMOD_SIDT_DEFAULT SEMOD_SIDT_IERS_CONV_2010
|
||||
|
||||
/* frame bias methods */
|
||||
#define SEMOD_BIAS_IAU2000 1 /* use frame bias matrix IAU 2000 */
|
||||
#define SEMOD_BIAS_IAU2006 2 /* use frame bias matrix IAU 2000 */
|
||||
#define SEMOD_BIAS_DEFAULT SEMOD_BIAS_IAU2006
|
||||
|
||||
/* methods of JPL Horizons (iflag & SEFLG_JPLHOR),
|
||||
* using daily dpsi, deps; see explanations below */
|
||||
#define SEMOD_JPLHOR_EXTENDED_1800 1 /* daily dpsi and deps from file are
|
||||
* limited to 1962 - today. JPL uses the
|
||||
* first and last value for all dates
|
||||
* beyond this time range. */
|
||||
#define SEMOD_JPLHOR_NOT_EXTENDED 2 /* outside the available time range
|
||||
* 1962 - today default to SEFLG_JPLHOR_APROX */
|
||||
#define SEMOD_JPLHOR_DEFAULT SEMOD_JPLHOR_EXTENDED_1800
|
||||
/* SEMOD_JPLHOR_EXTENDED_1800, if combined with SEFLG_JPLHOR provides good
|
||||
* agreement with JPL Horizons for 1800 - today. However, Horizons uses
|
||||
* correct dpsi and deps only after 20-jan-1962. For all dates before that
|
||||
* it uses dpsi and deps of 20-jan-1962, which provides a continuous
|
||||
* ephemeris, but does not make sense otherwise.
|
||||
* Before 1800, even this option does not provide agreement with Horizons,
|
||||
* because Horizons uses a different precession model (Owen 1986)
|
||||
* before 1800, which is not included in the Swiss Ephemeris.
|
||||
* SEMOD_JPLHOR_NOT_EXTENDED causes the program to default to SEFLG_JPLHOR_APPROX,
|
||||
* if the date is outside the time range 1962 - today, where values
|
||||
* for dpsi and deps are given.
|
||||
* Note that this will result in a non-continuous ephemeris near
|
||||
* 20-jan-1962 and current years.
|
||||
*/
|
||||
|
||||
/* methods of approximation of JPL Horizons (iflag & SEFLG_JPLHORA),
|
||||
* without dpsi, deps; see explanations below */
|
||||
#define SEMOD_JPLHORA_1 1
|
||||
#define SEMOD_JPLHORA_2 2
|
||||
#define SEMOD_JPLHORA_DEFAULT SEMOD_JPLHORA_1
|
||||
/* With SEMOD_JPLHORA_1, planetary positions are always calculated
|
||||
* using a recent precession/nutation model. Frame bias matrix is applied
|
||||
* with some correction to RA and another correction is added to epsilon.
|
||||
* This provides a very good approximation of JPL Horizons positions.
|
||||
* With SEMOD_JPLHORA_2, frame bias as r$ecommended by IERS Conventions 2003
|
||||
* and 2010 is *not* applied. Instead, dpsi_bias and deps_bias are added to
|
||||
* nutation. This procedure is found in some older astronomical software.
|
||||
* Equatorial apparent positions will be close to JPL Horizons
|
||||
* (within a few mas) beetween 1962 and current years. Ecl. longitude
|
||||
* will be good, latitude bad.
|
||||
*/
|
||||
|
||||
#define SEMOD_DELTAT_ESPENAK_MEEUS_2006 1
|
||||
#define SEMOD_DELTAT_STEPHENSON_MORRISON_2004 2
|
||||
#define SEMOD_DELTAT_DEFAULT SEMOD_DELTAT_ESPENAK_MEEUS_2006
|
||||
|
||||
/**************************************************************
|
||||
* here follow some ugly definitions which are only required
|
||||
@@ -454,16 +551,10 @@ extern "C" {
|
||||
|
||||
#if defined(DOS32) || !MSDOS || defined(WIN32)
|
||||
/* use compiler switch to define DOS32 */
|
||||
# ifndef FAR
|
||||
# define FAR
|
||||
# endif
|
||||
# define MALLOC malloc
|
||||
# define CALLOC calloc
|
||||
# define FREE free
|
||||
#else
|
||||
# ifndef FAR
|
||||
# define FAR far
|
||||
# endif
|
||||
# ifdef __BORLANDC__
|
||||
# include <alloc.h>
|
||||
# define MALLOC farmalloc
|
||||
@@ -478,10 +569,10 @@ extern "C" {
|
||||
|
||||
/* DLL defines */
|
||||
#ifdef MAKE_DLL
|
||||
#if defined (PASCAL)
|
||||
#define PASCAL_CONV PASCAL
|
||||
#if defined (PASCAL) || defined(__stdcall)
|
||||
#define CALL_CONV __stdcall
|
||||
#else
|
||||
#define PASCAL_CONV
|
||||
#define CALL_CONV
|
||||
#endif
|
||||
#ifdef MAKE_DLL16 /* 16bit DLL */
|
||||
/* We compiled the 16bit DLL for Windows 3.x using Borland C/C++ Ver:3.x
|
||||
@@ -495,7 +586,7 @@ extern "C" {
|
||||
#define EXP32 __declspec( dllexport )
|
||||
#endif
|
||||
#else
|
||||
#define PASCAL_CONV
|
||||
#define CALL_CONV
|
||||
#define EXP16
|
||||
#define EXP32
|
||||
#endif
|
||||
@@ -506,16 +597,21 @@ extern "C" {
|
||||
* exported functions
|
||||
***********************************************************/
|
||||
|
||||
#define ext_def(x) extern EXP32 x FAR PASCAL_CONV EXP16
|
||||
#define ext_def(x) extern EXP32 x CALL_CONV EXP16
|
||||
/* ext_def(x) evaluates to x on Unix */
|
||||
|
||||
ext_def(int32) swe_heliacal_ut(double tjdstart_ut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 iflag, double *dret, char *serr);
|
||||
ext_def(int32) swe_heliacal_pheno_ut(double tjd_ut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 helflag, double *darr, char *serr);
|
||||
ext_def(int32) swe_vis_limit_mag(double tjdut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 helflag, double *dret, char *serr);
|
||||
|
||||
/* the following are secret, for Victor Reijs' */
|
||||
ext_def(int32) swe_heliacal_angle(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
|
||||
ext_def(int32) swe_topo_arcus_visionis(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double alt_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
|
||||
|
||||
/* the following is secret, for Dieter, allows to test old models of
|
||||
* precession, nutation, etc. Search for SE_MODEL_... in this file */
|
||||
ext_def(void) swe_set_astro_models(int32 *imodel);
|
||||
|
||||
/****************************
|
||||
* exports from sweph.c
|
||||
****************************/
|
||||
@@ -561,11 +657,15 @@ ext_def (void) swe_set_topo(double geolon, double geolat, double geoalt);
|
||||
ext_def(void) swe_set_sid_mode(int32 sid_mode, double t0, double ayan_t0);
|
||||
|
||||
/* get ayanamsa */
|
||||
ext_def(int32) swe_get_ayanamsa_ex(double tjd_et, int32 iflag, double *daya, char *serr);
|
||||
ext_def(int32) swe_get_ayanamsa_ex_ut(double tjd_ut, int32 iflag, double *daya, char *serr);
|
||||
ext_def(double) swe_get_ayanamsa(double tjd_et);
|
||||
|
||||
ext_def(double) swe_get_ayanamsa_ut(double tjd_ut);
|
||||
|
||||
ext_def( char *) swe_get_ayanamsa_name(int32 isidmode);
|
||||
|
||||
ext_def(const char *) swe_get_ayanamsa_name(int32 isidmode);
|
||||
|
||||
/*ext_def(void) swe_set_timeout(int32 tsec);*/
|
||||
|
||||
/****************************
|
||||
* exports from swedate.c
|
||||
@@ -737,6 +837,7 @@ ext_def (int32) swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
|
||||
|
||||
/* delta t */
|
||||
ext_def( double ) swe_deltat(double tjd);
|
||||
ext_def(double) swe_deltat_ex(double tjd, int32 iflag, char *serr);
|
||||
|
||||
/* equation of time */
|
||||
ext_def(int32) swe_time_equ(double tjd, double *te, char *serr);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -59,45 +59,11 @@
|
||||
for promoting such software, products or services.
|
||||
*/
|
||||
|
||||
#define PREC_IAU_1976 1
|
||||
#define PREC_IAU_2000 2
|
||||
#define PREC_IAU_2006 3
|
||||
#define PREC_BRETAGNON_2003 4
|
||||
#define PREC_LASKAR_1986 5
|
||||
#define PREC_SIMON_1994 6
|
||||
#define PREC_WILLIAMS_1994 7
|
||||
#define PREC_VONDRAK_2011 8
|
||||
|
||||
/* Precession coefficients for remote past and future.
|
||||
* One of the following four defines must be true.
|
||||
*/
|
||||
#define USE_PREC_VONDRAK_2011 TRUE
|
||||
#define USE_PREC_WILLIAMS_1994 FALSE
|
||||
#define USE_PREC_SIMON_1994 FALSE
|
||||
#define USE_PREC_LASKAR_1986 FALSE
|
||||
#define USE_PREC_BRETAGNON_2003 FALSE
|
||||
/* IAU precession 1976 or 2003 for recent centuries.
|
||||
* only one of the following two defines may be TRUE */
|
||||
#define USE_PREC_IAU_1976 FALSE
|
||||
#define USE_PREC_IAU_2000 FALSE
|
||||
#define USE_PREC_IAU_2006 FALSE /* precession model P03 */
|
||||
#define PREC_IAU_1976_CTIES 2.0 /* J2000 +/- two centuries */
|
||||
#define PREC_IAU_2000_CTIES 2.0 /* J2000 +/- two centuries */
|
||||
/* we use P03 for whole ephemeris */
|
||||
#define PREC_IAU_2006_CTIES 75.0 /* J2000 +/- 75 centuries */
|
||||
|
||||
/* choose between the following nutation models */
|
||||
#define NUT_IAU_1980 FALSE
|
||||
#define NUT_IAU_2000A FALSE /* very time consuming ! */
|
||||
#define NUT_IAU_2000B TRUE /* fast, but precision of milli-arcsec */
|
||||
/* Set TRUE, to include Herring's (1987) corrections to IAU 1980
|
||||
* nutation series. AA (1996) neglects them. */
|
||||
#define NUT_CORR_1987 FALSE
|
||||
|
||||
/* frame bias */
|
||||
#define FRAME_BIAS_IAU2006 TRUE /* if false, frame bias iau2000 will be used
|
||||
* difference is minimal. */
|
||||
|
||||
/* For reproducing JPL Horizons to 2 mas (SEFLG_JPLHOR):
|
||||
* The user has to keep the following files up to date which contain
|
||||
* the earth orientation parameters related to the IAU 1980 nutation
|
||||
@@ -111,7 +77,9 @@
|
||||
#define DPSI_DEPS_IAU1980_FILE_FINALS "eop_finals.txt"
|
||||
#define DPSI_DEPS_IAU1980_TJD0_HORIZONS 2437684.5
|
||||
#define HORIZONS_TJD0_DPSI_DEPS_IAU1980 2437684.5
|
||||
#define INCLUDE_CODE_FOR_DPSI_DEPS_IAU1980 TRUE
|
||||
/*#define INCLUDE_CODE_FOR_DPSI_DEPS_IAU1980 TRUE*/
|
||||
|
||||
/*#define INCLUDE_CODE_FOR_DPSI_DEPS_IAU1980 TRUE */
|
||||
/* You can set the latter false if you do not want to compile the
|
||||
* code required to reproduce JPL Horizons.
|
||||
* Keep it TRUE in order to reproduce JPL Horizons following
|
||||
@@ -140,9 +108,9 @@
|
||||
* JPL Horizons is even better. Frame bias matrix is applied with
|
||||
* some correction to RA and another correction is added to epsilon.
|
||||
*/
|
||||
#define APPROXIMATE_HORIZONS_ASTRODIENST TRUE
|
||||
/*#define APPROXIMATE_HORIZONS_ASTRODIENST TRUE */
|
||||
|
||||
#define USE_HORIZONS_METHOD_BEFORE_1980 TRUE /* Horizons method before 20-jan-1962 */
|
||||
/*#define USE_HORIZONS_METHOD_BEFORE_1980 TRUE * Horizons method before 20-jan-1962 */
|
||||
/* The latter, if combined with SEFLG_JPLHOR provides good agreement
|
||||
* with JPL Horizons for 1800 - today. However, Horizons uses correct
|
||||
* dpsi and deps only after 20-jan-1962. For all dates before that
|
||||
@@ -183,12 +151,14 @@ extern void swi_icrs2fk5(double *x, int32 iflag, AS_BOOL backward);
|
||||
extern int swi_precess(double *R, double J, int32 iflag, int direction );
|
||||
extern void swi_precess_speed(double *xx, double t, int32 iflag, int direction);
|
||||
|
||||
extern int32 swi_guess_ephe_flag();
|
||||
|
||||
/* from sweph.c, light deflection, aberration, etc. */
|
||||
extern void swi_deflect_light(double *xx, double dt, int32 iflag);
|
||||
extern void swi_aberr_light(double *xx, double *xe, int32 iflag);
|
||||
extern int swi_plan_for_osc_elem(int32 iflag, double tjd, double *xx);
|
||||
extern int swi_trop_ra2sid_lon(double *xin, double *xout, double *xoutr, int32 iflag, char *serr);
|
||||
extern int swi_trop_ra2sid_lon_sosy(double *xin, double *xout, double *xoutr, int32 iflag, char *serr);
|
||||
extern int swi_trop_ra2sid_lon(double *xin, double *xout, double *xoutr, int32 iflag);
|
||||
extern int swi_trop_ra2sid_lon_sosy(double *xin, double *xout, int32 iflag);
|
||||
extern int swi_get_observer(double tjd, int32 iflag,
|
||||
AS_BOOL do_save, double *xobs, char *serr);
|
||||
extern void swi_force_app_pos_etc();
|
||||
@@ -242,13 +212,13 @@ extern double swi_deltat_ephe(double tjd_ut, int32 epheflag);
|
||||
|
||||
#ifdef TRACE
|
||||
# define TRACE_COUNT_MAX 10000
|
||||
extern FILE *swi_fp_trace_c;
|
||||
extern FILE *swi_fp_trace_out;
|
||||
extern TLS FILE *swi_fp_trace_c;
|
||||
extern TLS FILE *swi_fp_trace_out;
|
||||
extern TLS int32 swi_trace_count;
|
||||
extern void swi_open_trace(char *serr);
|
||||
extern int32 swi_trace_count;
|
||||
static char *fname_trace_c = "swetrace.c";
|
||||
static char *fname_trace_out = "swetrace.txt";
|
||||
static const char *fname_trace_c = "swetrace.c";
|
||||
static const char *fname_trace_out = "swetrace.txt";
|
||||
#ifdef FORCE_IFLAG
|
||||
static char *fname_force_flg = "force.flg";
|
||||
static const char *fname_force_flg = "force.flg";
|
||||
#endif
|
||||
#endif /* TRACE */
|
||||
|
@@ -85,10 +85,10 @@ static char *infocmd1 = "\n\
|
||||
Note: the date format is day month year (European style).\n\
|
||||
-bj... begin date as an absolute Julian day number; e.g. -bj2415020.5\n\
|
||||
-j... same as -bj\n\
|
||||
-tHH.MMSS input time (ephemeris time)\n\
|
||||
-ut input date is universal time\n\
|
||||
-utHH:MM:SS input time\n\
|
||||
-utHH.MMSS input time\n\
|
||||
-tHH.MMSS input time (as Ephemeris Time)\n\
|
||||
-ut input date is Universal Time\n\
|
||||
-utHH:MM:SS input time (as Universal Time)\n\
|
||||
-utHH.MMSS input time (as Universal Time)\n\
|
||||
output time for eclipses, occultations, risings/settings is UT by default\n\
|
||||
-lmt output date/time is LMT (with -geopos)\n\
|
||||
-lat output date/time is LAT (with -geopos)\n\
|
||||
@@ -129,11 +129,11 @@ static char *infocmd2 = "\
|
||||
The output lists 12 house cusps, Asc, MC, ARMC and Vertex.\n\
|
||||
Houses can only be computed if option -ut is given.\n\
|
||||
A equal\n\
|
||||
E equal\n\
|
||||
E equal = A\n\
|
||||
B Alcabitius\n\
|
||||
C Campanus\n\
|
||||
G 36 Gauquelin sectors\n\
|
||||
H horizon / azimut\n\
|
||||
H horizon / azimuth\n\
|
||||
K Koch\n\
|
||||
M Morinus\n\
|
||||
O Porphyry\n\
|
||||
@@ -158,11 +158,41 @@ static char *infocmd3 = "\
|
||||
commas separated, + for east and north. If none are given,\n\
|
||||
Greenwich is used: 0,51.5,0\n\
|
||||
sidereal astrology:\n\
|
||||
-ay.. ayanamsa, with number of method, e.g. ay0 for Fagan/Bradley\n\
|
||||
-sid.. sidereal, with number of method; 'sid0' for Fagan/Bradley\n\
|
||||
'sid1' for Lahiri\n\
|
||||
-ay.. ayanamsha, with number of method, e.g. ay0 for Fagan/Bradley\n\
|
||||
-sid.. sidereal, with number of method (see below)\n\
|
||||
-sidt0.. sidereal, projection on ecliptic of t0 \n\
|
||||
-sidsp.. sidereal, projection on solar system plane \n\
|
||||
number of ayanamsha method:\n\
|
||||
0 for Fagan/Bradley\n\
|
||||
1 for Lahiri\n\
|
||||
2 for De Luce\n\
|
||||
3 for Raman\n\
|
||||
4 for Ushashashi\n\
|
||||
5 for Krishnamurti\n\
|
||||
6 for Djwhal Khul\n\
|
||||
7 for Yukteshwar\n\
|
||||
8 for J.N. Bhasin\n\
|
||||
9 for Babylonian/Kugler 1\n\
|
||||
10 for Babylonian/Kugler 2\n\
|
||||
11 for Babylonian/Kugler 3\n\
|
||||
12 for Babylonian/Huber\n\
|
||||
13 for Babylonian/Eta Piscium\n\
|
||||
14 for Babylonian/Aldebaran = 15 Tau\n\
|
||||
15 for Hipparchos\n\
|
||||
16 for Sassanian\n\
|
||||
17 for Galact. Center = 0 Sag\n\
|
||||
18 for J2000\n\
|
||||
19 for J1900\n\
|
||||
20 for B1950\n\
|
||||
21 for Suryasiddhanta\n\
|
||||
22 for Suryasiddhanta, mean Sun\n\
|
||||
23 for Aryabhata\n\
|
||||
24 for Aryabhata, mean Sun\n\
|
||||
25 for SS Citra\n\
|
||||
26 for SS Revati\n\
|
||||
27 for True Citra\n\
|
||||
28 for True Revati\n\
|
||||
29 for True Pushya\n\
|
||||
ephemeris specifications:\n\
|
||||
-edirPATH change the directory of the ephemeris files \n\
|
||||
-eswe swiss ephemeris\n\
|
||||
@@ -176,10 +206,12 @@ static char *infocmd3 = "\
|
||||
-j2000 no precession (i.e. J2000 positions)\n\
|
||||
-icrs ICRS (use Internat. Celestial Reference System)\n\
|
||||
-nonut no nutation \n\
|
||||
";
|
||||
static char *infocmd4 = "\
|
||||
-speed calculate high precision speed \n\
|
||||
-speed3 'low' precision speed from 3 positions \n\
|
||||
do not use this option. -speed parameter\n\
|
||||
is faster and preciser \n\
|
||||
is faster and more precise \n\
|
||||
-iXX force iflag to value XX\n\
|
||||
-testaa96 test example in AA 96, B37,\n\
|
||||
i.e. venus, j2450442.5, DE200.\n\
|
||||
@@ -189,8 +221,6 @@ static char *infocmd3 = "\
|
||||
-testaa97\n\
|
||||
-roundsec round to seconds\n\
|
||||
-roundmin round to minutes\n\
|
||||
";
|
||||
static char *infocmd4 = "\
|
||||
observer position:\n\
|
||||
-hel compute heliocentric positions\n\
|
||||
-bary compute barycentric positions (bar. earth instead of node) \n\
|
||||
@@ -217,6 +247,8 @@ static char *infocmd4 = "\
|
||||
-occult occultation of planet or star by the moon. Use -p to \n\
|
||||
specify planet (-pf -xfAldebaran for stars) \n\
|
||||
output format same as with -solecl\n\
|
||||
";
|
||||
static char *infocmd5 = "\
|
||||
-lunecl lunar eclipse\n\
|
||||
output 1st line:\n\
|
||||
eclipse date,\n\
|
||||
@@ -225,8 +257,6 @@ static char *infocmd4 = "\
|
||||
output 2nd line:\n\
|
||||
6 contacts for start and end of penumbral, partial, and\n\
|
||||
total phase\n\
|
||||
";
|
||||
static char *infocmd5 = "\
|
||||
-local only with -solecl or -occult, if the next event of this\n\
|
||||
kind is wanted for a given geogr. position.\n\
|
||||
Use -geopos[long,lat,elev] to specify that position.\n\
|
||||
@@ -257,12 +287,13 @@ static char *infocmd5 = "\
|
||||
-penumbral penumbral lunar eclipse (only with -lunecl)\n\
|
||||
-central central eclipse (only with -solecl, nonlocal)\n\
|
||||
-noncentral non-central eclipse (only with -solecl, nonlocal)\n\
|
||||
";
|
||||
static char *infocmd6 = "\
|
||||
specifications for risings and settings:\n\
|
||||
-norefrac neglect refraction (with option -rise)\n\
|
||||
-disccenter find rise of disc center (with option -rise)\n\
|
||||
-discbottom find rise of disc bottom (with option -rise)\n\
|
||||
-hindu hindu version of sunrise (with option -rise)\n\
|
||||
";
|
||||
static char *infocmd6 = "\
|
||||
specifications for heliacal events:\n\
|
||||
-at[press,temp,rhum,visr]:\n\
|
||||
pressure in hPa\n\
|
||||
@@ -285,7 +316,7 @@ static char *infocmd6 = "\
|
||||
backward search:\n\
|
||||
-bwd\n";
|
||||
/* characters still available:
|
||||
bcgijklruvxy
|
||||
bcgijklruvx
|
||||
*/
|
||||
static char *infoplan = "\n\
|
||||
Planet selection letters:\n\
|
||||
@@ -295,11 +326,16 @@ static char *infoplan = "\n\
|
||||
h ficticious factors J..X\n\
|
||||
a all factors\n\
|
||||
(the letters above can only appear as a single letter)\n\n\
|
||||
single planet letters:\n\
|
||||
single body numbers/letters:\n\
|
||||
0 Sun (character zero)\n\
|
||||
1 Moon (character 1)\n\
|
||||
2 Mercury\n\
|
||||
....\n\
|
||||
3 Venus\n\
|
||||
4 Mars\n\
|
||||
5 Jupiter\n\
|
||||
6 Saturn\n\
|
||||
7 Uranus\n\
|
||||
8 Neptune\n\
|
||||
9 Pluto\n\
|
||||
m mean lunar node\n\
|
||||
t true lunar node\n\
|
||||
@@ -348,6 +384,8 @@ static char *infoplan = "\n\
|
||||
Z White Moon\n\
|
||||
w Waldemath's dark Moon\n\
|
||||
z hypothetical body, with number given in -xz\n\
|
||||
sidereal time:\n\
|
||||
x sidereal time\n\
|
||||
e print a line of labels\n\
|
||||
\n";
|
||||
/* characters still available
|
||||
@@ -382,12 +420,12 @@ static char *infoform = "\n\
|
||||
a right ascension hours decimal\n\
|
||||
D declination degree\n\
|
||||
d declination decimal\n\
|
||||
I Azimuth degree\n\
|
||||
i Azimuth decimal\n\
|
||||
H Height degree\n\
|
||||
h Height decimal\n\
|
||||
K Height (with refraction) degree\n\
|
||||
k Height (with refraction) decimal\n\
|
||||
I azimuth degree\n\
|
||||
i azimuth decimal\n\
|
||||
H altitude degree\n\
|
||||
h altitude decimal\n\
|
||||
K altitude (with refraction) degree\n\
|
||||
k altitude (with refraction) decimal\n\
|
||||
G house position in degrees\n\
|
||||
g house position in degrees decimal\n\
|
||||
j house number 1.0 - 12.99999\n\
|
||||
@@ -417,7 +455,7 @@ static char *infodate = "\n\
|
||||
1.2.1991 three integers separated by a nondigit character for\n\
|
||||
day month year. Dates are interpreted as Gregorian\n\
|
||||
after 4.10.1582 and as Julian Calendar before.\n\
|
||||
Time is always set to midnight.\n\
|
||||
Time is always set to midnight (0 h).\n\
|
||||
If the three letters jul are appended to the date,\n\
|
||||
the Julian calendar is used even after 1582.\n\
|
||||
If the four letters greg are appended to the date,\n\
|
||||
@@ -525,6 +563,10 @@ static char *infoexamp = "\n\
|
||||
#define MODE_HOUSE 1
|
||||
#define MODE_LABEL 2
|
||||
|
||||
#define SEARCH_RANGE_LUNAR_CYCLES 20000
|
||||
|
||||
#define OUTPUT_EXTRA_PRECISION 0
|
||||
|
||||
static char se_pname[AS_MAXCH];
|
||||
static char *zod_nam[] = {"ar", "ta", "ge", "cn", "le", "vi",
|
||||
"li", "sc", "sa", "cp", "aq", "pi"};
|
||||
@@ -567,8 +609,8 @@ static int hpos_meth = 0;
|
||||
static double geopos[10];
|
||||
static double attr[20], tret[20], datm[4], dobs[6];
|
||||
static int32 iflag = 0, iflag2; /* external flag: helio, geo... */
|
||||
static char *hs_nam[] = {"undef",
|
||||
"Ascendant", "MC", "ARMC", "Vertex"};
|
||||
static char *hs_nam[] =
|
||||
{"undef", "Ascendant", "MC", "ARMC", "Vertex"};
|
||||
static int direction = 1;
|
||||
static AS_BOOL direction_flag = FALSE;
|
||||
static int32 helflag = 0;
|
||||
@@ -580,6 +622,10 @@ static int32 whicheph = SEFLG_SWIEPH;
|
||||
static char *psp;
|
||||
static int32 norefrac = 0;
|
||||
static int32 disccenter = 0;
|
||||
static int32 discbottom = 0;
|
||||
/* for test of old models only */
|
||||
static int32 astro_models[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
static int do_set_astro_models = FALSE;
|
||||
|
||||
#define SP_LUNAR_ECLIPSE 1
|
||||
#define SP_SOLAR_ECLIPSE 2
|
||||
@@ -629,10 +675,9 @@ int main(int argc, char *argv[])
|
||||
int32 sid_mode = SE_SIDM_FAGAN_BRADLEY;
|
||||
double t2, tstep = 1, thour = 0;
|
||||
double delt;
|
||||
datm[0] = 0; datm[1] = 0; datm[2] = 0; datm[3] = 0;
|
||||
datm[0] = 1013.25; datm[1] = 15; datm[2] = 40; datm[3] = 0;
|
||||
dobs[0] = 0; dobs[1] = 0;
|
||||
dobs[2] = 0; dobs[3] = 0; dobs[4] = 0; dobs[5] = 0;
|
||||
/* swe_set_tid_acc(-25.858); * to test delta t output */
|
||||
serr[0] = serr_save[0] = serr_warn[0] = sdate_save[0] = '\0';
|
||||
# ifdef MACOS
|
||||
argc = ccommand(&argv); /* display the arguments window */
|
||||
@@ -653,10 +698,11 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
thour = atof(s1);
|
||||
thour += (thour < 0 ? -.00005 : .00005);
|
||||
/* h.mmss -> decimal */
|
||||
t = fmod(thour, 1) * 100 + 1e-6;
|
||||
t = fmod(thour, 1) * 100;
|
||||
j = (int) t;
|
||||
t = fmod(t, 1) * 100 + 1e-6;
|
||||
t = (int)(fmod(t, 1) * 100);
|
||||
thour = (int) thour + j / 60.0 + t / 3600.0;
|
||||
}
|
||||
} else if (strncmp(argv[i], "-head", 5) == 0) {
|
||||
@@ -670,26 +716,26 @@ int main(int argc, char *argv[])
|
||||
} else if (strncmp(argv[i], "-ay", 3) == 0) {
|
||||
do_ayanamsa = TRUE;
|
||||
sid_mode = atol(argv[i]+3);
|
||||
swe_set_sid_mode(sid_mode, 0, 0);
|
||||
/*swe_set_sid_mode(sid_mode, 0, 0);*/
|
||||
} else if (strncmp(argv[i], "-sidt0", 6) == 0) {
|
||||
iflag |= SEFLG_SIDEREAL;
|
||||
sid_mode = atol(argv[i]+6);
|
||||
if (sid_mode == 0)
|
||||
sid_mode = SE_SIDM_FAGAN_BRADLEY;
|
||||
sid_mode |= SE_SIDBIT_ECL_T0;
|
||||
swe_set_sid_mode(sid_mode, 0, 0);
|
||||
/*swe_set_sid_mode(sid_mode, 0, 0);*/
|
||||
} else if (strncmp(argv[i], "-sidsp", 6) == 0) {
|
||||
iflag |= SEFLG_SIDEREAL;
|
||||
sid_mode = atol(argv[i]+6);
|
||||
if (sid_mode == 0)
|
||||
sid_mode = SE_SIDM_FAGAN_BRADLEY;
|
||||
sid_mode |= SE_SIDBIT_SSY_PLANE;
|
||||
swe_set_sid_mode(sid_mode, 0, 0);
|
||||
/*swe_set_sid_mode(sid_mode, 0, 0);*/
|
||||
} else if (strncmp(argv[i], "-sid", 4) == 0) {
|
||||
iflag |= SEFLG_SIDEREAL;
|
||||
sid_mode = atol(argv[i]+4);
|
||||
if (sid_mode > 0)
|
||||
swe_set_sid_mode(sid_mode, 0, 0);
|
||||
/*if (sid_mode > 0)
|
||||
swe_set_sid_mode(sid_mode, 0, 0);*/
|
||||
} else if (strcmp(argv[i], "-jplhora") == 0) {
|
||||
iflag |= SEFLG_JPLHOR_APPROX;
|
||||
} else if (strcmp(argv[i], "-jplhor") == 0) {
|
||||
@@ -786,13 +832,13 @@ int main(int argc, char *argv[])
|
||||
} else if (strcmp(argv[i], "-how") == 0) {
|
||||
special_mode |= SP_MODE_HOW;
|
||||
} else if (strcmp(argv[i], "-total") == 0) {
|
||||
search_flag |= SE_ECL_TOTAL|SE_ECL_CENTRAL|SE_ECL_NONCENTRAL;
|
||||
search_flag |= SE_ECL_TOTAL;
|
||||
} else if (strcmp(argv[i], "-annular") == 0) {
|
||||
search_flag |= SE_ECL_ANNULAR|SE_ECL_CENTRAL|SE_ECL_NONCENTRAL;
|
||||
search_flag |= SE_ECL_ANNULAR;
|
||||
} else if (strcmp(argv[i], "-anntot") == 0) {
|
||||
search_flag |= SE_ECL_ANNULAR_TOTAL|SE_ECL_CENTRAL|SE_ECL_NONCENTRAL;
|
||||
search_flag |= SE_ECL_ANNULAR_TOTAL;
|
||||
} else if (strcmp(argv[i], "-partial") == 0) {
|
||||
search_flag |= SE_ECL_PARTIAL|SE_ECL_CENTRAL|SE_ECL_NONCENTRAL;
|
||||
search_flag |= SE_ECL_PARTIAL;
|
||||
} else if (strcmp(argv[i], "-penumbral") == 0) {
|
||||
search_flag |= SE_ECL_PENUMBRAL;
|
||||
} else if (strcmp(argv[i], "-noncentral") == 0) {
|
||||
@@ -813,9 +859,22 @@ int main(int argc, char *argv[])
|
||||
} else if (strcmp(argv[i], "-hindu") == 0) {
|
||||
norefrac = 1;
|
||||
disccenter = 1;
|
||||
} else if (strcmp(argv[i], "-discbottom") == 0) {
|
||||
discbottom = 1;
|
||||
} else if (strcmp(argv[i], "-metr") == 0) {
|
||||
special_event = SP_MERIDIAN_TRANSIT;
|
||||
have_geopos = TRUE;
|
||||
/* secret test feature for dieter */
|
||||
} else if (strncmp(argv[i], "-prec",5) == 0) {
|
||||
j = 0;
|
||||
astro_models[j] = atoi(argv[i]+5);
|
||||
sp = argv[i];
|
||||
while((sp2 = strchr(sp, ',')) != NULL) {
|
||||
sp = sp2 + 1;
|
||||
j++;
|
||||
astro_models[j] = atoi(sp);
|
||||
}
|
||||
do_set_astro_models = TRUE;
|
||||
} else if (strncmp(argv[i], "-hev", 4) == 0) {
|
||||
special_event = SP_HELIACAL;
|
||||
search_flag = 0;
|
||||
@@ -824,7 +883,14 @@ int main(int argc, char *argv[])
|
||||
have_geopos = TRUE;
|
||||
if (strstr(argv[i], "AV")) hel_using_AV = TRUE;
|
||||
} else if (strncmp(argv[i], "-at", 3) == 0) {
|
||||
sscanf(argv[i]+3, "%lf,%lf,%lf,%lf", &(datm[0]), &(datm[1]), &(datm[2]), &(datm[3]));
|
||||
sp = argv[i]+3;
|
||||
j = 0;
|
||||
while (j < 4 && sp != NULL) {
|
||||
datm[j] = atof(sp);
|
||||
sp = strchr(sp, ',');
|
||||
if (sp != NULL) sp += 1;
|
||||
j++;
|
||||
}
|
||||
} else if (strncmp(argv[i], "-obs", 4) == 0) {
|
||||
sscanf(argv[i]+4, "%lf,%lf", &(dobs[0]), &(dobs[1]));
|
||||
} else if (strncmp(argv[i], "-opt", 4) == 0) {
|
||||
@@ -890,6 +956,8 @@ int main(int argc, char *argv[])
|
||||
round_flag |= BIT_ROUND_SEC;
|
||||
} else if (strcmp(argv[i], "-roundmin") == 0) {
|
||||
round_flag |= BIT_ROUND_MIN;
|
||||
/*} else if (strncmp(argv[i], "-timeout", 8) == 0) {
|
||||
swe_set_timeout(atoi(argv[i]) + 8);*/
|
||||
} else if (strncmp(argv[i], "-t", 2) == 0) {
|
||||
if (strlen(argv[i]) > 2) {
|
||||
*s1 = '\0';
|
||||
@@ -902,10 +970,11 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
thour = atof(s1);
|
||||
thour += (thour < 0 ? -.00005 : .00005);
|
||||
/* h.mmss -> decimal */
|
||||
t = fmod(thour, 1) * 100 + 1e-6;
|
||||
t = fmod(thour, 1) * 100;
|
||||
j = (int) t;
|
||||
t = fmod(t, 1) * 100 + 1e-6;
|
||||
t = (int)(fmod(t, 1) * 100);
|
||||
thour = (int) thour + j / 60.0 + t / 3600.0;
|
||||
}
|
||||
} else if (strncmp(argv[i], "-h", 2) == 0
|
||||
@@ -952,10 +1021,6 @@ int main(int argc, char *argv[])
|
||||
if (special_event == SP_OCCULTATION && ipl == 1)
|
||||
ipl = 2; /* no occultation of moon by moon */
|
||||
}
|
||||
geopos[0] = top_long;
|
||||
geopos[1] = top_lat;
|
||||
geopos[2] = top_elev;
|
||||
swe_set_topo(top_long, top_lat, top_elev);
|
||||
#if HPUNIX
|
||||
gethostname (hostname, 80);
|
||||
if (strstr(hostname, "as10") != NULL)
|
||||
@@ -968,7 +1033,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
iflag = (iflag & ~SEFLG_EPHMASK) | whicheph;
|
||||
if (strpbrk(fmt, "SsQ") != NULL)
|
||||
if (strpbrk(fmt, "SsQ") != NULL && !(iflag & SEFLG_SPEED3))
|
||||
iflag |= SEFLG_SPEED;
|
||||
if (*ephepath == '\0') {
|
||||
if (make_ephemeris_path(iflag, argv[0], ephepath) == ERR) {
|
||||
@@ -976,9 +1041,20 @@ int main(int argc, char *argv[])
|
||||
whicheph = SEFLG_MOSEPH;
|
||||
}
|
||||
}
|
||||
swe_set_ephe_path(ephepath);
|
||||
if (whicheph != SEFLG_MOSEPH)
|
||||
swe_set_ephe_path(ephepath);
|
||||
if (whicheph & SEFLG_JPLEPH)
|
||||
swe_set_jpl_file(fname);
|
||||
/* the following is only a test feature */
|
||||
if (do_set_astro_models)
|
||||
swe_set_astro_models(astro_models); /* secret test feature for dieter */
|
||||
if ((iflag & SEFLG_SIDEREAL) || do_ayanamsa)
|
||||
swe_set_sid_mode(sid_mode, 0, 0);
|
||||
geopos[0] = top_long;
|
||||
geopos[1] = top_lat;
|
||||
geopos[2] = top_elev;
|
||||
swe_set_topo(top_long, top_lat, top_elev);
|
||||
/*swe_set_tid_acc(-25.82); * to test delta t output */
|
||||
while (TRUE) {
|
||||
serr[0] = serr_save[0] = serr_warn[0] = '\0';
|
||||
if (begindate == NULL) {
|
||||
@@ -1019,7 +1095,6 @@ int main(int argc, char *argv[])
|
||||
strcpy(sastno, sdate + 3);
|
||||
*sdate = '\0';
|
||||
}
|
||||
// swe_set_tid_acc((double) (iflag & SEFLG_EPHMASK));
|
||||
sp = sdate;
|
||||
if (*sp == '.') {
|
||||
goto end_main;
|
||||
@@ -1091,7 +1166,7 @@ int main(int argc, char *argv[])
|
||||
printf(" greg.");
|
||||
else
|
||||
printf(" jul.");
|
||||
t2 = jut;
|
||||
t2 = jut + (jut < 0 ? -.5 : .5) / 3600.;
|
||||
printf(" % 2d:", (int) t2);
|
||||
t2 = (t2 - (int32) t2) * 60;
|
||||
printf("%02d:", (int) t2);
|
||||
@@ -1103,10 +1178,10 @@ int main(int argc, char *argv[])
|
||||
printf(" ET");
|
||||
printf("\t\tversion %s", swe_version(sout));
|
||||
}
|
||||
delt = swe_deltat(t);
|
||||
delt = swe_deltat_ex(t, iflag, serr);
|
||||
if (universal_time) {
|
||||
if (with_header) {
|
||||
printf("\nUT: %.11f", t);
|
||||
printf("\nUT: %.9f", t);
|
||||
}
|
||||
if (with_header) {
|
||||
printf(" delta t: %f sec", delt * 86400.0);
|
||||
@@ -1119,10 +1194,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
iflgret = swe_calc(te, SE_ECL_NUT, iflag, xobl, serr);
|
||||
if (with_header) {
|
||||
printf("\nET: %.11f", te);
|
||||
printf("\nET: %.9f", te);
|
||||
if (iflag & SEFLG_SIDEREAL) {
|
||||
daya = swe_get_ayanamsa(te);
|
||||
printf(" ayanamsa = %s", dms(daya, round_flag));
|
||||
if (swe_get_ayanamsa_ex(te, iflag, &daya, serr) == ERR) {
|
||||
printf(" error in swe_get_ayanamsa_ex(): %s\n", serr);
|
||||
exit(1);
|
||||
}
|
||||
printf(" ayanamsa = %s (%s)", dms(daya, round_flag), swe_get_ayanamsa_name(sid_mode));
|
||||
}
|
||||
if (have_geopos) {
|
||||
printf("\ngeo. long %f, lat %f, alt %f", geopos[0], geopos[1], geopos[2]);
|
||||
@@ -1154,7 +1232,10 @@ int main(int argc, char *argv[])
|
||||
if (with_header && !with_header_always)
|
||||
with_header = FALSE;
|
||||
if (do_ayanamsa) {
|
||||
daya = swe_get_ayanamsa(te);
|
||||
if (swe_get_ayanamsa_ex(te, iflag, &daya, serr) == ERR) {
|
||||
printf(" error in swe_get_ayanamsa_ex(): %s\n", serr);
|
||||
exit(1);
|
||||
}
|
||||
fputs("Ayanamsa", stdout);
|
||||
fputs(gap, stdout);
|
||||
fputs(dms(daya, round_flag), stdout);
|
||||
@@ -1186,9 +1267,10 @@ int main(int argc, char *argv[])
|
||||
if (ipl == SE_MEAN_NODE || ipl == SE_TRUE_NODE
|
||||
|| ipl == SE_MEAN_APOG || ipl == SE_OSCU_APOG)
|
||||
continue;
|
||||
} else /* geocentric */
|
||||
} else { /* geocentric */
|
||||
if (ipl == SE_EARTH)
|
||||
continue;
|
||||
}
|
||||
/* ecliptic position */
|
||||
if (iflag_f >=0)
|
||||
iflag = iflag_f;
|
||||
@@ -1209,10 +1291,15 @@ int main(int argc, char *argv[])
|
||||
swe_get_planet_name(ipl, se_pname);
|
||||
}
|
||||
if (*psp == 'q') {/* delta t */
|
||||
x[0] = swe_deltat(te) * 86400;
|
||||
x[0] = swe_deltat_ex(te, iflag, serr) * 86400;
|
||||
x[1] = x[2] = x[3] = 0;
|
||||
strcpy(se_pname, "Delta T");
|
||||
}
|
||||
if (*psp == 'x') {/* sidereal time */
|
||||
x[0] = swe_degnorm(swe_sidtime(tut) * 15 + geopos[0]);
|
||||
x[1] = x[2] = x[3] = 0;
|
||||
strcpy(se_pname, "Sidereal Time");
|
||||
}
|
||||
if (*psp == 'o') {/* ecliptic is wanted, remove nutation */
|
||||
x[2] = x[3] = 0;
|
||||
strcpy(se_pname, "Ecl. Obl.");
|
||||
@@ -1234,7 +1321,8 @@ int main(int argc, char *argv[])
|
||||
&& (ipl == SE_SUN || ipl == SE_MOON
|
||||
|| ipl == SE_MEAN_NODE || ipl == SE_TRUE_NODE
|
||||
|| ipl == SE_CHIRON || ipl == SE_PHOLUS || ipl == SE_CUPIDO
|
||||
|| ipl >= SE_AST_OFFSET || ipl == SE_FIXSTAR)) {
|
||||
|| ipl >= SE_AST_OFFSET || ipl == SE_FIXSTAR
|
||||
|| *psp == 'y')) {
|
||||
fputs("error: ", stdout);
|
||||
fputs(serr, stdout);
|
||||
fputs("\n", stdout);
|
||||
@@ -1306,10 +1394,10 @@ int main(int argc, char *argv[])
|
||||
* of 1013.25 mbar is assumed at 0 m above sea level.
|
||||
* If the altitude of the observer is given (in geopos[2])
|
||||
* pressure is estimated according to that */
|
||||
swe_azalt(tut, SE_EQU2HOR, geopos, 0, 10, xt, xaz);
|
||||
swe_azalt(tut, SE_EQU2HOR, geopos, datm[0], datm[1], xt, xaz);
|
||||
if (diff_mode) {
|
||||
iflgret = swe_calc(te, ipldiff, iflgt, xt, serr);
|
||||
swe_azalt(tut, SE_EQU2HOR, geopos, 0, 10, xt, x2);
|
||||
swe_azalt(tut, SE_EQU2HOR, geopos, datm[0], datm[1], xt, x2);
|
||||
if (diff_mode == DIFF_DIFF) {
|
||||
for (i = 1; i < 3; i++)
|
||||
xaz[i] -= x2[i];
|
||||
@@ -1548,7 +1636,11 @@ static int print_line(int mode)
|
||||
case 'l':
|
||||
if (is_label) { printf("long"); break; }
|
||||
ldec:
|
||||
#if OUTPUT_EXTRA_PRECISION
|
||||
printf("%# 11.9f", x[0]);
|
||||
#else
|
||||
printf("%# 11.7f", x[0]);
|
||||
#endif
|
||||
break;
|
||||
case 'G':
|
||||
if (is_label) { printf("housPos"); break; }
|
||||
@@ -1671,7 +1763,11 @@ static int print_line(int mode)
|
||||
break;
|
||||
case 'b':
|
||||
if (is_label) { printf("lat"); break; }
|
||||
#if OUTPUT_EXTRA_PRECISION
|
||||
printf("%# 11.9f", x[1]);
|
||||
#else
|
||||
printf("%# 11.7f", x[1]);
|
||||
#endif
|
||||
break;
|
||||
case 'A': /* right ascension */
|
||||
if (is_label) { printf("RA"); break; }
|
||||
@@ -1679,7 +1775,11 @@ static int print_line(int mode)
|
||||
break;
|
||||
case 'a': /* right ascension */
|
||||
if (is_label) { printf("RA"); break; }
|
||||
#if OUTPUT_EXTRA_PRECISION
|
||||
printf("%# 11.9f", xequ[0]);
|
||||
#else
|
||||
printf("%# 11.7f", xequ[0]);
|
||||
#endif
|
||||
break;
|
||||
case 'D': /* declination */
|
||||
if (is_label) { printf("decl"); break; }
|
||||
@@ -1687,7 +1787,11 @@ static int print_line(int mode)
|
||||
break;
|
||||
case 'd': /* declination */
|
||||
if (is_label) { printf("decl"); break; }
|
||||
#if OUTPUT_EXTRA_PRECISION
|
||||
printf("%# 11.9f", xequ[1]);
|
||||
#else
|
||||
printf("%# 11.7f", xequ[1]);
|
||||
#endif
|
||||
break;
|
||||
case 'I': /* azimuth */
|
||||
if (is_label) { printf("azimuth"); break; }
|
||||
@@ -1874,7 +1978,6 @@ static int print_line(int mode)
|
||||
return OK;
|
||||
}
|
||||
|
||||
#define OUTPUT_EXTRA_PRECISION 0
|
||||
static char *dms(double xv, int32 iflg)
|
||||
{
|
||||
int izod;
|
||||
@@ -1890,18 +1993,29 @@ static char *dms(double xv, int32 iflg)
|
||||
if (isnan(xv))
|
||||
return "nan";
|
||||
#endif
|
||||
if (xv >= 360)
|
||||
xv = 0;
|
||||
*s = '\0';
|
||||
if (iflg & SEFLG_EQUATORIAL)
|
||||
c = "h";
|
||||
if (xv < 0) {
|
||||
xv = -xv;
|
||||
sgn = -1;
|
||||
} else
|
||||
} else {
|
||||
sgn = 1;
|
||||
if (iflg & BIT_ROUND_MIN)
|
||||
}
|
||||
if (iflg & BIT_ROUND_MIN) {
|
||||
xv = swe_degnorm(xv + 0.5/60);
|
||||
if (iflg & BIT_ROUND_SEC)
|
||||
} else if (iflg & BIT_ROUND_SEC) {
|
||||
xv = swe_degnorm(xv + 0.5/3600);
|
||||
} else {
|
||||
/* rounding 0.9999999999 to 1 */
|
||||
#if OUTPUT_EXTRA_PRECISION
|
||||
xv += (xv < 0 ? -1 : 1 ) * 0.000000005 / 3600.0;
|
||||
#else
|
||||
xv += (xv < 0 ? -1 : 1 ) * 0.00005 / 3600.0;
|
||||
#endif
|
||||
}
|
||||
if (iflg & BIT_ZODIAC) {
|
||||
izod = (int) (xv / 30);
|
||||
xv = fmod(xv, 30);
|
||||
@@ -1935,10 +2049,10 @@ static char *dms(double xv, int32 iflg)
|
||||
goto return_dms;
|
||||
xv -= ksec;
|
||||
#if OUTPUT_EXTRA_PRECISION
|
||||
k = (int32) (xv * 100000 + 0.5);
|
||||
sprintf(s1, ".%05d", k);
|
||||
k = (int32) (xv * 100000000);
|
||||
sprintf(s1, ".%08d", k);
|
||||
#else
|
||||
k = (int32) (xv * 10000 + 0.5);
|
||||
k = (int32) (xv * 10000);
|
||||
sprintf(s1, ".%04d", k);
|
||||
#endif
|
||||
strcat(s, s1);
|
||||
@@ -1973,6 +2087,7 @@ static int letter_to_ipl(int letter)
|
||||
case 'e': /* swetest: a line of labels */
|
||||
case 'q': /* swetest: delta t */
|
||||
case 'y': /* swetest: time equation */
|
||||
case 'x': /* swetest: sidereal time */
|
||||
case 's': /* swetest: an asteroid, with number given in -xs[number] */
|
||||
case 'z': /* swetest: a fictitious body, number given in -xz[number] */
|
||||
case 'd': /* swetest: default (main) factors 0123456789mtABC */
|
||||
@@ -2001,13 +2116,13 @@ static int32 call_rise_set(double t_ut, int32 ipl, char *star, int32 whicheph, i
|
||||
{
|
||||
int ii;
|
||||
int32 rsmi = 0;
|
||||
double tret[10];
|
||||
double tret[10], tret1sv = 0;
|
||||
double t0, t1;
|
||||
int32 retc = OK;
|
||||
swe_set_topo(geopos[0], geopos[1], geopos[2]);
|
||||
do_printf("\n");
|
||||
/* loop over days */
|
||||
for (ii = 0; ii < nstep; ii++, t_ut = tret[1] + 0.1) {
|
||||
for (ii = 0; ii < nstep; ii++, t_ut = tret1sv + 0.1) {
|
||||
*sout = '\0';
|
||||
/* swetest -rise
|
||||
* calculate and print rising and setting */
|
||||
@@ -2016,7 +2131,8 @@ static int32 call_rise_set(double t_ut, int32 ipl, char *star, int32 whicheph, i
|
||||
rsmi = SE_CALC_RISE;
|
||||
if (norefrac) rsmi |= SE_BIT_NO_REFRACTION;
|
||||
if (disccenter) rsmi |= SE_BIT_DISC_CENTER;
|
||||
if (swe_rise_trans(t_ut, ipl, star, whicheph, rsmi, geopos, 1013.25, 10, &(tret[0]), serr) != OK) {
|
||||
if (discbottom) rsmi |= SE_BIT_DISC_BOTTOM;
|
||||
if (swe_rise_trans(t_ut, ipl, star, whicheph, rsmi, geopos, datm[0], datm[1], &(tret[0]), serr) != OK) {
|
||||
do_printf(serr);
|
||||
exit(0);
|
||||
}
|
||||
@@ -2024,10 +2140,12 @@ static int32 call_rise_set(double t_ut, int32 ipl, char *star, int32 whicheph, i
|
||||
rsmi = SE_CALC_SET;
|
||||
if (norefrac) rsmi |= SE_BIT_NO_REFRACTION;
|
||||
if (disccenter) rsmi |= SE_BIT_DISC_CENTER;
|
||||
if (swe_rise_trans(t_ut, ipl, star, whicheph, rsmi, geopos, 1013.25, 10, &(tret[1]), serr) != OK) {
|
||||
if (discbottom) rsmi |= SE_BIT_DISC_BOTTOM;
|
||||
if (swe_rise_trans(t_ut, ipl, star, whicheph, rsmi, geopos, datm[0], datm[1], &(tret[1]), serr) != OK) {
|
||||
do_printf(serr);
|
||||
exit(0);
|
||||
}
|
||||
tret1sv = tret[1];
|
||||
if (time_flag & (BIT_TIME_LMT | BIT_TIME_LAT)) {
|
||||
retc = ut_to_lmt_lat(tret[0], geopos, &(tret[0]), serr);
|
||||
retc = ut_to_lmt_lat(tret[1], geopos, &(tret[1]), serr);
|
||||
@@ -2061,15 +2179,16 @@ static int32 call_rise_set(double t_ut, int32 ipl, char *star, int32 whicheph, i
|
||||
* midheaven */
|
||||
if (special_event == SP_MERIDIAN_TRANSIT) {
|
||||
/* transit over midheaven */
|
||||
if (swe_rise_trans(t_ut, ipl, star, whicheph, SE_CALC_MTRANSIT, geopos, 1013.25, 10, &(tret[0]), serr) != OK) {
|
||||
if (swe_rise_trans(t_ut, ipl, star, whicheph, SE_CALC_MTRANSIT, geopos, datm[0], datm[1], &(tret[0]), serr) != OK) {
|
||||
do_printf(serr);
|
||||
return ERR;
|
||||
}
|
||||
/* transit over lower midheaven */
|
||||
if (swe_rise_trans(t_ut, ipl, star, whicheph, SE_CALC_ITRANSIT, geopos, 1013.25, 10, &(tret[1]), serr) != OK) {
|
||||
if (swe_rise_trans(t_ut, ipl, star, whicheph, SE_CALC_ITRANSIT, geopos, datm[0], datm[1], &(tret[1]), serr) != OK) {
|
||||
do_printf(serr);
|
||||
return ERR;
|
||||
}
|
||||
tret1sv = tret[1];
|
||||
if (time_flag & (BIT_TIME_LMT | BIT_TIME_LAT)) {
|
||||
retc = ut_to_lmt_lat(tret[0], geopos, &(tret[0]), serr);
|
||||
retc = ut_to_lmt_lat(tret[1], geopos, &(tret[1]), serr);
|
||||
@@ -2198,6 +2317,7 @@ ERR) {
|
||||
sprintf(sout + strlen(sout), "%s ", hms_from_tjd(tret[7]));
|
||||
else
|
||||
strcat(sout, " - ");
|
||||
sprintf(sout + strlen(sout), "dt=%.1f", swe_deltat_ex(tret[0], whicheph, serr) * 86400.0);
|
||||
strcat(sout, "\n");
|
||||
/* global lunar eclipse */
|
||||
} else {
|
||||
@@ -2238,7 +2358,7 @@ ERR) {
|
||||
/* short output:
|
||||
* date, time of day, umbral magnitude, umbral duration, saros series, member number */
|
||||
sprintf(sout_short, "%s\t%2d.%2d.%4d\t%s\t%.3f\t%s\t%d\t%d\n", sout, jday, jmon, jyear, hms(jut,0), attr[8],s1, (int) attr[9], (int) attr[10]);
|
||||
sprintf(sout + strlen(sout), "%2d.%02d.%04d\t%s\t%.4f/%.4f\tsaros %d/%d\t%.6f\n", jday, jmon, jyear, hms(jut,BIT_LZEROES), attr[0],attr[1], (int) attr[9], (int) attr[10], t_ut);
|
||||
sprintf(sout + strlen(sout), "%2d.%02d.%04d\t%s\t%.4f/%.4f\tsaros %d/%d\t%.6f\tdt=%.2f\n", jday, jmon, jyear, hms(jut,BIT_LZEROES), attr[0],attr[1], (int) attr[9], (int) attr[10], t_ut, swe_deltat_ex(t_ut, whicheph, serr) * 86400);
|
||||
/* second line:
|
||||
* eclipse times, penumbral, partial, total begin and end */
|
||||
sprintf(sout + strlen(sout), " %s ", hms_from_tjd(tret[6]));
|
||||
@@ -2258,7 +2378,9 @@ ERR) {
|
||||
sprintf(sout + strlen(sout), "%s ", hms_from_tjd(tret[3]));
|
||||
else
|
||||
strcat(sout, " - ");
|
||||
sprintf(sout + strlen(sout), "%s\n", hms_from_tjd(tret[7]));
|
||||
sprintf(sout + strlen(sout), "%s", hms_from_tjd(tret[7]));
|
||||
sprintf(sout + strlen(sout), "dt=%.1f", swe_deltat_ex(tret[0], whicheph, serr) * 86400.0);
|
||||
strcat(sout, "\n");
|
||||
if (special_mode & SP_MODE_HOCAL) {
|
||||
swe_split_deg(jut, SE_SPLIT_DEG_ROUND_MIN, &ihou, &imin, &isec, &dfrc, &isgn);
|
||||
sprintf(sout, "\"%04d %02d %02d %02d.%02d %d\",\n", jyear, jmon, jday, ihou, imin, ecl_type);
|
||||
@@ -2315,7 +2437,7 @@ attr, direction_flag, serr)) == ERR) {
|
||||
if (!has_found) {
|
||||
ii--;
|
||||
} else {
|
||||
swe_calc(t_ut + swe_deltat(t_ut), SE_ECL_NUT, 0, x, serr);
|
||||
swe_calc(t_ut + swe_deltat_ex(t_ut, whicheph, serr), SE_ECL_NUT, 0, x, serr);
|
||||
if (time_flag & (BIT_TIME_LMT | BIT_TIME_LAT)) {
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (tret[i] != 0)
|
||||
@@ -2351,6 +2473,7 @@ attr, direction_flag, serr)) == ERR) {
|
||||
strcpy(s4, hms(fmod(tret[3] + 0.5, 1) * 24, BIT_LZEROES)),
|
||||
strcpy(s2, hms(fmod(tret[4] + 0.5, 1) * 24, BIT_LZEROES)));
|
||||
#endif
|
||||
sprintf(sout + strlen(sout), "dt=%.1f", swe_deltat_ex(tret[0], whicheph, serr) * 86400.0);
|
||||
strcat(sout, "\n");
|
||||
do_printf(sout);
|
||||
}
|
||||
@@ -2404,7 +2527,9 @@ attr, direction_flag, serr)) == ERR) {
|
||||
} else {
|
||||
strcat(sout, " - ");
|
||||
}
|
||||
sprintf(sout + strlen(sout), "%s\n", hms_from_tjd(tret[3]));
|
||||
sprintf(sout + strlen(sout), "%s", hms_from_tjd(tret[3]));
|
||||
sprintf(sout + strlen(sout), "dt=%.1f", swe_deltat_ex(tret[0], whicheph, serr) * 86400.0);
|
||||
strcat(sout, "\n");
|
||||
sprintf(sout + strlen(sout), "\t%s\t%s", strcpy(s1, dms(geopos_max[0], BIT_ROUND_MIN)), strcpy(s2, dms(geopos_max[1], BIT_ROUND_MIN)));
|
||||
strcat(sout, "\t");
|
||||
strcat(sout_short, "\t");
|
||||
@@ -2413,8 +2538,9 @@ attr, direction_flag, serr)) == ERR) {
|
||||
do_printf(serr);
|
||||
return ERR;
|
||||
}
|
||||
if (fabs(tret[0] - t_ut) > 2)
|
||||
if (fabs(tret[0] - t_ut) > 2) {
|
||||
do_printf("when_loc returns wrong date\n");
|
||||
}
|
||||
dt = (tret[3] - tret[2]) * 24 * 60;
|
||||
sprintf(s1, "%d min %4.2f sec", (int) dt, fmod(dt, 1) * 60);
|
||||
strcat(sout, s1);
|
||||
@@ -2445,6 +2571,7 @@ static int32 call_lunar_occultation(double t_ut, int32 ipl, char *star, int32 wh
|
||||
double dt, tret[30], attr[30], geopos_max[3];
|
||||
char s1[AS_MAXCH], s2[AS_MAXCH];
|
||||
AS_BOOL has_found = FALSE;
|
||||
int nloops = 0;
|
||||
/* no selective eclipse type set, set all */
|
||||
if ((search_flag & SE_ECL_ALLTYPES_SOLAR) == 0)
|
||||
search_flag |= SE_ECL_ALLTYPES_SOLAR;
|
||||
@@ -2454,10 +2581,25 @@ static int32 call_lunar_occultation(double t_ut, int32 ipl, char *star, int32 wh
|
||||
do_printf("\n");
|
||||
for (ii = 0; ii < nstep; ii++) {
|
||||
*sout = '\0';
|
||||
nloops++;
|
||||
if (nloops > SEARCH_RANGE_LUNAR_CYCLES) {
|
||||
sprintf(serr, "event search ended after %d lunar cycles at jd=%f\n", SEARCH_RANGE_LUNAR_CYCLES, t_ut);
|
||||
do_printf(serr);
|
||||
return ERR;
|
||||
}
|
||||
if (special_mode & SP_MODE_LOCAL) {
|
||||
if ((eclflag = swe_lun_occult_when_loc(t_ut, ipl, star, whicheph, geopos, tret, attr, direction_flag, serr)) == ERR) {
|
||||
/* * local search for occultation, test one lunar cycle only (SE_ECL_ONE_TRY) */
|
||||
if (ipl != SE_SUN) {
|
||||
search_flag &= ~(SE_ECL_ANNULAR|SE_ECL_ANNULAR_TOTAL);
|
||||
if (search_flag == 0)
|
||||
search_flag = SE_ECL_ALLTYPES_SOLAR;
|
||||
}
|
||||
if ((eclflag = swe_lun_occult_when_loc(t_ut, ipl, star, whicheph, geopos, tret, attr, direction_flag|SE_ECL_ONE_TRY, serr)) == ERR) {
|
||||
do_printf(serr);
|
||||
return ERR;
|
||||
} else if (eclflag == 0) { /* event not found, try next conjunction */
|
||||
t_ut = tret[0] + direction * 10; /* try again with start date increased by 10 */
|
||||
ii--;
|
||||
} else {
|
||||
t_ut = tret[0];
|
||||
if (time_flag & (BIT_TIME_LMT | BIT_TIME_LAT)) {
|
||||
@@ -2525,17 +2667,23 @@ static int32 call_lunar_occultation(double t_ut, int32 ipl, char *star, int32 wh
|
||||
strcpy(s4, hms(fmod(tret[3] + 0.5, 1) * 24, BIT_LZEROES)),
|
||||
strcpy(s2, hms(fmod(tret[4] + 0.5, 1) * 24, BIT_LZEROES)));
|
||||
#endif
|
||||
sprintf(sout + strlen(sout), "dt=%.1f", swe_deltat_ex(tret[0], whicheph, serr) * 86400.0);
|
||||
strcat(sout, "\n");
|
||||
do_printf(sout);
|
||||
}
|
||||
}
|
||||
} /* endif search_local */
|
||||
if (!(special_mode & SP_MODE_LOCAL)) {
|
||||
/* * global search for occultations */
|
||||
if ((eclflag = swe_lun_occult_when_glob(t_ut, ipl, star, whicheph, search_flag, tret, direction_flag, serr)) == ERR) {
|
||||
/* * global search for occultations, test one lunar cycle only (SE_ECL_ONE_TRY) */
|
||||
if ((eclflag = swe_lun_occult_when_glob(t_ut, ipl, star, whicheph, search_flag, tret, direction_flag|SE_ECL_ONE_TRY, serr)) == ERR) {
|
||||
do_printf(serr);
|
||||
return ERR;
|
||||
}
|
||||
if (eclflag == 0) { /* no occltation was found at next conjunction, try next conjunction */
|
||||
t_ut = tret[0] + direction;
|
||||
ii--;
|
||||
continue;
|
||||
}
|
||||
if ((eclflag & SE_ECL_TOTAL)) {
|
||||
strcpy(sout, "total ");
|
||||
ecl_type = ECL_SOL_TOTAL;
|
||||
@@ -2573,7 +2721,9 @@ static int32 call_lunar_occultation(double t_ut, int32 ipl, char *star, int32 wh
|
||||
sprintf(sout + strlen(sout), "%s ", hms_from_tjd(tret[5]));
|
||||
else
|
||||
strcat(sout, " - ");
|
||||
sprintf(sout + strlen(sout), "%s\n", hms_from_tjd(tret[3]));
|
||||
sprintf(sout + strlen(sout), "%s", hms_from_tjd(tret[3]));
|
||||
sprintf(sout + strlen(sout), "dt=%.1f", swe_deltat_ex(tret[0], whicheph, serr) * 86400.0);
|
||||
strcat(sout, "\n");
|
||||
sprintf(sout + strlen(sout), "\t%s\t%s", strcpy(s1, dms(geopos_max[0], BIT_ROUND_MIN)), strcpy(s2, dms(geopos_max[1], BIT_ROUND_MIN)));
|
||||
if (!(eclflag & SE_ECL_PARTIAL) && !(eclflag & SE_ECL_NONCENTRAL)) {
|
||||
if ((eclflag = swe_lun_occult_when_loc(t_ut - 10, ipl, star, whicheph, geopos_max, tret, attr, 0, serr)) == ERR) {
|
||||
@@ -2785,10 +2935,14 @@ static int do_special_event(double tjd, int32 ipl, char *star, int32 special_eve
|
||||
return retc;
|
||||
}
|
||||
|
||||
static char *hms_from_tjd(double x)
|
||||
static char *hms_from_tjd(double tjd)
|
||||
{
|
||||
static char s[AS_MAXCH];
|
||||
sprintf(s, "%s ", hms(fmod(x + 1000000.5, 1) * 24, BIT_LZEROES));
|
||||
double x;
|
||||
/* tjd may be negative, 0h corresponds to day number 9999999.5 */
|
||||
x = fmod(tjd, 1); /* may be negative ! */
|
||||
x = fmod(x + 1.5, 1); /* is positive day fraction */
|
||||
sprintf(s, "%s ", hms(x * 24, BIT_LZEROES));
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -2831,9 +2985,6 @@ static int make_ephemeris_path(int32 iflg, char *argv0, char *path)
|
||||
char *sp;
|
||||
char *dirglue = DIR_GLUE;
|
||||
size_t pathlen = 0;
|
||||
/* moshier needs no ephemeris path */
|
||||
if (iflg & SEFLG_MOSEPH)
|
||||
return OK;
|
||||
/* current working directory */
|
||||
sprintf(path, ".%c", *PATH_SEPARATOR);
|
||||
/* program directory */
|
||||
|
@@ -4,6 +4,7 @@ LDADD = $(top_builddir)/src/libswe-glib-2.0.la
|
||||
DEFS = -DG_LOG_DOMAIN=\"SWE-GLib\"
|
||||
AM_CPPFLAGS = $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) $(LIBSWE_CFLAGS) -I$(top_srcdir)/src
|
||||
AM_CFLAGS = -g
|
||||
AM_LDFLAGS = $(GOBJECT_LIBS)
|
||||
|
||||
test_programs = gswe-timestamp-test
|
||||
TESTS += $(test_programs)
|
||||
|
@@ -6,72 +6,390 @@
|
||||
|
||||
#include "test-asserts.h"
|
||||
|
||||
struct testdata_t {
|
||||
gint year;
|
||||
guint month;
|
||||
guint day;
|
||||
guint hour;
|
||||
guint minute;
|
||||
guint second;
|
||||
guint ms;
|
||||
gdouble tz;
|
||||
gdouble jdet;
|
||||
gdouble jdut;
|
||||
gdouble jdsr;
|
||||
};
|
||||
|
||||
static struct testdata_t td[] = {
|
||||
{ 1983, 3, 7, 11, 54, 45, 948, 1.0, 2445400.954699264, 3, 4 },
|
||||
{ 2013, 9, 1, 13, 52, 18, 419, 2.0, 2456536.994646754, 3, 4 },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
/* Test Gregorian date values */
|
||||
static void
|
||||
test_timestamp_jd(void)
|
||||
test_timestamp_gregorian(void)
|
||||
{
|
||||
GsweTimestamp *timestamp;
|
||||
gdouble jd,
|
||||
seconds;
|
||||
GError *err = NULL;
|
||||
gint year;
|
||||
guint month, day, hour, minute, second, ms;
|
||||
gdouble tz;
|
||||
|
||||
/* Create timestamp from testdata */
|
||||
timestamp = gswe_timestamp_new_from_gregorian_full(
|
||||
1983, 3, 7,
|
||||
11, 54, 45, 0,
|
||||
1.0
|
||||
td[0].year, td[0].month, td[0].day,
|
||||
td[0].hour, td[0].minute, td[0].second, td[0].ms,
|
||||
td[0].tz
|
||||
);
|
||||
g_assert(timestamp);
|
||||
g_assert_nonnull(timestamp);
|
||||
|
||||
jd = gswe_timestamp_get_julian_day_et(timestamp, NULL);
|
||||
/* Check for Gregorian validity */
|
||||
|
||||
g_object_unref(timestamp);
|
||||
/* Set year, get year */
|
||||
gswe_timestamp_set_gregorian_year(timestamp, td[1].year, &err);
|
||||
g_assert_null(err);
|
||||
|
||||
timestamp = gswe_timestamp_new_from_julian_day(jd);
|
||||
g_assert(timestamp);
|
||||
gswe_timestamp_set_gregorian_timezone(timestamp, 1.0, NULL);
|
||||
g_assert_cmpfloat(
|
||||
gswe_timestamp_get_gregorian_timezone(timestamp),
|
||||
==,
|
||||
1.0
|
||||
);
|
||||
g_assert_cmpint(
|
||||
gswe_timestamp_get_gregorian_year(timestamp, NULL),
|
||||
==,
|
||||
1983
|
||||
);
|
||||
g_assert_cmpuint(
|
||||
gswe_timestamp_get_gregorian_month(timestamp, NULL),
|
||||
==,
|
||||
3
|
||||
);
|
||||
g_assert_cmpuint(gswe_timestamp_get_gregorian_day(timestamp, NULL), ==, 7);
|
||||
g_assert_cmpuint(
|
||||
gswe_timestamp_get_gregorian_hour(timestamp, NULL),
|
||||
==,
|
||||
11
|
||||
);
|
||||
g_assert_cmpuint(
|
||||
gswe_timestamp_get_gregorian_minute(timestamp, NULL),
|
||||
==,
|
||||
54
|
||||
);
|
||||
year = gswe_timestamp_get_gregorian_year(timestamp, &err);
|
||||
g_assert_null(err);
|
||||
g_assert_cmpint(year, ==, td[1].year);
|
||||
|
||||
seconds =
|
||||
gswe_timestamp_get_gregorian_second(timestamp, NULL)
|
||||
+ gswe_timestamp_get_gregorian_microsecond(timestamp, NULL) / 1000.0;
|
||||
/* Set month, get month */
|
||||
gswe_timestamp_set_gregorian_month(timestamp, td[1].month, &err);
|
||||
g_assert_null(err);
|
||||
|
||||
/* Due to floating point errors, we allow 5 microseconds fuzzyness here */
|
||||
gswe_assert_fuzzy_equals(
|
||||
seconds,
|
||||
45.0,
|
||||
0.005
|
||||
month = gswe_timestamp_get_gregorian_month(timestamp, &err);
|
||||
g_assert_null(err);
|
||||
g_assert_cmpuint(month, ==, td[1].month);
|
||||
|
||||
/* Set day, get day */
|
||||
gswe_timestamp_set_gregorian_day(timestamp, td[1].day, &err);
|
||||
g_assert_null(err);
|
||||
|
||||
day = gswe_timestamp_get_gregorian_day(timestamp, &err);
|
||||
g_assert_null(err);
|
||||
g_assert_cmpuint(day, ==, td[1].day);
|
||||
|
||||
/* Set hour, get hour */
|
||||
gswe_timestamp_set_gregorian_hour(timestamp, td[1].hour, &err);
|
||||
g_assert_null(err);
|
||||
|
||||
hour = gswe_timestamp_get_gregorian_hour(timestamp, &err);
|
||||
g_assert_null(err);
|
||||
g_assert_cmpuint(hour, ==, td[1].hour);
|
||||
|
||||
/* Set minute, get minute */
|
||||
gswe_timestamp_set_gregorian_minute(timestamp, td[1].minute, &err);
|
||||
g_assert_null(err);
|
||||
|
||||
minute = gswe_timestamp_get_gregorian_minute(timestamp, &err);
|
||||
g_assert_null(err);
|
||||
g_assert_cmpuint(minute, ==, td[1].minute);
|
||||
|
||||
/* Set second, get second */
|
||||
gswe_timestamp_set_gregorian_second(timestamp, td[1].second, &err);
|
||||
g_assert_null(err);
|
||||
|
||||
second = gswe_timestamp_get_gregorian_second(timestamp, &err);
|
||||
g_assert_null(err);
|
||||
g_assert_cmpuint(second, ==, td[1].second);
|
||||
|
||||
/* Set ms, get ms */
|
||||
gswe_timestamp_set_gregorian_microsecond(timestamp, td[1].ms, &err);
|
||||
g_assert_null(err);
|
||||
|
||||
ms = gswe_timestamp_get_gregorian_microsecond(timestamp, &err);
|
||||
g_assert_null(err);
|
||||
g_assert_cmpuint(ms, ==, td[1].ms);
|
||||
|
||||
/* Set tz, get tz */
|
||||
gswe_timestamp_set_gregorian_timezone(timestamp, td[1].tz, &err);
|
||||
g_assert_null(err);
|
||||
|
||||
tz = gswe_timestamp_get_gregorian_timezone(timestamp);
|
||||
g_assert_cmpfloat(tz, ==, td[1].tz);
|
||||
|
||||
/* Set full, check all */
|
||||
gswe_timestamp_set_gregorian_full(
|
||||
timestamp,
|
||||
td[0].year, td[0].month, td[0].day,
|
||||
td[0].hour, td[0].minute, td[0].second, td[0].ms,
|
||||
td[0].tz,
|
||||
&err
|
||||
);
|
||||
g_assert_null(err);
|
||||
g_object_get(
|
||||
timestamp,
|
||||
"gregorian-year", &year,
|
||||
"gregorian-month", &month,
|
||||
"gregorian-day", &day,
|
||||
"gregorian-hour", &hour,
|
||||
"gregorian-minute", &minute,
|
||||
"gregorian-second", &second,
|
||||
"gregorian-microsecond", &ms,
|
||||
"gregorian-timezone-offset", &tz,
|
||||
NULL
|
||||
);
|
||||
g_assert_cmpint(year, ==, td[0].year);
|
||||
g_assert_cmpuint(month, ==, td[0].month);
|
||||
g_assert_cmpuint(day, ==, td[0].day);
|
||||
g_assert_cmpuint(hour, ==, td[0].hour);
|
||||
g_assert_cmpuint(minute, ==, td[0].minute);
|
||||
g_assert_cmpuint(second, ==, td[0].second);
|
||||
g_assert_cmpuint(ms, ==, td[0].ms);
|
||||
g_assert_cmpfloat(tz, ==, td[0].tz);
|
||||
|
||||
g_clear_object(×tamp);
|
||||
}
|
||||
|
||||
/* Check timezone mangling */
|
||||
static void
|
||||
test_timestamp_timezone(void)
|
||||
{
|
||||
GsweTimestamp *timestamp;
|
||||
gdouble tz, val_old, val_new;
|
||||
guint hour, minute, second, ms;
|
||||
GError *err = NULL;
|
||||
|
||||
/* Create timestamp */
|
||||
timestamp = gswe_timestamp_new_from_gregorian_full(
|
||||
td[0].year, td[0].month, td[0].day,
|
||||
td[0].hour, td[0].minute, td[0].second, td[0].ms,
|
||||
td[0].tz
|
||||
);
|
||||
g_assert_nonnull(timestamp);
|
||||
|
||||
/* Change timezone */
|
||||
if (td[0].tz >= 23.0) {
|
||||
tz = td[0].tz - 1;
|
||||
} else {
|
||||
tz = td[0].tz + 1;
|
||||
}
|
||||
|
||||
/* Check hour, minute, second and microsecond */
|
||||
val_old = (td[0].hour * 3600)
|
||||
+ (td[0].minute * 60)
|
||||
+ td[0].second
|
||||
+ (td[0].ms / 1000.0);
|
||||
|
||||
gswe_timestamp_set_gregorian_timezone(timestamp, tz, &err);
|
||||
g_assert_null(err);
|
||||
|
||||
g_object_get(
|
||||
timestamp,
|
||||
"gregorian-hour", &hour,
|
||||
"gregorian-minute", &minute,
|
||||
"gregorian-second", &second,
|
||||
"gregorian-microsecond", &ms,
|
||||
NULL
|
||||
);
|
||||
val_new = (hour * 3600)
|
||||
+ (minute * 60)
|
||||
+ second
|
||||
+ (ms / 1000.0);
|
||||
|
||||
g_assert_cmpfloat(val_new, !=, val_old);
|
||||
|
||||
g_clear_object(×tamp);
|
||||
}
|
||||
|
||||
/* Test Julian Day (Ephemeris Time) properties */
|
||||
static void
|
||||
test_timestamp_jdet(void)
|
||||
{
|
||||
GsweTimestamp *timestamp;
|
||||
gdouble jdet;
|
||||
GError *err = NULL;
|
||||
|
||||
/* Create timestamp */
|
||||
timestamp = gswe_timestamp_new_from_julian_day(td[0].jdet);
|
||||
g_assert_nonnull(timestamp);
|
||||
|
||||
/* Check value */
|
||||
jdet = gswe_timestamp_get_julian_day_et(timestamp, &err);
|
||||
g_assert_null(err);
|
||||
gswe_assert_fuzzy_equals(jdet, td[0].jdet, 0.000001);
|
||||
|
||||
/* Set new value */
|
||||
gswe_timestamp_set_julian_day_et(timestamp, td[1].jdet, &err);
|
||||
g_assert_null(err);
|
||||
|
||||
/* Check value */
|
||||
jdet = gswe_timestamp_get_julian_day_et(timestamp, &err);
|
||||
g_assert_null(err);
|
||||
gswe_assert_fuzzy_equals(jdet, td[1].jdet, 0.000001);
|
||||
|
||||
/* Set via property */
|
||||
g_object_set(timestamp,
|
||||
"julian-day", td[0].jdet,
|
||||
NULL);
|
||||
jdet = gswe_timestamp_get_julian_day_et(timestamp, &err);
|
||||
gswe_assert_fuzzy_equals(jdet, td[0].jdet, 0.000001);
|
||||
g_object_get(timestamp,
|
||||
"julian-day", &jdet,
|
||||
NULL);
|
||||
gswe_assert_fuzzy_equals(jdet, td[0].jdet, 0.000001);
|
||||
|
||||
g_clear_object(×tamp);
|
||||
}
|
||||
|
||||
/* Test Julian Day (Universal Time) properties */
|
||||
static void
|
||||
test_timestamp_jdut(void)
|
||||
{}
|
||||
|
||||
/* Test instant-recalc property */
|
||||
static void
|
||||
test_timestamp_instant(void)
|
||||
{
|
||||
GsweTimestamp *timestamp;
|
||||
gboolean instrecalc, greg_valid, jul_valid;
|
||||
GError *err = NULL;
|
||||
|
||||
timestamp = gswe_timestamp_new_from_now_local();
|
||||
g_assert_nonnull(timestamp);
|
||||
|
||||
g_object_get(
|
||||
timestamp,
|
||||
"instant-recalc", &instrecalc,
|
||||
"gregorian-valid", &greg_valid,
|
||||
"julian-day-valid", &jul_valid,
|
||||
NULL);
|
||||
g_assert_false(instrecalc);
|
||||
g_assert_true(greg_valid);
|
||||
g_assert_false(jul_valid);
|
||||
|
||||
g_object_set(timestamp, "instant-recalc", TRUE, NULL);
|
||||
g_object_get(
|
||||
timestamp,
|
||||
"instant-recalc", &instrecalc,
|
||||
"gregorian-valid", &greg_valid,
|
||||
"julian-day-valid", &jul_valid,
|
||||
NULL);
|
||||
g_assert_true(instrecalc);
|
||||
g_assert_true(greg_valid);
|
||||
g_assert_true(jul_valid);
|
||||
|
||||
g_object_set(timestamp, "instant-recalc", FALSE, NULL);
|
||||
gswe_timestamp_set_now_local(timestamp, &err);
|
||||
g_assert_null(err);
|
||||
g_object_get(
|
||||
timestamp,
|
||||
"instant-recalc", &instrecalc,
|
||||
"gregorian-valid", &greg_valid,
|
||||
"julian-day-valid", &jul_valid,
|
||||
NULL);
|
||||
g_assert_false(instrecalc);
|
||||
g_assert_true(greg_valid);
|
||||
g_assert_false(jul_valid);
|
||||
}
|
||||
|
||||
/* Test Gregorian Date to Julian Day conversion */
|
||||
static void
|
||||
test_timestamp_conv_gregjd(void)
|
||||
{
|
||||
GsweTimestamp *timestamp;
|
||||
gdouble jdet, tz_jdet;
|
||||
GError *err = NULL;
|
||||
|
||||
/* Create timestamp from testdata */
|
||||
timestamp = gswe_timestamp_new_from_gregorian_full(
|
||||
td[1].year, td[1].month, td[1].day,
|
||||
td[1].hour, td[1].minute, td[1].second, td[1].ms,
|
||||
td[1].tz
|
||||
);
|
||||
g_assert_nonnull(timestamp);
|
||||
|
||||
jdet = gswe_timestamp_get_julian_day_ut(timestamp, &err);
|
||||
g_assert_null(err);
|
||||
|
||||
/* Allow 5ms of fuzzyness here */
|
||||
gswe_assert_fuzzy_equals(
|
||||
jdet,
|
||||
td[1].jdet,
|
||||
0.0001
|
||||
);
|
||||
|
||||
/* Julian Day should not change if only the timezone changes */
|
||||
td[1].tz += 1.0;
|
||||
tz_jdet = gswe_timestamp_get_julian_day_ut(timestamp, &err);
|
||||
g_assert_cmpfloat(jdet, ==, tz_jdet);
|
||||
|
||||
g_clear_object(×tamp);
|
||||
}
|
||||
|
||||
/* Julian Day to Gregorian Date conversion */
|
||||
static void
|
||||
test_timestamp_conv_jdgreg(void)
|
||||
{
|
||||
GsweTimestamp *timestamp;
|
||||
guint year, month, day, hour, minute, second, ms;
|
||||
gdouble tz;
|
||||
gboolean gregorian_valid, julian_valid;
|
||||
GError *err = NULL;
|
||||
|
||||
timestamp = gswe_timestamp_new_from_julian_day(td[0].jdet);
|
||||
g_assert_nonnull(timestamp);
|
||||
g_object_get(timestamp,
|
||||
"gregorian-valid", &gregorian_valid,
|
||||
"julian-day-valid", &julian_valid,
|
||||
"gregorian-timezone-offset", &tz,
|
||||
NULL);
|
||||
g_assert_true(julian_valid);
|
||||
g_assert_cmpfloat(0.0, ==, tz);
|
||||
|
||||
gswe_timestamp_set_gregorian_timezone(timestamp, td[0].tz, &err);
|
||||
g_object_get(
|
||||
timestamp,
|
||||
"gregorian-year", &year,
|
||||
"gregorian-month", &month,
|
||||
"gregorian-day", &day,
|
||||
"gregorian-hour", &hour,
|
||||
"gregorian-minute", &minute,
|
||||
"gregorian-second", &second,
|
||||
"gregorian-microsecond", &ms,
|
||||
"gregorian-timezone-offset", &tz,
|
||||
NULL
|
||||
);
|
||||
g_assert_cmpint(year, ==, td[0].year);
|
||||
g_assert_cmpuint(month, ==, td[0].month);
|
||||
g_assert_cmpuint(day, ==, td[0].day);
|
||||
g_assert_cmpuint(hour, ==, td[0].hour);
|
||||
gswe_assert_fuzzy_equals(minute, td[0].minute, 1);
|
||||
|
||||
/* The following lines are commented out, as they will always fail
|
||||
* with the current precision of the test data.
|
||||
|
||||
g_assert_cmpuint(minute, ==, td[0].minute);
|
||||
g_assert_cmpuint(second, ==, td[0].second);
|
||||
g_assert_cmpuint(ms, ==, td[0].ms);
|
||||
*/
|
||||
g_assert_cmpfloat(tz, ==, td[0].tz); }
|
||||
|
||||
/* Sidereal time tests */
|
||||
static void
|
||||
test_timestamp_sidereal(void)
|
||||
{}
|
||||
|
||||
/* timestamp_now_* tests */
|
||||
static void
|
||||
test_timestamp_now(void)
|
||||
{}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
g_test_init(&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func("/gswe-timestamp/jd", test_timestamp_jd);
|
||||
g_test_add_func("/gswe/timestamp/gregorian", test_timestamp_gregorian);
|
||||
g_test_add_func("/gswe/timestamp/timezone", test_timestamp_timezone);
|
||||
g_test_add_func("/gswe/timestamp/jdet", test_timestamp_jdet);
|
||||
g_test_add_func("/gswe/timestamp/jdut", test_timestamp_jdut);
|
||||
g_test_add_func("/gswe/timestamp/instant", test_timestamp_instant);
|
||||
g_test_add_func("/gswe/timestamp/conv/greg_jd", test_timestamp_conv_gregjd);
|
||||
g_test_add_func("/gswe/timestamp/conv/jd_greg", test_timestamp_conv_jdgreg);
|
||||
g_test_add_func("/gswe/timestamp/sidereal", test_timestamp_sidereal);
|
||||
g_test_add_func("/gswe/timestamp/now", test_timestamp_now);
|
||||
|
||||
return g_test_run();
|
||||
}
|
||||
|
@@ -24,4 +24,43 @@
|
||||
} \
|
||||
} G_STMT_END
|
||||
|
||||
/* g_assert_null() and g_assert_nonnull() were defined in 2.36 and
|
||||
* 2.40. Requiring a newer GLib just because of this would be an
|
||||
* overkill, so let's just backport them:
|
||||
*/
|
||||
#ifndef g_assert_null
|
||||
#define g_assert_null(expr) do { if G_LIKELY ((expr) == NULL) ; else \
|
||||
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
"'" #expr "' should be NULL"); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#ifndef g_assert_nonnull
|
||||
#define g_assert_nonnull(expr) do { if G_LIKELY ((expr) != NULL) ; else \
|
||||
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
"'" #expr "' should not be NULL"); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/* g_assert_true() and g_assert_false() were defined in 2.38. Requiring
|
||||
* a newer GLib just because of this would be an overkill, so let's just
|
||||
* backport them:
|
||||
*/
|
||||
#ifndef g_assert_true
|
||||
#define g_assert_true(expr) G_STMT_START { \
|
||||
if G_LIKELY (expr) ; else \
|
||||
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
"'" #expr "' should be TRUE"); \
|
||||
} G_STMT_END
|
||||
#endif
|
||||
|
||||
#ifndef g_assert_false
|
||||
#define g_assert_false(expr) G_STMT_START { \
|
||||
if G_LIKELY (!(expr)) ; else \
|
||||
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
"'" #expr "' should be FALSE"); \
|
||||
} G_STMT_END
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __SWE_GLIB_TEST_ASSERTS_H__ */
|
||||
|
Reference in New Issue
Block a user