This loads a font easier to read for people with dyslexia.
This renders the document in high contrast mode.
This renders the document as white on black
This can help those with trouble processing rapid screen movements.

Software documentation: Srcpac

Preface

This program will take a standard catalogue and plot all the sources above the horizon as an arc starting from the initial HA/Dec to the final HA/Dec position on an Az/El graph. Also on the graph other limits may be displayed, and the parameters for these may be controlled through this program. Geometric antenna shadowing is also displayed. Notice that all SRCPAC subroutines have the "SRC_" prefix.
 
To create faster plotting, SRCPAC now uses the "Uranometric" (Tirion) standard for the plotting of sub- resolution radio sources; namely upright, equilateral triangles. This should be much faster than the circles when using the PGPT routine.
 
This code is NOT standard to ATNF, nor is it officially supported. The author makes no guarentee to it performance and users are advised that they operate this software at their own risk. This software is Compact Array specific.

Call sequence:

      program srcpac
      implicit none
      include 'srcplot$inc:srcpac.inc'  ! Include file with "src"
                                        ! structure
      include 'constants'
Creation date: 23-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: eq2pr

Function:

This routine does a simple conversion from Hour Angle and Declination to Zenith projected horizon coordinates (namely Azimuth and Elevation). The function returns .true. if the source lies above the ATCA horizon (12 degrees elevation).

Call sequence:

      logical function eq2pr(ha,dec,x,y)
      implicit none
      include 'constants'
      real*8
     -  ha,   ! Hour angle
     -  dec   ! Declination
      real
     -  x,    ! X-Projection of AZ/EL
     -  y     ! Y-Projection of AZ/EL
Creation date: 24-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: rem_blank

Function:

This routine removes leading spaces from a string

Call sequence:

      subroutine rem_blank(str)
      implicit none
      character*(*) str
Creation date: 30-Sep-1993

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_add

Function:

Adds a source to the schedule

Call sequence:

      subroutine src_add()
      implicit none
      include 'srcplot$inc:srcpac.inc'  ! Include file with "src"
                                        ! structure
Creation date: 25-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_cmb

Function:

Returns the shortest baseline in metres of the current array configuration.

Call sequence:

      real*8 function src_cmb()
      implicit none
      include 'caobs$inc:caobs_status.inc'
Creation date: 1-Mar-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_colour

Function:

Sets up the PGPLOT colour map for the SRCPAC graphics. It returns the colour index of a grey that is suitable for the faint, background grid lines. Note that "src_colour" also returns a maximum and minimum colour index ("ci") for the assignment of a colour index to the sources based on flux.

Call sequence:

Creation date: 25-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_cur_lst

Function:

Thisfunction returns the current local sidereal time (LST) in radians

Call sequence:

      real*8 function src_cur_lst()
      implicit none
      include 'constants'
Creation date: 1-Mar-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_dehighlight

Function:

This routine dehighlights a source on the plot. That is, it make the source revert to its normal colour.

Call sequence:

      subroutine src_dehighlight(n)
      implicit none
      include 'srcplot$inc:srcpac.inc'  ! Include file with "src"
                                        ! structure
      integer n    ! The index of the source that you want to make
                   ! normal again.
Creation date: 25-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_del

Function:

Deletes a source from the schedule. The function returns the source number that was selected (used later for highlighting reasons).

Call sequence:

      integer function src_del()
      implicit none
      include 'srcplot$inc:srcpac.inc'  ! Include file with "src"
                                        ! structure
Creation date: 1-Mar-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_get_data

Function:

This routine extracts the Name, R.A. and Dec. from a datum string

Call sequence:

      subroutine src_get_data(string_in,
     -                        name_out,ra_out,dec_out,flux_out,
     -                        flux_index)
      implicit none
      character*(*)
     -  string_in,   ! Inputed catalogue entry
     -  name_out,    ! Returned source name string
     -  ra_out,      ! Returned Right Ascension string
     -  dec_out,     ! Returned Declination string
     -  flux_out     ! Returned flux string
      integer
     -  flux_index   ! The column that the flux information is expected
                     ! to be in.
Creation date: 30-Sep-1993

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_help

Function:

This routine prints a short message to the screen advising users of the options that they have available to them. It is sort of a "micro" on-line help.

Call sequence:

      subroutine src_help()
      implicit none
Creation date: 25-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_info

Function:

This routine looks for the nearest source to the mouse / keyboard activated cursor, and displays all known information about the source. It returns the number of the source that the info was displayed for (used later for dehighlighting reasons).

