[daip] CLCAL and TAMRG

R. Craig Walker cwalker at nrao.edu
Sun Apr 22 14:46:26 EDT 2007


I have run into what appears to be a bug in CLCAL.  I ran CLCAL with
INTERPOL='SELF' using an SN table from PCCOR as input.  The output CL
table is twice the size of the input table (twice as many rows).  For
each input row, there are two output rows.  One has been interpolated
(delays) as expected with SELF.  The other has apparently been
interpolated with 2PT.  I tried deleting the output table and
rerunning to be sure I hadn't run twice or some such.  But the fresh
table has these properties.  I found the problem by using SNPLT to
plot the contents of the CL table delay and found two entries at each
time stamp.  Across a scan boundary, one set of entries was flat, to
the boundary and then stepped across the boundary, as expected for
SELF.  The other ramped between the values at the times of the actual
measurements, putting a slope across the region around the scan change
time, as exected for 2PT.  A look with PRTAB shows that there are two
entries, with different delays, for each time stamp.  Here is a PRTAB
output for one such pair (using BOX to just look at delays):

>go prtab
 localhos  PRTAB(31DEC07)    501     22-APR-2007  01:17:32    Page    1
BW088A      .MULTI .   1  Disk= 4    CL Table version  10
Title: AIPS UV DATA FILE CALIBRATION TABLE
Created by      CLCAL on 22-APR-2007 01:06:11
Last written by CLCAL on 22-APR-2007 01:06:26
Ncol  33  Nrow  134578    Sort cols:   1 (ASCEND)   4 (ASCEND)
    Table has     6 keyword-value pairs:
   NO_ANT   =            9
   NO_POL   =            2
   NO_IF    =            2
   NO_TERM  =            6
   MGMOD    =  1.0000000000000D+00
   REVISION =           10
   Table format incompatable with FITS ASCII tables

COL. NO.           1              3              4             20         
   31
     ROW      TIME            SOURCE ID      ANTENNA       DELAY 1       
DELAY 2
  NUMBER      D/HMS                                        SECONDS       
SECONDS
   24309      08:10:23.9          3              2         4.400E-08     
5.034E-08
   24309                                                   4.294E-08     
4.869E-08
   24310      08:10:23.9          3              2         4.399E-08     
5.044E-08
   24310                                                   4.199E-08     
4.859E-08
AIPS 1: Resumes


Other bookkeeping parameters like subarray and freqid are the same.

Here are my CLCAL inputs:


