Changeset 1628 in Sophya


Ignore:
Timestamp:
Aug 7, 2001, 6:23:37 PM (24 years ago)
Author:
cmv
Message:

ajout documentation cmv 7/8/01

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/XAstroPack/xastropack.cc

    r1515 r1628  
    33#include "xastropack.h"
    44
     5/*!
     6  \defgroup XAstroPack XAstroPack module
     7  This module contains simple programs to perform various
     8  astronomical computation (based on the libastro of Xephem).
     9
     10  \verbatim
    511// TEMPS: modified Julian date (mjd) (number of days elapsed since 1900 jan 0.5)
    612//        jour [1,31] (dy)
     
    2430//                 (angle + vers l'ouest, - vers l'est)
    2531//             latitude en degres [-90,90] (north>0) (geolat)
    26 
     32  \endverbatim
     33*/
     34
     35/*! \ingroup XAstroPack
     36\brief Compute true Julian day from MJD
     37*/
    2738double TrueJDfrMJD(double mjd)
    2839{
     
    3041}
    3142
     43/*! \ingroup XAstroPack
     44\brief Compute MJD from true Julian day
     45*/
    3246double MJDfrTrueJD(double jd)
    3347{
     
    3549}
    3650
     51/*! \ingroup XAstroPack
     52\brief Compute MJD from date
     53*/
    3754double MJDfrDate(double dy,int mn,int yr)
    3855{
     
    4259}
    4360
     61/*! \ingroup XAstroPack
     62\brief Compute date from MJD
     63*/
    4464void DatefrMJD(double mjd,double *dy,int *mn,int *yr)
    4565{
     
    4767}
    4868
    49 /* given a mjd, return the year as a double. */
     69/*! \ingroup XAstroPack
     70\brief  Given a mjd, return the year as a double.
     71*/
    5072double YearfrMJD(double mjd)
    5173{
     
    5577}
    5678
    57 /* given a decimal year, return mjd */
     79/*! \ingroup XAstroPack
     80\brief Given a decimal year, return mjd
     81*/
    5882double MJDfrYear(double yr)
    5983{
     
    6387}
    6488
    65 /* given a mjd, return the year and number of days since 00:00 Jan 1 */
    66 /* Attention: si mjd = 2 Janvier -> number of days = 1               */
     89/*! \ingroup XAstroPack
     90\brief Given a mjd, return the year and number of days since 00:00 Jan 1
     91\warning: if mjd = 2 January -> number of days = 1
     92*/
    6793void YDfrMJD(double mjd,double *dy,int *yr)
    6894{
     
    7096}
    7197
    72 /* given a modified julian date, mjd, and a universally coordinated time, utc,
    73  * return greenwich mean siderial time, *gst.
    74  * N.B. mjd must be at the beginning of the day.
    75  */
     98/*! \ingroup XAstroPack
     99\brief Give GST from UTC
     100\verbatim
     101 Given a modified julian date, mjd, and a universally coordinated time, utc,
     102 return greenwich mean siderial time, *gst.
     103 N.B. mjd must be at the beginning of the day.
     104\endverbatim
     105*/
    76106double GSTfrUTC(double mjd0,double utc)
    77107{
     
    81111}
    82112
    83 /* given a modified julian date, mjd, and a greenwich mean siderial time, gst,
    84  * return universally coordinated time, *utc.
    85  * N.B. mjd must be at the beginning of the day.
    86  */                                                                             
     113/*! \ingroup XAstroPack
     114\brief Give UTC from GST
     115\verbatim
     116 Given a modified julian date, mjd, and a greenwich mean siderial time, gst,
     117 return universally coordinated time, *utc.
     118 N.B. mjd must be at the beginning of the day.
     119\endverbatim
     120*/                                                                             
    87121double UTCfrGST(double mjd0,double gst)
    88122{
     
    92126}
    93127
    94 /* gmst0() - return Greenwich Mean Sidereal Time at 0h UT */
    95 /* mjd = date at 0h UT in julian days since MJD0          */
     128/*! \ingroup XAstroPack
     129\brief gmst0() - return Greenwich Mean Sidereal Time at 0h UT
     130\param mjd = date at 0h UT in julian days since MJD0
     131*/                                                                             
    96132double GST0(double mjd0)
    97133/* Copie depuis le code de Xephem car pas prototype */
     
    106142}
    107143
     144/*! \ingroup XAstroPack
     145\brief Compute precession between 2 dates.
     146*/                                                                             
    108147void Precess(double mjd1,double mjd2,double ra1,double dec1,double *ra2,double *dec2)
    109148{
     
    115154}
    116155
    117 /* given apparent altitude find airmass. */
     156/*! \ingroup XAstroPack
     157\brief Given apparent altitude find airmass.
     158*/                                                                             
    118159double AirmassfrAlt(double alt)
    119160{
     
    124165}
    125166
    126 /* donne l'angle horaire a partir du temps sideral et de l'ascension droite */
     167/*! \ingroup XAstroPack
     168\brief Give the hour angle from sideral time and right ascencion
     169*/                                                                             
    127170double HafrRaTS(double gst,double ra)
    128171{
     
    135178}
    136179
    137 void HMSfrHdec(double hd,int *h,int *mn,double *s)
     180/*! \ingroup XAstroPack
     181\brief Give a time in h:mn:s from a decimal hour
     182\verbatim
    138183// INPUT: hd
    139184// OUTPUT: h mn s   (h,mn,s >=< 0)
     
    141186// EX: 12.51 -> h=12  mn=30  s=10 ;
    142187//    -12.51 -> h=-12 mn=-30 s=-10 ;
     188\endverbatim
     189*/                                                                             
     190void HMSfrHdec(double hd,int *h,int *mn,double *s)
    143191{
    144192 int sgn=1;
     
    155203}
    156204
    157 double HdecfrHMS(int h,int mn,double s)
     205/*! \ingroup XAstroPack
     206\brief Give a decimal hour from a time in h:mn:s
     207\verbatim
    158208// INPUT: h , mn , s  (h,mn,s >=< 0)
    159209// RETURN:  en heures decimales
    160210// REMARQUE: pour avoir hd=-12.51 <- h=-12 mn=-30 s=-10
     211\endverbatim
     212*/                                                                             
     213double HdecfrHMS(int h,int mn,double s)
    161214{
    162215 return ((double)h + (double)mn/60. + s/3600.);
    163216}
    164217
    165 string ToStringHMS(int h,int mn,double s)
     218/*! \ingroup XAstroPack
     219\brief Give a time string from a time in h:mn:s
     220\verbatim
    166221// INPUT: h , mn , s   (h,mn,s >=< 0)
    167222// RETURN: string h:mn:s
     223\endverbatim
     224*/                                                                             
     225string ToStringHMS(int h,int mn,double s)
    168226{
    169227 double hd = HdecfrHMS(h,mn,s); // put in range
     
    178236}
    179237
     238/*! \ingroup XAstroPack
     239\brief Give a time string from a decimal hour
     240*/                                                                             
    180241string ToStringHdec(double hd)
    181242{
     
    185246}
    186247
     248/*! \ingroup XAstroPack
     249\brief Convert equatorial coordinates into galactic coordinates
     250*/                                                                             
    187251void EqtoGal(double mjd,double ra,double dec, double *glng,double *glat)
    188252// Coordonnees equatoriales -> Coordonnees galactiques
     
    196260}
    197261
     262/*! \ingroup XAstroPack
     263\brief Convert galactic coordinates into equatorial coordinates
     264*/                                                                             
    198265void GaltoEq(double mjd,double glng,double glat,double *ra,double *dec)
    199266// Coordonnees galactiques -> Coordonnees equatoriales
     
    206273}
    207274
     275/*! \ingroup XAstroPack
     276\brief Convert equatorial coordinates into horizontal coordinates
     277*/                                                                             
    208278void EqtoHor(double geolat,double ha,double dec,double *az,double *alt)
    209279// Coordonnees equatoriales -> Coordonnees horizontales
     
    217287}
    218288
     289/*! \ingroup XAstroPack
     290 Convert horizontal coordinates into equatorial coordinates
     291*/                                                                             
    219292void HortoEq(double geolat,double az,double alt,double *ha,double *dec)
    220293// Coordonnees horizontales -> Coordonnees equatoriales
     
    229302}
    230303
     304/*! \ingroup XAstroPack
     305\brief Convert equatorial coordinates into ecliptic coordinates
     306*/                                                                             
    231307// Attention, j'ai modifie eq_ecl.c pour proteger NaN
    232308// dans ecleq_aux :
     
    243319}
    244320
     321/*! \ingroup XAstroPack
     322\brief Convert ecliptic coordinates into equatorial coordinates
     323*/                                                                             
    245324void EcltoEq(double mjd,double eclng,double eclat,double *ra,double *dec)
    246325// Coordonnees ecliptiques -> Coordonnees equatoriales
     
    253332}
    254333
    255 /* given the modified JD, mjd, return the true geocentric ecliptic longitude
    256  *   of the sun for the mean equinox of the date, *lsn, in radians, the
    257  *   sun-earth distance, *rsn, in AU, and the latitude *bsn, in radians
    258  *   (since this is always <= 1.2 arcseconds, in can be neglected by
    259  *   calling with bsn = NULL). */
     334/*! \ingroup XAstroPack
     335\brief Give Sun position
     336\verbatim
     337 given the modified JD, mjd, return the true geocentric ecliptic longitude
     338 of the sun for the mean equinox of the date, *lsn, in radians, the
     339 sun-earth distance, *rsn, in AU, and the latitude *bsn, in radians
     340 (since this is always <= 1.2 arcseconds, in can be neglected by
     341 calling with bsn = NULL).
     342\endverbatim
     343*/
    260344void SunPos(double mjd,double *eclsn,double *ecbsn)
    261345{
     
    266350}
    267351
    268 /* given the mjd, find the geocentric ecliptic longitude, lam, and latitude,
    269  *   bet, and geocentric distance, rho in a.u. for the moon.  also return
    270  *   the sun's mean anomaly, *msp, and the moon's mean anomaly, *mdp.
    271  *   (for the mean equinox) */
     352/*! \ingroup XAstroPack
     353\brief Give Moon position
     354\verbatim
     355 given the mjd, find the geocentric ecliptic longitude, lam, and latitude,
     356 bet, and geocentric distance, rho in a.u. for the moon.  also return
     357 the sun's mean anomaly, *msp, and the moon's mean anomaly, *mdp.
     358 (for the mean equinox)
     359\endverbatim
     360*/
    272361void MoonPos(double mjd,double *eclmn,double *ecbmn)
    273362{
     
    278367}
    279368
    280 void PlanetPos(double mjd,int numplan,double *ecl,double *ecb,double *diamang)
    281 /* given a modified Julian date, mjd, and a planet, p, find:
     369/*! \ingroup XAstroPack
     370\brief Give planet position
     371\verbatim
     372 * given a modified Julian date, mjd, and a planet, p, find:
    282373 *   lpd0: heliocentric longitude,
    283374 *   psi0: heliocentric latitude,
     
    292383 *   dia:  angular diameter in arcsec at 1 AU,
    293384 *   mag:  visual magnitude when 1 AU from sun and earth at 0 phase angle.
    294  *   (for the mean equinox) */
     385 *   (for the mean equinox)
     386 \endverbatim
     387*/
     388void PlanetPos(double mjd,int numplan,double *ecl,double *ecb,double *diamang)
    295389{
    296390  double lpd0,psi0,rp0,rho0,mag;
     
    300394}
    301395
     396/*! \ingroup XAstroPack
     397\brief Give Jupiter position
     398*/
    302399void JupiterPos(double mjd,double *ecl,double *ecb,double *diamang)
    303400{
     
    305402}
    306403
     404/*! \ingroup XAstroPack
     405\brief Give Saturn position
     406*/
    307407void SaturnPos(double mjd,double *ecl,double *ecb,double *diamang)
    308408{
     
    310410}
    311411
    312 /* Given a coordinate type "typ", convert to standard for astropack */
     412/*! \ingroup XAstroPack
     413\brief Given a coordinate type "typ", convert to standard for astropack
     414\verbatim
     415// Return : 0 = OK
     416//          1 = Unknown type of coordinates
     417//          2 = bad range for coord1
     418//          4 = bad range for coord2
     419//          6 = bad range for coord1 et coord2
     420\endverbatim
     421*/
    313422int  CoordConvertToStd(TypAstroCoord typ,double& coord1,double& coord2)
    314 // Return : 0 = OK
    315 //          1 = Type de coordonnees non connu
    316 //          2 = Mauvais range pour coord1
    317 //          4 = Mauvais range pour coord2
    318 //          6 = Mauvais range pour coord1 et coord2
    319423{
    320424  int rc = 0;
Note: See TracChangeset for help on using the changeset viewer.