Call sequence:

      integer function src_info()
      implicit none
      include 'constants'
      include 'srcplot$inc:srcpac.inc'  ! Include file with "src"
                                        ! structure
Creation date: 25-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_list

Function:

This routine goes through the schedule list and produces an on-screen listing of the sources that it has recorded. It also records some additional information concerning the source position etc.

Call sequence:

      subroutine src_list()
      implicit none
      include 'constants'
      include 'srcplot$inc:srcpac.inc'  ! Include file with "src"
                                        ! structure
Creation date: 28-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_load_data

Function:

This routine loads all the source information into a structure that may be read by the program more rapidly.

Call sequence:

      subroutine src_load_data(filename,max_ci, min_ci)
      implicit none
      include 'srcplot$inc:srcpac.inc'    ! Include file with "src"
                                          ! structure
      include 'constants'
      character*(*) filename  ! The name of the catalogue file to be
                              ! read
      integer
     -  max_ci,               ! The maximum colour index that may be
                              ! used for a grey- scale flux
                              ! representation.
     -  min_ci                ! The same, but the minimum that may be
                              ! used.
Creation date: 24-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_nearest

Function:

Determines the nearest unflagged source to the cursor position that is in the include file. It takes the source flagging into account.

Call sequence:

      integer function src_nearest()
      implicit none
      include 'srcplot$inc:srcpac.inc'  ! Include file with "src"
                                        ! structure
Creation date: 25-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_pack

Function:

This routine takes a list of numbers in an array, and repacks the array in the received order, but omits any elements that are equal to zero (0). It returns the element number of the last non-zero entry in the array.

Call sequence:

      subroutine src_pack(array,size)
      implicit none
      integer
     -  array(*),  ! The array of integers that needs the zero entries
                   ! removed
     -  size       ! The initial size of the array. When returned it
                   ! will be the corrected value; that is, the last
                   ! non-zero entry in the "array".
Creation date: 28-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_plot_grid

Function:

This routine examines the passed grid bit mask and where possible, plots the appropriate grid lines. Currently supported are Azimuth, and Elevation. It assumes that the appropriate colour index was already set before entering the subroutine.

Call sequence:

      subroutine src_plot_grid(mask)
      implicit none
      integer mask    ! The bit mask that describes which grid lines
                      ! have been requested. See the description in the
                      ! header of the routine src_set_grid().
Creation date: 25-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_plot_shadow

Function:

This routine examines the passed minimum baseline length and determines if there will be any shadowing with the Compact Array. If there is it plots a warning line on the display. The colour of this is set by the value of the PGSCI call before this routine is called (similar to the src_plot_grid() routine). The algorithm used is the GEOMETRIC PROJECTION as described by Ravi Subrahmanyan in the technical document "Effects of Shadowing at the AT" (7-Jan-1991). A few modifications have been made to it by the author. Note the intrinsic 22.; this corresponds to the 22m diameter of the Australia Telescope Compact Array dishes.

Call sequence:

      subroutine src_plot_shadow(min_bsln)
      implicit none
      real*8 min_bsln   ! The minimum conpact array baseline.
Creation date: 28-Mar-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_sched_type

Function:

This routine determines from user input what type of schedule is required. The function returns a single letter code

 
                    B  = Baseline schedule
                    O  = Optical pointing schedule
                    P  = Pointing schedule
                   ' ' = General (non-specific) schedule
 
