sweph-napi

0.4.0 • Public • Published
WARNING: This program is using N-API and therefore might not work, since
N-API is subject to being changed. This API is also subject to being
changed. Therefore, the major version number is set to zero. Also, many
functions are currently missing but will be added on later.

Swiss Ephemeris is license by GNU GPL version 2 or later version. It is
currently not included with this package and you must compile it yourself.

Some functions take option arguments. These are objects, or undefined or
omitted if the default values are used. The list of possible options
which are keys for the object, are specified. If & is specified, this
means it is a "default option"; the option can be the value of this
option instead of an object, if only that option is to be set.

Also, most functions that require a date can use either a JavaScript Date
object or a Julian day number.


***** .ayanamsha(option,[date])

Computes and returns the ayanamsha (in degrees, normalized in range from 0
to 360) for the specified sidereal mode and date. "Ayanamsha" is the
Sanskrit word for the precession of equinoxes, and is the angle by which
the ecliptic longitude with the specified sidereal mode is less than the
ecliptic longitude with the equinox of date.

The valid options include:

 .ephemeris
   Specify which ephemeris to use.

 .ephemerisTime
   Set true to use ephemeris time instead of universal time.

 .sidereal &
   The sidereal mode to use. The return value will always be zero if this
   option is not specified, since the difference between the equinox of
   date and the equinox of date is always zero.


***** .calc(what,[option],[when])

Calculates the position (and optionally speed) of an object, specified as
a number (from .planet) or a string (a fixed star name; see .name() for
details about fixed star names).

The third argument is the date for which coordinates are wanted.

Valid options includes:

 .aberration
   Set true (the default) to use aberration. For astrometric positions,
   set this to false.

 .apparent
   Set true (default) to use apparent positions, or false for true
   positions instead.

 .barycentricNodes
   Only valid if .node is also set. Set true to use barycentric positions
   and speed for planets beyond Jupiter, for purpose of calculating the
   nodes and apsides.

 .ephemeris
   Specify which ephemeris to use.

 .ephemerisTime
   Set true to use ephemeris time instead of universal time.

 .equatorial
   Set true for equatorial coordinates, or false (default) for ecliptic.

 .geoalt
   Altitude above sea level (in metres); only used if .geolon and .geolat
   are also set. Default value is zero.

 .geolat
   Set to geographic latitude (in degrees) if you want topocentric
   coordinates (only valid if origin is set to Earth).

 .geolon
   Set to geographic longitude (in degrees) if you want topocentric
   coordinates (you must set .geolat option too). Positive numbers are
   used for east of prime meridian, and negative numbers for west.

 .gravitation
   Set true (the default) to use gravitational deflection. For astrometric
   positions, set this to false.

 .icrs
   Set true to use International Celestial Reference System.

 .jplHorizons
   Set true if you want JPL Horizons positions. You will need the data
   files to compute positions properly, otherwise it tries to approximate.

 .meanNodes
   Only valid if .node is also set. Set true to calculate mean nodes and
   apsides instead of osculating when possible.

 .node
   Set to calculate a node or apside instead of position. Not valid with
   fixed stars. This can be "A" for the ascending node, "D" for the
   descending node, "p" for perihelion, "a" for aphelion, or "f" for the
   second focal point of the orbital ellipse.

 .nutation
   Set true (the default) to use the true equinox of date; if false, the
   mean equinox of date is used instead.

 .origin
   Origin of measurement. Can be .planet.Earth (the default), .planet.Sun,
   or .planet.barycenter (not supported in some cases). (Future versions
   of this software may permit other origins.)

 .radians
   Set true if you want results in radians instead of degrees.

 .sidereal
   The sidereal mode to use, specifying where the zero point is. Can be
   false (the default) for equinox of date, true for J2000, or an object
   returned by the .sidereal() function.

 .speed
   Set true (the default) to calculate speed. Speed is not calculated for
   fixed stars; in this case it is false by default.

 .xyz
   Set true for rectangular instead of polar coordinates.

