Software documentation: Solve_Early
Preface
This program, in conjunction with CAOBS, solves the Early/Normal calibration for the smapler phase rotators. In this program, "sp" means sampler phase and "xy" means the delay of the intra-antenna cross-products. BAT is binary atomic time.Call sequence:
program solve_early implicit none include 'caobs$inc:caobs_status.inc' include 'cacal$inc:solve_early.inc'Creation date: 7-Dec-1995
Author: Michael Kesteven & Derek McKay
File: SOLVE_EARLY.FOR
Routine name: en_get_sp_data
Function:
This routine looks for new CAOBS cycles and records the associated sampler phase offsets for each antenna/IF. To be honest, I don't believe that this routine is needed at all.
Call sequence:
subroutine en_get_sp_data implicit none include 'cacal$inc:solve_early.inc' * include 'cacal$inc:delcor.inc' include 'caobs$inc:caobs_status.inc'Creation date: 7-Dec-1995
Author: Micahel Kesteven & Derek McKay
File: SOLVE_EARLY.FOR
Routine name: en_get_xy_data
Function:
This routine recovers the correlator data (out of the global common) and puts it into the "tmp" structure.
Call sequence:
subroutine en_get_xy_data implicit none include 'caobs$inc:caobs_status.inc' * include 'cacal$inc:delcor.inc' include 'cacal$inc:solve_early.inc'Creation date: 8-Dec-1995
Author: Michael Kesteven & Derek McKay
File: SOLVE_EARLY.FOR
Routine name: en_init
Function:
Performs a lot of the basic initialisation of the program. It sorts out the mapping between visibilities, as delivered by CACOR, and the interferometer pairs. It returns results in common - the mapping, the reference antenna and poln.
status return ... 0 OK -1 no useful visibilities found
Call sequence:
subroutine en_init(status) implicit none include 'caobs$inc:caobs_status.inc' * include 'cacal$inc:delcor.inc' include 'cacal$inc:solve_early.inc' integer status ! Return status (0 = okay; -1 = fail)Creation date: 8-Dec-1995
Author: Michael Kesteven & Derek McKay
File: SOLVE_EARLY.FOR
Routine name: en_match_data
Function:
When data has been acquired from both the CAOBS and CACOR sources, it needs to be matched. This routine takes the new CACOR visibility data and looks for a matching BAT (binary atomic time) in the CAOBS data records. If it finds one, it adds the new XY product data to that record. It returns a status:
0 = Success -1 = Early 1 = End of data
Call sequence:
subroutine en_match_data (count, status) implicit none * include 'cacal$inc:delcor.inc' include 'cacal$inc:solve_early.inc' integer - count, - statusCreation date: 7-Dec-1995
Author: Michael Kesteven & Derek McKay
File: SOLVE_EARLY.FOR
Routine name: en_process
Function:
At the conclusion of the data acquisition, this routine is called to determine what the new, calibrated sampler phases should be.
Call sequence:
subroutine en_process(count) implicit none include 'caobs$inc:caobs_status.inc' * include 'cacal$inc:delcor.inc' include 'cacal$inc:solve_early.inc'Creation date: 7-Dec-1995
Author: Michael Kesteven & Derek McKay
File: SOLVE_EARLY.FOR
Routine name: en_put_results
Function:
This routine is used to enter the data into the global common. The tricky little bit of maths inside the sp_corr() array, is to convert from the freq/pol to an IF number.
Call sequence:
subroutine en_put_results(sp_corr,ant,num_freq) implicit none include 'caobs$inc:c_sac.inc' integer - ant, ! Antenna number - freq, ! Frequency counter - pol, ! Polarisation counter (1-2) - num_freq ! Number of used frequencies (1 or 2) real sp_corr(4) ! Sampler phase corrections (4 IFs)Creation date: 7-Dec-1995
Author: Derek McKay
File: SOLVE_EARLY.FOR
Routine name: en_real_to_str
Function:
This function takes one of the "normalised" solution results (delay) and derives a character string value to describe it. This character string is returned (delay_str). The value is checked to see if it matches one of the "expected" values, or something close to one. If not, the character string has an escape sequence buried in it to make it reverse video, otherwise it has an escape sequence in it to cancel any such video effect. The "closeness" to the nominal value that is acceptable (i.e. not printed in reverse video), is set using the parameter LIMIT.
Call sequence:
subroutine en_real_to_str(delay, delay_str) implicit none real delay character*16 delay_strCreation date: 28-Dec-1995
Author: Derek McKay
File: SOLVE_EARLY.FOR
Include file: solve_early.inc
Function:
This is the include file to the SOLVE_EARLY program.
Creation date: 7-Dec-1995
Author: Michael Kesteven & Derek McKay
File: SOLVE_EARLY.INC
Original: Derek McKay (14-Oct-1996)
Modified: Derek McKay (14-Oct-1996)