The indexing and navigation of NEWSTAR 's compound data files
Contributed by Johan Hamaker, November 1994
960104: Add loops vs. aggregates
and repetitive processing
The indexing structure described in this document is common to three types of NEWSTAR files. Each of these is a collection of 'elementary' data blocks under a hierarchical index:
This document describes the generic properties of the index mechanism and the versatile mechanisms in the NEWSTAR program-parameter interface through which sets of data blocks can be defined for processing.
The data blocks are organised in a hierarchical index. This structure is isomorphous to the familiar directory structure for files, the data blocks taking the place of the individual files. Unlike directories, however, the indices are not names but numbers. As we shall see below, in some cases these numbers are related to some physical parameter, in other cases they are simply administrative sequence numbers.
Just like a full file path is composed of concatenated directory names, a data block is adressed through its compound index, i.e. its concatenated indices:
<index0>.<index1>.<index2>....
At all levels, the first index value is 0. You may find this uncomfortable at first, but you will soon get used to it
The successive indices convey specific information which is different between file types. The following information levels are used:
The true power of the indexing mechanism lies in its ability to address data blocks in aggregates of widely varying composition, through shorthand notations that one may type in response to a prompt asking for the data blocks to be processed.
Firstly, a compound index may refer to a set or aggregate of data blocks in several ways:
<start value>-<end value> <start value>-:<step> <start value>-
For all practical purposes, the number of data blocks that can be addressed in these ways through a single specification is unlimited.
Suppose one wants to make 8 maps from 16 visibility sectors and specifies
What one needs is a mechanism to tell NMAP that it should use the sectors in pairs. One way to do this is to 'manually' execute it 8 times with sector specifications
LOOPS provide an efficient shorthand to do just that. With a LOOP specification, one directs the program to execute a program a number of times, incrementing the data-block specification after every cycle. The LOOP specification takes the form
In combination with this, the initial set of data blocks is specified.
Thus for the above example one would specify
The LOOPS construct may also be used for executing the same operation more than once in a single run. viz. by specifying an increment of 0. E.g.
It is possible to specify more than one loop simultaneously, e.g.
It more than one set is specified for the start cycle, incrementation is applied to each set. Thus, e.g. , for a specification
the data blocks used would be
In those operations where each data block is processaed individually, the blocks to be selected may be specified either as an aggregate or through a loop construct. For instance, Self-calibration operates on each data block ('sector') in a .SCN file in isolation; in this case, e.g. the specifications
There are also applications in which data blocks are combined, for instance when a sky map is made using an aggregate of .SCN-file sectors as input. Here the LOOPS construct results in a separate map for each loop cycle, rather than a single map from all input sectors as an aggregate specification would. See above for an example where a number of maps are made each using a sector aggregate as input.
Data files may become so large and complex that one does not remember precisely the ranges of the indices in all the various branches of the index hierarchy. If one doesn't particularly care, one may use wildcards or deliberately specify an index range that is too large: In most cases a NEWSTAR program, finding that a requested data block does not exist, will simply proceed to the next one. Thus, for example, if one specifies 8 loop cycles but there are only data for the first three, the 4th through 8th cycles will be traversed but nothing will be done in them.
Another possibility one has is to reply with 'L' (for Layout) or 'O' (for Overview) to a _SETS or _LOOPS prompt. This will give you information about the composition of your data file.
In addition to the compound indices discussed so far, one may also use the absolute index to address a data block. The absolute index is a sequence number that is allocated sequentially to each new data block created; thus the newest data block invariably has the highest absolute index. Like the other indices, the absolute index starts at 0. To address a data block through its absolute index, prefix the number with a hash sign, e.g.
Absolute indices can be used throughout in place of compound indices. For example, the loop specification
is valid (but is may not be very easy to be sure that it does the right thing).
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.