Sei sulla pagina 1di 56

OVERVIEW PACKAGE CLASS TREE DEPRECATED INDEX HELP

PREV CLASS NEXT CLASS FRAMES NO FRAMES ALL CLASSES

SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

swisseph

Class SwissEph

java.lang.Object
swisseph.SwissEph

All Implemented Interfaces:


java.io.Serializable

public class SwissEph


extends java.lang.Object
implements java.io.Serializable

This class is the basic class for planetary calculations.

One important note: in all this package, negative longitudes are considered to be west of Greenwich, positive longitudes are seen as east of
Greenwich. America seems to often use a different notation!

You will find the complete documentation for the original SwissEphemeris package at
http://www.astro.ch/swisseph/sweph_g.htm. By far most of the information there is directly valid for this port to Java as well.

See Also:
Serialized Form

Constructor Summary

Constructors

Constructor and Description

SwissEph()
Constructs a new SwissEph object with the default search path for the Swiss Ephemeris data files.
SwissEph(java.lang.String path)
Constructs a new SwissEph object with the specified search path for the Swiss Ephemeris data files.

Method Summary

All Methods Static Methods Instance Methods Concrete Methods

Modifier and Type Method and Description

int calc(double jdET, int ipl, int iflag, double[] xx)


This method will probably be deprecated some time in future or change parameters.

double[] getDatafileTimerange(java.lang.String fname)


Returns the range of dates for a data file as [start, end]

double getFixstarMagnitude(java.lang.String star)


Returns the magnitude (brightness) of a fixstar.

double getFixstarMagnitude(java.lang.StringBuffer star)


Returns the magnitude (brightness) of a fixstar.

static java.lang.String getHouseobjectname(int obj)


Returns the name of the house object.

double getTransitET(TransitCalculator tc, double jdET, boolean backwards)


Searches for the next or previous transit of a planet over a specified longitude, latitude, distance or speed
value with geocentric or topocentric positions in a tropical or sidereal zodiac.

double getTransitET(TransitCalculator tc, double jdET, boolean backwards, double jdLimit)


Searches for the next or previous transit of a planet over a specified longitude, latitude, distance or speed
value with geocentric or topocentric positions in a tropical or sidereal zodiac.

double getTransitUT(TransitCalculator tc, double jdUT, boolean backwards)


Searches for the next or previous transit of a planet over a specified longitude, latitude, distance or speed
value with geocentric or topocentric positions in a tropical or sidereal zodiac.

double getTransitUT(TransitCalculator tc, double jdUT, boolean backwards, double jdLimit)


Searches for the next or previous transit of a planet over a specified longitude, latitude, distance or speed
value with geocentric or topocentric positions in a tropical or sidereal zodiac.

protected java.lang.String[] readFixstarParameters(java.lang.StringBuffer star, java.lang.StringBuffer serr)

void setHttpBufSize(int size)


This sets the buffer size for access to Swiss Ephemeris or JPL data files, if you specify an http-URL in
swe_set_ephe_path() or via the SwissEph constructor.

void setTransitSpeedsfile(java.lang.String fname, boolean writeable)


-- NOT YET IMPLEMENTED -- File to read from and write to the maximum and minimum speeds of
planets and other objects.

void swe_azalt_rev(double tjd_ut, int calc_flag, double[] geopos, double[] xin,


double[] xout)
Computes either ecliptic or equatorial coordinates from azimuth and true altitude.

void swe_azalt(double tjd_ut, int calc_flag, double[] geopos, double atpress, double attemp,
double[] xin, double[] xaz)
Computes the azimut and height from either ecliptic or equatorial coordinates.

int swe_calc_ut(double tjd_ut, int ipl, int iflag, double[] xx,


java.lang.StringBuffer serr)
This is the main calculation routine for all planets, asteroids, lunar nodes and apogees.

int swe_calc(double tjd, int ipl, int iflag, double[] xx, java.lang.StringBuffer serr)
This is the main calculation routine for all planets, asteroids, lunar nodes and apogees.

void swe_close()

protected int swe_fixstar_mag(java.lang.StringBuffer star, double[] mag, java.lang.StringBuffer serr)


Returns the magnitude (brightness) of a fixstar.

int swe_fixstar_ut(java.lang.StringBuffer star, double tjd_ut, int iflag, double[] xx,


java.lang.StringBuffer serr)
Computes fixed stars.

int swe_fixstar(java.lang.StringBuffer star, double tjd, int iflag, double[] xx,


java.lang.StringBuffer serr)
Computes fixed stars.
int swe_gauquelin_sector(double t_ut, int ipl, java.lang.StringBuffer starname, int iflag,
int imeth, double[] geopos, double atpress, double attemp, DblObj dgsect,
java.lang.StringBuffer serr)
Finds the gauquelin sector position of a planet or fixed star.

java.lang.String swe_get_ayanamsa_name(int isidmode)

double swe_get_ayanamsa_ut(double tjd_ut)


This calculates the ayanamsha for a given date.

double swe_get_ayanamsa(double tjd_et)


This calculates the ayanamsha for a given date.

java.lang.String swe_get_planet_name(int ipl)


This will return the planet name for the given planet number.

java.lang.String swe_house_name(char hsys)


The function returns the name of the house system.

double swe_house_pos(double armc, double geolat, double eps, int hsys, double[] xpin,
java.lang.StringBuffer serr)
The function returns a value between 1.0 and 12.999999, indicating in which house a planet is and how far
from its cusp it is.

int swe_houses_armc(double armc, double geolat, double eps, int hsys, double[] cusp,
double[] ascmc)
Calculates the house positions and other vital points.

int swe_houses(double tjd_ut, int iflag, double geolat, double geolon, int hsys,
double[] cusp, double[] ascmc)
Calculates the house positions and other vital points.

int swe_houses(double tjd_ut, int iflag, double geolat, double geolon, int hsys,
double[] cusp, double[] ascmc, int aOffs)

java.lang.String swe_java_version()
Returns the version information of this swisseph package including the version of this java port.

int swe_lat_to_lmt(double tjd_lat, double geolon, double[] tjd_lmt,


java.lang.StringBuffer serr)
int swe_lmt_to_lat(double tjd_lmt, double geolon, double[] tjd_lat,
java.lang.StringBuffer serr)

int swe_lun_eclipse_how(double tjd_ut, int ifl, double[] geopos, double[] attr,


java.lang.StringBuffer serr)
Computes the attributes of a lunar eclipse for a given Julian Day, geographic longitude, latitude, and
height.

int swe_lun_eclipse_when_loc(double tjd_start, int ifl, double[] geopos, double[] tret,


double[] attr, int backward, java.lang.StringBuffer serr)

int swe_lun_eclipse_when(double tjd_start, int ifl, int ifltype, double[] tret,


int backward, java.lang.StringBuffer serr)
Computes the next lunar eclipse anywhere on earth.

int swe_lun_occult_when_glob(double tjd_start, int ipl, java.lang.StringBuffer starname,


int ifl, int ifltype, double[] tret, int backward, java.lang.StringBuffer serr)
Computes the next lunar occultation anywhere on earth.

int swe_lun_occult_when_loc(double tjd_start, int ipl, java.lang.StringBuffer starname,


int ifl, double[] geopos, double[] tret, double[] attr, int backward,
java.lang.StringBuffer serr)
Computes the next eclipse of any planet or fixstar at a given geographical position.

int swe_lun_occult_where(double tjd_ut, int ipl, java.lang.StringBuffer starname, int ifl,


double[] geopos, double[] attr, java.lang.StringBuffer serr)
Computes the geographic location for a given time, where a planet occultation by the moon is central or
maximum for a non-central occultation.

int swe_nod_aps_ut(double tjd_ut, int ipl, int iflag, int method, double[] xnasc,
double[] xndsc, double[] xperi, double[] xaphe, java.lang.StringBuffer serr)
Computes planetary nodes and apsides (perihelia, aphelia, second focal points of the orbital ellipses).

int swe_nod_aps(double tjd_et, int ipl, int iflag, int method, double[] xnasc,
double[] xndsc, double[] xperi, double[] xaphe, java.lang.StringBuffer serr)
Computes planetary nodes and apsides (perihelia, aphelia, second focal points of the orbital ellipses).

int swe_pheno_ut(double tjd_ut, int ipl, int iflag, double[] attr,


java.lang.StringBuffer serr)
Computes phase, phase angel, elongation, apparent diameter and apparent magnitude for sun, moon, all
planets and asteroids.

int swe_pheno(double tjd, int ipl, int iflag, double[] attr, java.lang.StringBuffer serr)
Computes phase, phase angel, elongation, apparent diameter and apparent magnitude for sun, moon, all
planets and asteroids.

double swe_refrac_extended(double inalt, double geoalt, double atpress, double lapse_rate,


double attemp, int calc_flag, double[] dret)
Calculates the true altitude from the apparent altitude or vice versa.

double swe_refrac(double inalt, double atpress, double attemp, int calc_flag)


Calculates the true altitude from the apparent altitude or vice versa.

int swe_rise_trans_true_hor(double tjd_ut, int ipl, java.lang.StringBuffer starname,


int epheflag, int rsmi, double[] geopos, double atpress, double attemp, double horhgt,
DblObj tret, java.lang.StringBuffer serr)
Same as swe_rise_trans(), but allows to define the height of the horizon at the point of the rising or setting
(horhgt) in degree.

int swe_rise_trans(double tjd_ut, int ipl, java.lang.StringBuffer starname, int epheflag,


int rsmi, double[] geopos, double atpress, double attemp, DblObj tret,
java.lang.StringBuffer serr)
Calculates the times of rising, setting and meridian transits for all planets, asteroids, the moon, and the
fixed stars.

void swe_set_ephe_path(java.lang.String path)


This sets the search path for the ephemeris data files.

void swe_set_jpl_file(java.lang.String fname)


This sets the name of the file that contains the ephemeris data for the use with the JPL ephemeris.

void swe_set_sid_mode(int sid_mode)


This sets the ayanamsha mode for sidereal planet calculations.

void swe_set_sid_mode(int sid_mode, double t0, double ayan_t0)


This sets a custom ayanamsha mode for sidereal planet calculations.

void swe_set_topo(double geolon, double geolat, double geoalt)


If you want to do calculations relative to the observer on some place on the earth rather than relative to the
center of the earth, you will want to set the geographic location with this method.