The function also returns the default catalgoue string, which is subsequently used by the main program to determine what catalogue should be offered to the user as the default (of course the user has the power to override this. It also returns the length of the default catalogue string as well. This will allow the calling routine to neaten the prompt for the catalogue and remove any extraneous spaces.

Call sequence:

      character*1 function src_sched_type(req_sched, def_cat, len)
      implicit none
      character*(*)
     -  req_sched,    ! The requested schedule type
     -  def_cat       ! The name of the default catalogue that would be
                      ! used for the aforementioned schedule type.
      integer
     -  len           ! The length of the "def_cat" string
Creation date: 16-Mar-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_set_grid

Function:

Looks at the provided user string and decides whether or not certain grid lines should or shouldn't be plotted. If they are, then a mask is set with the following format

 
                 grid_mask = XXXXXXXX
                                 ^^^^
                                 |||+---- Azimuth
                                 ||+----- Elevation
                                 |+------ Hour angle
                                 +------- Declination
 

Call sequence:

      subroutine src_set_grid(string,mask)
      implicit none
      character*(*) string  ! The users generic input string. This will
                            ! be parsed for the relevent information
      integer mask          ! An integer bitmask showing what gridlines
                            ! are requested. See the routine header for
                            ! information about the mapping.
Creation date: 25-Feb-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_write_bsln_sched

Function:

This routine creates a schedule of the specified name in the standard AT$SCHED area. Note that it would be susceptible to changes in the CAOBS read format, and thus should mimic the corresponding change that occurs in SCHED. This routine was modelled off the WRITESCH.FOR code (original author unknown - but probably Mike Kesteven). Unlike the origianl, we'll assume that this routine is only called if there are a non-zero number of sources in the schedule. This saves the trauma of a very large "if" statement. This function returns TRUE if the schedule file was written successfully. Notice that the format is that of a BSLN schedule. There is also a corresponding pointing schedule as well.

Call sequence:

      logical function src_write_bsln_sched(filename)
      implicit none
      include 'srcplot$inc:srcpac.inc'  ! Include file with "src"
                                        ! structure
      include 'constants'
      character*(*) filename   ! The name of the schedule file
Creation date: 3-Mar-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_write_entry

Function:

This routine puts a single scan entry into the schedule file specified by the Logical Unit Number ("lun"). It creates a Version 1 type schedule file.

Call sequence:

      subroutine src_write_entry(lun, id, name, obs, proj, ra, dec,
     -                           epoch,
     -                           scan, calcode, sc_type)
      implicit none
      integer
     -  lun        ! The Logical Unit Number of the schedule file
      character*(*)
     -  id,        ! The scan identifier string
     -  name,      ! The source name
     -  obs,       ! The name of the observer
     -  proj,      ! The name of the project
     -  epoch,     ! The Epoch of the observation (B1950., J2000., or AZ/EL)
     -  calcode,   ! The calibrator code (B, C, ' ', etc.)
     -  sc_type    ! The actual scan type (DWELL, etc.)
      real*8
     -  ra,        ! The source's Right Ascension
     -  dec,       ! The source's Declination
     -  scan       ! The amount of time (in days) to be spent on that source
Creation date: 15-Mar-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_write_opt_sched

Function:

This routine creates a schedule of the specified name in the standard AT$SCHED area. Note that it would be susceptible to changes in the CAOBS read format, and thus should mimic the corresponding change that occurs in SCHED. This routine was modelled off the WRITESCH.FOR code (original author unknown - but probably Mike Kesteven). This function returns TRUE if the schedule file was written successfully. Notice that the format is that of an OPTICAL POINTING schedule. There is also a corresponding baseline and (normal radio) pointing schedule as well.

Call sequence:

      logical function src_write_opt_sched(filename)
      implicit none
      include 'srcplot$inc:srcpac.inc'  ! Include file with "src"
                                        ! structure
      include 'constants'
      character*(*) filename   ! The name of the schedule file
Creation date: 13-Jul-1995

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_write_pnt_sched

Function:

This routine creates a schedule of the specified name in the standard AT$SCHED area. Note that it would be susceptible to changes in the CAOBS read format, and thus should mimic the corresponding change that occurs in SCHED. This routine was modelled off the WRITESCH.FOR code (original author unknown - but probably Mike Kesteven). This function returns TRUE if the schedule file was written successfully. Notice that the format is that of a POINT schedule. There is also a corresponding baseline schedule as well.

Call sequence:

      logical function src_write_pnt_sched(filename)
      implicit none
      include 'srcplot$inc:srcpac.inc'  ! Include file with "src"
                                        ! structure
      include 'constants'
      character*(*) filename   ! The name of the schedule file
Creation date: 15-Mar-1994

Author: Derek McKay

File: SRCPAC.FOR


Routine name: src_write_sched

Function:

This routine looks at the specified schedule type (as the argument) and determines what type of src_write_xxx_sched needs calling. The "xxx" will be an indication of this (e.g. PNT, BSLN, etc.). If it does not get a valid sched file type, it will use the generic sched file creator. The function returns .TRUE. if the write appeared to work successfully (as returned by the called subroutines).

Call sequence:

      logical function src_write_sched(sched_type)
      implicit none
      character*1
     -  sched_type   ! The single letter character coed that will
                     ! determine what type of schedule file will be
                     ! generated. See the routine src_sched_type for
                     ! more information.
Creation date: 16-Mar-1994

Author: Derek McKay

File: SRCPAC.FOR


Include file: srcpac

Function:

Contains the src (source) structures and the src counters. It also has the schedule list array and its index and a special structure for hold the cursor information for the user mouse/cursor input.

Creation date: 22-Mar-1993

Author: Derek McKay

File: SRCPAC.INC


Original: Derek McKay (11-Oct-1996)
Modified: Derek McKay (11-Oct-1996)