Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
swisseph
Class SwissEph
java.lang.Object
swisseph.SwissEph
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
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
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(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()
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_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(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.
java.lang.String swe_version()
Returns the version information of this swisseph package.
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
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
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
Returns:
package information in the form x.yy.zz
See Also:
swe_java_version()
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
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).
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
swe_calc
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).
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).
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.
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).
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
swe_set_ephe_path
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
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
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
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)
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.
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
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
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
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).
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!
readFixstarParameters
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).
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!
swe_get_planet_name
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
getHouseobjectname
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
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
getDatafileTimerange
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
Computes the azimut and height from either ecliptic or equatorial coordinates.
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.
xin - double[3] with a content depending on parameter calc_flag. See there. xin[3] does not need to be defined.
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
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.
swe_lun_eclipse_how
Computes the attributes of a lunar eclipse for a given Julian Day, geographic longitude, latitude, and height.
Parameters:
tjd_ut - The Julian Day number in UT
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.
swe_lun_eclipse_when
Parameters:
tjd_start - The Julian Day number in UT, from when to start searching
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.)
swe_nod_aps
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
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
swe_nod_aps_ut
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
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
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.
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.
swe_pheno_ut
Computes phase, phase angel, elongation, apparent diameter and apparent magnitude for sun, moon, all planets and asteroids.
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.
swe_refrac
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.
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
atpress - Atmospheric pressure in mBar (hPa). If it is 0, the pressure will be estimated from attemp on sea level.
Returns:
The converted altitude; see parameter dret for more output values
swe_rise_trans
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
starname - The name of the star, if times for a star should be calculated. It has to be null or the empty string
otherwise!
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.
swe_rise_trans_true_hor
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
starname - The name of the star, if times for a star should be calculated. It has to be null or the empty string
otherwise!
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.
swe_sol_eclipse_how
Computes the attributes of a solar eclipse for a given Julian Day, geographic longitude, latitude, and height.
Parameters:
tjd_ut - The Julian Day number in UT
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.
swe_sol_eclipse_when_glob
Parameters:
tjd_start - The Julian Day number in UT, from when to start searching
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
swe_sol_eclipse_when_loc
Computes the next solar eclipse at a given geographical position. Note the uncertainty of Delta T for the remote past and the future.
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.
swe_sol_eclipse_where
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
Parameters:
tjd_ut - The Julian Day number in UT
swe_lun_occult_when_loc
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.
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.
swe_lun_eclipse_when_loc
swe_lun_occult_where
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
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).
swe_lun_occult_when_glob
Computes the next lunar occultation anywhere on earth. This method also finds solar eclipses, but is less efficient than
swe_sol_eclipse_when_glob().
Parameters:
tjd_start - The Julian Day number in UT, from when to start searching
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
swe_gauquelin_sector
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.
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.
swe_house_name
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
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)
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].
swe_houses_armc
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.
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
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
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.
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
setTransitSpeedsfile
-- 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
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.
SwissephException
See Also:
TCPlanet, TCPlanetPlanet
getTransitET
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
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.
getTransitUT
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.
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
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
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
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].
swe_time_equ
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)
swe_lmt_to_lat
swe_lat_to_lmt