int swe_sol_eclipse_how(double tjd_ut, int ifl, double[] geopos, double[] attr,


java.lang.StringBuffer serr)
Computes the attributes of a solar eclipse for a given Julian Day, geographic longitude, latitude, and
height.

int swe_sol_eclipse_when_glob(double tjd_start, int ifl, int ifltype, double[] tret,


int backward, java.lang.StringBuffer serr)
Computes the next solar eclipse anywhere on earth.

int swe_sol_eclipse_when_loc(double tjd_start, int ifl, double[] geopos, double[] tret,


double[] attr, int backward, java.lang.StringBuffer serr)
Computes the next solar eclipse at a given geographical position.

int swe_sol_eclipse_where(double tjd_ut, int ifl, double[] geopos, double[] attr,


java.lang.StringBuffer serr)
Computes the geographic location for a given time, where a solar eclipse is central (or maximum for a non-
central eclipse).

int swe_time_equ(double tjd_ut, double[] E, java.lang.StringBuffer serr)


Returns the difference between local apparent and local mean time in days.

java.lang.String swe_version()
Returns the version information of this swisseph package.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SwissEph

public SwissEph()
Constructs a new SwissEph object with the default search path for the Swiss Ephemeris data files.

See Also:
SweConst.SE_EPHE_PATH

SwissEph

public SwissEph(java.lang.String path)

Constructs a new SwissEph object with the specified search path for the Swiss Ephemeris data files. If you want to use this class in applets, you
would have to specify the path as a valid http URL on the same www server from where your applet gets served, if the normal security
restrictions apply.
ATTENTION: This constructor sets a global parameter used in calculation of delta T when parameter path is not null.

Parameters:
path - The search path for the Swiss Ephemeris and JPL data files. If null or empty, a default path will be used.
Additionally to the '\' character, you will have to quote ':' and ';', so a path like "C:\swiss\ephe" has to be
written as "C\\:\\swiss\\ephe". You can specify multiple path elements separated by the (unquoted) ':' or ';'
character. See swe_set_ephe_path() for more information.
See Also:
SweConst.SE_EPHE_PATH, swe_set_ephe_path(java.lang.String)

Method Detail

setHttpBufSize

public void setHttpBufSize(int size)

This sets the buffer size for access to Swiss Ephemeris or JPL data files, if you specify an http-URL in swe_set_ephe_path() or via the SwissEph
constructor. The buffer size determines, how many bytes will get read on one single HTTP request. Increased buffer size will result in a reduced
number of HTTP-requests, but it will increase the amount of data to be transferred. As the access to the data is somehow random, it does not
make so much sense to increase the size arbitrarily.

Some test numbers for the calculation of sun, and for calculation of 9 planets in a row:
buffer HTTP Requests HTTP Requests
size for the sun for 9 planets
100 57 69
200 30 40
300 23 33
400 19 29
800 14 24

Parameters:
size - The size of the buffer. It defaults to 300 bytes. Values less than 100 bytes will be increased to 100 bytes,
as you will only increase the number of requests dramatically, but the amount of bytes transferred will just be
minimal less.
See Also:
swe_set_ephe_path(java.lang.String)

swe_version

public java.lang.String swe_version()

Returns the version information of this swisseph package.

Returns:
package information in the form x.yy.zz
See Also:
swe_java_version()

swe_java_version

public java.lang.String swe_java_version()

Returns the version information of this swisseph package including the version of this java port.

Returns:
package information in the form x.yy.zz_jj
See Also:
swe_version()

swe_calc_ut

public int swe_calc_ut(double tjd_ut,


int ipl,
int iflag,
double[] xx,
java.lang.StringBuffer serr)

This is the main calculation routine for all planets, asteroids, lunar nodes and apogees. See swe_calc(...) for more information.
ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
tjd_ut - The Julian Day number in UT (Universal Time).

ipl - The body to be calculated. See SweConst for a list of bodies

iflag - A flag that contains detailed specification on how the body is to be computed. See SweConst for a list of
valid flags (SEFLG_*).

xx - A double[6] in which the result is returned. See swe_calc() for the description of this parameter

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
iflag or SweConst.ERR (-1); iflag MAY have changed from input parameter!
See Also:
swe_calc(double, int, int, double[], java.lang.StringBuffer), SweDate.setGlobalTidalAcc(double)

swe_calc

public int swe_calc(double tjd,


int ipl,
int iflag,
double[] xx,
java.lang.StringBuffer serr)

This is the main calculation routine for all planets, asteroids, lunar nodes and apogees. It is equal to swe_calc_ut() with the exception that the
time has to be given in ET (Ephemeris Time or Dynamical Time). You would get ET by adding deltaT to the UT, e.g.,
tjd_et + SweDate.getDeltaT(tjd_et).

The parameter xx is used as an output parameter containing the following info:

xx[0]: longitude
xx[1]: latitude
xx[2]: distance in AU
xx[3]: speed in longitude (degree / day)
xx[4]: speed in latitude (degree / day)
xx[5]: speed in distance (AU / day)

The speed infos will be calculated only, if the appropriate SEFLG_* switch is set.

Parameters:
tjd - The Julian Day number in ET (UT + deltaT).

ipl - The body to be calculated. See SweConst for a list of bodies

iflag - A flag that contains detailed specification on how the body is to be computed. See SweConst for a list of
valid flags (SEFLG_*).

xx - A double[6] in which the result is returned. See above for more details.

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
iflag or SweConst.ERR (-1); iflag MAY have changed from input parameter, when the calculation had used different
flags, e.g.: when specified SweConst.SEFLG_SWIEPH, but the ephemeris data files wheren't available, the calculation
automatically switches to Moshier calculations (SweConst.SEFLG_MOSEPH).
See Also:
swe_calc_ut(double, int, int, double[], java.lang.StringBuffer), swe_fixstar_ut(java.lang.StringBuffer, double, int,
double[], java.lang.StringBuffer), swe_fixstar(java.lang.StringBuffer, double, int, double[],
java.lang.StringBuffer)

calc
public int calc(double jdET,
int ipl,
int iflag,
double[] xx)
throws SwissephException

This method will probably be deprecated some time in future or change parameters. Use swe_calc() or swe_calc_ut() instead. ATTENTION:
This method possibly (re-)sets a global parameter used in calculation of delta T. See SweDate.setGlobalTidalAcc(double).

Parameters:
jdET - The Julian Day number in ET (UT + deltaT).

ipl - The body to be calculated. See SweConst for a list of bodies

iflag - A flag that contains detailed specification on how the body is to be computed. See SweConst for a list of
valid flags (SEFLG_*).

xx - A double[6] in which the result is returned. See above for more details.
Returns:
iflag; iflag MAY have changed from input parameter, when the calculation had used different flags, e.g.: when
specified SweConst.SEFLG_SWIEPH, but the ephemeris data files wheren't available, the calculation automatically
switches to Moshier calculations (SweConst.SEFLG_MOSEPH) and changes iflag.
Throws:
SwissephException
See Also:
swe_calc_ut(double, int, int, double[], java.lang.StringBuffer), swe_calc(double, int, int, double[],
java.lang.StringBuffer)

swe_close

public void swe_close()

swe_set_ephe_path

public void swe_set_ephe_path(java.lang.String path)


This sets the search path for the ephemeris data files. Asteroid files are searched in the subdirectories ast0 to ast9 first. Multiple path elements
are separated by a semikolon (;) or colon (:). Ephemeris path elements can be normal file system paths or http-URLs. If your elements contain
colons or semikolons or spaces or backslashes, you have to escape them with a backslash (\), e.g. "./ephe:C\\:\\ephe:http\\://th-
mack.de/datafiles" for a search path of: a) local subdirectory ephe, or, if something is not found here, b) in C:\ephe, or as a last resort c)
http://th-mack.de/datafiles.

Note: Opposed to the behaviour of the C version, the Java version does not evaluate environment variables. This is also true
for the environment variable SE_EPHE_PATH!
ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
path - The search path for the Swiss Ephemeris and JPL data files. If null or empty, a default path will be used.
Additionally to the '\' character, you will have to quote ':' and ';', so a path like "C:\swiss\ephe" has to be
written as "C\\:\\swiss\\ephe". You can specify multiple path elements separated by the (unquoted) ':' or ';'
character.
See Also:
SweDate.setGlobalTidalAcc(double)

swe_set_jpl_file

public void swe_set_jpl_file(java.lang.String fname)

This sets the name of the file that contains the ephemeris data for the use with the JPL ephemeris. It defaults to the string "de406.eph" defined
in SweConst.SE_FNAME_DFT. If a path is given in fname, the path will be cut off, as the path is given by swe_set_ephe_path(...).

Parameters:
fname - Name of the JPL data file
See Also:
SweConst.SE_FNAME_DFT, swe_set_ephe_path(java.lang.String)

swe_set_sid_mode

public void swe_set_sid_mode(int sid_mode)


This sets the ayanamsha mode for sidereal planet calculations. If you don't set the ayanamsha mode, it will default to Fagan/Bradley
(SE_SIDM_FAGAN_BRADLEY). The predefined ayanamsha modes are as follows:

SE_SIDM_FAGAN_BRADLEY
SE_SIDM_LAHIRI
SE_SIDM_DELUCE
SE_SIDM_RAMAN
SE_SIDM_USHASHASHI
SE_SIDM_KRISHNAMURTI
SE_SIDM_DJWHAL_KHUL
SE_SIDM_YUKTESHWAR
SE_SIDM_JN_BHASIN
SE_SIDM_BABYL_KUGLER1
SE_SIDM_BABYL_KUGLER2
SE_SIDM_BABYL_KUGLER3
SE_SIDM_BABYL_HUBER
SE_SIDM_BABYL_ETPSC
SE_SIDM_ALDEBARAN_15TAU
SE_SIDM_HIPPARCHOS
SE_SIDM_SASSANIAN
SE_SIDM_GALCENT_0SAG
SE_SIDM_J2000
SE_SIDM_J1900
SE_SIDM_B1950

