GILDAS Headers
Keywords: sic

Next: Structures Up: Variables and Expressions Previous: GILDAS Images Contents Index

###
GILDAS Headers

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[7]     Dimensions           (ReadOnly)
           VAR%CONVERT    Double[3,7]    Conversion formulae for the 7 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%MINLOC     Integer[7]     Position of min value
           VAR%MAXLOC     Integer[7]     Position of max value
           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%EQUINOX    Real           Equinox 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%IMAGFRE    Double         Image Frequency
           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%SIGMA      Integer        Noise section length
           VAR%NOISE      Real           Theoretical noise
           VAR%RMS        Real           Actual noise
           VAR%PROPER     Integer        Proper motion section length
           VAR%MU         Real[2]        along RA and DEC, in mas/yr
           VAR%PARALLAX   Real           Parallax in mas

In addition, the following variables are also created when accessing GILDAS UV Tables through the `DEFINE UVTABLE` command:

           VAR%NCHAN      Integer        Number of channels
           VAR%NVISI      Integer        Number of visibilities
           VAR%NSTOKES    Integer        Number of Stokes parameters
           VAR%NATOM      Integer        Complex visibility size
           VAR%BASEMIN    Real           Minimum baseline
           VAR%BASEMAX    Real           Maximum baseline

`VAR` becomes a dummy variable of type header, which can only be referenced in a further `DELETE /VARIABLE` command. 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. `VAR%READONLY` indicates whether the variable can be modified or not.

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 4 dimensions GILDAS data file can be obtained within SIC as follows:

        DEFINE IMAGE A Oldfile.gdf 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 (and more generic) 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...

Next: Structures Up: Variables and Expressions Previous: GILDAS Images Contents Index