Return value is an object with the following properties:

 .ephemeris
   Specifies which ephemeris is in use. This may be different than the one
   passed in if it is unable to use the passed in one (such as if the
   files do not exist in the path); in this case you may call .warning()
   to retrieve an error message relating to it.

There are additional properties giving the coordinates, which depend on
whether it is ecliptic, equatorial, or rectangular.

For ecliptic coordinates, these are .lon (ecliptic longitude), .lat
(ecliptic latitude), and .dist (distance in AU).

For equatorial coordinates, these are .ra (right ascension), .dec
(declination), and .dist (distance in AU). Right ascension is returned in
degrees (or radians), and not in hours.

For rectangular coordinates, these are .x, .y, and .z, all in AU.

If speed is computed, there are additional properties with the same names
but with "d" at front; these are per day.

Distance for fixed stars is always 1 or close to 1, rather than the true
distance to the star (which is much farther away). (This may change in
future versions though.)


***** .cotrans(coordinate,obliquity)

Converts between ecliptic and equatorial coordinates. The second argument
is the obliquity of the ecliptic, in degrees. This should be negative to
convert ecliptic to equatorial, or positive for other way around.

The first argument is an object with two properties "lon" and "lat", with
the values in degrees. The return value is this same object, with the
values altered.


***** .deltaT([time],[ephemeris],[tidal])

The arguments are time (a Julian day number (in universal time) or a
JavaScript Date object), ephemeris selection, and tidal acceleration.
The tidal acceleration is given in arcseconds per square century, and
if not specified a default value will be used.

The result is a number given in days (not in seconds).


***** .ecliptic([date],[ephemerisTime])

Returns parameters for obliquity of the ecliptic and for nutation. The
output is an object with properties:
 .trueOb = True obliquity of the ecliptic (including nutation)
 .meanOb = Mean obliquity of the ecliptic
 .nutLon = Nutation in longitude
 .nutOb = Nutation in obliquity

Normally the calculation is using universal time. To use ephemeris time
instead, the second argument must be true.


***** .ephemeris

An object with constants to specify the ephemerides in use:
 .default = Use the default setting.
 .JPL = Use JPL ephemeris.
 .Moshier = Use Moshier ephemeris.
 .Swiss = Use Swiss ephemeris.

JPL ephemeris is the most accurate, but requires larger files. Moshier
does not require external files, but is the least precise.


***** .format(angle,option)

Format a number which is an angle, given in degrees. It is automatically
normalized to the proper range.

The valid options include:

 .d1
   First delimiter string, which is a space by default.

 .d2
   Second delimiter string. If omitted, the second delimiter and parts
   after it are omitted in the output (except for bearings).

 .d3
   Third delimiter string. If omitted, the third delimiter and parts after
   it are omitted in the output.

 .offset
   A number from 0 to 69 giving the degree offset, which is zero by
   default. You can change it to 1 to use the older one-based degree
   numbering that was sometimes used in astrology. Only the number
   displayed is affected by this, and not the calculation. Modes that
   treat the input as a signed number ignore this parameter.

 .padding
   Padding mode; a number from 0 to 3.

   0 = No padding (default)
   1 = Pad with spaces
   2 = Pad with spaces at beginning, zeroes in other places
   3 = Pad with zeroes

   Things other than numbers are padded only with spaces (if padding is
   enabled at all), and not with zeroes.

 .precision
   A number giving the number of decimal places for the last component; if
   zero, the dot is also omitted. The default setting is zero.

   In the case of type "c", this specifies how much the compass is
   divided, where 0 means four points, 1 means eight points, 2 means
   sixteen points, and 3 means thirty-two points. In the case of 32
   points, the d3 parameter sets the abbreviation for "by" (default "b").

 .type
   The type of formatting to use; a string with a single character (or the
   ASCII code of that character). The default is "s", although this may be
   changed in future so should not be relied on.

   "2" = Degrees and two-letter sign. [deg d1 sign d2 arcmin d3 arcsec]
   "3" = Degrees and three-letter sign. [deg d1 sign d2 arcmin d3 arcsec]
   "A" = Signed degrees (-999 to +999). [-/+ deg d2 arcmin d3 arcsec]
   "B" = Octant bearing. [dir d1 deg d2 dir]
   "D" = Degrees of latitude. [-/+ deg d2 arcmin d3 arcsec]
   "G" = Geographic latitude. [deg d1 dir d2 arcmin d3 arcsec]
   "S" = Sign only. [sign]
   "b" = Quadrant bearing. [dir d1 deg d2 dir]
   "c" = Compass direction. [dir]
   "d" = Degrees. [deg d2 arcmin d3 arcsec]
   "g" = Geographic longitude. [deg d1 dir d2 arcmin d3 arcsec]
   "h" = Sidereal hours. [hour d2 min d3 sec]
   "s" = Degrees and sign. [deg d1 sign d2 arcmin d3 arcsec]