Parameters:
sid_mode - One of the above ayanamsha modes plus (optionally) one of the non-standard sidereal calculation modes of
SE_SIDBIT_ECL_T0 or SE_SIDBIT_SSY_PLANE.
See Also:
swe_set_sid_mode(int, double, double), SweConst.SE_SIDM_FAGAN_BRADLEY, SweConst.SE_SIDM_LAHIRI,
SweConst.SE_SIDM_DELUCE, SweConst.SE_SIDM_RAMAN, SweConst.SE_SIDM_USHASHASHI, SweConst.SE_SIDM_KRISHNAMURTI,
SweConst.SE_SIDM_DJWHAL_KHUL, SweConst.SE_SIDM_YUKTESHWAR, SweConst.SE_SIDM_JN_BHASIN,
SweConst.SE_SIDM_BABYL_KUGLER1, SweConst.SE_SIDM_BABYL_KUGLER2, SweConst.SE_SIDM_BABYL_KUGLER3,
SweConst.SE_SIDM_BABYL_HUBER, SweConst.SE_SIDM_BABYL_ETPSC, SweConst.SE_SIDM_ALDEBARAN_15TAU,
SweConst.SE_SIDM_HIPPARCHOS, SweConst.SE_SIDM_SASSANIAN, SweConst.SE_SIDM_GALCENT_0SAG, SweConst.SE_SIDM_J2000,
SweConst.SE_SIDM_J1900, SweConst.SE_SIDM_B1950, SweConst.SE_SIDBIT_ECL_T0, SweConst.SE_SIDBIT_SSY_PLANE
swe_set_sid_mode

public void swe_set_sid_mode(int sid_mode,


double t0,
double ayan_t0)

This sets a custom ayanamsha mode for sidereal planet calculations. Use SE_SIDM_USER optionally together with SE_SIDBIT_ECL_T0 or
SE_SIDBIT_SSY_PLANE for custom modes.
You may want to use swe_set_sid_mode(int), if your are satisfied with the predefined ayanamsa modes.
This method is also for compatibility to the original C-source code. So you may also use any of the predefined sid_modes from
swe_set_sid_mode(int), neglecting t0 and ayan_t0 parameters.
E.g., those two calls are identical:

swe_set_sid_mode(SweConst.SE_SIDM_LAHIRI)
swe_set_sid_mode(SweConst.SE_SIDM_LAHIRI, 0, 0)

Normally, you would use this method in the sense of:

swe_set_sid_mode(SweConst.SE_SIDM_USER, 2450789.5, 23.454578)

If you don't set any ayanamsha mode via one of the swe_set_sid_mode() methods, it will default to Fagan/Bradley
(SE_SIDM_FAGAN_BRADLEY).

Parameters:
sid_mode - SweConst.SE_SIDM_USER plus (optionally) one of the non-standard sidereal calculation modes of
SE_SIDBIT_ECL_T0 or SE_SIDBIT_SSY_PLANE. You may also use any of the SE_SIDM_* parameters of swe_set_sid_mode(int).
The parameters t0 and ayan_t0 will be irrelevant in that case.

t0 - Reference date (Julian day), if sid_mode is SE_SIDM_USER

ayan_t0 - Initial ayanamsha at t0, if sid_mode is SE_SIDM_USER. This is (tropical position - sidereal position) at
date t0.
See Also:
swe_set_sid_mode(int), SweConst.SE_SIDM_USER, SweConst.SE_SIDBIT_ECL_T0, SweConst.SE_SIDBIT_SSY_PLANE

swe_get_ayanamsa

public double swe_get_ayanamsa(double tjd_et)


This calculates the ayanamsha for a given date. You should call swe_set_sid_mode(...) before, where you will set the mode of ayanamsha, as
many different ayanamshas are used in the world today.

Parameters:
tjd_et - The date as Julian Day in ET (Ephemeris Time or Dynamic Time)
Returns:
The value of the ayanamsha
See Also:
swe_set_sid_mode(int, double, double), swe_get_ayanamsa_ut(double)

swe_get_ayanamsa_ut

public double swe_get_ayanamsa_ut(double tjd_ut)

This calculates the ayanamsha for a given date. You should call swe_set_sid_mode(...) before, where you will set the mode of ayanamsha, as
many different ayanamshas are used in the world today.

Parameters:
tjd_ut - The date as Julian Day in UT (Universal Time)
Returns:
The value of the ayanamsha
See Also:
swe_set_sid_mode(int, double, double), swe_get_ayanamsa(double)

swe_fixstar

public int swe_fixstar(java.lang.StringBuffer star,


double tjd,
int iflag,
double[] xx,
java.lang.StringBuffer serr)

Computes fixed stars. This method is identical to swe_fixstar_ut() with the one exception that the time has to be given in ET (Ephemeris Time
or Dynamical Time instead of Universal Time UT). You would get ET by adding deltaT to the UT, e.g.,
tjd_et + SweDate.getDeltaT(tjd_et).

The fixed stars are defined in the file sefstars.txt and the star parameter must refer to any entry in that file. The entries in that file start with
traditional_name ,nomenclature_name,..., e.g., "Alpheratz ,alAnd,"[...].

Parameters:
star - Actually, it is an input and an output parameter at the same time. So it is not possible to define it as a
String, but rather as a StringBuffer. On input it defines the star to be calculated and can be in three forms:
- as a positive integer number meaning the star in the file sefstars.txt that is given on the line number of the
given number, without counting any comment lines beginning with #.
- as a traditional name case insensitively compared to the first name on every line in sefstars.txt.
- as a nomenclature prefixed by a comma. This name is compared in a case preserving manner to the nomenclature name
on every line in sefstars.txt.
On Output it returns the complete name (traditional plus nomenclature name), e.g. "Alpheratz,alAnd".
ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

tjd - The Julian Day in ET

iflag - Any of the SweConst.SEFLG_* flags

xx - A double[6] used as output parameter only. This returns longitude, latitude and the distance (in AU) of the
fixed stars, but it does not return any speed values in xx[3] to xx[5] as it does in swe_calc() / swe_calc_ut(),
even if you specify SweConst.SEFLG_SPEED in the flags parameter!

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
iflag or SweConst.ERR (-1); iflag MAY have changed from input parameter!
See Also:
swe_fixstar(java.lang.StringBuffer, double, int, double[], java.lang.StringBuffer),
SweDate.setGlobalTidalAcc(double)

readFixstarParameters

protected java.lang.String[] readFixstarParameters(java.lang.StringBuffer star,


java.lang.StringBuffer serr)
swe_fixstar_ut

public int swe_fixstar_ut(java.lang.StringBuffer star,


double tjd_ut,
int iflag,
double[] xx,
java.lang.StringBuffer serr)

Computes fixed stars. This method is identical to swe_fixstar() with the one exception that the time has to be given in UT (Universal Time
instead of Ephemeris Time or Dynamical Time ET).

The fixed stars are defined in the file sefstars.txt and the star parameter must refer to any entry in that file. The entries in that file start with
traditional_name ,nomenclature_name,..., e.g., "Alpheratz ,alAnd,"[...].

Parameters:
star - Actually, it is an input and an output parameter at the same time. So it is not possible to define it as a
String, but rather as a StringBuffer. On input it defines the star to be calculated and can be in three forms:
- as a positive integer number meaning the star in the file sefstars.txt that is given on the line number of the
given number, without counting any comment lines beginning with #.
- as a traditional name case insensitively compared to the first name on every line in sefstars.txt.
- as a nomenclature prefixed by a comma. This name is compared in a case preserving manner to the nomenclature name
on every line in sefstars.txt.
On Output it returns the complete name (traditional plus nomenclature name), e.g. "Alpheratz,alAnd".
ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

tjd_ut - The Julian Day in UT

iflag - Any of the SweConst.SEFLG_* flags

xx - A double[6] used as output parameter only. This returns longitude, latitude and the distance (in AU) of the
fixed stars, but it does not return any speed values in xx[3] to xx[5] as it does in swe_calc() / swe_calc_ut(),
even if you specify SweConst.SEFLG_SPEED in the flags parameter!

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
iflag or SweConst.ERR (-1); iflag MAY have changed from input parameter!
See Also:
swe_fixstar(java.lang.StringBuffer, double, int, double[], java.lang.StringBuffer),
SweDate.setGlobalTidalAcc(double)

swe_get_planet_name

public java.lang.String swe_get_planet_name(int ipl)

This will return the planet name for the given planet number. If you are looking for names of asteroids, it may be possible that no name is
available so far. The names should be found in the asteroids data file, but if nothing is found there, the name will be looked up in the file
seasnam.txt that should be more up to date and can be updated by the user. You can get a list of names from http://cfa-
www.harvard.edu/iau/lists/MPNames.html, which you would like to rename to seasnam.txt and move to your ephemeris directory.

Parameters:
ipl - The planet number
Returns:
The name of the planet

swe_get_ayanamsa_name

public java.lang.String swe_get_ayanamsa_name(int isidmode)

getHouseobjectname

public static java.lang.String getHouseobjectname(int obj)

Returns the name of the house object.

Parameters:
obj - Constant for house object
Returns:
Corresponding string for this house constant
See Also:
SweConst.SE_HOUSE1, SweConst.SE_HOUSE1, SweConst.SE_HOUSE1, SweConst.SE_HOUSE1, SweConst.SE_HOUSE1,
SweConst.SE_HOUSE1, SweConst.SE_HOUSE1, SweConst.SE_HOUSE1, SweConst.SE_HOUSE1, SweConst.SE_HOUSE10,
SweConst.SE_HOUSE11, SweConst.SE_HOUSE12, SweConst.SE_ASC, SweConst.SE_MC, SweConst.SE_ARMC, SweConst.SE_VERTEX,
SweConst.SE_EQUASC, SweConst.SE_COASC1, SweConst.SE_COASC2, SweConst.SE_POLASC

swe_set_topo

public void swe_set_topo(double geolon,


double geolat,
double geoalt)

If you want to do calculations relative to the observer on some place on the earth rather than relative to the center of the earth, you will want to
set the geographic location with this method.

Parameters:
geolon - The Longitude in degrees

geolat - The Latitude in degrees

geoalt - The height above sea level in meters

getDatafileTimerange

public double[] getDatafileTimerange(java.lang.String fname)


throws SwissephException

Returns the range of dates for a data file as [start, end]

Parameters:
fname - filename of the JPL data file. Filenames are searched for in the directories of SE_EPHE_PATH or set by
SwissEph(String) or swe_set_ephe_path().
Throws SwissephException, when file cannot be found or is not readable or seems to be damaged.
Returns:
double[2] with start and end date as julian day numbers.
Throws:
SwissephException
See Also:
SweConst.SE_EPHE_PATH, SwissEph(java.lang.String), swe_set_ephe_path(java.lang.String)

swe_azalt

public void swe_azalt(double tjd_ut,


int calc_flag,
double[] geopos,
double atpress,
double attemp,
double[] xin,
double[] xaz)

