1 | throw new Error("Description for built in functions. Must not be included!");
|
---|
2 | /**
|
---|
3 | * @fileOverview
|
---|
4 | * Documentation of Sun class built into dimctrl.
|
---|
5 | */
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * @namespace
|
---|
9 | *
|
---|
10 | * Namespace for functions returning astrometry information about the Sun.
|
---|
11 | *
|
---|
12 | * @author <a href="mailto:tbretz@physik.rwth-aachen.de">Thomas Bretz</a>
|
---|
13 | */
|
---|
14 | var Sun = { };
|
---|
15 |
|
---|
16 | /**
|
---|
17 | * Calculate sun rise, set and transit times.
|
---|
18 | *
|
---|
19 | * Calculates the sun's rise and set time, above and below horizon,
|
---|
20 | * and the time of culmination (transit time) for the given time.
|
---|
21 | * As a second argument the angle abov or below horizon of interest
|
---|
22 | * can be provided. The calculation is done using libnova's
|
---|
23 | * ln_get_solar_rst_horizon and is always performed for the FACT
|
---|
24 | * site at La Palma.
|
---|
25 | *
|
---|
26 | * @param {Number,String} [angle=null]
|
---|
27 | * Angle above (positive) or below (negative) horizon. The
|
---|
28 | * angle can be given as Number in degree or as string referring to
|
---|
29 | * "horizon" (0deg), "civil" (-6deg), "nautical" (-12deg),
|
---|
30 | * "fact" (-15deg), "astronomical" (-18deg). Strings can be abbreviated
|
---|
31 | * down to "h", "c", "n", "f" and "a". If the argument is omitted or
|
---|
32 | * null, a value referring to the appearance or the disappearance of
|
---|
33 | * the Sun's disk at horizon is chosen (~-0.8deg).
|
---|
34 | *
|
---|
35 | * @param {Date} [time=new Date()]
|
---|
36 | * Date for which the times should be calculated. Note that the date
|
---|
37 | * is converted to UTC and the times are calculated such that the
|
---|
38 | * Date (yy/mm/dd) is identical for all returned values.
|
---|
39 | * The order of time and observatory is arbitrary.
|
---|
40 | *
|
---|
41 | * @param {String} [observatory='ORM']
|
---|
42 | * Observatory location as defined in nova.h as a string. The default
|
---|
43 | * is the FACT site ('ORM'). The order of time and observatory is
|
---|
44 | * arbitrary.
|
---|
45 | *
|
---|
46 | * @type {Object}
|
---|
47 | *
|
---|
48 | * @returns
|
---|
49 | * An object with the following properties is returned: time {Date}
|
---|
50 | * the provided time; rise, transit, set {Date} times of rise, set and
|
---|
51 | * transit; horizon {Number} the angle used for the calculation;
|
---|
52 | * isUp {Boolean} whether the sun is above or below the given horizon
|
---|
53 | * at th given time. If the sun does not rise or set, the properties
|
---|
54 | * rise, transit and set will be undefined, isUp will refer to
|
---|
55 | * the fact whether the sun is the whole day above or below the
|
---|
56 | * horizon (0deg).
|
---|
57 | *
|
---|
58 | * @example
|
---|
59 | * var date = new Date("2012-10-25 16:30 GMT"); // Date in UTC
|
---|
60 | * console.out(JSON.stringify(Sun.horizon());
|
---|
61 | * console.out(JSON.stringify(Sun.horizon("astro"));
|
---|
62 | * console.out(JSON.stringify(Sun.horizon(-12, date); // nautical
|
---|
63 | * console.out(JSON.stringify(Sun.horizon(-12, "SPM");
|
---|
64 | * console.out(JSON.stringify(Sun.horizon(-12, "HAWC", date);
|
---|
65 | * console.out(JSON.stringify(Sun.horizon(-12, date, "ORM");
|
---|
66 | */
|
---|
67 | Sun.horizon = function() { /* [native code] */ }
|
---|