Program: MINBOX Purpose: MINBOX calculates the smallest box in a (sub)set, outside which only blanks exist and creates an output set with the calculated box size. It stores the box in physical coordinates in the header of the set. Category: UTILITY File: minbox.c Author: M.G.R. Vogelaar Keywords: INSET= Give input set (, subsets): Maximum number of subsets is 2048. OUTSET= Set and subset(s) where to copy to: [do not copy] ** MARGIN= Give n (subset dimension) margin values: [no margins] ** SQUARE= Adjust (2dim) box sizes to form a square? Y/[N] If the dimension of a box is greater than or equal to 2 then it is possible for the first two box axes to adjust their sizes so that a square box is the resulting shape. If SQUARE=Y then only the smallest axis size will increase. The maximum however is the size of the frame of the set. Note that if you enter a box at MINBOX= and this entry is not a square box then SQUARE=Y will transform this box into a square box as described above by increasing the size of the smallest axis. If it encounters a border it will increase only in the other direction. If both boundaries are crossed the result is possibly not a square. This keyword can be handy if cursor input is given to define a region around an object, but you want a square version of this box as output box. MINBOX= Change default values for box: [calculated] Program MINBOX prompts with the calculated default values of a box so that you can use these values, or alter them before MINBOX continues. NOTE, there is no (boundary) check of the box that is altered by the user. Read also the remarks in the description of the hidden keyword SQUARE= Description: MINBOX calculates the smallest box in the given (sub)set(s), outside which only blanks exist. Then program COPY is called with the calculated box parameters to actually copy the data into a new set. Therefore COPY prompts with the OUTSET= keyword. The box calculated by MINBOX can be changed by using the MARGIN= keyword. This keyword accepts at most n integer values where n equals the dimension of the input subset(s). If a margin value is positive, it will increase the size of the 'minbox'. The box that was found (or entered) in grids by MINBOX is converted to a box in physical coordinates and stored as a character string in a table in the header of the input set. The name of the table is MBOX, the column is MINBOX and the level is the subset level. If possible the units are converted to degrees and then this unit is abbreviated to DEG. If you want to run MINBOX on set AURORA freq 2 then type MINBOX INSET=AURORA FREQ 2 Now inspect the contents with: TABLE INSET=AURORA FREQ 2 OPTION=5 TABCOL1=1 FORMAT1= COLNAME1= COLUNITS1= TABCOL2= DESTINATION= Result will look something like this: MINBOX NONE ========================================================= 44.985860 DEG 44.989999 DEG 45.014145 DEG 45.009999 DEG Notes: Example: Minimize set AURORA with axes RA, DEC and FREQ in RA and DEC directions only: INSET=AURORA FREQ OUTSET=AURORA_SMALL1 Minimize same set AURORA in all directions: INSET=AURORA OUTSET=AURORA_SMALL2 Minimize same set AURORA in RA and DEC direction but copy only frequency planes 4 to 60: INSET=AURORA FREQ 4:60 OUTSET=AURORA_SMALL3 Updates: feb 14, 1995: VOG, Document created. mar 10, 1995: VOG, MARGIN= keyword included. oct 20, 1995: VOG, SQUARE= keyword added. MINBOX string in header may 10, 2000: VOG, Force SQUARE=Y to square any manual box input