Computes the azimut and height from either ecliptic or equatorial coordinates.

xaz is an output parameter as follows:

xaz[0]: azimuth, i.e. position degree, measured from the south point to west.
xaz[1]: true altitude above horizon in degrees.
xaz[2]: apparent (refracted) altitude above horizon in degrees.

Parameters:
tjd_ut - time and date in UT

calc_flag - SweConst.SE_ECL2HOR (xin[0] contains ecliptic longitude, xin[1] the ecliptic latitude) or
SweConst.SE_EQU2HOR (xin[0] = rectascension, xin[1] = declination)

geopos - A double[3] containing the longitude, latitude and height of the geographic position. Eastern longitude and
northern latitude is given by positive values, western longitude and southern latitude by negative values.

atpress - atmospheric pressure in mBar (hPa). If it is 0, the pressure will be estimated from geopos[2] and attemp.

attemp - atmospheric temperature in degrees Celsius.

xin - double[3] with a content depending on parameter calc_flag. See there. xin[3] does not need to be defined.

xaz - Output parameter: a double[3] returning values as specified above.

swe_azalt_rev
public void swe_azalt_rev(double tjd_ut,
int calc_flag,
double[] geopos,
double[] xin,
double[] xout)

Computes either ecliptic or equatorial coordinates from azimuth and true altitude. The true altitude might be gained from an apparent altitude
by calling swe_refrac.

xout is an output parameter containing the ecliptic or equatorial coordinates, depending on the value of the parameter calc_flag.

Parameters:
tjd_ut - time and date in UT

calc_flag - SweConst.SE_HOR2ECL or SweConst.SE_HOR2EQU

geopos - A double[3] containing the longitude, latitude and height of the geographic position. Eastern longitude and
northern latitude is given by positive values, western longitude and southern latitude by negative values.

xin - double[2] with azimuth and true altitude of planet

xout - Output parameter: a double[2] returning either ecliptic or equatorial coordinates

swe_lun_eclipse_how

public int swe_lun_eclipse_how(double tjd_ut,


int ifl,
double[] geopos,
double[] attr,
java.lang.StringBuffer serr)

Computes the attributes of a lunar eclipse for a given Julian Day, geographic longitude, latitude, and height.

attr[0]: umbral magnitude at tjd


attr[1]: penumbral magnitude
attr[4]: azimuth of moon at tjd. Not yet implemented.
attr[5]: true altitude of moon above horizon at tjd. Not yet implemented.
attr[6]: apparent altitude of moon above horizon at tjd. Not yet implemented.
attr[7]: distance of moon from opposition in degrees
Attention: attr must be a double[20]!
ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
tjd_ut - The Julian Day number in UT

ifl - To indicate, which ephemeris should be used (SEFLG_JPLEPH, SEFLG_SWIEPH or SEFLG_MOSEPH)

geopos - A double[3] containing geographic longitude, latitude and height in meters above sea level in this order.
Eastern longitude and northern latitude is given by positive values, western longitude and southern latitude by
negative values.

attr - A double[20], on return containing the attributes of the eclipse as above

serr - A StringBuffer containing a warning or error message, if something fails


Returns:
-1 (SweConst.ERR), if the calculation failed
0, if there is no lunar eclipse at that time and location
otherwise:
SweConst.SE_ECL_TOTAL
SweConst.SE_ECL_PENUMBRAL
SweConst.SE_ECL_PARTIAL
See Also:
SweConst.SE_ECL_TOTAL, SweConst.SE_ECL_PENUMBRAL, SweConst.SE_ECL_PARTIAL, SweDate.setGlobalTidalAcc(double)

swe_lun_eclipse_when

public int swe_lun_eclipse_when(double tjd_start,


int ifl,
int ifltype,
double[] tret,
int backward,
java.lang.StringBuffer serr)

Computes the next lunar eclipse anywhere on earth.

tret is an output parameter with the following meaning:


tret[0]: time of maximum eclipse.
tret[1]:
tret[2]: time of the begin of partial phase.
tret[3]: time of the end of partial phaseend.
tret[4]: time of the begin of totality.
tret[5]: time of the end of totality.
tret[6]: time of the begin of center line.
tret[7]: time of the end of center line

Attention: tret must be a double[10]!


ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
tjd_start - The Julian Day number in UT, from when to start searching

ifl - To indicate, which ephemeris should be used (SEFLG_JPLEPH, SEFLG_SWIEPH or SEFLG_MOSEPH)

ifltype - SweConst.SE_ECL_TOTAL for total eclipse or 0 for any eclipse

tret - A double[10], on return containing the times of different occasions of the eclipse as above

backward - 1, if search should be done backwards. If you want to have only one conjunction of the moon with the body
tested, add the following flag: backward |= SE_ECL_ONE_TRY. If this flag is not set, the function will search for an
occultation until it finds one. For bodies with ecliptical latitudes > 5, the function may search successlessly
until it reaches the end of the ephemeris. (Note: we do not add SE_ECL_ONE_TRY to ifl, because ifl may contain
SEFLG_TOPOCTR (=SE_ECL_ONE_TRY) from the parameter iflag of swe_calc() etc. Although the topocentric flag is
irrelevant here, it might cause confusion.)

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
-1 (SweConst.ERR), if the calculation failed
otherwise:
SweConst.SE_ECL_TOTAL
SweConst.SE_ECL_ANNULAR
SweConst.SE_ECL_PARTIAL
SweConst.SE_ECL_ANNULAR_TOTAL
in combination with:
SweConst.SE_ECL_CENTRAL
SweConst.SE_ECL_NONCENTRAL
See Also:
SweConst.SE_ECL_TOTAL, SweConst.SE_ECL_ANNULAR, SweConst.SE_ECL_PARTIAL, SweConst.SE_ECL_ANNULAR_TOTAL,
SweConst.SE_ECL_CENTRAL, SweConst.SE_ECL_NONCENTRAL, SweDate.setGlobalTidalAcc(double)

swe_nod_aps

public int swe_nod_aps(double tjd_et,


int ipl,
int iflag,
int method,
double[] xnasc,
double[] xndsc,
double[] xperi,
double[] xaphe,
java.lang.StringBuffer serr)

Computes planetary nodes and apsides (perihelia, aphelia, second focal points of the orbital ellipses). This method is identical to
swe_nod_aps_ut() with the one exception that the time has to be given in ET (Ephemeris Time or Dynamical Time). You would get ET by
adding deltaT to the UT, e.g., tjd_et + SweDate.getDeltaT(tjd_et).

Parameters:
tjd_et - The time in ET

ipl - Planet number

iflag - Any of the SEFLG_* flags

method - Defines, what kind of calculation is wanted (SE_NODBIT_MEAN, SE_NODBIT_OSCU, SE_NODBIT_OSCU_BAR,


SE_NODBIT_FOPOINT)

xnasc - Output parameter of double[6]. On return it contains six doubles for the ascending node

xndsc - Output parameter of double[6]. On return it contains six doubles for the descending node

xperi - Output parameter of double[6]. On return it contains six doubles for the perihelion

xaphe - Output parameter of double[6]. On return it contains six doubles for the aphelion

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
SweConst.OK (0) or SweConst.ERR (-1)
See Also:
swe_nod_aps_ut(double, int, int, int, double[], double[], double[], double[], java.lang.StringBuffer), SweConst.OK,
SweConst.ERR, SweConst.SE_NODBIT_MEAN, SweConst.SE_NODBIT_OSCU, SweConst.SE_NODBIT_OSCU_BAR,
SweConst.SE_NODBIT_FOPOINT, SweDate.setGlobalTidalAcc(double)

swe_nod_aps_ut

public int swe_nod_aps_ut(double tjd_ut,


int ipl,
int iflag,
int method,
double[] xnasc,
double[] xndsc,
double[] xperi,
double[] xaphe,
java.lang.StringBuffer serr)

Computes planetary nodes and apsides (perihelia, aphelia, second focal points of the orbital ellipses). This method is identical to
swe_nod_aps() with the one exception that the time has to be given in UT (Universal Time) and not in ET (Ephemeris Time or Dynamical
Time).
ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
tjd_ut - The time in UT

ipl - Planet number

iflag - Any of the SEFLG_* flags

method - Defines, what kind of calculation is wanted (SE_NODBIT_MEAN, SE_NODBIT_OSCU, SE_NODBIT_OSCU_BAR,


SE_NODBIT_FOPOINT)

xnasc - Output parameter of double[6]. On return it contains six doubles for the ascending node

xndsc - Output parameter of double[6]. On return it contains six doubles for the descending node

xperi - Output parameter of double[6]. On return it contains six doubles for the perihelion

xaphe - Output parameter of double[6]. On return it contains six doubles for the aphelion
serr - A StringBuffer containing a warning or error message, if something fails.
Returns:
SweConst.OK (0) or SweConst.ERR (-1)
See Also:
swe_nod_aps(double, int, int, int, double[], double[], double[], double[], java.lang.StringBuffer), SweConst.OK,
SweConst.ERR, SweConst.SE_NODBIT_MEAN, SweConst.SE_NODBIT_OSCU, SweConst.SE_NODBIT_OSCU_BAR,
SweConst.SE_NODBIT_FOPOINT, SweDate.setGlobalTidalAcc(double)

swe_pheno

public int swe_pheno(double tjd,


int ipl,
int iflag,
double[] attr,
java.lang.StringBuffer serr)

Computes phase, phase angel, elongation, apparent diameter and apparent magnitude for sun, moon, all planets and asteroids. This method is
identical to swe_pheno_ut() with the one exception that the time has to be given in ET (Ephemeris Time or Dynamical Time). You would get ET
by adding deltaT to the UT, e.g., tjd_et + SweDate.getDeltaT(tjd_et).

See swe_pheno_ut() for missing information. Computes phase, phase angel, elongation, apparent diameter and apparent magnitude for sun,
moon, all planets and asteroids.

attr is an output parameter with the following meaning:

attr[0]: phase angle (earth-planet-sun).


attr[1]: phase (illumined fraction of disc).
attr[2]: elongation of planet.
attr[3]: apparent diameter of disc.
attr[4]: apparent magnitude.

Attention: attr must be a double[20]!


ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
tjd - The Julian Day number in ET.
ipl - The body number to be calculated. See class SweConst for a list of bodies (SE_*)

iflag - Which ephemeris is to be used (SEFLG_JPLEPH, SEFLG_SWIEPH, SEFLG_MOSEPH). Other flags: SEFLG_TRUEPOS,
SEFLG_HELCTR.