Note: Astrological signs are not the same as constellations, even though
the names are similar. These signs are actually the unit of angular
measurement, used for measuring ecliptic longitude. (The abbreviations are
also different than those of the constellations.)

Note also that if you want a suffix (such as for arcseconds) you must add
that suffix on afterward by yourself.


***** .fromJulian(jd,[ephemerisTime])

Converts a Julian day number into a JavaScript Date object. The second
argument specifies whether to use ephemeris time (true) or universal time
(false or omitted).


***** .horizon(option)

Converts equatorial coordinates into horizontal coordinates.

Input:

 .dec
   The declination of the object, in degrees.

 .geolat
   The geographic latitude of the observer, in degrees.

 .hour
   The hour angle of the object, in degrees. This is equal to local
   sidereal time minus right ascension.

Output:

 .altitude
   The altitude in degrees, from -90 to +90.

 .azimuth
   Azimuth in degrees, from 0 to 360, where 0 is north and 90 is east.
   This value will be NaN if the object is directly overhead.

 .zenith
   The zenith angle in degrees.

Use .refract() to apply refraction to the returned altitude.


***** .house(option,[when])

Computes astrological houses. You must give either .geolon, or give .eps
and .time. If you do not give .geolon then the second argument isn't used.

Input:

 .eps
   Obliquity of the ecliptic.

 .geolat
   Geographic latitude to compute house positions for.

 .geolon
   Geographic longitude to compute house positions for.

 .method
   The house system to use. Can be one of:

   "A" = Equally spaced houses; house 1 is ascendant
   "B" = Alcabitus
   "C" = Campanus
   "D" = Equally spaced houses; house 10 is midheaven
   "E" = Same as "A"
   "F" = Carter / Poli-Equatorial
   "G" = Gauquelin sectors (has 36 houses, unlike other systems)
   "H" = Horizontal / Azimuthal
   "I" = Sunshine (Treindl)
   "i" = Sunshine (Makransky)
   "K" = Koch/GOH
   "L" = Pullen sinusoidal delta / Neo-Porphyry
   "M" = Morinus
   "N" = Null; houses are equally spaced beginning at zero
   "O" = Porphyrius
   "P" = Placidus
   "Q" = Pullen sinusoidal ratio
   "R" = Regiomontanus
   "S" = Sripati
   "T" = Polich/Page (sometimes called "topocentric")
   "U" = Krusinsky-Pisa-Goelzer
   "V" = Vehlow equal
   "W" = Whole; like "A" but rounded down to a multiple of 30 degrees
   "X" = Axial rotation / Meridian system / Zariel
   "Y" = APC

 .method2
   May be specified instead of .method for an alternative set of house
   systems (experimental). Can be one of:

   "L" = Latitude
   "N" = Hemisphere-Null; first house is vernal equinox
   "S" = Solar
   "V" = Vertical

   The following are not currently implemented:

   "A" = AM Sidereal Hours
   "C" = Clockwise
   "c" = Calendar
   "D" = Draconic (based on nodes)
   "G" = Great
   "g" = Natural graduation
   "h" = Natural hours
   "P" = Photographic
   "v" = Vehlow-RA

 .sidereal
   Specify sidereal mode to use.

 .time
   Local sidereal time (in degrees).

