Changeset 1682 in Sophya for trunk/SophyaExt/XAstroPack/xastropack.h
- Timestamp:
- Oct 11, 2001, 2:42:00 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/XAstroPack/xastropack.h
r1679 r1682 18 18 TypCoordUndef = (unsigned long) (0), 19 19 20 TypCoordH0 = (unsigned long) (1 << 10), // heure=[0,24[ 21 TypCoordH1 = (unsigned long) (1 << 11), // heure=]-12,12] 22 TypCoordD0 = (unsigned long) (1 << 12), // degre=[0,360[ 23 TypCoordD1 = (unsigned long) (1 << 13), // degre=]-180,180] 24 TypCoordD2 = (unsigned long) (1 << 14), // degre=[-90,90] 25 TypCoordR0 = (unsigned long) (1 << 15), // degre=[0,2Pi[ 26 TypCoordR1 = (unsigned long) (1 << 16), // degre=]-Pi,Pi] 27 TypCoordR2 = (unsigned long) (1 << 17), // degre=[-Pi/2,Pi/2] 28 20 29 // Pour indiquer que les coordonnees sont en (heure=[0,24[,degre=[-90,90]) 21 30 TypCoordHD = (unsigned long) (1 << 20), … … 24 33 // Pour indiquer que les coordonnees sont en (radian=[0,2Pi[,radian=[-Pi/2,Pi/2]) 25 34 TypCoordRR = (unsigned long) (1 << 22), 35 // Pour indiquer que les coordonnees sont en (heure=]-12,12],degre=[-90,90]) 36 TypCoordH1D = (unsigned long) (1 << 23), 37 // Pour indiquer que les coordonnees sont en (degre=]-180,180],degre=[-90,90]) 38 TypCoordD1D = (unsigned long) (1 << 24), 39 // Pour indiquer que les coordonnees sont en (radian=]-Pi,Pi],radian=[-Pi/2,Pi/2]) 40 TypCoordR1R = (unsigned long) (1 << 25), 26 41 27 42 // Coordonnees Equatoriales alpha,delta … … 69 84 inline double MJDfrTrueJD(double jd) {return jd - MJD0;} 70 85 71 /*! \ingroup XAstroPack 72 \brief Compute MJD from date 73 \verbatim 74 MJD = modified Julian date (number of days elapsed since 1900 jan 0.5), 75 \endverbatim 76 */ 77 inline double MJDfrDate(double dy,int mn,int yr) 78 {double mjd; cal_mjd(mn,dy,yr,&mjd); return mjd;} 79 80 /*! \ingroup XAstroPack 81 \brief Compute date from MJD 82 */ 83 inline void DatefrMJD(double mjd,double *dy,int *mn,int *yr) 84 {mjd_cal(mjd,mn,dy,yr);} 85 86 /*! \ingroup XAstroPack 87 \brief Given a mjd, return the year as a double. 88 */ 89 inline double YearfrMJD(double mjd) 90 {double yr; mjd_year(mjd,&yr); return yr;} 91 92 /*! \ingroup XAstroPack 93 \brief Given a decimal year, return mjd 94 */ 95 inline double MJDfrYear(double yr) 96 {double mjd; year_mjd(yr,&mjd); return mjd;} 97 98 /*! \ingroup XAstroPack 99 \brief Given a mjd, return the year and number of days since 00:00 Jan 1 100 \warning: if mjd = 2 January -> number of days = 1 101 */ 102 inline void YDfrMJD(double mjd,double *dy,int *yr) 103 {mjd_dayno(mjd,yr,dy);} 104 105 /*! \ingroup XAstroPack 106 \brief Given a year, 107 */ 108 inline int IsLeapYear(int y) 109 {return isleapyear(y);} 110 111 /*! \ingroup XAstroPack 112 \brief given an mjd, set *dow to 0..6 according to which day of the week it falls on (0=sunday). 113 \return return 0 if ok else -1 if can't figure it out. 114 */ 115 inline int DayOrder(double mjd,int *dow) 116 {return mjd_dow(mjd,dow);} 117 118 /*! \ingroup XAstroPack 119 \brief given a mjd, return the the number of days in the month. 120 */ 121 inline int DaysInMonth(double mjd) 122 {int ndays; mjd_dpm(mjd,&ndays); return ndays;} 123 124 /*! \ingroup XAstroPack 125 \brief Given a mjd, truncate it to the beginning of the whole day 126 */ 127 inline double MJDat0hFrMJD(double mjd) {return mjd_day(mjd);} 128 129 /*! \ingroup XAstroPack 130 \brief Given a mjd, return the number of hours past midnight of the whole day 131 */ 132 inline double HfrMJD(double mjd) {return mjd_hr(mjd);} 133 134 /*! \ingroup XAstroPack 135 \brief Give GST from UTC 136 \verbatim 137 Given a modified julian date, mjd, and a universally coordinated time, utc, 138 return greenwich mean siderial time, *gst. 139 N.B. mjd must be at the beginning of the day. 140 \endverbatim 141 */ 142 inline double GSTfrUTC(double mjd0,double utc) 143 {double gst; utc_gst(mjd0,utc,&gst) ; return gst;} 144 145 /*! \ingroup XAstroPack 146 \brief Give UTC from GST 147 \verbatim 148 Given a modified julian date, mjd, and a greenwich mean siderial time, gst, 149 return universally coordinated time, *utc. 150 N.B. mjd must be at the beginning of the day. 151 \endverbatim 152 */ 153 inline double UTCfrGST(double mjd0,double gst) 154 {double utc; gst_utc(mjd0,gst,&utc); return utc;} 86 double MJDfrDate(double dy,int mn,int yr); 87 void DatefrMJD(double mjd,double *dy,int *mn,int *yr); 88 double YearfrMJD(double mjd); 89 double MJDfrYear(double yr); 90 void YDfrMJD(double mjd,double *dy,int *yr); 91 int IsLeapYear(int y); 92 int DayOrder(double mjd,int *dow); 93 int DaysInMonth(double mjd); 94 double MJDat0hFrMJD(double mjd); 95 double HfrMJD(double mjd); 96 double GSTfrUTC(double mjd0,double utc); 97 double UTCfrGST(double mjd0,double gst); 155 98 156 99 /*! \ingroup XAstroPack … … 171 114 // ------------------- Calculs Divers ------------------- 172 115 void Precess(double mjd1,double mjd2,double ra1,double dec1,double *ra2,double *dec2); 173 174 /*! \ingroup XAstroPack 175 \brief Given apparent altitude find airmass. 176 */ 177 inline double AirmassfrAlt(double alt) 178 {double x; alt = degrad(alt); airmass(alt,&x); return x;} 179 180 /*! \ingroup XAstroPack 181 \brief given geocentric time "jd" and coords of a distant object at "ra/dec" (J2000), 182 find the difference "hcp" in time between light arriving at earth vs the sun. 183 \return "hcp" must be subtracted from "geocentric jd" to get "heliocentric jd". 184 \warning "jd" is the TRUE Julian day (jd = mjd+MJD0). 185 */ 186 inline double HelioCorr(double jd,double ra,double dec) 187 {double hcp; ra=hrrad(ra); dec=degrad(dec); heliocorr(jd,ra,dec,&hcp); return hcp;} 116 double AirmassfrAlt(double alt); 117 double HelioCorr(double jd,double ra,double dec); 188 118 189 119 // ------------------- Transformation de coordonnees -------------------
Note:
See TracChangeset
for help on using the changeset viewer.