attr - A double[20] in which the result is returned. See above for more details.

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
SweConst.OK (0) or SweConst.ERR (-1)
See Also:
swe_pheno_ut(double, int, int, double[], java.lang.StringBuffer), SweConst.OK, SweConst.ERR, SweConst.SEFLG_JPLEPH,
SweConst.SEFLG_SWIEPH, SweConst.SEFLG_MOSEPH, SweConst.SEFLG_TRUEPOS, SweConst.SEFLG_HELCTR,
SweDate.setGlobalTidalAcc(double)

swe_pheno_ut

public int swe_pheno_ut(double tjd_ut,


int ipl,
int iflag,
double[] attr,
java.lang.StringBuffer serr)

Computes phase, phase angel, elongation, apparent diameter and apparent magnitude for sun, moon, all planets and asteroids.

attr is an output parameter with the following meaning:

attr[0]: phase angle (earth-planet-sun).


attr[1]: phase (illumined fraction of disc).
attr[2]: elongation of planet.
attr[3]: apparent diameter of disc.
attr[4]: apparent magnitude.

Attention: attr must be a double[20]!


ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
tjd_ut - The Julian Day number in UT (Universal Time).
ipl - The body number to be calculated. See class SweConst for a list of bodies (SE_*)

iflag - Which ephemeris is to be used (SEFLG_JPLEPH, SEFLG_SWIEPH, SEFLG_MOSEPH). Other flags: SEFLG_TRUEPOS,
SEFLG_HELCTR.

attr - A double[20] in which the result is returned. See above for more details.

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
SweConst.OK (0) or SweConst.ERR (-1)
See Also:
SweConst.OK, SweConst.ERR, SweConst.SEFLG_JPLEPH, SweConst.SEFLG_SWIEPH, SweConst.SEFLG_MOSEPH,
SweConst.SEFLG_TRUEPOS, SweConst.SEFLG_HELCTR, SweDate.setGlobalTidalAcc(double)

swe_refrac

public double swe_refrac(double inalt,


double atpress,
double attemp,
int calc_flag)

Calculates the true altitude from the apparent altitude or vice versa.

Parameters:
inalt - The true or apparent altitude to be converted

atpress - Atmospheric pressure in mBar (hPa). If it is 0, the pressure will be estimated from attemp on sea level.

attemp - Atmospheric temperature in degrees Celsius.

calc_flag - SweConst.SE_TRUE_TO_APP or SweConst.SE_APP_TO_TRUE


Returns:
The converted altitude

swe_refrac_extended
public double swe_refrac_extended(double inalt,
double geoalt,
double atpress,
double lapse_rate,
double attemp,
int calc_flag,
double[] dret)

Calculates the true altitude from the apparent altitude or vice versa.

Parameters:
inalt - The true or apparent altitude to be converted

geoalt - altitude of observer above sea level in meters

atpress - Atmospheric pressure in mBar (hPa). If it is 0, the pressure will be estimated from attemp on sea level.

attemp - Atmospheric temperature in degrees Celsius.

lapse_rate - (dattemp/dgeoalt) = [°K/m]

calc_flag - SweConst.SE_TRUE_TO_APP or SweConst.SE_APP_TO_TRUE

dret - output parameter, use a double[4] as input.

- dret[0] true altitude, if possible; otherwise input value


- dret[1] apparent altitude, if possible; otherwise input value
- dret[2] refraction
- dret[3] dip of the horizon

Returns:
The converted altitude; see parameter dret for more output values

swe_rise_trans

public int swe_rise_trans(double tjd_ut,


int ipl,
java.lang.StringBuffer starname,
int epheflag,
int rsmi,
double[] geopos,
double atpress,
double attemp,
DblObj tret,
java.lang.StringBuffer serr)

Calculates the times of rising, setting and meridian transits for all planets, asteroids, the moon, and the fixed stars.

Parameters:
tjd_ut - The Julian Day number in UT, from when to start searching

ipl - Planet number, if times for planet or moon are to be calculated.

starname - The name of the star, if times for a star should be calculated. It has to be null or the empty string
otherwise!

epheflag - To indicate, which ephemeris should be used (SEFLG_JPLEPH, SEFLG_SWIEPH or SEFLG_MOSEPH)

rsmi - Specification, what type of calculation is wanted (SE_CALC_RISE, SE_CALC_SET, SE_CALC_MTRANSIT,


SE_CALC_ITRANSIT). For SE_CALC_RISE or SE_CALC_SET you may add SE_BIT_DISC_CENTER for rise or set of the center of
the body, SE_BIT_DISC_BOTTOM for the completely visible object. Add SE_BIT_NO_REFRACTION for calculation without
refraction effects. Add SE_BIT_CIVIL_TWILIGHT or SE_BIT_NAUTIC_TWILIGHT or SE_BIT_ASTRO_TWILIGHT for civil,
nautical, or astronomical twilight. Use SE_BIT_FIXED_DISC_SIZE to neglect the effect of distance on disc size. The
calculation method defaults to SE_CALC_RISE.

geopos - A double[3] containing the longitude, latitude and height of the observer. Eastern longitude and northern
latitude is given by positive values, western longitude and southern latitude by negative values.

atpress - atmospheric pressure in mBar (hPa). If it is 0, the pressure will be estimated from geopos[2] and attemp
(1013.25 mbar for sea level). When calculating MTRANSIT or ITRANSIT, this parameter is not used.

attemp - atmospheric temperature in degrees Celsius. When calculating MTRANSIT or ITRANSIT, this parameter is not
used.

tret - Return value containing the time of rise or whatever was requested. This is UT.

serr - A StringBuffer containing a warning or error message, if something fails


Returns:
SweConst.OK (0) or SweConst.ERR (-1) or -2 if the body does not rise or set
See Also:
SweConst.OK, SweConst.ERR, SweConst.SEFLG_JPLEPH, SweConst.SEFLG_MOSEPH, SweConst.SE_CALC_RISE,
SweConst.SE_CALC_SET, SweConst.SE_CALC_MTRANSIT, SweConst.SE_CALC_ITRANSIT, SweConst.SE_BIT_DISC_CENTER,
SweConst.SE_BIT_DISC_BOTTOM, SweConst.SE_BIT_NO_REFRACTION, SweConst.SE_BIT_CIVIL_TWILIGHT,
SweConst.SE_BIT_NAUTIC_TWILIGHT, SweConst.SE_BIT_ASTRO_TWILIGHT, SweConst.SE_BIT_FIXED_DISC_SIZE, DblObj

swe_rise_trans_true_hor

public int swe_rise_trans_true_hor(double tjd_ut,


int ipl,
java.lang.StringBuffer starname,
int epheflag,
int rsmi,
double[] geopos,
double atpress,
double attemp,
double horhgt,
DblObj tret,
java.lang.StringBuffer serr)

Same as swe_rise_trans(), but allows to define the height of the horizon at the point of the rising or setting (horhgt) in degree.
ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
tjd_ut - The Julian Day number in UT, from when to start searching

ipl - Planet number, if times for planet or moon are to be calculated.

starname - The name of the star, if times for a star should be calculated. It has to be null or the empty string
otherwise!

epheflag - To indicate, which ephemeris should be used (SEFLG_JPLEPH, SEFLG_SWIEPH or SEFLG_MOSEPH)

rsmi - Specification, what type of calculation is wanted (SE_CALC_RISE, SE_CALC_SET, SE_CALC_MTRANSIT,


SE_CALC_ITRANSIT) plus optionally SE_BIT_DISC_CENTER, when the rise time of the disc center of the body is requested
and / or SE_BIT_NO_REFRACTION for calculation without refraction effects. The calculation method defaults to
SE_CALC_RISE.

geopos - A double[3] containing the longitude, latitude and height of the observer. Eastern longitude and northern
latitude is given by positive values, western longitude and southern latitude by negative values.
atpress - atmospheric pressure in mBar (hPa). If it is 0, the pressure will be estimated from geopos[2] and attemp
(1013.25 mbar for sea level). When calculating MTRANSIT or ITRANSIT, this parameter is not used.

attemp - atmospheric temperature in degrees Celsius. When calculating MTRANSIT or ITRANSIT, this parameter is not
used.

horhgt - Height of horizon in degree.

tret - Return value containing the time of rise or whatever was requested. This is UT.

serr - A StringBuffer containing a warning or error message, if something fails


Returns:
SweConst.OK (0) or SweConst.ERR (-1) or -2 if the body does not rise or set
See Also:
swe_rise_trans(double, int, StringBuffer, int, int, double[], double, double, DblObj, StringBuffer), SweConst.OK,
SweConst.ERR, SweConst.SEFLG_JPLEPH, SweConst.SEFLG_MOSEPH, SweConst.SE_CALC_RISE, SweConst.SE_CALC_SET,
SweConst.SE_CALC_MTRANSIT, SweConst.SE_CALC_ITRANSIT, SweConst.SE_BIT_DISC_CENTER, SweConst.SE_BIT_NO_REFRACTION,
DblObj, SweDate.setGlobalTidalAcc(double)

swe_sol_eclipse_how

public int swe_sol_eclipse_how(double tjd_ut,


int ifl,
double[] geopos,
double[] attr,
java.lang.StringBuffer serr)

Computes the attributes of a solar eclipse for a given Julian Day, geographic longitude, latitude, and height.

attr[0]: fraction of solar diameter covered by moon (magnitude)


attr[1]: ratio of lunar diameter to solar one
attr[2]: fraction of solar disc covered by moon (obscuration)
attr[3]: diameter of core shadow in km
attr[4]: azimuth of sun at tjd
attr[5]: true altitude of sun above horizon at tjd
attr[6]: apparent altitude of sun above horizon at tjd
attr[7]: angular distance of moon from sun in degrees
Attention: attr must be a double[20]!
ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
tjd_ut - The Julian Day number in UT

ifl - To indicate, which ephemeris should be used (SEFLG_JPLEPH, SEFLG_SWIEPH or SEFLG_MOSEPH)

geopos - A double[3] containing geographic longitude, latitude and height in meters above sea level in this order.
Eastern longitude and northern latitude is given by positive values, western longitude and southern latitude by
negative values.

attr - A double[20], on return containing the attributes of the eclipse as above

serr - A StringBuffer containing a warning or error message, if something fails