Output:

 [1]
   If a house system is specified, elements 1 to 12 (or 1 to 36 for method
   "G") contain the ecliptic longitude of that house, in degrees.

 .armc
   Right ascension of midheaven

 .asc
   Ascendant

 .coasc1
   Co-Ascendant (Koch)

 .coasc2
   Co-Ascendant (Munkasey)

 .equasc
   Equatorial Ascendant

 .mc
   Midheaven

 .polasc
   Polar Ascendant

 .vertex
   Vertex (the point of the ecliptic that is precisely to the west)


***** .jplFile(filename)

Set which JPL ephemeris file to use. The filename can be a string, buffer,
or a number; if a number it is just the DE number of the ephemeris to use.
It has no function unless the calculation functions specify that you are
using .ephemeris.JPL as the current ephemeris.


***** .julian([date],[ephemerisTime])

Converts a given JavaScript Date object into a Julian day number (if it is
already a number, just returns that number). Returns the current date/time
as a Julian day number if not specified.

Normally the result is using universal time. To use ephemeris time
instead, the second argument must be true.


***** .list(what)

Make a list of valid values for certain enumerations used in this API,
returning an object where the keys are ASCII strings describing them. Use
Object.keys() to retrieve the list (in an arbitrary order; you may wish to
sort the list afterward).

Choose from:
  "H" = House systems
  "h" = Alternate house systems
  "P" = Planets (including Sun, Moon, etc)
  "p" = Map projections


***** .listSidereal()

Returns an array of valid strings to pass to .sidereal().


***** .magnitude(star)

Returns the apparent magnitude of a (not necessarily fixed) star. The
input has the same format as with the .name() function.

Only stars can be used with this function; not planets.


***** .magnitudeSum(array)

Given an array of apparent magnitudes, returns the combined apparent
magnitude of them.


***** .model(model)

Set models to use and receive a report about it. This feature is meant
only for testing and there is no guarantee of its working.

The format of the argument given is deliberately undocumented.


***** .name(what)

Returns the name (as a string) of a celestial object, which can be
specified as a number or as a string.

If a number, it is something from the .planet list (which is not limited
to planets, however).

If a string, it is a fixed star, and the result will include a comma, with
the traditional name before the comma and the nomenclature name after the
comma. ("Fixed star" means stars other than our Sun. Use .planet.Sun if
you want to refer to our Sun. Also, "fixed stars" are not actually fixed.)

For a fixed star, the input can be one of five formats:

- A string representing a number. In this case, it is a line number in
sefstars.txt, not counting comment lines.

- A prefix of the traditional name. The first star listed in the file
that has that prefix (possibly as the entire name) is used.

- A comma followed by the nomenclature name.

- The full traditional name followed by a comma.

- The full traditional name followed by a comma and then the nomenclature
name. The return value has the same format as this.


***** .occult(what,[option],[start],[end])

Calculate when and where the moon blocks the view of another object. Give
the start and end dates for the search; if only one date is given, does a
search forever in the future (or past); if no dates are given, calculates
the next (or previous) occultation from now.

If the first argument is .planet.Sun then it can find solar eclipses.

Options:

 .ephemeris
   Specify what ephemeris to use.

 .geoalt
   Altitude above sea level, in metres. Default is sea level.

 .geolat
   Geographic latitude. If omitted, use a global calculation.

 .geolon
   Geographic longitude. If omitted, use a global calculation.

 .increment &
   Increment (in days) for searching within a given time frame. The
   default is 2 days (or -2 if the end date is earlier than the start
   date). Specify a negative number for a backward search.

