The skycal routine was originally a purely interactive code that does a lot of things. The EASIEST way to run it is through the bash script: skycalgen.sh.
Usage: skycalgen.sh 16:13:15.10 +35:00:29.0 20150922 22:20:45 arg1 - Ra J2000 in sexigecimal arg2 - Dec J2000 in sexigecimal arg3 - UT date (yyyymmdd) arg4 - UT time (hh:mm:ss) This version for McDonald Obs only! % skycalgen.sh 16:13:15.10 +35:00:29.0 20150922 22:20:45 ====================================================================== Summary of SKYCAL data: Target RA,DEC : 16:13:15.10 +35:00:29.0 UT date : 20150922 UT : 22:20:45 LST : 15:30:30.23 Days since J2000.0 : 5743.430664 Julian Date : 2457288.431076 Hour Angle : 00:42:44.87 (EAST) Target Altitude,Azimuth (degrees) : 80.034 61.362 Target airmass : 1.015 RA,DEC of Moon : 18:26:12.90 -18:00:44.0 Percentage moon illumination : 56.7000 Angle between target and moon (degrees): 65.6616 Zenith distance of target (degrees) : 9.9656 Zenith distance of moon (degrees) : 64.4475 Predicted V sky surface brightness : 20.28 (mag/sq.arcsec)The information above that flashes by on the monitor is also written to a local file called "skycal.ascii":
% cat skycal.ascii 16:13:15.10 # RA +35:00:29.0 # DEC 20150922 # UT_date 22:20:45 # UT_time 15:30:30.23 # LST 5743.430664 # Years_since_2000 2457288.431076 # JD 00:42:44.87 # hour angle 80.034 # altitude 61.362 # azimuth 1.015 # airmass 56.7000 # Moon percentage illumination 65.6616 # Moon angle (degrees) 9.9656 # Target zenith distance (degrees) 64.4475 # Moon zenith distance (degrees) 20.2780 # V sky surface brightness, mssHence, you can embed a call to skycalgen.sh in some larger script, and then read the results from "skycal.ascii".
The skycal code is a large kluge of date/time/astrometry routines. It is extremely un-OTW (One Thing Well), but it is useful. I currently run it interactively with the following:
% SKYCAL 0) Compute various times with current UT time and date. 1) Given RA, DEC and UT, compute aziumth (AZ,ALT). 2) Compute (AZ,ALT)+ for current McDonald Obs. 3) Compute (AZ,ALT)+ for specific time at McDonald Obs. 99) End execution. Enter index of desired job:The user just follows the directions. A convenient script, that is appropriate for McDonald Observatory use is: skycal.sh (but be aware that you must have the MOONDAT system variable set in order for the moon phase and position information to be given properly. I show the value of $MOONDAT for my home machine below.
% skycal.sh 12:30:28.14 +32:18:44.3 now ====================================================================== Summary of SKYCAL data: Target RA,DEC : 12:30:28.14 +32:18:44.3 UT date : 20140904 UT : 19:24:20 LST : 11:23:35.74 Days since J2000.0 : 5360.308594 Julian Date : 2456905.308565 Hour Angle : 01:06:52.40 (EAST) Target Altitude,Azimuth (degrees) : 75.664 79.073 Target airmass : 1.032 RA,DEC of Moon : 18:04:16.70 -18:31:25.0 Percentage moon illumination : Moon down Angle between target and moon (degrees): Moon down Zenith distance of target (degrees) : 14.3367 Zenith distance of moon (degrees) : Moon down (V sky SB = 21.9 if dark) % echo $MOONDAT /home/sco/sco/codes/fortran/gfortran_compiler/lmgf/src/critical_files/moon/MOON.DATSometimes the user may want to know sky positions for some time other than the CURRENT UT time. In this case, feed the value of the UT desired (i.e. 13:06:10) as the third command line argument for the skycal.sh script.
% skycal.sh 12:12:12.00 +12:12:12.1 13:06:10 Summary of SKYCAL data: Target RA,DEC : 12:12:12.00 +12:12:12.1 UT date : 20141003 UT : 13:06:10 LST : 06:58:43.71 Days since J2000.0 : 5389.045898 Julian Date : 2456934.045949 Hour Angle : 05:13:28.29 (EAST) Target Altitude,Azimuth (degrees) : 16.101 85.146 Target airmass : 3.606 RA,DEC of Moon : 19:44:44.80 -15:54:59.0 Percentage moon illumination : Moon down Angle between target and moon (degrees): Moon down Zenith distance of target (degrees) : 73.9008 Zenith distance of moon (degrees) : Moon down (V sky SB = 21.9 if dark)