| 1 | throw new Error("Description for built in functions. Must not be included!");
|
|---|
| 2 | /**
|
|---|
| 3 | * @fileOverview
|
|---|
| 4 | * Documentation of Sky class built into dimctrl.
|
|---|
| 5 | */
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 | /**
|
|---|
| 9 | * @class
|
|---|
| 10 | *
|
|---|
| 11 | * This class represents a set of sky coordinates.
|
|---|
| 12 | *
|
|---|
| 13 | * If the data was the result of a coordinate transformation, the
|
|---|
| 14 | * corresponding time is stored in addition. A function to convert
|
|---|
| 15 | * to local coordinates is included.
|
|---|
| 16 | *
|
|---|
| 17 | * @param {Number} rightAscension
|
|---|
| 18 | * Right ascension in hours
|
|---|
| 19 | *
|
|---|
| 20 | * @param {Number} declination
|
|---|
| 21 | * Declination in degree
|
|---|
| 22 | *
|
|---|
| 23 | * @example
|
|---|
| 24 | * var sky = new Sky(12, 45);
|
|---|
| 25 | * var local = sky.toLocal();
|
|---|
| 26 | * var date = new Date("2012-10-25 16:30 GMT"); // Date in UTC
|
|---|
| 27 | * var local = sky.toLocal(date);
|
|---|
| 28 | * var local = sky.toLocal("ORM");
|
|---|
| 29 | * var local = sky.toLocal(date, "HAWC");
|
|---|
| 30 | * var local = sky.toLocal("SPM", date);
|
|---|
| 31 | *
|
|---|
| 32 | * @author <a href="mailto:tbretz@physik.rwth-aachen.de">Thomas Bretz</a>
|
|---|
| 33 | *
|
|---|
| 34 | */
|
|---|
| 35 | function Sky()
|
|---|
| 36 | {
|
|---|
| 37 |
|
|---|
| 38 | /**
|
|---|
| 39 | * Right ascension in hours
|
|---|
| 40 | *
|
|---|
| 41 | * @constant
|
|---|
| 42 | * @type Number
|
|---|
| 43 | */
|
|---|
| 44 | this.ra = rightAscension
|
|---|
| 45 |
|
|---|
| 46 | /**
|
|---|
| 47 | * Declination in degrees
|
|---|
| 48 | *
|
|---|
| 49 | * @constant
|
|---|
| 50 | * @type Number
|
|---|
| 51 | */
|
|---|
| 52 | this.dec = declination;
|
|---|
| 53 |
|
|---|
| 54 | /**
|
|---|
| 55 | * Time corresponding to ra and dec if they are the result of
|
|---|
| 56 | * a conversion.
|
|---|
| 57 | *
|
|---|
| 58 | * @constant
|
|---|
| 59 | * @type Date
|
|---|
| 60 | */
|
|---|
| 61 | this.time = undefined;
|
|---|
| 62 |
|
|---|
| 63 | /**
|
|---|
| 64 | * Convert sky coordinates to celestial coordinates.
|
|---|
| 65 | * As observatory location the FACT telescope is assumed.
|
|---|
| 66 | * The conversion is done using libnova's ln_get_hrz_from_equ.
|
|---|
| 67 | *
|
|---|
| 68 | * @param {Date} [time=new Date()]
|
|---|
| 69 | * Time for which the coordinates will be tranfromed.
|
|---|
| 70 | * The order of time and observatory is arbitrary.
|
|---|
| 71 | *
|
|---|
| 72 | * @param {String} [observatory='ORM']
|
|---|
| 73 | * Observatory location as defined in nova.h as a string for which
|
|---|
| 74 | * the coordinate conversion is done The default is the
|
|---|
| 75 | * FACT site ('ORM'). The order of time and observatory is arbitrary.
|
|---|
| 76 | *
|
|---|
| 77 | * @type Local
|
|---|
| 78 | *
|
|---|
| 79 | * @returns
|
|---|
| 80 | * A Local object with the converted coordinates,
|
|---|
| 81 | * the conversion time and the observatory location.
|
|---|
| 82 | */
|
|---|
| 83 | this.toLocal = function() { /* [native code] */ }
|
|---|
| 84 | }
|
|---|
| 85 |
|
|---|
| 86 | /**
|
|---|
| 87 | * Calculate the distance between two sky positions.
|
|---|
| 88 | *
|
|---|
| 89 | * The distance between the two provided objects is calculated.
|
|---|
| 90 | * The returned value is an absolute distance (angle) between
|
|---|
| 91 | * the two positions.
|
|---|
| 92 | *
|
|---|
| 93 | * @constant
|
|---|
| 94 | *
|
|---|
| 95 | * @param {Sky} sky1
|
|---|
| 96 | * Celestial coordinates for one of the two objects for which
|
|---|
| 97 | * the distance on the sky should be calculated. In principle
|
|---|
| 98 | * every object with the properties 'ra' and 'dec' can be provided.
|
|---|
| 99 | *
|
|---|
| 100 | * @param {Sky} sky2
|
|---|
| 101 | * Celestial coordinates for one of the two objects for which
|
|---|
| 102 | * the distance on the sky should be calculated. In principle
|
|---|
| 103 | * every object with the properties 'ra' and 'dec' can be provided.
|
|---|
| 104 | *
|
|---|
| 105 | * @returns {Number}
|
|---|
| 106 | * Absolute distance between both positions on the sky in degrees.
|
|---|
| 107 | */
|
|---|
| 108 | Sky.dist = function() { /* [native code] */}
|
|---|