source: trunk/FACT++/scripts/doc/Moon.js@ 18855

Last change on this file since 18855 was 18829, checked in by tbretz, 8 years ago
Updated with the latest changes in the astromtry interface of the JavaScript interpreter.
File size: 4.3 KB
Line 
1throw new Error("Description for built in functions. Must not be included!");
2/**
3 * @fileOverview
4 * Documentation of Moon class built into dimctrl.
5 */
6
7/**
8 * @class
9 *
10 * Calculates the moon's sky position at a given time.
11 *
12 * When instantiated, the class members are set to the sky position
13 * of the moon at the given time. The calculation is done using
14 * libnova's ln_get_lunar_equ_coords. A different time can be provided
15 * by the user. The sky coordinates are stored together with the time.
16 * A function is provided to convert the moon's position to celestial
17 * coordinates. A function to calculate the illuminated fraction of
18 * the moon's disk.
19 *
20 * @param {Date} [time=new Date()]
21 * Reference time for the calculation of the moon's position.
22 *
23 * @example
24 * var date = new Date("2012-10-25 16:30 GMT"); // Date in UTC
25 * var moon = new Moon(date);
26 * var moon = new Moon();
27 * var local = moon.toLocal();
28 * var local = moon.toLocal("HAWC");
29 *
30 * @author <a href="mailto:tbretz@physik.rwth-aachen.de">Thomas Bretz</a>
31 */
32function Moon(time)
33{
34 /**
35 * Right ascension of the moon in hours.
36 *
37 * @type Number
38 * @constant
39 *
40 */
41 this.ra = 0;
42
43 /**
44 * Declination of the moon in degrees.
45 *
46 * @type Number
47 * @constant
48 *
49 */
50 this.dec = 0;
51
52 /**
53 * Time corresponding to the calculated sky coordinates of the moon.
54 *
55 * @type Date
56 * @constant
57 */
58 this.time = time;
59
60 /**
61 * Converts the moon's sky coordinates to celestial coordinates.
62 * As observatory location the FACT telescope is assumed. For the
63 * time, the time corresponding to the stored sky coordinates is used.
64 * The conversion is done using libnova's ln_get_hrz_from_equ.
65 *
66 * @param {String} [observatory='ORM']
67 * Observatory location as defined in nova.h as a string. The default
68 * is the FACT site ('ORM').
69 *
70 * @returns {Local}
71 * A Local object with the converted coordinates and
72 * the corresponding time and observatory.
73 */
74 this.toLocal = function() { /* [native code] */ }
75}
76
77/**
78 * Calculates the illuminated fraction of the moon's disk.
79 *
80 * Calculates the illuminated fraction of the moon's disk for the
81 * provided time. If no time is provided, the current system time
82 * is used. The calculation is done using libnova's ln_get_lunar_disk.
83 *
84 * @param {Date} [time=new Date()]
85 * Time for which the moon disk should be calculated. If no time is
86 * given, the current time is used.
87 *
88 * @type Number
89 *
90 * @returns
91 * The illuminated fraction of the moon's disk corresponding
92 * to the time argument
93 *
94 */
95Moon.disk = function() { /* [native code] */ }
96
97/**
98 * Calculate moon rise, set and transit times.
99 *
100 * Calculates the moon rise and set time, above and below horizon,
101 * and the time of culmination (transit time) for the given time.
102 * The calculation is done using libnova's ln_get_lunar_rst and is
103 * always performed for the FACT site at La Palma.
104 *
105 * @param {Date} [time=new Date()]
106 * Date for which the times should be calculated. Note that the date
107 * is converted to UTC and the times are calculated such that the
108 * Date (yy/mm/dd) is identical for all returned values.
109 * The order of time and observatory is arbitrary.
110 *
111 * @param {String} [observatory='ORM']
112 * Observatory location as defined in nova.h as a string. The default
113 * is the FACT site ('ORM'). The order of time and observatory is
114 * arbitrary.
115 *
116 * @type {Object}
117 *
118 * @returns
119 * An object with the following properties is returned: time {Date}
120 * the provided time; observatory {Date} the provided observatory location;
121 * rise, transit, set {Date} times of rise, set and transit;
122 * isUp {Boolean} whether the moon is above or below horizon
123 * at the provided time. If the moon does not rise or set, the properties
124 * rise, transit and set will be undefined.
125 *
126 * @example
127 * var date = new Date("2012-10-25 16:30 GMT"); // Date in UTC
128 * console.out(JSON.stringify(Moon.horizon());
129 * console.out(JSON.stringify(Moon.horizon(date));
130 * console.out(JSON.stringify(Moon.horizon(date, "SPM"));
131 * console.out(JSON.stringify(Moon.horizon("ORM, date);
132 */
133Moon.horizon = function() { /* [native code] */ }
Note: See TracBrowser for help on using the repository browser.