UNPKG

sweph-wasm

Version:

High-precision Swiss Ephemeris WebAssembly bindings for TypeScript — comprehensive astronomical calculations including planetary positions, house systems, eclipses, fixed stars, and astrological computations with modern JS/TS support.

1,202 lines 139 kB
import { type FixedLengthArray } from "fixed-len-array"; import type { SwissephModule } from "src/wasm/swisseph"; /** Wrapper class for Swiss Ephemeris WebAssembly bindings. */ export default class SwissEPH { readonly TRUE = 1; readonly FALSE = 0; readonly OK = 0; readonly ERR = -1; readonly NOT_AVAILABLE = -2; readonly BEYOND_EPH_LIMITS = -3; /** Degree as string, utf8 encoding */ readonly ODEGREE_STRING = "\u00B0"; /** Biggest value for REAL8 */ readonly HUGE = 1.7e+308; /** 3.14159265358979323846 */ readonly M_PI: number; /** * Forward static obsolete used for string declarations, allowing 255 * char+\0 */ readonly AS_MAXCH = 256; readonly RADTODEG: number; readonly DEGTORAD: number; /** Degree expressed in centiseconds */ readonly DEG = 360000; /** 7.5 degrees */ readonly DEG7_30 = 2700000; readonly DEG15: number; readonly DEG24: number; readonly DEG30: number; readonly DEG60: number; readonly DEG90: number; readonly DEG120: number; readonly DEG150: number; readonly DEG180: number; readonly DEG270: number; readonly DEG360: number; /** CSTORAD = 4.84813681109536E-08 centisec to rad: pi / 180 /3600/100 */ readonly CSTORAD: number; /** RADTOCS = 2.06264806247096E+07 rad to centisec 180_3600_100/pi */ readonly RADTOCS: number; /** Centisec to degree */ readonly CS2DEG: number; /** Open binary file for reading */ readonly BFILE_R_ACCESS = "rb"; /** Open binary file for writing and reading */ readonly BFILE_RW_ACCESS = "r+b"; /** Create/open binary file for write */ readonly BFILE_W_CREATE = "wb"; /** Create/open binary file for append */ readonly BFILE_A_ACCESS = "a+b"; /** Semicolon as PATH separator */ readonly PATH_SEPARATOR = ";"; /** Default file creation mode */ readonly OPEN_MODE = "0666"; /** Open text file for reading */ readonly FILE_R_ACCESS = "rt"; /** Open text file for writing and reading */ readonly FILE_RW_ACCESS = "r+t"; /** Create/open text file for write */ readonly FILE_W_CREATE = "wt"; /** Create/open text file for append */ readonly FILE_A_ACCESS = "a+t"; /** * Attention, all backslashes for msdos directry names must be written as * because it is the C escape character glue string for directory/file */ readonly DIR_GLUE = "\\"; readonly SE_AUNIT_TO_KM = 149597870.7; readonly SE_AUNIT_TO_LIGHTYEAR: number; readonly SE_AUNIT_TO_PARSEC: number; /** Values for gregflag in swe_julday() and swe_revjul() */ readonly SE_JUL_CAL = 0; readonly SE_GREG_CAL = 1; /** Planet numbers for the ipl parameter in swe_calc() */ readonly SE_ECL_NUT = -1; readonly SE_SUN = 0; readonly SE_MOON = 1; readonly SE_MERCURY = 2; readonly SE_VENUS = 3; readonly SE_MARS = 4; readonly SE_JUPITER = 5; readonly SE_SATURN = 6; readonly SE_URANUS = 7; readonly SE_NEPTUNE = 8; readonly SE_PLUTO = 9; readonly SE_MEAN_NODE = 10; readonly SE_TRUE_NODE = 11; readonly SE_MEAN_APOG = 12; readonly SE_OSCU_APOG = 13; readonly SE_EARTH = 14; readonly SE_CHIRON = 15; readonly SE_PHOLUS = 16; readonly SE_CERES = 17; readonly SE_PALLAS = 18; readonly SE_JUNO = 19; readonly SE_VESTA = 20; readonly SE_INTP_APOG = 21; readonly SE_INTP_PERG = 22; readonly SE_NPLANETS = 23; readonly SE_PLMOON_OFFSET = 9000; readonly SE_AST_OFFSET = 10000; readonly SE_VARUNA: number; readonly SE_FICT_OFFSET = 40; readonly SE_FICT_OFFSET_1 = 39; readonly SE_FICT_MAX = 999; readonly SE_NFICT_ELEM = 15; readonly SE_COMET_OFFSET = 1000; readonly SE_NALL_NAT_POINTS: number; /** Hamburger or Uranian "planets" */ readonly SE_CUPIDO = 40; readonly SE_HADES = 41; readonly SE_ZEUS = 42; readonly SE_KRONOS = 43; readonly SE_APOLLON = 44; readonly SE_ADMETOS = 45; readonly SE_VULKANUS = 46; readonly SE_POSEIDON = 47; /** Other fictitious bodies */ readonly SE_ISIS = 48; readonly SE_NIBIRU = 49; readonly SE_HARRINGTON = 50; readonly SE_NEPTUNE_LEVERRIER = 51; readonly SE_NEPTUNE_ADAMS = 52; readonly SE_PLUTO_LOWELL = 53; readonly SE_PLUTO_PICKERING = 54; readonly SE_VULCAN = 55; readonly SE_WHITE_MOON = 56; readonly SE_PROSERPINA = 57; readonly SE_WALDEMATH = 58; readonly SE_FIXSTAR = -10; readonly SE_ASC = 0; readonly SE_MC = 1; readonly SE_ARMC = 2; readonly SE_VERTEX = 3; readonly SE_EQUASC = 4; /** "equatorial ascendant" */ readonly SE_COASC1 = 5; /** "co-ascendant" ( W. Koch) */ readonly SE_COASC2 = 6; /** "co-ascendant" ( M. Munkasey) */ readonly SE_POLASC = 7; /** "polar ascendant" ( M. Munkasey) */ readonly SE_NASCMC = 8; /** * Flag bits for parameter iflag in swe_calc() The flag bits are defined in * such a way that iflag = 0 delivers what one usually wants: * * - The default ephemeris ( SWISS EPHEMERIS) is used, * - Apparent geocentric positions referring to the true equinox of date are * returned. If not only coordinates, but also speed values are required, * use flag = SEFLG_SPEED. The 'L' behind the number indicates that 32-bit * integers ( Long) are used. */ /** Use JPL ephemeris */ readonly SEFLG_JPLEPH = 1; /** Use SWISSEPH ephemeris */ readonly SEFLG_SWIEPH = 2; /** Use Moshier ephemeris */ readonly SEFLG_MOSEPH = 4; /** Heliocentric position */ readonly SEFLG_HELCTR = 8; /** True/geometric position, not apparent position */ readonly SEFLG_TRUEPOS = 16; /** No precession, i.e. give J2000 equinox */ readonly SEFLG_J2000 = 32; /** No nutation, i.e. mean equinox of date */ readonly SEFLG_NONUT = 64; /** * Speed from 3 positions (do not use it, SEFLG_SPEED is faster and more * precise.) */ readonly SEFLG_SPEED3 = 128; /** High precision speed */ readonly SEFLG_SPEED = 256; /** Turn off gravitational deflection */ readonly SEFLG_NOGDEFL = 512; /** Turn off 'annual' aberration of light */ readonly SEFLG_NOABERR = 1024; /** * Astrometric position, i.e. with light - time, but without aberration and * light deflection */ readonly SEFLG_ASTROMETRIC: number; /** Equatorial positions are wanted */ readonly SEFLG_EQUATORIAL: number; /** Cartesian, not polar, coordinates */ readonly SEFLG_XYZ: number; /** Coordinates in radians, not degrees */ readonly SEFLG_RADIANS: number; /** Barycentric position */ readonly SEFLG_BARYCTR: number; /** Topocentric position */ readonly SEFLG_TOPOCTR: number; /** Used for Astronomical Almanac mode in calculation of Kepler elipses */ readonly SEFLG_ORBEL_AA: number; /** Tropical position ( default) */ readonly SEFLG_TROPICAL = 0; /** Sidereal position */ readonly SEFLG_SIDEREAL: number; /** ICRS ( DE406 reference frame) */ readonly SEFLG_ICRS: number; /** Reproduce JPL Horizons 1962 - today to 0.002 arcsec. */ readonly SEFLG_DPSIDEPS_1980: number; readonly SEFLG_JPLHOR: number; /** Approximate JPL Horizons 1962 - today */ readonly SEFLG_JPLHOR_APPROX: number; /** * Calculate position of center of body ( COB) of planet, not barycenter of * its system */ readonly SEFLG_CENTER_BODY: number; /** Test raw data in files sepm9* */ readonly SEFLG_TEST_PLMOON: number; readonly SE_SIDBITS = 256; /** For projection onto ecliptic of t0 */ readonly SE_SIDBIT_ECL_T0 = 256; /** For projection onto solar system plane */ readonly SE_SIDBIT_SSY_PLANE = 512; /** With user-defined ayanamsha, t0 is UT */ readonly SE_SIDBIT_USER_UT = 1024; /** * Ayanamsha measured on ecliptic of date; see commentaries in sweph.c: * swi_get_ayanamsa_ex(). */ readonly SE_SIDBIT_ECL_DATE = 2048; /** * Test feature: don't apply const ant offset to ayanamsha see commentary * above sweph.c: get_aya_correction() */ readonly SE_SIDBIT_NO_PREC_OFFSET = 4096; /** Test feature: calculate ayanamsha using its original precession model */ readonly SE_SIDBIT_PREC_ORIG = 8192; /** Sidereal modes ( ayanamsas) */ readonly SE_SIDM_FAGAN_BRADLEY = 0; readonly SE_SIDM_LAHIRI = 1; readonly SE_SIDM_DELUCE = 2; readonly SE_SIDM_RAMAN = 3; readonly SE_SIDM_USHASHASHI = 4; readonly SE_SIDM_KRISHNAMURTI = 5; readonly SE_SIDM_DJWHAL_KHUL = 6; readonly SE_SIDM_YUKTESHWAR = 7; readonly SE_SIDM_JN_BHASIN = 8; readonly SE_SIDM_BABYL_KUGLER1 = 9; readonly SE_SIDM_BABYL_KUGLER2 = 10; readonly SE_SIDM_BABYL_KUGLER3 = 11; readonly SE_SIDM_BABYL_HUBER = 12; readonly SE_SIDM_BABYL_ETPSC = 13; readonly SE_SIDM_ALDEBARAN_15TAU = 14; readonly SE_SIDM_HIPPARCHOS = 15; readonly SE_SIDM_SASSANIAN = 16; readonly SE_SIDM_GALCENT_0SAG = 17; readonly SE_SIDM_J2000 = 18; readonly SE_SIDM_J1900 = 19; readonly SE_SIDM_B1950 = 20; readonly SE_SIDM_SURYASIDDHANTA = 21; readonly SE_SIDM_SURYASIDDHANTA_MSUN = 22; readonly SE_SIDM_ARYABHATA = 23; readonly SE_SIDM_ARYABHATA_MSUN = 24; readonly SE_SIDM_SS_REVATI = 25; readonly SE_SIDM_SS_CITRA = 26; readonly SE_SIDM_TRUE_CITRA = 27; readonly SE_SIDM_TRUE_REVATI = 28; readonly SE_SIDM_TRUE_PUSHYA = 29; readonly SE_SIDM_GALCENT_RGILBRAND = 30; readonly SE_SIDM_GALEQU_IAU1958 = 31; readonly SE_SIDM_GALEQU_TRUE = 32; readonly SE_SIDM_GALEQU_MULA = 33; readonly SE_SIDM_GALALIGN_MARDYKS = 34; readonly SE_SIDM_TRUE_MULA = 35; readonly SE_SIDM_GALCENT_MULA_WILHELM = 36; readonly SE_SIDM_ARYABHATA_522 = 37; readonly SE_SIDM_BABYL_BRITTON = 38; readonly SE_SIDM_TRUE_SHEORAN = 39; readonly SE_SIDM_GALCENT_COCHRANE = 40; readonly SE_SIDM_GALEQU_FIORENZA = 41; readonly SE_SIDM_VALENS_MOON = 42; readonly SE_SIDM_LAHIRI_1940 = 43; readonly SE_SIDM_LAHIRI_VP285 = 44; readonly SE_SIDM_KRISHNAMURTI_VP291 = 45; readonly SE_SIDM_LAHIRI_ICRC = 46; /** User-defined ayanamsha, t0 is TT */ readonly SE_SIDM_USER = 255; readonly SE_NSIDM_PREDEF = 47; /** Used for swe_nod_aps(): */ /** Mean nodes/apsides */ readonly SE_NODBIT_MEAN = 1; /** Osculating nodes/apsides */ readonly SE_NODBIT_OSCU = 2; /** Same, but motion about solar system barycenter is considered */ readonly SE_NODBIT_OSCU_BAR = 4; /** Focal point of orbit instead of aphelion */ readonly SE_NODBIT_FOPOINT = 256; /** Default ephemeris used when no ephemeris flagbit is set */ readonly SEFLG_DEFAULTEPH = 2; /** * Maximum size of fixstar name; the parameter star in swe_fixstar must * allow twice this space for the returned star name. */ readonly SE_MAX_STNAME = 256; /** Defines for eclipse computations */ readonly SE_ECL_CENTRAL = 1; readonly SE_ECL_NONCENTRAL = 2; readonly SE_ECL_TOTAL = 4; readonly SE_ECL_ANNULAR = 8; readonly SE_ECL_PARTIAL = 16; readonly SE_ECL_ANNULAR_TOTAL = 32; /** = annular-total */ readonly SE_ECL_HYBRID = 32; readonly SE_ECL_PENUMBRAL = 64; readonly SE_ECL_ALLTYPES_SOLAR: number; readonly SE_ECL_ALLTYPES_LUNAR: number; readonly SE_ECL_VISIBLE = 128; readonly SE_ECL_MAX_VISIBLE = 256; /** Begin of partial eclipse */ readonly SE_ECL_1ST_VISIBLE = 512; /** Begin of partial eclipse */ readonly SE_ECL_PARTBEG_VISIBLE = 512; /** Begin of total eclipse */ readonly SE_ECL_2ND_VISIBLE = 1024; /** Begin of total eclipse */ readonly SE_ECL_TOTBEG_VISIBLE = 1024; /** End of total eclipse */ readonly SE_ECL_3RD_VISIBLE = 2048; /** End of total eclipse */ readonly SE_ECL_TOTEND_VISIBLE = 2048; /** End of partial eclipse */ readonly SE_ECL_4TH_VISIBLE = 4096; /** End of partial eclipse */ readonly SE_ECL_PARTEND_VISIBLE = 4096; /** Begin of penumbral eclipse */ readonly SE_ECL_PENUMBBEG_VISIBLE = 8192; /** End of penumbral eclipse */ readonly SE_ECL_PENUMBEND_VISIBLE = 16384; /** Occultation begins during the day */ readonly SE_ECL_OCC_BEG_DAYLIGHT = 8192; /** Occultation ends during the day */ readonly SE_ECL_OCC_END_DAYLIGHT = 16384; /** * Check if the next conjunction of the moon with a planet is an * occultation; don't search further */ readonly SE_ECL_ONE_TRY: number; /** For swe_rise_transit() */ readonly SE_CALC_RISE = 1; readonly SE_CALC_SET = 2; readonly SE_CALC_MTRANSIT = 4; readonly SE_CALC_ITRANSIT = 8; /** * To be or'ed to SE_CALC_RISE/SET, if rise or set of disc center is * required */ readonly SE_BIT_DISC_CENTER = 256; /** * To be or'ed to SE_CALC_RISE/SET, if rise or set of lower limb of disc is * requried */ readonly SE_BIT_DISC_BOTTOM = 8192; /** * Use geocentric rather than topocentric position of object and ignore its * ecliptic latitude */ readonly SE_BIT_GEOCTR_NO_ECL_LAT = 128; /** To be or'ed to SE_CALC_RISE/SET, if refraction is to be ignored */ readonly SE_BIT_NO_REFRACTION = 512; /** To be or'ed to SE_CALC_RISE/SET */ readonly SE_BIT_CIVIL_TWILIGHT = 1024; /** To be or'ed to SE_CALC_RISE/SET */ readonly SE_BIT_NAUTIC_TWILIGHT = 2048; /** To be or'ed to SE_CALC_RISE/SET */ readonly SE_BIT_ASTRO_TWILIGHT = 4096; /** Or'ed to SE_CALC_RISE/SET: neglect the effect of distance on disc size */ readonly SE_BIT_FIXED_DISC_SIZE = 16384; /** * This is only an Astrodienst in-house test flag.It forces the usage of the * old, slow calculation of risings and settings. */ readonly SE_BIT_FORCE_SLOW_METHOD = 32768; readonly SE_BIT_HINDU_RISING: number; /** For swe_azalt() and swe_azalt_rev() */ readonly SE_ECL2HOR = 0; readonly SE_EQU2HOR = 1; readonly SE_HOR2ECL = 0; readonly SE_HOR2EQU = 1; /** For swe_refrac() */ readonly SE_TRUE_TO_APP = 0; readonly SE_APP_TO_TRUE = 1; /** * Only used for experimenting with various JPL ephemeris files which are * available at Astrodienst's internal network */ readonly SE_DE_NUMBER = 431; readonly SE_FNAME_DE200 = "de200.eph"; readonly SE_FNAME_DE403 = "de403.eph"; readonly SE_FNAME_DE404 = "de404.eph"; readonly SE_FNAME_DE405 = "de405.eph"; readonly SE_FNAME_DE406 = "de406.eph"; readonly SE_FNAME_DE431 = "de431.eph"; readonly SE_FNAME_DFT = "de431.eph"; readonly SE_FNAME_DFT2 = "de406.eph"; readonly SE_STARFILE_OLD = "fixstars.cat"; readonly SE_STARFILE = "sefstars.txt"; readonly SE_ASTNAMFILE = "seasnam.txt"; readonly SE_FICTFILE = "seorbel.txt"; /** Defines for swe_split_deg() ( in swephlib.c) */ readonly SE_SPLIT_DEG_ROUND_SEC = 1; readonly SE_SPLIT_DEG_ROUND_MIN = 2; readonly SE_SPLIT_DEG_ROUND_DEG = 4; readonly SE_SPLIT_DEG_ZODIACAL = 8; readonly SE_SPLIT_DEG_NAKSHATRA = 1024; /** * Don't round to next sign, e.g. 29.9999999 will be rounded to 29d59'59" ( * or 29d59' or 29d) */ readonly SE_SPLIT_DEG_KEEP_SIGN = 16; /** * Don't round to next degree e.g. 13.9999999 will be rounded to 13d59'59" ( * or 13d59' or 13d) */ readonly SE_SPLIT_DEG_KEEP_DEG = 32; /** For heliacal functions */ readonly SE_HELIACAL_RISING = 1; readonly SE_HELIACAL_SETTING = 2; readonly SE_MORNING_FIRST = 1; readonly SE_EVENING_LAST = 2; readonly SE_EVENING_FIRST = 3; readonly SE_MORNING_LAST = 4; /** Still not implemented */ readonly SE_ACRONYCHAL_RISING = 5; /** Still not implemented */ readonly SE_ACRONYCHAL_SETTING = 6; readonly SE_COSMICAL_SETTING = 6; readonly SE_HELFLAG_LONG_SEARCH = 128; readonly SE_HELFLAG_HIGH_PRECISION = 256; readonly SE_HELFLAG_OPTICAL_PARAMS = 512; readonly SE_HELFLAG_NO_DETAILS = 1024; /** 2048 */ readonly SE_HELFLAG_SEARCH_1_PERIOD: number; /** 4096 */ readonly SE_HELFLAG_VISLIM_DARK: number; /** 8192 */ readonly SE_HELFLAG_VISLIM_NOMOON: number; /** The following undocumented defines are for test reasons only */ /** 16384 */ readonly SE_HELFLAG_VISLIM_PHOTOPIC: number; /** 32768 */ readonly SE_HELFLAG_VISLIM_SCOTOPIC: number; /** 65536 */ readonly SE_HELFLAG_AV: number; /** 65536 */ readonly SE_HELFLAG_AVKIND_VR: number; readonly SE_HELFLAG_AVKIND_PTO: number; readonly SE_HELFLAG_AVKIND_MIN7: number; readonly SE_HELFLAG_AVKIND_MIN9: number; readonly SE_HELFLAG_AVKIND: number; readonly TJD_INVALID = 99999999; readonly SIMULATE_VICTORVB = 1; /** Unused and redundant */ readonly SE_HELIACAL_LONG_SEARCH = 128; readonly SE_HELIACAL_HIGH_PRECISION = 256; readonly SE_HELIACAL_OPTICAL_PARAMS = 512; readonly SE_HELIACAL_NO_DETAILS = 1024; /** 2048 */ readonly SE_HELIACAL_SEARCH_1_PERIOD: number; /** 4096 */ readonly SE_HELIACAL_VISLIM_DARK: number; /** 8192 */ readonly SE_HELIACAL_VISLIM_NOMOON: number; /** 16384 */ readonly SE_HELIACAL_VISLIM_PHOTOPIC: number; /** 32768 */ readonly SE_HELIACAL_AVKIND_VR: number; readonly SE_HELIACAL_AVKIND_PTO: number; readonly SE_HELIACAL_AVKIND_MIN7: number; readonly SE_HELIACAL_AVKIND_MIN9: number; readonly SE_HELIACAL_AVKIND: number; readonly SE_PHOTOPIC_FLAG = 0; readonly SE_SCOTOPIC_FLAG = 1; readonly SE_MIXEDOPIC_FLAG = 2; /** * For swe_set_tid_acc() and ephemeris-dependent delta t: intrinsic tidal * acceleration in the mean motion of the moon, not given in the parameters * list of the ephemeris files but computed by Chapront / Chapront - Touzé / * Francou A & A 387(2002), p. 705. */ readonly SE_TIDAL_DE200 = -23.8946; /** Was ( -25.8) until V. 1.76.2 */ readonly SE_TIDAL_DE403 = -25.58; /** Was ( -25.8) until V. 1.76.2 */ readonly SE_TIDAL_DE404 = -25.58; /** Was ( -25.7376) until V. 1.76.2 */ readonly SE_TIDAL_DE405 = -25.826; /** Was ( -25.7376) until V. 1.76.2 */ readonly SE_TIDAL_DE406 = -25.826; /** JPL Interoffice Memorandum 14-mar-2008 on DE421 Lunar Orbit */ readonly SE_TIDAL_DE421 = -25.85; /** JPL Interoffice Memorandum 14-mar-2008 on DE421 ( sic!) Lunar Orbit */ readonly SE_TIDAL_DE422 = -25.85; /** JPL Interoffice Memorandum 9-jul-2013 on DE430 Lunar Orbit */ readonly SE_TIDAL_DE430 = -25.82; /** * IPN Progress Report 42-196 • February 15, 2014, p. 15; was ( -25.82) in * V. 2.00.00 */ readonly SE_TIDAL_DE431 = -25.8; /** Unpublished value, from email by Jon Giorgini to DK on 11 Apr 2021 */ readonly SE_TIDAL_DE441 = -25.936; readonly SE_TIDAL_26 = -26; readonly SE_TIDAL_STEPHENSON_2016 = -25.85; readonly SE_TIDAL_DEFAULT = -25.8; readonly SE_TIDAL_AUTOMATIC = 999999; readonly SE_TIDAL_MOSEPH = -25.58; readonly SE_TIDAL_SWIEPH = -25.8; readonly SE_TIDAL_JPLEPH = -25.8; /** For swe_set_delta_t_userdef() */ readonly SE_DELTAT_AUTOMATIC = -1e-10; readonly SE_MODEL_DELTAT = 0; readonly SE_MODEL_PREC_LONGTERM = 1; readonly SE_MODEL_PREC_SHORTTERM = 2; readonly SE_MODEL_NUT = 3; readonly SE_MODEL_BIAS = 4; readonly SE_MODEL_JPLHOR_MODE = 5; readonly SE_MODEL_JPLHORA_MODE = 6; readonly SE_MODEL_SIDT = 7; readonly NSE_MODELS = 8; /** Precession models */ readonly SEMOD_NPREC = 11; readonly SEMOD_PREC_IAU_1976 = 1; readonly SEMOD_PREC_LASKAR_1986 = 2; readonly SEMOD_PREC_WILL_EPS_LASK = 3; readonly SEMOD_PREC_WILLIAMS_1994 = 4; readonly SEMOD_PREC_SIMON_1994 = 5; readonly SEMOD_PREC_IAU_2000 = 6; readonly SEMOD_PREC_BRETAGNON_2003 = 7; readonly SEMOD_PREC_IAU_2006 = 8; readonly SEMOD_PREC_VONDRAK_2011 = 9; readonly SEMOD_PREC_OWEN_1990 = 10; readonly SEMOD_PREC_NEWCOMB = 11; readonly SEMOD_PREC_DEFAULT = 9; /** * SE versions before 1.70 used IAU 1976 precession for a limited time range * of 2 centuries in combination with the long - term precession Simon * 1994. */ readonly SEMOD_PREC_DEFAULT_SHORT = 9; /** Nutation models */ readonly SEMOD_NNUT = 5; readonly SEMOD_NUT_IAU_1980 = 1; /** * Herring's ( 1987) corrections to IAU 1980 nutation series.AA(1996) * neglects them. */ readonly SEMOD_NUT_IAU_CORR_1987 = 2; /** Very time consuming ! */ readonly SEMOD_NUT_IAU_2000A = 3; /** Fast, but precision of milli-arcsec */ readonly SEMOD_NUT_IAU_2000B = 4; readonly SEMOD_NUT_WOOLARD = 5; /** Fast, but precision of milli-arcsec */ readonly SEMOD_NUT_DEFAULT = 4; /** Methods for sidereal time */ readonly SEMOD_NSIDT = 4; readonly SEMOD_SIDT_IAU_1976 = 1; readonly SEMOD_SIDT_IAU_2006 = 2; readonly SEMOD_SIDT_IERS_CONV_2010 = 3; readonly SEMOD_SIDT_LONGTERM = 4; readonly SEMOD_SIDT_DEFAULT = 4; /** Frame bias methods */ readonly SEMOD_NBIAS = 3; /** Ignore frame bias */ readonly SEMOD_BIAS_NONE = 1; /** Use frame bias matrix IAU 2000 */ readonly SEMOD_BIAS_IAU2000 = 2; /** Use frame bias matrix IAU 2006 */ readonly SEMOD_BIAS_IAU2006 = 3; readonly SEMOD_BIAS_DEFAULT = 3; /** * Methods of JPL Horizons ( iflag & SEFLG_JPLHOR), using daily dpsi, deps; * see explanations below */ readonly SEMOD_NJPLHOR = 2; /** Daily dpsi and deps from file are */ readonly SEMOD_JPLHOR_LONG_AGREEMENT = 1; /** * Limited to 1962 - today.JPL uses the first and last value for all dates * beyond this time range. */ readonly SEMOD_JPLHOR_DEFAULT = 1; /** * Note, currently this is the only option for SEMOD_JPLHOR.. * SEMOD_JPLHOR_LONG_AGREEMENT, if combined with SEFLG_JPLHOR provides good * agreement with JPL Horizons for 9998 BC(-9997) until 9999 CE. * * - After 20 - jan - 1962 until today, Horizons uses correct dpsi and deps. * - For dates before that, it uses dpsi and deps of 20 - jan - 1962, which * provides a continuous ephemeris, but does not make sense otherwise. * - Before 1.1.1799 and after 1.1.2202, the precession model Owen 1990 is * used, as in Horizons. An agreement with Horizons to a couple of milli * arc seconds is achieved for the whole time range of Horizons. (BC 9998 * * - Mar - 20 to AD 9999 - Dec - 31 TT.) methods of approximation of JPL * Horizons ( iflag & SEFLG_JPLHORA), without dpsi, deps; see * explanations below */ readonly SEMOD_NJPLHORA = 3; readonly SEMOD_JPLHORA_1 = 1; readonly SEMOD_JPLHORA_2 = 2; readonly SEMOD_JPLHORA_3 = 3; readonly SEMOD_JPLHORA_DEFAULT = 3; /** * With SEMOD_JPLHORA_1, planetary positions are always calculated using a * recent precession / nutation model.Frame bias matrix is applied with some * correction to RA and another correction added to epsilon. this provides a * very good approximation of JPL Horizons positions. With SEMOD_JPLHORA_2, * frame bias as recommended by IERS Conventions 2003 and 2010 is not * applied.Instead, dpsi_bias and deps_bias are added to nutation.this * procedure is found in some older astronomical software. Equatorial * apparent positions will be close to JPL Horizons (within a few mas) * between 1962 and current years.Ecl.longitude will be good, latitude bad. * With SEMOD_JPLHORA_3 works like SEMOD_JPLHORA_3 after 1962, but like * SEFLG_JPLHOR before that.this allows EXTREMELY good agreement with JPL * Horizons over its whole time range. */ readonly SEMOD_NDELTAT = 5; readonly SEMOD_DELTAT_STEPHENSON_MORRISON_1984 = 1; readonly SEMOD_DELTAT_STEPHENSON_1997 = 2; readonly SEMOD_DELTAT_STEPHENSON_MORRISON_2004 = 3; readonly SEMOD_DELTAT_ESPENAK_MEEUS_2006 = 4; readonly SEMOD_DELTAT_STEPHENSON_ETC_2016 = 5; /** Public SEMOD_DELTAT_DEFAULT = SEMOD_DELTAT_ESPENAK_MEEUS_2006; */ readonly SEMOD_DELTAT_DEFAULT = 5; /** The Swisseph Emscripten WebAssembly Module instance. */ wasm: SwissephModule; /** * Creates a new instance. * * @param wasm - Swisseph Emscripten WebAssembly Module instance */ constructor(wasm: SwissephModule); /** * Static method for creating and initializing the Swisseph module. This * method handles the asynchronous loading of the WebAssembly file. * * @param wasm_path An optional path to the `swisseph.wasm` file. If not * provided, it defaults to a path relative to the current module. * @returns A Promise that resolves to an initialized `SwissEPH` instance. */ static init(wasm_path?: string): Promise<SwissEPH>; /** * Converts horizontal coordinates (azimuth and altitude) to either ecliptic * or equatorial coordinates, based on the observer's geographical position * and desired coordinate system. * * @param tjd_ut - Julian day in Universal Time (UT). * @param calc_flag - Calculation mode flag: `SE_HOR2ECL` for ecliptic or * `SE_HOR2EQU` for equatorial conversion. * @param geopos - Observer's geographic position as a tuple: `[longitude, * latitude, elevation]` in degrees/meters. * @param xin - Horizontal coordinates as `[azimuth, true altitude]` in * degrees. * @returns {CelestialCoordinates2D} An Array of 2 numbers representing * celestial coordinates in either: * * - **Ecliptic coordinates**: (λ, β) when using `SE_HOR2ECL` * - **Equatorial coordinates**: (α, δ) when using `SE_HOR2EQU` * * Array format: * * - `[0]` → longitude / right ascension * - `[1]` → latitude / declination */ swe_azalt_rev(tjd_ut: number, calc_flag: number, geopos: [longitude: number, latitude: number, elevation: number], xin: [azimuth: number, true_altitude: number]): CelestialCoordinates2D; /** * Converts ecliptic or equatorial coordinates into horizontal coordinates * based on observer's geographic location and atmospheric conditions. * * @param {number} tjd_ut - Julian Day in Universal Time * @param {number} calc_flag - Calculation flag: `0 (SE_ECL2HOR)` for * ecliptic, `1 (SE_EQU2HOR)` for equatorial to horizontal * @param {[number, number, number]} geopos - Observer's geographic * coordinates as `[longitude, latitude, elevation]` * @param {number} atpress - Atmospheric pressure in mbar/hPa (0 to * auto-estimate) * @param {number} attemp - Atmospheric temperature in °C * @param {[number, number, number]} xin - Input coordinates: * `[longitude/right ascension, latitude/declination, distance * (optional)]` * @returns {HorizontalCoordinates} Array of 2 numbers representing * horizontal coordinates of a celestial object: * * Array format: * * - `[0]` → Azimuth in degrees (measured from the south point, increasing * westwards) * - `[1]` → True altitude above the horizon in degrees * - `[2]` → Apparent altitude in degrees (corrected for atmospheric * refraction) */ swe_azalt(tjd_ut: number, calc_flag: number, geopos: [number, number, number], atpress: number, attemp: number, xin: [number, number, number]): HorizontalCoordinates; /** * Computes the planetocentric apparent position of a target celestial body * as seen from another planet. Useful for generating ephemerides from the * perspective of a different planet — for example, Jupiter-centric * positions of other planets. * * @param {number} tjd_et - Julian day (ephemeris time, TT) * @param {number} ipl - Target body ID (e.g., SE_MARS) * @param {number} iplctr - Center body ID (e.g., SE_JUPITER) * @param {number} iflag - Computation flags (bitwise ORed SEFLG swe) * @returns {CelestialCoordinatesAdvance} Array of 6 numbers representing * celestial position: * * Array format: * * - `[0]` → Longitude (λ), Right Ascension (α), Cartesian X, or True * Obliquity (ε) depending on flags * - `[1]` → Latitude (β), Declination (δ), Cartesian Y, or Mean Obliquity (ε) * depending on flags * - `[2]` → Distance (AU), Cartesian Z, or Nutation in longitude (Δψ) * depending on flags * - `[3]` → Longitude daily speed (λs), Right Ascension daily speed (αs), * Cartesian X speed (xs), or Nutation in obliquity (Δε) * - `[4]` → Latitude daily speed (βs), Declination daily speed (δs), * Cartesian Y speed (ys) * - `[5]` → Distance daily speed (aus), Cartesian Z speed (zs) * * @throws {SWEerror} - SWEerror If fails. */ swe_calc_pctr(tjd_et: number, ipl: number, iplctr: number, iflag: number): CelestialCoordinatesAdvance; /** * Computes positions of planets, asteroids, lunar nodes, and apogees for a * given Julian date. * * @param {number} tjd_ut - Julian day in universal time. * @param {number} ipl - Target object ID (planet, asteroid, etc.). * @param {number} iflag - Calculation flags controlling precision and * output format. * @returns {CelestialCoordinatesAdvance} Array of 6 numbers representing * celestial position: * * Array format: * * - `[0]` → Longitude (λ), Right Ascension (α), Cartesian X, or True * Obliquity (ε) depending on flags * - `[1]` → Latitude (β), Declination (δ), Cartesian Y, or Mean Obliquity (ε) * depending on flags * - `[2]` → Distance (AU), Cartesian Z, or Nutation in longitude (Δψ) * depending on flags * - `[3]` → Longitude daily speed (λs), Right Ascension daily speed (αs), * Cartesian X speed (xs), or Nutation in obliquity (Δε) * - `[4]` → Latitude daily speed (βs), Declination daily speed (δs), * Cartesian Y speed (ys) * - `[5]` → Distance daily speed (aus), Cartesian Z speed (zs) * * @throws {SWEerror} - SWEerror If fails. */ swe_calc_ut(tjd_ut: number, ipl: number, iflag: number): CelestialCoordinatesAdvance; /** * Compute positions of planets, asteroids, lunar nodes and apogees from * ephemeris time * * @param tjd_et - Julian day in terrestrial/ephemeris time. * @param ipl - Target object ID (planet, asteroid, etc.). * @param iflag - Calculation flags controlling precision and output format. * @returns {CelestialCoordinatesAdvance} Array of 6 numbers representing * celestial position: * * Array format: * * - `[0]` → Longitude (λ), Right Ascension (α), Cartesian X, or True * Obliquity (ε) depending on flags * - `[1]` → Latitude (β), Declination (δ), Cartesian Y, or Mean Obliquity (ε) * depending on flags * - `[2]` → Distance (AU), Cartesian Z, or Nutation in longitude (Δψ) * depending on flags * - `[3]` → Longitude daily speed (λs), Right Ascension daily speed (αs), * Cartesian X speed (xs), or Nutation in obliquity (Δε) * - `[4]` → Latitude daily speed (βs), Declination daily speed (δs), * Cartesian Y speed (ys) * - `[5]` → Distance daily speed (aus), Cartesian Z speed (zs) * * @throws {SWEerror} - SWEerror If fails. */ swe_calc(tjd_et: number, ipl: number, iflag: number): CelestialCoordinatesAdvance; /** * Reset swisseph internals and cleanup file handles Not usually required as * Node cleans after itself */ swe_close(): void; /** * Transform between ecliptic and equatorial coordinate systems including * motion speeds From equatorial to ecliptic, obliquity must be positive * From ecliptic to equatorial, obliquity must be negative Distances are not * affected and can be 0 * * @param {CelestialCoordinatesAdvance} xpo - Input coordinates in ecliptic * or equatorial coordinates [lon, lat, dist, lonSpd, latSpd, distSpd] * @param {number} eps - Positive or negative obliquity of the ecliptic * @returns {CelestialCoordinatesAdvance} Array of 6 numbers representing * celestial position: * * Array format: * * - `[0]` → Longitude (λ), Right Ascension (α), Cartesian X, or True * Obliquity (ε) depending on flags * - `[1]` → Latitude (β), Declination (δ), Cartesian Y, or Mean Obliquity (ε) * depending on flags * - `[2]` → Distance (AU), Cartesian Z, or Nutation in longitude (Δψ) * depending on flags * - `[3]` → Longitude daily speed (λs), Right Ascension daily speed (αs), * Cartesian X speed (xs), or Nutation in obliquity (Δε) * - `[4]` → Latitude daily speed (βs), Declination daily speed (δs), * Cartesian Y speed (ys) * - `[5]` → Distance daily speed (aus), Cartesian Z speed (zs) */ swe_cotrans_sp(xpo: CelestialCoordinatesAdvance, eps: number): CelestialCoordinatesAdvance; /** * Transform between ecliptic and equatorial coordinate systems From * equatorial to ecliptic, obliquity must be positive From ecliptic to * equatorial, obliquity must be negative Distance is not affected and can * be 0 * * @param {CelestialCoordinates3D} xpo - Input coordinates in ecliptic or * equatorial coordinates [lon, lat, dist] * @param {number} eps - Positive or negative obliquity of the ecliptic * @returns {CelestialCoordinates3D} Array of 3 numbers representing * celestial position: * * Array format: * * - `[0]` → Longitude (λ), Right Ascension (α), Cartesian X, or True * Obliquity (ε) depending on flags * - `[1]` → Latitude (β), Declination (δ), Cartesian Y, or Mean Obliquity (ε) * depending on flags * - `[2]` → Distance (AU), Cartesian Z, or Nutation in longitude (Δψ) * depending on flags */ swe_cotrans(xpo: CelestialCoordinates3D, eps: number): CelestialCoordinates3D; /** * Convert centiseconds to degrees string * * @param csec - Centiseconds value * @returns String */ swe_cs2degstr(csec: number): string; /** * Convert centiseconds to longitude or latitude string with user defined * sign character * * @param csec - Centiseconds value * @param pchar - Sign character for positive values * @param mchar - Sign character for negative values * @returns String */ swe_cs2lonlatstr(csec: number, pchar: string, mchar: string): string; /** * Convert centiseconds to time string * * @param csec - Centiseconds value * @param sep - Separator character * @param suppresszero - Omit seconds if they are zero * @returns String */ swe_cs2timestr(csec: number, sep: string, suppresszero: boolean): string; /** * Normalize centiseconds to 360 degrees range * * @param csec - Centiseconds value * @returns Number */ swe_csnorm(csec: number): number; /** * Round centiseconds to nearest second * * @param csec - Centiseconds value * @returns Number */ swe_csroundsec(csec: number): number; /** * Round double precision value to long integer * * @param x - Double value * @returns Number */ swe_d2l(csec: number): number; /** * Calculate julian day and check if the date is valid * * @param {number} year Full year * @param {number} month Month (1-12) * @param {number} day Day (1-31) * @param {number} uttime Universal time in decimal Hour fraction (0-23.999) * @param {char} calendar: Calendar system, 'g' for gregorian calendar, 'j' * for julian calendar calendar g[regorian]|j[ulian]|a[stro = greg] * @returns {Number} Julian day numeric value */ swe_date_conversion(year: number, month: number, day: number, uttime: number, calendar?: "g" | "j"): number; /** * Find which day of the week a particular date is * * @param {number} jd Julian day value in universal time number // 0 = * monday, ... 6 = sunday; */ swe_day_of_week(jd: number): number; /** * Normalize degree value to 0-360 range * * @param {number} deg Degree value number // Normalized degree value; */ swe_degnorm(deg: number): number; /** * Obtain the Delta T value for a date using a particular ephemeris system * * @param {number} tjd Julian day value in Universal Time * @param {number} iflag Ephemeris flag (SEFLG_SWIEPH, SEFLG_JPLEPH or * SEFLG_MOSEPH) * @returns {number} Delta T value * @throws {SWEerror} Warning message if any */ swe_deltat_ex(tjd: number, iflag: number): number; /** * Obtain the Delta T value for a particular date * * @param {number} tjd Julian day value in Universal Time number // Delta T * value */ swe_deltat(tjd: number): number; /** * Arc distance between two points in centiseconds * * @param {number} csecP1 First point in centiseconds * @param {number} csecP2 Second point in centiseconds number // Distance in * centiseconds from -64800000 to 64800000 (negative if second point is * ahead of the first) */ swe_difcs2n(csecP1: number, csecP2: number): number; /** * Arc distance between two points in centiseconds in a single direction * * @param {number} csec1 First point in centiseconds * @param {number} csec2 Second point in centiseconds number // Distance in * centiseconds from 0 to 129600000 */ swe_difcsn(csecP1: number, csecP2: number): number; /** * Arc distance between two points in degrees * * @param {number} deg1 First point in degrees * @param {number} deg2 Second point in degrees number // Distance in * degrees from -180 to 180 (negative if second point is ahead of the * first) */ swe_difdeg2n(deg1: number, deg2: number): number; /** * Arc distance between two points in degrees in a single direction * * @param {number} deg1 First point in degrees * @param {number} deg2 Second point in degrees number // Distance in * degrees from 0 to 360 */ swe_difdegn(deg1: number, deg2: number): number; /** * Get the visual magnitude (brightness) of a fixed star * * @param star: Name of the star to search for in the sefstars.txt file * @returns Object { name: string, // The name of the matched star from the * sefstars.txt file data: number // The star's magnitude value } Star: * ${result.name} Magnitude: ${result.data} `) */ swe_fixstar_mag(star: string): { /** Star name The full star name as it appears in the sefstars.txt file */ star_name: string; /** Magnitude value */ mag: number; }; /** * Calculate the positions of a star from universal time * * @param star: Name of the star to search for in the sefstars.txt file * @param {number} tjd_ut Julian day in universal time * @param {number} iflag Calculation flags * @returns Object { name: string, // The name of the matched star from the * sefstars.txt file data: Array<number> [ lon, // Longitude, right * ascension or cartesian X lat, // Latitude, declination or cartesian Y * dist, // Distance in AU or cartesian Z lonSpd, // Daily speed for lon * latSpd, // Daily speed for lat distSpd, // Daily speed for dist ] } * Name: ${result.name} Longitude: ${result.data[0]} `); */ swe_fixstar_ut(star: string, tjd_ut: number, iflag: number): FixstarResult; /** * Calculates the apparent position and motion of a fixed star for a given * Julian date in ephemeris/terrestrial time. * * @param {string} star - Name of the star (must match an entry in * `sefstars.txt`). * @param {number} tjd_et - Julian day number in ephemeris time (ET). * @param {number} iflag - Bitwise flags that control the calculation mode * and output format. * @returns {FixstarResult} An object containing: * * - `star_name`: Full name of the resolved star from `sefstars.txt` * - `data`: Array of 6 numbers representing the star's celestial coordinates * and daily motion * * @throws {SWEerror} If the star cannot be found or the calculation fails. */ swe_fixstar(star: string, tjd_et: number, iflag: number): FixstarResult; /** * Get the visual magnitude (brightness) of a fixed star * * @param {string} star - Name of the star (must match an entry in * `sefstars.txt`). * @returns {FixstarMagnitude} An object containing: * * - `star_name`: Full name of the resolved star from `sefstars.txt` * - `magnitude`: The star's magnitude value * * @throws {SWEerror} If the star cannot be found or the calculation fails. */ swe_fixstar2_mag(star: string): FixstarMagnitude; /** * Calculate the positions of a star from universal time * * @param star: Name of the star to search for in the sefstars.txt file * @param {number} tjd_ut Julian day in universal time * @param {number} iflag Calculation flags * @returns Object { name: string, // The name of the matched star from the * sefstars.txt file data: Array<number> [ lon, // Longitude, right * ascension or cartesian X lat, // Latitude, declination or cartesian Y * dist, // Distance in AU or cartesian Z lonSpd, // Daily speed for lon * latSpd, // Daily speed for lat distSpd, // Daily speed for dist ] } * Name: ${result.name} Longitude: ${result.data[0]} `); */ swe_fixstar2_ut(star: string, tjd_ut: number, iflag: number): { /** Star name The full star name as it appears in the sefstars.txt file */ star_name: string; /** * Array of values returned by the calculation By default the values are * in ecliptic coordinates (longitude, latitude, distance) If * `SEFLG_SPEED` or `SEFLG_SPEED3` are used, the daily speeds for each * value are also retured, otherwise they are 0 If `SEFLG_EQUATORIAL` is * used, the values are in equatorial coordinates instead (right * ascension, declination, distance) If `SELFG_XYZ` is used, the values * are in cartesian coordinates instead (X, Y, Z) */ data: CelestialCoordinatesAdvance; }; /** * Calculate the positions of a star from ephemeris/terrestrial time * * @param star: Name of the star to search for in the sefstars.txt file * @param {number} tjd_et Julian day in ephemeris/terrestrial time * @param {number} iflag Calculation flags * @returns Object { name: string, // The name of the matched star from the * sefstars.txt file data: Array<number> [ lon, // Longitude, right * ascension or cartesian X lat, // Latitude, declination or cartesian Y * dist, // Distance in AU or cartesian Z lonSpd, // Daily speed for lon * latSpd, // Daily speed for lat distSpd, // Daily speed for dist ] } * Name: ${result.name} Longitude: ${result.data[0]} `); */ swe_fixstar2(star: string, tjd_et: number, iflag: number): { /** Star name The full star name as it appears in the sefstars.txt file */ star_name: string; /** * Array of values returned by the calculation By default the values are * in ecliptic coordinates (longitude, latitude, distance) If * `SEFLG_SPEED` or `SEFLG_SPEED3` are used, the daily speeds for each * value are also retured, otherwise they are 0 If `SEFLG_EQUATORIAL` is * used, the values are in equatorial coordinates instead (right * ascension, declination, distance) If `SELFG_XYZ` is used, the values * are in cartesian coordinates instead (X, Y, Z) */ data: CelestialCoordinatesAdvance; }; /** * Calculates the **Gauquelin Sector** position of a celestial body or star * based on the observer's location and time. * * ### Parameters * * @param tjd_ut - Julian day in Universal Time * @param ipl - Planet/star ID (ignored if `starname` is provided) * @param starname - Star name (C-style string), or `null` to use `ipl` * @param iflag - Calculation flags (e.g., `SEFLG_SWIEPH`) * @param imeth - Gauquelin sector calculation method * @param geopos - Geographic coordinates `[longitude, latitude, elevation]` * @param atpress - Atmospheric pressure in mbar/hPa * @param attemp - Atmospheric temperature in Celsius * @returns `number` — The Gauquelin sector (decimal, with fraction part) * * ### Throws * * Throws `SWEerror` if the underlying C function returns an error flag. * * Const result = swe_gauquelin_sector(2413256, swe.SE_MOON, null, * swe.SEFLG_SWIEPH, 0, [15, 10, 0], 0, 0); console.log(`Sector: * ${Math.floor(result)}`); */ swe_gauquelin_sector(tjd_ut: number, ipl: number, starname: string | null, iflag: number, imeth: number, geopos: [longitude: number, latitude: number, elevation: number], atpress: number, attemp: number): number; /** * Computes the **Ayanamsa** value (precession correction) for a given * Universal Time Julian Day, using the current ephemeris mode and optional * nutation flags. * * ### Parameters * * @param tjd_ut - Julian day in Universal Time * @param iflags - Ephemeris flags (e.g., `SEFLG_SWIEPH`, `SEFLG_JPLHOR`) * @returns `number` — The computed Ayanamsa value (in degrees) * * ### Throws * * Throws `SWEerror` if computation fails or flags are incompatible. * * Const result = swe_get_ayanamsa_ex_ut(2314234, swe.SEFLG_SWIEPH); * console.log(`Ayanamsa: ${result}`); */ swe_get_ayanamsa_ex_ut(tjd_ut: number, iflags: number): number; /** * Computes the **Ayanamsa** value (precession correction) for a given * Ephemeris/Terrestrial time Julian Day, using the current ephemeris mode * and optional nutation flags. * * ### Parameters * * @param tjd_ut - Julian day in ephemeris/terrestrial time. * @param iflags - Ephemeris flags (e.g., `SEFLG_SWIEPH`, `SEFLG_JPLHOR`) * @returns `number` — The computed Ayanamsa value (in degrees) * * ### Throws * * Throws `SWEerror` if computation fails or flags are incompatible. * * Const result = swe_get_ayanamsa_ex(2314234, swe.SEFLG_SWIEPH); * console.log(`Ayanamsa: ${result}`); */ swe_get_ayanamsa_ex(tjd_et: number, iflags: number): number; /** * Returns the name of a predefined **Ayanamsa** based on its constant ID. * * ### Parameters * * @param isidmode - Ayanamsa ID (e.g., `SE_SIDM_LAHIRI`, `SE_SIDM_RAMAN`, * etc.) * @returns `string` — The name of the corresponding Ayanamsa */ swe_get_ayanamsa_name(isidmode: number): string; /** * Computes the **Ayanamsa** (precession correction) value for a given * Julian day in **Universal Time** without considering nutation. * * ### Parameters * * @param tjd_ut - Julian Day in Universal Time (UT) * @returns `number` — Ayanamsa value in degrees for the given date */ swe_get_ayanamsa_ut(tjd_ut: number): number; /** * Computes the **Ayanamsa** (precession correction) value for a given * Julian day in **Ephemeris Time (ET)**, without accounting for nutation. * * ### Parameters * * @param tjd_et - Julian Day in Ephemeris/Terrestrial Time (ET) * @returns `number` — Ayanamsa value in degrees for the specified date */ swe_get_ayanamsa(tjd_et: number): number; /** * Retrieves metadata about the **most recently used ephemeris file** of a * given type. this function must be called _after_ a successful ephemeris * calculation (e.g., `calc()` or `swe_calc_ut()`). * * ### Parameters * * @param ifno - Ephemeris file type index (0 for planetary, etc.) * @returns `Object` — Ephemeris file metadata: { path: string; // Absolute * or relative path to the ephemeris file used start: number; // Start * Julian Day of ephemeris data in the file end: number; // End Julian Day * of ephemeris data in the file denum: number; // JPL DE version number * used (e.g., 431) } * * // Perform a calculation to ensure ephemeris file is loaded calc(2342342, * swe.SE_VENUS, swe.SEFLG_SWIEPH); */ swe_get_current_file_data(ifno: number): { /** Path to ephemeris file */ path: string; /** Ephemeris start date for this file */ start: number; /** Ephemeris end date for this file */ end: number; /** JPL ephemeris version used to generate the file */ denum: number; }; /** * Returns the file system path to the Swiss Ephemeris library currently in * use. * * @returns `string` — Path to the Swiss Ephemeris shared library. */ swe_get_library_path(): string; /** * Get an object's orbital elements for a given date in * ephemeris/terrestrial time * * @param tjd_et - Number // Julian day in ephemeris/terr