Returns:
-1 (SweConst.ERR), if the calculation failed
0, if there is no solar eclipse at that time and location
SweConst.SE_ECL_TOTAL
SweConst.SE_ECL_ANNULAR
SweConst.SE_ECL_PARTIAL
See Also:
SweConst.SE_ECL_TOTAL, SweConst.SE_ECL_ANNULAR, SweConst.SE_ECL_PARTIAL, SweConst.SEFLG_JPLEPH,
SweConst.SEFLG_MOSEPH, SweDate.setGlobalTidalAcc(double)

swe_sol_eclipse_when_glob

public int swe_sol_eclipse_when_glob(double tjd_start,


int ifl,
int ifltype,
double[] tret,
int backward,
java.lang.StringBuffer serr)

Computes the next solar eclipse anywhere on earth.

tret is an output parameter with the following meaning:


tret[0]: time of maximum eclipse.
tret[1]: time, when the eclipse takes place at local apparent noon.

tret[2]: time of the begin of the eclipse.


tret[3]: time of the end of the eclipse.
tret[4]: time of the begin of totality.
tret[5]: time of the end of totality.
tret[6]: time of the begin of center line.
tret[7]: time of the end of center line
tret[8]: time, when annular-total eclipse becomes total -- Not yet implemented.
tret[9]: time, when annular-total eclipse becomes annular again -- Not yet implemented.

Attention: tret must be a double[10]!


ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
tjd_start - The Julian Day number in UT, from when to start searching

ifl - To indicate, which ephemeris should be used (SEFLG_JPLEPH, SEFLG_SWIEPH or SEFLG_MOSEPH)

ifltype - SweConst.SE_ECL_TOTAL or any other SE_ECL_* constant or 0 for any type of eclipse:

SweConst.SE_ECL_TOTAL
SweConst.SE_ECL_ANNULAR
SweConst.SE_ECL_PARTIAL
SweConst.SE_ECL_ANNULAR_TOTAL
in combination with:
SweConst.SE_ECL_CENTRAL
SweConst.SE_ECL_NONCENTRAL

tret - A double[10], on return containing the times of different occasions of the eclipse as above

backward - !=0, if search should be done backwards

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
-1 (SweConst.ERR), if the calculation failed
See Also:
SweConst.SE_ECL_TOTAL, SweConst.SE_ECL_ANNULAR, SweConst.SE_ECL_PARTIAL, SweConst.SE_ECL_ANNULAR_TOTAL,
SweConst.SE_ECL_CENTRAL, SweConst.SEFLG_JPLEPH, SweConst.SEFLG_MOSEPH, SweDate.setGlobalTidalAcc(double)

swe_sol_eclipse_when_loc

public int swe_sol_eclipse_when_loc(double tjd_start,


int ifl,
double[] geopos,
double[] tret,
double[] attr,
int backward,
java.lang.StringBuffer serr)

Computes the next solar eclipse at a given geographical position. Note the uncertainty of Delta T for the remote past and the future.

tret is an output parameter with the following meaning:

tret[0]: time of maximum eclipse.


tret[1]: time of first contact.
tret[2]: time of second contact.
tret[3]: time of third contact.
tret[4]: time of forth contact.
tret[5]: time of sun rise between first and forth contact -- Not yet implemented.
tret[6]: time of sun set between first and forth contact -- Not yet implemented.

attr is an output parameter with the following meaning:

attr[0]: fraction of solar diameter covered by moon (magnitude).


attr[1]: ratio of lunar diameter to solar one.
attr[2]: fraction of solar disc covered by moon (obscuration).
attr[3]: diameter of core shadow in km.
attr[4]: azimuth of sun at tjd.
attr[5]: true altitude of sun above horizon at tjd.
attr[6]: apparent altitude of sun above horizon at tjd.
attr[7]: elongation of moon in degrees.

Attention: attr must be a double[20]!


ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).
Parameters:
tjd_start - The Julian Day number in UT, from when to start searching

ifl - To indicate, which ephemeris should be used (SEFLG_JPLEPH, SEFLG_SWIEPH or SEFLG_MOSEPH)

geopos - A double[3] containing the longitude, latitude and height of the geographic position. Eastern longitude and
northern latitude is given by positive values, western longitude and southern latitude by negative values.

tret - A double[7], on return containing the times of different occasions of the eclipse as specified above

attr - A double[20], on return containing different attributes of the eclipse. See above.

backward - true, if search should be done backwards

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
-1 (SweConst.ERR), if the calculation failed
SweConst.SE_ECL_TOTAL
SweConst.SE_ECL_ANNULAR
SweConst.SE_ECL_PARTIAL
in combination with:
SweConst.SE_ECL_VISIBLE
SweConst.SE_ECL_MAX_VISIBLE
SweConst.SE_ECL_1ST_VISIBLE
SweConst.SE_ECL_2ND_VISIBLE
SweConst.SE_ECL_3RD_VISIBLE
SweConst.SE_ECL_4TH_VISIBLE
See Also:
SweConst.SE_ECL_TOTAL, SweConst.SE_ECL_ANNULAR, SweConst.SE_ECL_PARTIAL, SweConst.SE_ECL_VISIBLE,
SweConst.SE_ECL_MAX_VISIBLE, SweConst.SE_ECL_1ST_VISIBLE, SweConst.SE_ECL_2ND_VISIBLE, SweConst.SE_ECL_3RD_VISIBLE,
SweConst.SE_ECL_4TH_VISIBLE, SweConst.SEFLG_JPLEPH, SweConst.SEFLG_MOSEPH, SweDate.setGlobalTidalAcc(double)

swe_sol_eclipse_where

public int swe_sol_eclipse_where(double tjd_ut,


int ifl,
double[] geopos,
double[] attr,
java.lang.StringBuffer serr)
Computes the geographic location for a given time, where a solar eclipse is central (or maximum for a non-central eclipse).

Output parameters:

geopos[0]: geographic longitude of central line, positive values mean east of Greenwich, negative
values west of Greenwich
geopos[1]: geographic latitude of central line, positive values mean north of equator, negative values
south

attr[0]: fraction of solar diameter covered by moon (magnitude)


attr[1]: ratio of lunar diameter to solar one
attr[2]: fraction of solar disc covered by moon (obscuration)
attr[3]: diameter of core shadow in km
attr[4]: azimuth of sun at tjd
attr[5]: true altitude of sun above horizon at tjd
attr[6]: apparent altitude of sun above horizon at tjd
attr[7]: angular distance of moon from sun in degrees

ATTENTION: geopos must be a double[10], attr a double[20]!


ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
tjd_ut - The Julian Day number in UT

ifl - To indicate, which ephemeris should be used (SEFLG_JPLEPH, SEFLG_SWIEPH or SEFLG_MOSEPH)

geopos - A double[10], on return containing the geographic positions.

attr - A double[20], on return containing the attributes of the eclipse as above.

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
-1 (SweConst.ERR), if the calculation failed
0, if there is no solar eclipse at that time
SweConst.SE_ECL_TOTAL
SweConst.SE_ECL_ANNULAR
SweConst.SE_ECL_TOTAL | SweConst.SE_ECL_CENTRAL
SweConst.SE_ECL_TOTAL | SweConst.SE_ECL_NONCENTRAL
SweConst.SE_ECL_ANNULAR | SweConst.SE_ECL_CENTRAL
SweConst.SE_ECL_ANNULAR | SweConst.SE_ECL_NONCENTRAL
SweConst.SE_ECL_PARTIAL
See Also:
SweConst.SE_ECL_TOTAL, SweConst.SE_ECL_ANNULAR, SweConst.SE_ECL_CENTRAL, SweConst.SE_ECL_NONCENTRAL,
SweConst.SE_ECL_PARTIAL, SweConst.SEFLG_JPLEPH, SweConst.SEFLG_MOSEPH, SweDate.setGlobalTidalAcc(double)

swe_lun_occult_when_loc

public int swe_lun_occult_when_loc(double tjd_start,


int ipl,
java.lang.StringBuffer starname,
int ifl,
double[] geopos,
double[] tret,
double[] attr,
int backward,
java.lang.StringBuffer serr)

Computes the next eclipse of any planet or fixstar at a given geographical position. Note the uncertainty of Delta T for the remote past and the
future.

tret is an output parameter with the following meaning:

tret[0]: time of maximum eclipse.


tret[1]: time of first contact.
tret[2]: time of second contact.
tret[3]: time of third contact.
tret[4]: time of forth contact.
tret[5]: time of sun rise between first and forth contact -- Not yet implemented.
tret[6]: time of sun set between first and forth contact -- Not yet implemented.

attr is an output parameter with the following meaning:

attr[0]: fraction of solar diameter covered by moon (magnitude).


attr[1]: ratio of lunar diameter to solar one.
attr[2]: fraction of solar disc covered by moon (obscuration).
attr[3]: diameter of core shadow in km.
attr[4]: azimuth of sun at tjd.
attr[5]: true altitude of sun above horizon at tjd.
attr[6]: apparent altitude of sun above horizon at tjd.
attr[7]: elongation of moon in degrees.

Attention: attr must be a double[20]!


ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
tjd_start - The Julian Day number in UT, from when to start searching

ipl - Planet number of the occulted planet. See SE_SUN etc. for the planet numbers.

starname - The name of the fixstar, if looking for an occulted fixstar. This has to be null or an empty
StringBuffer, if you are looking for a planet specified in parameter ipl. See routine swe_fixstar() for this
parameter.

ifl - To indicate, which ephemeris should be used (SEFLG_JPLEPH, SEFLG_SWIEPH or SEFLG_MOSEPH) Additionally, you can
specify SE_ECL_ONE_TRY, to only search for one conjunction of the moon with the planetary body. If this flag is not
set, the function will search for an occultation until it finds one. For bodies with ecliptical latitudes > 5, the
function may search successlessly until it reaches the end of the ephemeris.

geopos - A double[3] containing the longitude, latitude and height of the geographic position. Eastern longitude and
northern latitude is given by positive values, western longitude and southern latitude by negative values.

tret - A double[7], on return containing the times of different occasions of the eclipse as specified above

attr - A double[20], on return containing different attributes of the eclipse. See above.