The result is the JavaScript "undefined" value if none was found,
otherwise it is an object with the following properties:

  .magnitude
    Fraction of solar diameter covered by moon (magnitude).

  .max
    Time of maximum eclipse.

  .obscuration
    Fraction of solar disc covered by moon (obscuration).

  .ratio
    Ratio of lunar diameter to solar one.

  .shadow
    Diameter of core shadow in km. (Seems to be negative for some reason.)

If a geographic location is specified, also has properties numbered 1 to 4
for the times of the first, second, third, and fourth contact.

If a geographic location is not specified, also has:

  .begin
    Begin time

  .beginCenter
    Center line begin time

  .beginTotal
    Begin time of totality

  .end
    End time

  .endCenter
    Center line end time

  .endTotal
    End time of totality

  .time
    Time, when eclipse takes place at local apparent noon.

Use .fromJulian() to convert time results into Date objects.


***** .path(path)

Set a pathname for the ephemeris files, and for some extra files such as
leap seconds, fictitious planets, fixed stars, etc. The format is the same
as the format of the PATH environment variable, and can be either a string
or a buffer. The path name is limited to 256 bytes.

If the environment variable called SE_EPHE_PATH is set, then this function
is ignored, and that environment variable is used instead. Your program
should not tamper with this environment variable without the user's
permission (the user may have a use to set their own ephemeris path).

The default setting is \SWEPH\EPHE (relative to the current drive) on
Windows (and presumably ReactOS), and is /users/ephe on UNIX.

Unlike with the C library, this JavaScript version does not need calling
this function for initialization; it will do so automatically.


***** .phase([option],[when])

Returns the phase angle of of the specified object (Moon by default), from
0 (fully illuminated) to 180 (dark), or from -180 to +180 in signed mode.