AIPS 1: CLCAL     Task to manage SN and CL calibration tables
AIPS 1: Adverbs     Values                 Comments
AIPS 1: ----------------------------------------------------------------
AIPS 1: INNAME     'BW088A'                Input UV file name (name)
AIPS 1: INCLASS    'MULTI'                 Input UV file name (class)
AIPS 1: INSEQ         1                    Input UV file name (seq. #)
AIPS 1: INDISK        4                    Input UV file disk unit #
AIPS 1: SOURCES    *all ' '                Source list to calibrate
AIPS 1: SOUCODE    ' '                     Source "Cal codes"
AIPS 1: CALSOUR    *all ' '                Cal sources for calibration
AIPS 1: QUAL         -1                    Source qualifier -1=>all
AIPS 1: CALCODE    ' '                     Calibrator code '    '=>all
AIPS 1: TIMERANG   *all 0                  Time range to calibrate
AIPS 1: SUBARRAY      0                    Subarray, 0=>all,
AIPS 1: ANTENNAS   *all 0                  Antennas selected, 0=> all
AIPS 1: SELBAND      -1                    Bandwidth to select (kHz)
AIPS 1: SELFREQ      -1                    Frequency to select (MHz)
AIPS 1: FREQID       -1                    Freq. ID to select.
AIPS 1: OPCODE     'CALI'                  Operation 'MERG','CALI',
AIPS 1:                                    'CALP'; ' ' => 'CALI'
AIPS 1: INTERPOL   'SELF'                  Interpolation function,
AIPS 1:                                    choices are: '2PT','SIMP',
AIPS 1:                                    'AMBG','CUBE','SELF','POLY',
AIPS 1:                                    'SELN'; see HELP for details
AIPS 1: CUTOFF        0                    Interpolation limit in
AIPS 1:                                    time (min); 0=> no limit.
AIPS 1: SAMPTYPE   ' '                     Smoothing function
AIPS 1: BPARM      *all 0                  Smoothing parameters
AIPS 1: ICUT           .1                  Cutoff for functional forms
AIPS 1: DOBLANK       0                    Blanked value interpolation
AIPS 1: DOBTWEEN      0                    > 0 -> smooth all sources
AIPS 1:                                    together; else separate them
AIPS 1: SMOTYPE    ' '                     Data to smooth
AIPS 1: SNVER         3                    Input SN table, 0=>all.
AIPS 1: INVERS        0                    Upper SN table vers in a
AIPS 1:                                    range.  0=>SNVER
AIPS 1: GAINVER       5                    Input Cal table 0=>high
AIPS 1: GAINUSE      10                    Output CAL table 0=>high+1
AIPS 1: REFANT        8                    Reference antenna 0=>pick.
AIPS 1: BADDISK    *all 0                  Disks to avoid for scratch

I'm working on my Mac PowerBook G4.
Rerunning with a nominal smoothing (box time shorter than SN interval) did
not help.


-------------------  TAMRG PROBLEM --------------------------------

In trying to salvage the output of CLCAL, I am attempting to use TAMRG.
Since the table already was sorted into an appropriate order, I set
APARM=0.  When I ran, I got:

localh> TAMRG1: Start merge to scratch version  11
localh> TAMRG1: Start sort to output version  11
localh> TAMRG1: TABINI: REQUESTED CL FILE  11 DOES NOT EXIST
localh> TAMRG1: TABSRT: ERROR   2 OPENING INPUT TABLE

It looks like the post-sort part of the program cannot deal with the sort
being bypassed.  Now I need to run the sort and hope that the order of
the pairs don't get inverted.  But TAMRG needs to be made to work without
sorting if that is desired.

Here are the TAMRG inputs:


AIPS 1: TAMRG:  Task to merge table rows under specified conditions
AIPS 1: Adverbs     Values                 Comments
AIPS 1: ----------------------------------------------------------------
AIPS 1: USERID        0                    User number.
AIPS 1: INNAME     'BW088A'                Main input file (name).
AIPS 1: INCLASS    'MULTI'                 Main input file (class).
AIPS 1: INSEQ         1                    Main input file (seq. #).
AIPS 1:                                       0 => high
AIPS 1: INDISK        4                    Disk unit #.       0 => any
AIPS 1: INEXT      'CL'                    Input table extension type
AIPS 1: INVERS       10                    Input table file version no.
AIPS 1: OUTVERS      11                    Output table file version.
AIPS 1: APARM      *all 0                  Initial sort: Keys & weights
AIPS 1:                                    1,2=> col. & wt pri. key 1.
AIPS 1:                                    3,4=> col. & wt sec. key 1.
AIPS 1:                                    5,6=> col. & wt pri. key 2.
AIPS 1:                                    7,8=> col. & wt sec. key 2.
AIPS 1:                                    APARM(1) = 0 => no sort.
AIPS 1: BPARM         1           3        Columns which must be equal
AIPS 1:               4           5        to merge two rows.
AIPS 1:               6        *rest 0
AIPS 1: CPARM      1.000E-05       .5      Allowed error in the equality
AIPS 1:                .5          .5      test by column.
AIPS 1:                .5      *rest 0
AIPS 1: DPARM      *all 0                  Columns to sum. 0 => none.
AIPS 1: BADDISK    *all 0                  Disks to avoid for scratch

I then tried sorting on column 5, the subarray (all data has the same
value).  That ran.  And I got 84328 output rows from 134578 input rows.
All previous CL tables had 67289 rows, so this was not perfect.

Also, it seems to have selected the second set of points - the ones
interpolated with 2PT.  So that was a failure.

I may have found a path through this minefield, but that in turn took
advantage of what looks like another bug in TAMRG.  I copied CL 10 to
CL 11, then ran TAMRG with the inputs above so that it would not try
to sort.  It claimed to have started to merge to version 12, then sorted
the output to version 11:
localh> TAMRG1: Task TAMRG  (release of 31DEC07) begins
localh> TAMRG1: Start merge to scratch version  12
localh> TAMRG1: Start sort to output version  11
localh> TAMRG1: Read     134578 rows from CL file version 10
localh> TAMRG1: Wrote     67271 rows to CL file version 11
localh> TAMRG1: Appears to have ended successfully

So somehow having version 11 there already tricked it into doing something
that was reasonable for me.  But it does mean that it would have blissfully
overwritten a version 11 that someone might have wanted.

The output, at least where I checked, is the desired SELF interpolation
points.


Cheers,

Craig



---------------------------------------------------------------------
    R. Craig Walker            Array Operations Center
    cwalker at nrao.edu           National Radio Astronomy Observatory
    Phone  505 835 7247        P. O. Box O
    Fax    505 835 7027        Socorro NM 87801   USA
--------------------------------------------------------------web





More information about the Daip mailing list