Produced by IDL 7.1.1
Developer Documentation

./guide
showiftab.pro

Last modification date:
Wed Sep 28 13:27:13 2016

Routine Summary  6 routines

procedure showiftab, scan, [/keep]

Summarize the valid ifnum, fdnum, plnum combinations for a scan.

function setArrFmt(arr)

private

Used internally in showiftab Format an array of *num (ifnum, fdnum or plnum) into a string.

procedure doiftab, iftab, idxstruct, idxcount

private

Process an iftable array returned by scan_info.

function compareIndexList(a, b)

private

Used during the sorting process in showiftab Compares two vectors of integers (will be vectors of index values, e.

function compareIndexStructs(a, b)

private

Used during the sorting process in showiftab Compares two index structures of ifnum, fdnum, and plnum fields.

function sortIndexStruct(a)

private

The sort function used by showiftab.

Routine Details

showiftab

procedure showiftab, scan, [/keep]

Summarize the valid ifnum, fdnum, plnum combinations for a scan.

Examples
A scan where all combinations of 2 IFs, 8 feeds, and 4 polarization is present.

 GBTIDL -> showiftab,35
  
      Scan : 35
      ifnum fdnum plnum
        0:1   0:7   0:4

 
In this scan, feed 0 has just plnum 2 for both IFs, feed 1 has just plnum 1 for the same IFs, and feeds 2 through 7 have plnum 0 and 1 for the second if.
 GBTIDL -> showiftab,33
  
      Scan : 33
      ifnum fdnum plnum
        0:1     0     2
        0:1     1     1
          1   2:7   0:1
 
Uses
scan_info
Version
$Id$

Parameters
scan
in, required
integer
Scan number of interest.

Keywords
keep
in, optional
boolean
If set, the summary uses information from the keep[ file.

setArrFmt private

function setArrFmt(arr)

Used internally in showiftab Format an array of *num (ifnum, fdnum or plnum) into a string. Compresses adjacent values into "a:b" sequence to cover the entire range. No internal error checking on the validity of arr.

Returns
formatted string

Parameters
arr
in, required
integer array
Array to format. Assumed to be already sorted, without duplicates.

doiftab private

procedure doiftab, iftab, idxstruct, idxcount

Process an iftable array returned by scan_info. Sets idxstruct to be a structure holding one instance of all of the index values for each quanity (ifnum, plnum, fdnum) and idxcount indicies of masks for each quantity. All combinations of the index values corresponding to the true values (1) for the masks for each instance in that exist. The masks and index values are then used to print out a table summarizing the 3D iftable array. There is no internal checking on the validity of the input values. This routine is called recursively, each call sets the current idxcount entry in idxstruct, increments idxcount, and calls it again if there remain additional elements in iftable that have not yet been accounted for in idxstruct. On return, idxstruct may contain more than idxcount elements, but only the first ixcount elements should be used. idxstruct is initialized if idxcount is <= 0. idxstruct has two fields: 'indexes' and 'masks'. idxstruct.indexes has 3 fields: 'ifnum', 'fdnum', and 'plnum'. Each of which are integer vectors holding the complete set of integer indexes available for that field (e.g. [0,1,2,3]). They are here for convenience. idxstruct.masks is an array of structures, each element has 3 fields: 'ifnum', 'fdnum', and plnum'. Each of which are integer vectors where 1 indicates the corresponding index in the indexes structure is in use for that set of masks and 0 indicates it is not in use.

Parameters
iftab
in, required
3D integer array
The iftable array. The 3 axes are, in order, ifnum, plnum, and fdnum. Elements are 1 when data exists with that combination and 0 if no data exists for that combination.
idxstruct
out, required
variable
The structure set by this routine. Valid through the first idxcount elements of the masks field.
idxcount
out, required
variable
The current size of idxstruct already in use.

compareIndexList private

function compareIndexList(a, b)

Used during the sorting process in showiftab Compares two vectors of integers (will be vectors of index values, e.g. ifnum). Sorting rules are: compare the first element if equal compare the length if equal compare the first non-equal element

Returns
-1 if ab

Parameters
a
in, required
integer vector
b
in, required
integer vector
.

compareIndexStructs private

function compareIndexStructs(a, b)

Used during the sorting process in showiftab Compares two index structures of ifnum, fdnum, and plnum fields. Uses compareIndex list to compare the individual index lists. First compares based on ifnum values if equal, compare based on fdnum values if equal, compare based on plnum values.

Returns
-1 if ab

Parameters
a
in, required
structure
.
b
in, required
structure
.

sortIndexStruct private

function sortIndexStruct(a)

The sort function used by showiftab. This is a simple sort. These structures are going to be small so this should be cheap and the extra effort to code something more efficient just isn't worth it.

Returns
the sorted indexes into a to be used to print the formatted summaries in a sorted order.

Parameters
a
in, required
structre
The index structure to sort, as used by showiftab.


Produced by IDLdoc 1.6 on Wed Sep 28 13:27:20 2016