backward - any value != 0 means, search should be done backwards

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
-1 (SweConst.ERR), if the calculation failed
SweConst.SE_ECL_TOTAL
SweConst.SE_ECL_ANNULAR
SweConst.SE_ECL_PARTIAL
in combination with:
SweConst.SE_ECL_VISIBLE
SweConst.SE_ECL_MAX_VISIBLE
SweConst.SE_ECL_1ST_VISIBLE
SweConst.SE_ECL_2ND_VISIBLE
SweConst.SE_ECL_3RD_VISIBLE
SweConst.SE_ECL_4TH_VISIBLE
See Also:
swe_fixstar_ut(StringBuffer, double, int, double[], StringBuffer), SweConst.SE_ECL_ONE_TRY, SweConst.SE_ECL_TOTAL,
SweConst.SE_ECL_ANNULAR, SweConst.SE_ECL_PARTIAL, SweConst.SE_ECL_VISIBLE, SweConst.SE_ECL_MAX_VISIBLE,
SweConst.SE_ECL_1ST_VISIBLE, SweConst.SE_ECL_2ND_VISIBLE, SweConst.SE_ECL_3RD_VISIBLE, SweConst.SE_ECL_4TH_VISIBLE,
SweConst.SE_ECL_ONE_TRY, SweConst.SEFLG_JPLEPH, SweConst.SEFLG_MOSEPH, SweDate.setGlobalTidalAcc(double)

swe_lun_eclipse_when_loc

public int swe_lun_eclipse_when_loc(double tjd_start,


int ifl,
double[] geopos,
double[] tret,
double[] attr,
int backward,
java.lang.StringBuffer serr)

swe_lun_occult_where

public int swe_lun_occult_where(double tjd_ut,


int ipl,
java.lang.StringBuffer starname,
int ifl,
double[] geopos,
double[] attr,
java.lang.StringBuffer serr)

Computes the geographic location for a given time, where a planet occultation by the moon is central or maximum for a non-central occultation.

Parameters:
tjd_ut - The Julian Day number in UT

ipl - The planet, whose occultation by the moon should be searched.

starname - The fixstar, whose occultation by the moon should be searched. See swe_fixstar() for details. It has to
be null or the empty string, if a planet (see parameter ipl) is to be searched.
ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

ifl - To indicate, which ephemeris should be used (SEFLG_JPLEPH, SEFLG_SWIEPH or SEFLG_MOSEPH)

geopos - A double[10], on return containing the geographic positions.

attr - A double[20], on return containing the attributes of the eclipse as above.


attr[0] fraction of solar diameter covered by moon (magnitude)
attr[1] ratio of lunar diameter to solar one
attr[2] fraction of solar disc covered by moon (obscuration)
attr[3] diameter of core shadow in km
attr[4] azimuth of sun at tjd
attr[5] true altitude of sun above horizon at tjd
attr[6] apparent altitude of sun above horizon at tjd
attr[7] angular distance of moon from sun in degrees

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
-1 (SweConst.ERR), if the calculation failed
0, if there is no solar eclipse at that time
SweConst.SE_ECL_TOTAL
SweConst.SE_ECL_ANNULAR
SweConst.SE_ECL_TOTAL | SweConst.SE_ECL_CENTRAL
SweConst.SE_ECL_TOTAL | SweConst.SE_ECL_NONCENTRAL
SweConst.SE_ECL_ANNULAR | SweConst.SE_ECL_CENTRAL
SweConst.SE_ECL_ANNULAR | SweConst.SE_ECL_NONCENTRAL
SweConst.SE_ECL_PARTIAL
See Also:
swe_sol_eclipse_where(double, int, double[], double[], java.lang.StringBuffer), swe_fixstar_ut(StringBuffer, double,
int, double[], StringBuffer), SweDate.setGlobalTidalAcc(double)

swe_lun_occult_when_glob

public int swe_lun_occult_when_glob(double tjd_start,


int ipl,
java.lang.StringBuffer starname,
int ifl,
int ifltype,
double[] tret,
int backward,
java.lang.StringBuffer serr)

Computes the next lunar occultation anywhere on earth. This method also finds solar eclipses, but is less efficient than
swe_sol_eclipse_when_glob().

tret is an output parameter with the following meaning:

tret[0]: time of maximum eclipse.


tret[1]: time, when the eclipse takes place at local apparent noon.

tret[2]: time of the begin of the eclipse.


tret[3]: time of the end of the eclipse.
tret[4]: time of the begin of totality.
tret[5]: time of the end of totality.
tret[6]: time of the begin of center line.
tret[7]: time of the end of center line
tret[8]: time, when annular-total eclipse becomes total -- Not yet implemented.
tret[9]: time, when annular-total eclipse becomes annular again -- Not yet implemented.

Attention: tret must be a double[10]!


ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).

Parameters:
tjd_start - The Julian Day number in UT, from when to start searching

ipl - planet number of occulted body

starname - name of occulted star. Must be null or "", if a planetary occultation is to be calculated. For the use of
this field, also see swe_fixstar().

ifl - To indicate, which ephemeris should be used (SEFLG_JPLEPH, SEFLG_SWIEPH or SEFLG_MOSEPH) If you like to have
only one conjunction of the moon with the body tested, add flag SE_ECL_ONE_TRY. If this flag is not set, the
function will search for an occultation until it finds one. For bodies with ecliptical latitudes > 5, the function
may search successlessly until it reaches the end of the ephemeris.

ifltype - eclipse type to be searched (SE_ECL_TOTAL, etc.). 0, if any type of eclipse is wanted. This functionality
also works with occultations.
tret - A double[10], on return containing the times of different occasions of the eclipse as above

backward - if != 0, search is done backwards

serr - A StringBuffer containing a warning or error message, if something fails.


Returns:
-1 (SweConst.ERR), if the calculation failed
SweConst.SE_ECL_TOTAL
SweConst.SE_ECL_ANNULAR
SweConst.SE_ECL_PARTIAL
SweConst.SE_ECL_ANNULAR_TOTAL
in combination with:
SweConst.SE_ECL_CENTRAL
SweConst.SE_ECL_NONCENTRAL
See Also:
swe_sol_eclipse_when_glob(double, int, int, double[], int, java.lang.StringBuffer), swe_fixstar_ut(StringBuffer,
double, int, double[], StringBuffer), SweConst.SE_ECL_ONE_TRY, SweConst.SE_ECL_TOTAL, SweConst.SE_ECL_ANNULAR,
SweConst.SE_ECL_PARTIAL, SweConst.SE_ECL_ANNULAR_TOTAL, SweConst.SE_ECL_CENTRAL, SweConst.SE_ECL_NONCENTRAL,
SweConst.SEFLG_JPLEPH, SweConst.SEFLG_MOSEPH, SweDate.setGlobalTidalAcc(double)

swe_gauquelin_sector

public int swe_gauquelin_sector(double t_ut,


int ipl,
java.lang.StringBuffer starname,
int iflag,
int imeth,
double[] geopos,
double atpress,
double attemp,
DblObj dgsect,
java.lang.StringBuffer serr)

Finds the gauquelin sector position of a planet or fixed star.

Parameters:
t_ut - Time in UT.
ipl - Planet number.

starname - If starname != null and not an empty string, then a fixstar is computed and not a planet specified in
ipl. See swe_fixstar() method on this.

iflag - Use the flags SE_SWIEPH, SE_JPLEPH, SE_MOSEPH, SEFLG_TOPOCTR.

imeth - defines the method.

imeth = 0: sector from longitude and latitude


imeth = 1: sector from longitude, with lat = 0
imeth = 2: sector from rise and set
imeth = 3: sector from rise and set with refraction

Rise and set are defined as appearance and disappearance of disc center.

geopos - An array of 3 doubles for geo. longitude, geo. latitude, elevation in meter.

atpress - Only needed for imeth = 3. If imeth=3 and atpress not given (= 0), the programm assumes 1013.25 mbar; if a
non-zero height above sea is given in geopos, atpress is estimated.

attemp - Temperature. Only needed for imeth = 3.

dgsect - Return value.

serr - Pointer to error string, may be null.


Returns:
SweConst.OK (0) or SweConst.ERR (-1) on error.
See Also:
swe_fixstar_ut(StringBuffer, double, int, double[], StringBuffer), SweConst.SEFLG_TOPOCTR, SweConst.SEFLG_JPLEPH,
SweConst.SEFLG_MOSEPH

swe_house_name

public java.lang.String swe_house_name(char hsys)

The function returns the name of the house system.

Parameters:
hsys - House system character house systems are:
A equal
E equal
B Alcabitius
C Campanus
G 36 Gauquelin sectors
H horizon / azimut
K Koch
M Morinus
O Porphyry
P Placidus
R Regiomontanus
T Polich/Page ("topocentric")
U Krusinski-Pisa-Goelzer
V equal Vehlow
W equal, whole sign
X axial rotation system/ Meridian houses
Y APC houses

Returns:
The name of the house system

swe_house_pos

public double swe_house_pos(double armc,


double geolat,
double eps,
int hsys,
double[] xpin,
java.lang.StringBuffer serr)

The function returns a value between 1.0 and 12.999999, indicating in which house a planet is and how far from its cusp it is. With Koch houses,
the function sometimes returns 0, if the computation was not possible.

Parameters:
armc - The ARMC (= sidereal time)

geolat - The latitude

eps - The ecliptic obliquity (e.g. xx[0] of swe_calc(...))


hsys - The house system. See swe_houses(...) for a list of all houses.

xpin - A double[2] containing the ecliptic longitude (xpin[0]) and latitude (xpin[1]) of the planet in degrees. It
is an input parameter, describing tropical positions. Indeed, it needs a double[6] as parameter with any value in
the other doubles, but the methods now accepts both a double[2] and a double[6].

serr - StringBuffer to contain any error messages or warnings


Returns:
A value between 1.0 and 12.999999, indicating in which house a planet is and how far from its cusp it is. Koch may
return 0, if the calculation was not possible.
See Also:
swe_houses(double, int, double, double, int, double[], double[])

swe_houses_armc

public int swe_houses_armc(double armc,


double geolat,
double eps,
int hsys,
double[] cusp,
double[] ascmc)

Calculates the house positions and other vital points. You would use this method instead of swe_houses, if you do not have a date available, but
just the ARMC (sidereal time).

Parameters:
armc - The ARMC (= sidereal time)

geolat - The latitude on earth, for which the calculation has to be done.

eps - The ecliptic obliquity (e.g. xx[0] of swe_calc(...))

hsys - The house system as a character given as an integer. See swe_houses(...) for a list of all houses.

cusp - The house cusps are returned here in cusp[1...12] for the house 1 to 12.