The options can be:

 .ephemeris
   Specify which ephemeris to use.

 .ephemerisTime
   Set true to use ephemeris time instead of universal time.

 .geoalt
   Altitude above sea level, in metres. If specified, .geolat and .geolon
   must also be specified. Default is zero (sea level).

 .geolat
   Geographic latitude in degrees. If omitted, use geocentric calculation.

 .geolon
   Geographic longitude in degrees. If omitted, it is geocentric.

 .object
   The object to calculate the phase angle of (relative to the Earth and
   Sun). The default is the Moon. Any number from .planet is allowed
   (although some aren't useful, such as lunar nodes).

 .radians
   If true, return radians instead of degrees.

 .signed
   If true, use signed mode; false (default) is unsigned mode. (I am
   unsure that the signed mode is actually work properly, currently.)


***** .phenomena(which,[option],[when])

Calculates planetary phenomena (phase angle, phase of illumination,
elongation, apparent diameter of disc, and apparent magnitude) of the
specified object; fixed stars are not allowed.

Options can be:

 .apparent
    Set true (default) for apparent positions (taking light time into
    account); set false for true positions (disregarding light time).

 .ephemeris &
    Specify which ephemeris to use.

 .ephemerisTime
    Set true for ephemeris time instead of universal time.

Return value is an object with properties:

 .diameter
    Apparent diameter of disc.

 .elongation
    Elongation.

 .magnitude
    Apparent magnitude.

 .phase
    Phase (fraction of illumination).

 .phaseAngle
    Phase angle.


***** .planet

An object with constants to specify which planet or other object you want.

This includes the solar system planets, including Pluto (now considered a
dwarf planet), as well as Sun and Moon even though they are not planets.
There is also TrueNode and MeanNode for the ascending lunar node (angular
points where the orbit of the Moon crosses the ecliptic; there are two
such points, and the descending node is 180 degrees away; TrueNode is the
osculating node element), even though that is not a physical object.

The planet name should be capitalized.

You can use .planet.fiction and add a zero-based index number from the
seorbel.txt file to calculate positions for a planet that does not
actually exist (you will not find them with a telescope). (See the
comments in seorbel.txt for the documentation of its format.)

You can use .planet.asteroid plus a minor planet catalogue number to
represent a "minor planet" (not necessarily an asteroid; dwarf planets
are also included). You can use .planet.asteroid+134340 for Pluto,
although this is a different number than .planet.Pluto, the same
positions will be calculated.

There is also .planet.barycenter which represents the solar system
barycenter, and is allowed only as a center of measurement (not as an
object), for barycentric calculations, which won't always work.


***** .projection(option)

Compute a map projection. Input options are:

 .accuracy
   Number of iterations of Newton's method, if applicable. Default is 5.

 .geoalt
   Altitude above sea level in metres (currently unused). Default is zero.

 .geolat
   Latitude in degrees, from -90 (south) to 90 (north).

 .geolon
   Longitude in degrees, from -180 (west) to 180 (east). You can subtract
   the number of the wanted prime meridian if you do not want the official
   prime meridian to be in use.

 .method
   The type of projection to use. Can be one of:

   "0" = Horoscope (maps longitude to a circle and ignores latitude)
   "2" = Eckert II
   "3" = Winkel tripel
   "4" = Eckert IV
   "6" = Eckert VI
   "7" = Kavrayskiy VII
   "A" = Aitoff
   "C" = Cassini
   "E" = Equirectangular (default)
   "G" = Gall-Peters
   "H" = Hammer
   "L" = Lambert cylindrical equal area
   "M" = Mercator (y output may be out of range -1 to +1)
   "P" = Polyconic
   "S" = Sinusoidal
   "V" = Van der Grinten
   "W" = Werner
   "Z" = Polar azimuthal equidistant
   "m" = Mollweide
   "z" = Equatorial azimuthal equidistant

   The following are not currently implemented (some require extra
   parameters, which is part of the reason why it isn't implemented; if
   they will be implemented, such parameter must be added; also, some
   are only for a part of the world):

   "1" = Gnomonic
   "8" = Cahill-Keyes octahedral
   "9" = Front face of globe
   "F" = Flat-polar quartic
   "N" = Natural Earth
   "O" = Ortelius oval
   "Q" = Craig retroazimuthal
   "R" = Robinson
   "T" = Tobler hyperelliptical
   "a" = Armadillo
   "b" = Waterman butterfly
   "c" = Lambert conformal conic
   "d" = Dymaxion
   "g" = Goode homolosine (interrupted)
   "h" = HEALPix
   "j" = Authagraph
   "k" = Gauss-Kruger
   "l" = Albers
   "o" = Hobo-Dyer
   "q" = Peirce quincunxial
   "u" = Guyou hemisphere-in-a-square

Output is an object with properties named x and y; y is positive upward,
and the result should be treated with a 1:1 aspect ratio (if the map has a
different aspect ratio, then y will have a shorter range than -1 to +1).
The x coordinate is normalized to be in range from -1 to +1. The z
coordinate is currently unused and is always zero.


***** .refract(altitude,[option])

Convert true to apparent altitude (both in degrees), by refraction.

Valid options are:

 .geoalt
    Geographic altitude (metres above sea level). The default setting is
    to compute refraction at sea level.

 .lapseRate
    Lapse rate in kelvins per metre. The default is 0.0065.

 .pressure
    Atmospheric pressure in millibars (or hectopascals).

 .temperature
    Atmospheric temperature in Celsius.


***** .release()

Try to release any memory and open file handles used by Swiss Ephemeris.
The effect is not visible; it will continue to work regardless. The path
settings will still be set and will not be reset.


***** .rise([option],[when])

Tell you when is sunrise/sunset; result is a Julian day number (you can
then use .fromJulian() to convert into a Date object). Searches after the
time specified by the second argument (by default, the current time).

Valid options are:

 .apparent
   Set true (default) for apparent positions; false for true positions.

 .disc
   Tell which part of the disc to use. Set 0 (default) for centre of disc,
   -1 for bottom of disc, and +1 for top of disc. Other numbers should not
   be used because their meaning may change in future versions.

 .ephemeris
   Specify which ephemeris to use.

 .fixed
   Set true to use a fixed disc size (for Sun and Moon); otherwise will
   try to calculate disc size.

 .geoalt
   Altitude above sea level in metres (default is sea level).

 .geolat
   Geographic latitude, in degrees. The default is the Royal Observatory.

 .geolon
   Geographic longitude, in degrees. The default is zero.

 .horizon
   The degrees of the horizon. Specify -6 for civil twilight (used for
   aviation, automobile headlights, and various other laws), -12 for
   nautical twilight (for sailors navigation and military), and -18 for
   astronomical twilight (for observing the stars).

 .nutation
   Set true (the default) to consider nutation.

 .object
   What object to compute rising/setting times for; by default, the Sun.

 .pressure
   Specify atmospheric pressure in millibars; only used if the temperature
   is also set. If omitted but the temperature is included, attempt to
   estimate it.

 .set
   False (the default) to compute rising times, or true for setting.

 .temperature
   Specify atmospheric temperature in Celsius. If omitted, don't include
   refraction in the calculation.


***** .sidereal([date_or_string],[option])

Define a sidereal mode. Sidereal modes are used to determine where the
zero point of ecliptic longitude is used; when doing calculations without
sidereal modes, the equinox of date is used.

There are two possibilities:

One is to give a date and (optionally) option. The date is the date when
the ecliptic longitude of the vernal equinox is zero, if no option is
specified; you can also omit the date to define a sidereal mode for the
ecliptic longitude of the vernal equinox to be zero at the time of
definition.

Second possibility is to use a string value, such as "Fagan/Bradley" or
"J2000" or "B1950". (See Swiss Ephemeris for a list of valid strings.) In
this case, no options are allowed.

Valid options (for the first case only) include:

 .ayanamsha &
   The ecliptic longitude (in degrees) of the vernal equinox at the
   specified date. By default, it is zero.

 .ecliptic
   Set true to use projection onto the ecliptic of the specified date.

 .ephemerisTime
   Set true to use ephemeris time instead of universal time.

 .solarSystemRotationPlane
   Set true to use projection onto the solar system rotation plane.

Returns an object. This object should not be tampered with, and later
versions may change the structure of this object. Nevertheless, if any
function requires a sidereal mode as an option, and the sidereal mode is
the default option, you can still specify it instead of the object with
the set of options if it is the only option to set.

Wherever a sidereal mode is expected, instead of an object returned by
this function, you may also specify true to use J2000, false or undefined
or omitted to use the equinox of date, or a number to use that Julian day
number (in universal time).


***** .time([when])

Computes sidereal time for longitude zero in degrees. Date must be given
in universal time.

Use this together with right ascension to compute hour angle. Local
sidereal time is Greenwich sidereal time plus the geographic longitude.
Hour angle is local sidereal time minus right ascension (using equinox
of date).


***** .unrefract(altitude,[option])

Convert apparent to true altitude (both in degrees), by refraction.

Valid options are same as .refract() function.


***** .version

The version number of Swiss Ephemeris, for example "2.06".

(This is not the same as the version of this program.)


***** (Other features not yet implemented)

Stuff that probably should be implemented in future:

- Terminator lines

- Origins of measurement other than Earth and Sun

- Moons for other planets

- Topocentric position of Earth

- Conversion between geocentric and geographic coordinates

- Search for configurations (including positions, aspects, station, solar
returns, and various others)

- Lunar eclipses

- Artificial satellites

- Galactic and supergalactic coordinates

- Constellations

- House positions in "3D" (using two coordinates, so actually 2D)

Stuff that will not be implemented in this API but in the author's opinion
may be implemented in a program using this:

- Arabic parts

- Calendar generation

- Esoteric rays

- Planetary rulerships

- Various graphics

- Macros

- World map/globe

Stuff that will not be implemented, and that in the author's opinion will
not be put into a program using this (that this author writes, anyways):

- Biorhythms

- Interpretations (which is pretty much junk anyways)

Dependents (0)

Package Sidebar

Install

npm i sweph-napi

Weekly Downloads

0

Version

0.4.0

License

GPL-2.0

Last publish

Collaborators

  • zzo38