The DEFINE IMAGE command allows SIC to access not only to the content of an image (the data value), but also to all its associated parameters; DEFINE HEADER allows access only to these associated parameters. The header variables have names derived from the generic name by adding the special character % and an extension (such as e.g. NDIM for the number of dimensions) to the generic header name. For example, command DEFINE HEADER VAR file.gdf READ also creates the following variables:
VAR%GENE Integer Length of general section
VAR%NDIM Integer Number of dimensions (ReadOnly)
VAR%DIM Integer[4] Dimensions (ReadOnly)
VAR%CONVERT Double[3,4] Conversion formulae for the 4 axes:
Reference pixel,
Value at reference pixel,
Increment
VAR%BLAN Integer Length of blanking section
VAR%BLANK Real[2] Blanking and tolerance
VAR%EXTREMA Integer Length of extrema section
VAR%MAX Real Maximum
VAR%MIN Real Minimum
VAR%WHERE Integer[4,2] Position of max and min
VAR%DESC Integer Length of units and system section
VAR%UNIT Char*12 Image unit
VAR%UNIT1 Char*12 First axis type
VAR%UNIT2 Char*12 Second axis type
VAR%UNIT3 Char*12 Third axis type
VAR%UNIT4 Char*12 Fourth axis type
VAR%SYSTEM Char*12 Coordinate system
VAR%POSI Integer Length of position section
VAR%SOURCE Char*12 Source name
VAR%RA Double Right Ascension
VAR%DEC Double Declination
VAR%LII Double Galactic longitude
VAR%BII Double Galactic latitude
VAR%EPOCH Real Epoch of coordinates
VAR%PROJ Integer Length of projection section
VAR%PTYPE Integer Projection type (code)
VAR%A0 Double first coordinate of projection center
VAR%D0 Double second coordinate of projection center
VAR%ANGLE Double position angle of projection
VAR%X_AXIS Integer First projected axis
VAR%Y_AXIS Integer Second projected axis
VAR%SPEC Integer Length of spectroscopy section
VAR%LINE Char*12 Line name
VAR%FREQRES Double Frequency resolution
VAR%FREQOFF Double Frequency offset
VAR%RESTFRE Double Rest Frequency
VAR%VELRES Real Velocity resolution
VAR%VELOFF Real Velocity offset
VAR%F_AXIS Integer Frequency/Velocity axis
VAR%BEAM Integer Length of beam section
VAR%MAJOR Real Major axis of beam
VAR%MINOR Real Minor axis of beam
VAR%PA Real Position angle of beam
VAR becomes a dummy variable of type header, which can only be
referenced in a further DELETE /VARIABLE command. VAR can
have at most 6 characters. The VAR%item variables are ReadOnly
or ReadWrite according to the keyword following the filename, except
for the dimension variables (VAR%DIM and VAR%NDIM), which
cannot be modified.
Full headers can be copied to one another, using the command
LET A% = B%
which copies the header of image B into that of image A (dimensions
are not modified, however). Thus a full copy of a GILDAS data file
can be obtained within SIC as follows:
DEFINE IMAGE A Oldfile.gdf READ
READ DEFINE INTEGER N1 N2 N3 N4
LET N1 A%DIM[1]
LET N2 A%DIM[2]
LET N3 A%DIM[3]
LET N4 A%DIM[4]
DEFINE IMAGE B[N1,N2,N3,N4] Newfile.gdf REAL
LET B A ! Copy A data into B
LET B% A% ! Copy A header into B header
DELETE /VARIABLE B ! Deletes the SIC variables, but not the file...
A simpler way to declare new images is to use the size casting provided by the /LIKE option:
DEFINE IMAGE A Oldfile.gdf READ
DEFINE IMAGE B Newfile.gdf REAL /LIKE A ! Define B like A...
LET B A ! Copy A data into B
LET B% A% ! Copy A header into B header
DELETE /VARIABLE B ! Deletes the SIC variables, but not the file...