source: trunk/MagicSoft/slalib/obs.c

Last change on this file was 731, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 19.5 KB
Line 
1#include "slalib.h"
2#include "slamac.h"
3#include <string.h>
4void slaObs ( int n, char *c, char *name, double *w, double *p, double *h )
5/*
6** - - - - - - -
7** s l a O b s
8** - - - - - - -
9**
10** Parameters of selected groundbased observing stations.
11**
12** Given:
13** n int number specifying observing station
14**
15** Either given or returned
16** *c char identifier specifying observing station
17**
18** Returned:
19** *name char name of specified observing station
20** *w double longitude (radians, West +ve)
21** *p double geodetic latitude (radians, North +ve)
22** *h double height above sea level (metres)
23**
24** Notes:
25**
26** Station identifiers may be up to 10 characters long
27** (plus string terminator), and station names may be up to
28** 40 characters long (plus string terminator). Leading or
29** trailing spaces are not supported.
30**
31** c and n are alternative ways of specifying the observing
32** station. The c option, which is the most generally useful,
33** may be selected by specifying an n value of zero or less.
34** If n is 1 or more, the parameters of the nth station
35** in the currently supported list are interrogated (n=1
36** meaning the first station in the list), and the station
37** identifier c is returned as well as name, w, p and h.
38**
39** If the station parameters are not available, either because
40** the station identifier c is not recognized, or because an
41** n value greater than the number of stations supported is
42** given, a name of "?" is returned and c, w, p and h are left
43** in their current states.
44**
45** Programs can obtain a list of all currently supported
46** stations by calling the routine repeatedly, with n=1,2,3...
47** When name="?" is seen, the list of stations has been
48** exhausted.
49**
50** Station numbers, identifiers, names and other details are
51** subject to change and should not be hardwired into
52** application programs.
53**
54** All station identifiers c are uppercase only; lowercase
55** characters must be converted to uppercase by the calling
56** program. The station names returned may contain both upper-
57** and lowercase. All characters up to the first space are
58** checked; thus an abbreviated ID will return the parameters
59** for the first station in the list which matches the
60** abbreviation supplied, and no station in the list will ever
61** contain embedded spaces. c must not have leading spaces.
62**
63** IMPORTANT -- BEWARE OF THE LONGITUDE SIGN CONVENTION. The
64** longitude returned by slaObs is west-positive in accordance
65** with astronomical usage. However, this sign convention is
66** left-handed and is the opposite of the one used by geographers;
67** elsewhere in slalib the preferable east-positive convention is
68** used. In particular, note that for use in slaAop, slaAoppa
69** and slaOap the sign of the longitude must be reversed.
70**
71** Users are urged to inform the author of any improvements
72** they would like to see made. For example:
73**
74** typographical corrections
75** more accurate parameters
76** better station identifiers or names
77** additional stations
78**
79** Defined in slamac.h: DAS2R
80**
81** Last revision: 13 December 1999
82**
83** Copyright P.T.Wallace. All rights reserved.
84*/
85
86#define WEST(id,iam,as) ( DAS2R * \
87 ( (double) (60L * ( (long) (60 * (id)) +(iam) ) ) + (as) ) )
88#define NORTH(id,iam,as) ( WEST(id,iam,as) )
89#define EAST(id,iam,as) ( -WEST(id,iam,as) )
90#define SOUTH(id,iam,as) ( -WEST(id,iam,as) )
91
92{
93/* ------------------- Table of station parameters ------------------- */
94
95 static struct station {
96 char *id; /* identifier */
97 char *na; /* name */
98 double wlong; /* longitude (west) */
99 double phi; /* latitude */
100 double hm; /* height ASL (metres) */
101 } statab[] = {
102
103/* AAT (Observer's Guide) */
104 {
105 "AAT",
106 "Anglo-Australian 3.9m Telescope",
107 EAST(149, 3,57.91),
108 SOUTH(31,16,37.34),
109 1164.0
110 },
111
112/* WHT (Gemini, April 1987) */
113 {
114 "LPO4.2",
115 "William Herschel 4.2m Telescope",
116 WEST(17,52,53.9),
117 NORTH(28,45,38.1),
118 2332.0
119 },
120
121/* INT (Gemini, April 1987) */
122 {
123 "LPO2.5",
124 "Isaac Newton 2.5m Telescope",
125 WEST(17,52,39.5),
126 NORTH(28,45,43.2),
127 2336.0
128 },
129
130/* JKT (Gemini, April 1987) */
131 {
132 "LPO1",
133 "Jacobus Kapteyn 1m Telescope",
134 WEST(17,52,41.2),
135 NORTH(28,45,39.9),
136 2364.0
137 },
138
139/* Lick 120" (1984 Almanac) */
140 {
141 "LICK120",
142 "Lick 120 inch",
143 WEST(121,38, 9.9),
144 NORTH(37,20,35.2),
145 1290.0
146 },
147
148/* MMT 6.5m conversion (MMT Observatory website) */
149 {
150 "MMT",
151 "MMT 6.5m, Mt Hopkins",
152 WEST(110,53, 4.4),
153 NORTH(31,41,19.6),
154 2608.0
155 },
156
157/* Victoria B.C. 1.85m (1984 Almanac) */
158 {
159 "VICBC",
160 "Victoria B.C. 1.85 metre",
161 WEST(123,25, 1.18),
162 NORTH(48,31,11.9),
163 238.0
164 },
165
166/* Las Campanas (1983 Almanac) */
167 {
168 "DUPONT",
169 "Du Pont 2.5m Telescope, Las Campanas",
170 WEST(70,42,9.),
171 SOUTH(29, 0,11.),
172 2280.0
173 },
174
175/* Mt Hopkins 1.5m (1983 Almanac) */
176 {
177 "MTHOP1.5",
178 "Mt Hopkins 1.5 metre",
179 WEST(110,52,39.00),
180 NORTH(31,40,51.4),
181 2344.0
182 },
183
184/* Mt Stromlo 74" (1983 Almanac) */
185 {
186 "STROMLO74",
187 "Mount Stromlo 74 inch",
188 EAST(149, 0,27.59),
189 SOUTH(35,19,14.3),
190 767.0
191 },
192
193/* ANU 2.3m, SSO (Gary Hovey) */
194 {
195 "ANU2.3",
196 "Siding Spring 2.3 metre",
197 EAST(149, 3,40.3),
198 SOUTH(31,16,24.1),
199 1149.0
200 },
201
202/* Greenbank 140' (1983 Almanac) */
203 {
204 "GBVA140",
205 "Greenbank 140 foot",
206 WEST(79,50, 9.61),
207 NORTH(38,26,15.4),
208 881.0
209 },
210
211/* Cerro Tololo 4m (1982 Almanac) */
212 {
213 "TOLOLO4M",
214 "Cerro Tololo 4 metre",
215 WEST(70,48,53.6),
216 SOUTH(30, 9,57.8),
217 2235.0
218 },
219
220/* Cerro Tololo 1.5m (1982 Almanac) */
221 {
222 "TOLOLO1.5M",
223 "Cerro Tololo 1.5 metre",
224 WEST(70,48,54.5),
225 SOUTH(30, 9,56.3),
226 2225.0
227 },
228
229/* Tidbinbilla 64m (1982 Almanac) */
230 {
231 "TIDBINBLA",
232 "Tidbinbilla 64 metre",
233 EAST(148,58,48.20),
234 SOUTH(35,24,14.3),
235 670.0
236 },
237
238/* Bloemfontein 1.52m (1981 Almanac) */
239 {
240 "BLOEMF",
241 "Bloemfontein 1.52 metre",
242 EAST(26,24,18.),
243 SOUTH(29, 2,18.),
244 1387.0
245 },
246
247/* Bosque Alegre 1.54m (1981 Almanac) */
248 {
249 "BOSQALEGRE",
250 "Bosque Alegre 1.54 metre",
251 WEST(64,32,48.0),
252 SOUTH(31,35,53.),
253 1250.0
254 },
255
256/* USNO 61" astrographic reflector, Flagstaff (1981 Almanac) */
257 {
258 "FLAGSTF61",
259 "USNO 61 inch astrograph, Flagstaff",
260 WEST(111,44,23.6),
261 NORTH(35,11, 2.5),
262 2316.0
263 },
264
265/* Lowell 72" (1981 Almanac) */
266 {
267 "LOWELL72",
268 "Perkins 72 inch, Lowell",
269 WEST(111,32, 9.3),
270 NORTH(35, 5,48.6),
271 2198.0
272 },
273
274/* Harvard 1.55m (1981 Almanac) */
275 {
276 "HARVARD",
277 "Harvard College Observatory 1.55m",
278 WEST(71,33,29.32),
279 NORTH(42,30,19.0),
280 185.0
281 },
282
283/* Okayama 1.88m (1981 Almanac) */
284 {
285 "OKAYAMA",
286 "Okayama 1.88 metre",
287 EAST(133,35,47.29),
288 NORTH(34,34,26.1),
289 372.0
290 },
291
292/* Kitt Peak Mayall 4m (1981 Almanac) */
293 {
294 "KPNO158",
295 "Kitt Peak 158 inch",
296 WEST(111,35,57.61),
297 NORTH(31,57,50.3),
298 2120.0
299 },
300
301/* Kitt Peak 90 inch (1981 Almanac) */
302 {
303 "KPNO90",
304 "Kitt Peak 90 inch",
305 WEST(111,35,58.24),
306 NORTH(31,57,46.9),
307 2071.0
308 },
309
310/* Kitt Peak 84 inch (1981 Almanac) */
311 {
312 "KPNO84",
313 "Kitt Peak 84 inch",
314 WEST(111,35,51.56),
315 NORTH(31,57,29.2),
316 2096.0
317 },
318
319/* Kitt Peak 36 foot (1981 Almanac) */
320 {
321 "KPNO36FT",
322 "Kitt Peak 36 foot",
323 WEST(111,36,51.12),
324 NORTH(31,57,12.1),
325 1939.0
326 },
327
328/* Kottamia 74" (1981 Almanac) */
329 {
330 "KOTTAMIA",
331 "Kottamia 74 inch",
332 EAST(31,49,30.),
333 NORTH(29,55,54.),
334 476.0
335 },
336
337/* La Silla 3.6m (1981 Almanac) */
338 {
339 "ESO3.6",
340 "ESO 3.6 metre",
341 WEST(70,43,36.),
342 SOUTH(29,15,36.),
343 2428.0
344 },
345
346/* Mauna Kea 88 inch
347 (IfA website, Richard Wainscoat) */
348 {
349 "MAUNAK88",
350 "Mauna Kea 88 inch",
351 WEST(155,28,09.96),
352 NORTH(19,49,22.77),
353 4213.6
354 },
355
356/* UKIRT
357 (Ifa website, Richard Wainscoat) */
358 {
359 "UKIRT",
360 "UK Infra Red Telescope",
361 WEST(155,28,13.18),
362 NORTH(19,49,20.75),
363 4198.5
364 },
365
366/* Quebec 1.6m (1981 Almanac) */
367 {
368 "QUEBEC1.6",
369 "Quebec 1.6 metre",
370 WEST(71, 9, 9.7),
371 NORTH(45,27,20.6),
372 1114.0
373 },
374
375/* Mt Ekar 1.82m (1981 Almanac) */
376 {
377 "MTEKAR",
378 "Mt Ekar 1.82 metre",
379 EAST(11,34,15.),
380 NORTH(45,50,48.),
381 1365.0
382 },
383
384/* Mt Lemmon 60" (1981 Almanac) */
385 {
386 "MTLEMMON60",
387 "Mt Lemmon 60 inch",
388 WEST(110,42,16.9),
389 NORTH(32,26,33.9),
390 2790.0
391 },
392
393/* Mt Locke 2.7m (1981 Almanac) */
394 {
395 "MCDONLD2.7",
396 "McDonald 2.7 metre",
397 WEST(104, 1,17.60),
398 NORTH(30,40,17.7),
399 2075.0
400 },
401
402/* Mt Locke 2.1m (1981 Almanac) */
403 {
404 "MCDONLD2.1",
405 "McDonald 2.1 metre",
406 WEST(104, 1,20.10),
407 NORTH(30,40,17.7),
408 2075.0
409 },
410
411/* Palomar 200" (1981 Almanac) */
412 {
413 "PALOMAR200",
414 "Palomar 200 inch",
415 WEST(116,51,50.),
416 NORTH(33,21,22.),
417 1706.0
418 },
419
420/* Palomar 60" (1981 Almanac) */
421 {
422 "PALOMAR60",
423 "Palomar 60 inch",
424 WEST(116,51,31.),
425 NORTH(33,20,56.),
426 1706.0
427 },
428
429/* David Dunlap 74" (1981 Almanac) */
430 {
431 "DUNLAP74",
432 "David Dunlap 74 inch",
433 WEST(79,25,20.),
434 NORTH(43,51,46.),
435 244.0
436 },
437
438/* Haute Provence 1.93m (1981 Almanac) */
439 {
440 "HPROV1.93",
441 "Haute Provence 1.93 metre",
442 EAST(5,42,46.75),
443 NORTH(43,55,53.3),
444 665.0
445 },
446
447/* Haute Provence 1.52m (1981 Almanac) */
448 {
449 "HPROV1.52",
450 "Haute Provence 1.52 metre",
451 EAST(5,42,43.82),
452 NORTH(43,56, 0.2),
453 667.0
454 },
455
456/* San Pedro Martir 83" (1981 Almanac) */
457 {
458 "SANPM83",
459 "San Pedro Martir 83 inch",
460 WEST(115,27,47.),
461 NORTH(31, 2,38.),
462 2830.0
463 },
464
465/* Sutherland 74" (1981 Almanac) */
466 {
467 "SAAO74",
468 "Sutherland 74 inch",
469 EAST(20,48,44.3),
470 SOUTH(32,22,43.4),
471 1771.0
472 },
473
474/* Tautenburg 2m (1981 Almanac) */
475 {
476 "TAUTNBG",
477 "Tautenburg 2 metre",
478 EAST(11,42,45.),
479 NORTH(50,58,51.),
480 331.0
481 },
482
483/* Catalina 61" (1981 Almanac) */
484 {
485 "CATALINA61",
486 "Catalina 61 inch",
487 WEST(110,43,55.1),
488 NORTH(32,25, 0.7),
489 2510.0
490 },
491
492/* Steward 90" (1981 Almanac) */
493 {
494 "STEWARD90",
495 "Steward 90 inch",
496 WEST(111,35,58.24),
497 NORTH(31,57,46.9),
498 2071.0
499 },
500
501/* Russian 6m (1981 Almanac) */
502 {
503 "USSR6",
504 "USSR 6 metre",
505 EAST(41,26,30.0),
506 NORTH(43,39,12.),
507 2100.0
508 },
509
510/* Arecibo 1000' (1981 Almanac) */
511 {
512 "ARECIBO",
513 "Arecibo 1000 foot",
514 WEST(66,45,11.1),
515 NORTH(18,20,36.6),
516 496.0
517 },
518
519/* Cambridge 5km (1981 Almanac) */
520 {
521 "CAMB5KM",
522 "Cambridge 5km",
523 EAST(0, 2,37.23),
524 NORTH(52,10,12.2),
525 17.0
526 },
527
528/* Cambridge 1 mile (1981 Almanac) */
529 {
530 "CAMB1MILE",
531 "Cambridge 1 mile",
532 EAST(0, 2,21.64),
533 NORTH(52, 9,47.3),
534 17.0
535 },
536
537/* Bonn 100m (1981 Almanac) */
538 {
539 "EFFELSBERG",
540 "Effelsberg 100 metre",
541 EAST(6,53, 1.5),
542 NORTH(50,31,28.6),
543 366.0
544 },
545
546/* Greenbank 300' (1981 Almanac - defunct) */
547 {
548 "GBVA300",
549 "Greenbank 300 foot",
550 WEST(79,50,56.36),
551 NORTH(38,25,46.3),
552 894.0
553 },
554
555/* Jodrell Bank Mk 1 (1981 Almanac) */
556 {
557 "JODRELL1",
558 "Jodrell Bank 250 foot",
559 WEST(2,18,25.),
560 NORTH(53,14,10.5),
561 78.0
562 },
563
564/* Australia Telescope Parkes Observatory
565 (private comm. Peter te Lintel Hekkert) */
566 {
567 "PARKES",
568 "Parkes 64 metre",
569 EAST(148,15,44.3591),
570 SOUTH(32,59,59.8657),
571 391.79
572 },
573
574/* VLA (1981 Almanac) */
575 {
576 "VLA",
577 "Very Large Array",
578 WEST(107,37, 3.82),
579 NORTH(34, 4,43.5),
580 2124.0
581 },
582
583/* Sugar Grove 150' (1981 Almanac) */
584 {
585 "SUGARGROVE",
586 "Sugar Grove 150 foot",
587 WEST(79,16,23.),
588 NORTH(38,31,14.),
589 705.0
590 },
591
592/* Russian 600' (1981 Almanac) */
593 {
594 "USSR600",
595 "USSR 600 foot",
596 EAST(41,35,25.5),
597 NORTH(43,49,32.),
598 973.0
599 },
600
601/* Nobeyama 45 metre mm dish (based on 1981 Almanac entry) */
602 {
603 "NOBEYAMA",
604 "Nobeyama 45 metre",
605 EAST(138,29,12.),
606 NORTH(35,56,19.),
607 1350.0
608 },
609
610/* James Clerk Maxwell 15 metre mm telescope, Mauna Kea
611 (IfA website, Richard Wainscoat, height from I.Coulson) */
612 {
613 "JCMT",
614 "JCMT 15 metre",
615 WEST(155,28,37.20),
616 NORTH(19,49,22.11),
617 4111.0
618 },
619
620/* ESO 3.5 metre NTT, La Silla (K.Wirenstrand) */
621 {
622 "ESONTT",
623 "ESO 3.5 metre NTT",
624 WEST(70,43, 7.),
625 SOUTH(29,15,30.),
626 2377.0
627 },
628
629/* St Andrews University Observatory (1982 Almanac) */
630 {
631 "ST.ANDREWS",
632 "St Andrews",
633 WEST(2,48,52.5),
634 NORTH(56,20,12.),
635 30.0
636 },
637
638/* Apache Point 3.5 metre (R.Owen) */
639 {
640 "APO3.5",
641 "Apache Point 3.5m",
642 WEST(105,49,11.56),
643 NORTH(32,46,48.96),
644 2809.0
645 },
646
647/* W.M.Keck Observatory, Telescope 1 (site survey)
648 (private comm. William Lupton) */
649 {
650 "KECK1",
651 "Keck 10m Telescope #1",
652 WEST(155,28,28.99),
653 NORTH(19,49,33.41),
654 4160.0
655 },
656
657/* Tautenberg Schmidt (1983 Almanac) */
658 {
659 "TAUTSCHM",
660 "Tautenberg 1.34 metre Schmidt",
661 EAST(11,42,45.0),
662 NORTH(50,58,51.0),
663 331.0
664 },
665
666/* Palomar Schmidt (1981 Almanac) */
667 {
668 "PALOMAR48",
669 "Palomar 48-inch Schmidt",
670 WEST(116,51,32.0),
671 NORTH(33,21,26.0),
672 1706.0
673 },
674
675/* UK Schmidt, Siding Spring (1983 Almanac) */
676 {
677 "UKST",
678 "UK 1.2 metre Schmidt, Siding Spring",
679 EAST(149,04,12.8),
680 SOUTH(31,16,27.8),
681 1145.0
682 },
683
684/* Kiso Schmidt, Japan (1981 Almanac) */
685 {
686 "KISO",
687 "Kiso 1.05 metre Schmidt, Japan",
688 EAST(137,37,42.2),
689 NORTH(35,47,38.7),
690 1130.0
691 },
692
693/* ESO Schmidt, La Silla (1981 Almanac) */
694 {
695 "ESOSCHM",
696 "ESO 1 metre Schmidt, La Silla",
697 WEST(70,43,46.5),
698 SOUTH(29,15,25.8),
699 2347.0
700 },
701
702/* Australia Telescope Compact Array (WGS84 coordinates of Station 35,
703 private comm. Mark Calabretta) */
704 {
705 "ATCA",
706 "Australia Telescope Compact Array",
707 EAST(149,33, 0.500),
708 SOUTH(30,18,46.385),
709 236.9
710 },
711
712/* Australia Telescope Mopra Observatory
713 (private comm. Peter te Lintel Hekkert) */
714 {
715 "MOPRA",
716 "ATNF Mopra Observatory",
717 EAST(149, 5,58.732),
718 SOUTH(31,16, 4.451),
719 850.0
720 },
721
722/* Subaru telescope, Mauna Kea
723 (IfA website, Richard Wainscoat) */
724 {
725 "SUBARU",
726 "Subaru 8m telescope",
727 WEST(155,28,33.67),
728 NORTH(19,49,31.81),
729 4163.0
730 },
731
732/* Canada-France-Hawaii Telescope, Mauna Kea
733 (IfA website, Richard Wainscoat) */
734 {
735 "CFHT",
736 "Canada-France-Hawaii 3.6m Telescope",
737 WEST(155,28,07.95),
738 NORTH(19,49,30.91),
739 4204.1
740 },
741
742/* W.M.Keck Observatory, Telescope 2
743 (William Lupton, private comm) */
744 {
745 "KECK2",
746 "Keck 10m Telescope #2",
747 WEST(155,28,27.24),
748 NORTH(19,49,35.62),
749 4159.6
750 },
751
752/* Gemini North, Mauna Kea
753 (IfA website, Richard Wainscoat) */
754 {
755 "GEMININ",
756 "Gemini North 8-m telescope",
757 WEST(155,28,08.57),
758 NORTH(19,49,25.69),
759 4213.4
760 },
761
762/* Five College Radio Astronomy Observatory
763 (Tim Jenness, private comm) */
764 {
765 "FCRAO",
766 "Five College Radio Astronomy Obs",
767 WEST(72,20,42.0),
768 NORTH(42,23,30.0),
769 314.0
770 },
771
772/* NASA Infra Red Telescope Facility
773 (IfA website, Richard Wainscoat) */
774 {
775 "IRTF",
776 "NASA IR Telescope Facility, Mauna Kea",
777 WEST(155,28,19.20),
778 NORTH(19,49,34.39),
779 4168.1
780 },
781
782/* Caltech Submillimeter Observatory
783 (IfA website, Richard Wainscoat; height estimated) */
784 {
785 "CSO",
786 "Caltech Sub-mm Observatory, Mauna Kea",
787 WEST(155,28,31.79),
788 NORTH(19,49,20.78),
789 4080.0
790 },
791
792/* ESO VLT, UT1
793 (ESO website, VLT Whitebook Chapter 2) */
794 {
795 "VLT1",
796 "ESO VLT, Paranal, Chile: UT1",
797 WEST(70,24,11.642),
798 SOUTH(24,37,33.117),
799 2635.43
800 },
801
802/* ESO VLT, UT2
803 (ESO website, VLT Whitebook Chapter 2) */
804 {
805 "VLT2",
806 "ESO VLT, Paranal, Chile: UT2",
807 WEST(70,24,10.855),
808 SOUTH(24,37,31.465),
809 2635.43
810 },
811
812/* ESO VLT, UT3
813 (ESO website, VLT Whitebook Chapter 2) */
814 {
815 "VLT3",
816 "ESO VLT, Paranal, Chile: UT3",
817 WEST(70,24,09.896),
818 SOUTH(24,37,30.300),
819 2635.43
820 },
821
822/* ESO VLT, UT4
823 (ESO website, VLT Whitebook Chapter 2) */
824 {
825 "VLT4",
826 "ESO VLT, Paranal, Chile: UT4",
827 WEST(70,24,08.000),
828 SOUTH(24,37,31.000),
829 2635.43
830 }
831 };
832
833 static int NMAX = ( sizeof statab / sizeof ( struct station ) );
834
835/* ------------------------------------------------------------------- */
836
837 int m;
838
839
840/* Station specified by number or identifier? */
841 if ( n > 0 ) {
842
843 /* Station specified by number */
844 m = n - 1;
845 if ( m < NMAX ) {
846 strcpy ( c, statab[m].id );
847 }
848 } else {
849
850 /* Station specified by identifier: determine corresponding number */
851 for ( m = 0; m < NMAX; m++ ) {
852 if ( ! strncmp ( c, statab[m].id, 10 ) ) {
853 break;
854 }
855 }
856 }
857
858/* Return parameters of mth station */
859 if ( m < NMAX ) {
860 strncpy ( name, statab[m].na, 40 );
861 *w = statab[m].wlong;
862 *p = statab[m].phi;
863 *h = statab[m].hm;
864 } else {
865 strcpy ( name, "?" );
866 }
867}
Note: See TracBrowser for help on using the repository browser.