ascmc - The special points like ascendant etc. are returned here. See swe_houses(...) for further info on this
parameter.
Returns:
SweConst.OK (==0) or SweConst.ERR (==-1), if calculation was not possible due to nearness to the polar circle in
Koch or Placidus house system or when requesting Gauquelin sectors. Calculation automatically switched to Porphyry
house calculation method in this case, so that valid houses will be returned anyway, just in a different house
system than requested.
See Also:
swe_houses(double, int, double, double, int, double[], double[]), swe_calc(double, int, int, double[],
java.lang.StringBuffer)

swe_houses

public int swe_houses(double tjd_ut,


int iflag,
double geolat,
double geolon,
int hsys,
double[] cusp,
double[] ascmc)

Calculates the house positions and other vital points. The possible house systems are:

(int)'A' equal
(int)'E' equal
(int)'B' Alcabitius
(int)'C' Campanus
(int)'G' 36 Gauquelin sectors
(int)'H' horizon / azimut
(int)'K' Koch
(int)'M' Morinus
(int)'O' Porphyry
(int)'P' Placidus
(int)'R' Regiomontanus
(int)'T' Polich/Page ("topocentric")
(int)'U' Krusinski-Pisa-Goelzer
(int)'V' equal Vehlow
(int)'W' equal, whole sign
(int)'X' axial rotation system/ Meridian houses
(int)'Y' APC houses
The parameter ascmc is defined as double[10] and will return the following points:

ascmc[0] = ascendant
ascmc[1] = mc
ascmc[2] = armc (= sidereal time)
ascmc[3] = vertex
ascmc[4] = equatorial ascendant
ascmc[5] = co-ascendant (Walter Koch)
ascmc[6] = co-ascendant (Michael Munkasey)
ascmc[7] = polar ascendant (Michael Munkasey)
ascmc[8] = reserved for future use
ascmc[9] = reserved for future use

You can use the SE_ constants below from SweConst.java to access these values in ascmc[].

Parameters:
tjd_ut - The Julian Day number in UT

iflag - An additional flag for calculation. It must be 0 or SEFLG_SIDEREAL and / or SEFLG_RADIANS.

geolat - The latitude on earth, for which the calculation has to be done.

geolon - The longitude on earth, for which the calculation has to be done. Eastern longitude and northern latitude
is given by positive values, western longitude and southern latitude by negative values.

hsys - The house system as a character given as an integer.

cusp - (double[13]) The house cusps are returned here in cusp[1...12] for the houses 1 to 12.

ascmc - (double[10]) The special points like ascendant etc. are returned here. See the list above.
Returns:
SweConst.OK (==0) or SweConst.ERR (==-1), if calculation was not possible due to nearness to the polar circle in
Koch or Placidus house system or when requesting Gauquelin sectors. Calculation automatically switched to Porphyry
house calculation method in this case, so that valid houses will be returned anyway, just in a different house
system than requested.
See Also:
swe_set_sid_mode(int, double, double), SweConst.SEFLG_RADIANS, SweConst.SEFLG_SIDEREAL, SweConst.SE_ASC,
SweConst.SE_MC, SweConst.SE_ARMC, SweConst.SE_VERTEX, SweConst.SE_EQUASC, SweConst.SE_COASC1, SweConst.SE_COASC2,
SweConst.SE_POLASC
swe_houses

public int swe_houses(double tjd_ut,


int iflag,
double geolat,
double geolon,
int hsys,
double[] cusp,
double[] ascmc,
int aOffs)

setTransitSpeedsfile

public void setTransitSpeedsfile(java.lang.String fname,


boolean writeable)

-- NOT YET IMPLEMENTED -- File to read from and write to the maximum and minimum speeds of planets and other objects.
If the maximum and minimum speeds of a transit object is not known, the routines calculate some number of random speeds to get an idea of
the extreme speeds. This is necessary, as one cannot find out about transits, if one doesn't have some idea about their movement.
If the transit speeds file is set, the transit routines will read the extreme speeds from this file and write findings due to the random calculations
done on initialization of the TransitCalculator to this file, so the results may become more reliable and the calculations faster with time.
This method throws IOException if the file cannot be read (or found) or isn't writeable, if param writeable is true.

Parameters:
fname - The filename to be used. It should be writable, so the extreme speed values can be further improved.

writeable - Say true here, if the file should be improved by newly calculated values, false otherwise. It will be a
good idea to keep it writeable.

getTransitET

public double getTransitET(TransitCalculator tc,


double jdET,
boolean backwards)
throws java.lang.IllegalArgumentException,
SwissephException
Searches for the next or previous transit of a planet over a specified longitude, latitude, distance or speed value with geocentric or topocentric
positions in a tropical or sidereal zodiac. Dates are interpreted as ET (=UT + deltaT).

See swisseph.TCPlanet or swisseph.TCPlanetPlanet below for examples on how to use this method.

Parameters:
tc - The TransitCalculator that should be used here.

jdET - The date (and time) in ET, from where to start searching.

backwards - If backward search should be performed.


Returns:
return A double containing the julian day number for the next / previous transit as ET.
Throws:
java.lang.IllegalArgumentException

SwissephException
See Also:
TCPlanet, TCPlanetPlanet

getTransitET

public double getTransitET(TransitCalculator tc,


double jdET,
boolean backwards,
double jdLimit)
throws java.lang.IllegalArgumentException,
SwissephException

Searches for the next or previous transit of a planet over a specified longitude, latitude, distance or speed value with geocentric or topocentric
positions in a tropical or sidereal zodiac. Dates are interpreted as ET (=UT + deltaT).

See swisseph.TCPlanet or swisseph.TCPlanetPlanet below for examples on how to use this method.

Parameters:
tc - The TransitCalculator that should be used here.

jdET - The date (and time) in ET, from where to start searching.
backwards - If backward search should be performed.

jdLimit - This is the date, when the search for transits should be stopped, even if no transit point had been found
up to then.
Returns:
return A double containing the julian day number for the next / previous transit as ET.
Throws:
java.lang.IllegalArgumentException

SwissephException
See Also:
TCPlanet, TCPlanetPlanet

getTransitUT

public double getTransitUT(TransitCalculator tc,


double jdUT,
boolean backwards)
throws java.lang.IllegalArgumentException,
SwissephException

Searches for the next or previous transit of a planet over a specified longitude, latitude, distance or speed value with geocentric or topocentric
positions in a tropical or sidereal zodiac. Dates are interpreted as UT (=ET - deltaT).

See swisseph.TCPlanet or swisseph.TCPlanetPlanet below for examples on how to use this method.

Parameters:
tc - The TransitCalculator that should be used here.

jdUT - The date (and time) in UT, from where to start searching.

backwards - If backward search should be performed.


Returns:
return A double containing the julian day number for the next / previous transit as UT.
Throws:
java.lang.IllegalArgumentException
SwissephException
See Also:
TCPlanet, TCPlanetPlanet

getTransitUT

public double getTransitUT(TransitCalculator tc,


double jdUT,
boolean backwards,
double jdLimit)
throws java.lang.IllegalArgumentException,
SwissephException

Searches for the next or previous transit of a planet over a specified longitude, latitude, distance or speed value with geocentric or topocentric
positions in a tropical or sidereal zodiac. Dates are interpreted as UT (=ET - deltaT).

See swisseph.TCPlanet or swisseph.TCPlanetPlanet below for examples on how to use this method.

Parameters:
tc - The TransitCalculator that should be used here.

jdUT - The date (and time) in UT, from where to start searching.

backwards - If backward search should be performed.

jdLimit - This is the date, when the search for transits should be stopped, even if no transit point had been found
up to then. It is interpreted as UT time as well.
Returns:
return A double containing the julian day number for the next / previous transit as UT.
Throws:
java.lang.IllegalArgumentException

SwissephException
See Also:
TCPlanet, TCPlanetPlanet
getFixstarMagnitude

public double getFixstarMagnitude(java.lang.String star)


throws SwissephException

Returns the magnitude (brightness) of a fixstar. Use this version, if you just need the magnitude of the star, but not the name of the star on
output.
Basically, this method corresponds to swe_fixstar_mag(...) method in the original.

Parameters:
star - Name of star or line number in star file (start from 1, don't count comment lines).

Returns:
magnitude of the star.
Throws:
SwissephException
See Also:
getFixstarMagnitude(StringBuffer)

getFixstarMagnitude

public double getFixstarMagnitude(java.lang.StringBuffer star)


throws SwissephException

Returns the magnitude (brightness) of a fixstar. Use this version, if you also need the star name on output.
Corresponds to swe_fixstar_mag(...) method in the original.

Parameters:
star - (Both input and output parameter.) Name of star or line number in star file (start from 1, don't count
comment lines).

The name of the star is returned in the format trad_name, nomeclat_name in this parameter.

Returns:
magnitude of the star.
Throws:
SwissephException
See Also:
getFixstarMagnitude(String)

swe_fixstar_mag

protected int swe_fixstar_mag(java.lang.StringBuffer star,


double[] mag,
java.lang.StringBuffer serr)
throws SwissephException

Returns the magnitude (brightness) of a fixstar.

Parameters:
star - (Both input and output parameter.) Name of star or line number in star file (start from 1, don't count
comment lines).

If no error occurs, the name of the star is returned in the format trad_name, nomeclat_name in this parameter.

mag - (Output parameter.) The magnitude of the star. The parameter has to be a double[1].

serr - Buffer for error message on output


Returns:
SweConst.OK. All errors will throw a SwissephException.
Throws:
SwissephException

swe_time_equ

public int swe_time_equ(double tjd_ut,


double[] E,
java.lang.StringBuffer serr)

Returns the difference between local apparent and local mean time in days. E = LAT - LMT
ATTENTION: This method possibly (re-)sets a global parameter used in calculation of delta T. See
SweDate.setGlobalTidalAcc(double).
Parameters:
tjd_ut - input date in julian days (UT)

E - double[1], output value: the difference between the times

serr - buffer for error message on output


Returns:
SweConst.ERR on error, SweConst.OK else
See Also:
SweDate.setGlobalTidalAcc(double)

swe_lmt_to_lat

public int swe_lmt_to_lat(double tjd_lmt,


double geolon,
double[] tjd_lat,
java.lang.StringBuffer serr)

swe_lat_to_lmt

public int swe_lat_to_lmt(double tjd_lat,


double geolon,
double[] tjd_lmt,
java.lang.StringBuffer serr)

OVERVIEW PACKAGE CLASS TREE DEPRECATED INDEX HELP

PREV CLASS NEXT CLASS FRAMES NO FRAMES ALL CLASSES

SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Potrebbero piacerti anche