next up previous contents index
Next: Specifying Keywords Up: MIDAS Data Structures Previous: MIDAS Data Structures

Specifying a Descriptor

 

Descriptors have been derived from the concepts used in a FITS file header and have many similarities with the FITS keywords. In particular the names of the MIDAS standard descriptors, e.g. NAXIS, NPIX, etc., (for details see Appendix ``Standard Descriptors'' of the MIDAS Environment doc.) correspond to those in the FITS header.
  Descriptors come in four flavours: integer, real, double precision and character. Mixed types are currently not supported.
Each descriptor also has a name (max. 15 chars.) and a length (no. of elements). Writing values into positions beyond the current length leads to an automatic extension of the descriptor (and update of its length) just as a text file is extended by the ``editor'' when you are editing it.

The command to write values into a descriptor requires the name of the data file (which could be an image, table or fit file), the descriptor name, the descriptor type, the first element to be accessed, and the total number of elements to be transferred (all separated by a `/' (slash)). Finally, the data values are given (separated by commas for numeric data, but no spaces). For example,

WRITE/DESCR imgfile Descname/C/1/7 Anyname

would write the ASCII string Anyname into the character descriptor Descname associated with the data file imgfile.bdf. Since spaces serve as parameter delimiters in MIDAS they have to be enclosed by double quotes ( ") if used as data. So

WRITE/DESCR imgfile Descname/C/1/7 " "

would fill Descname with 7 blanks.

WRITE/DESCR imgfile Descname/R/4/3 17.3,8.8E2,-.3

would write the numbers 17.3, 880.0, -0.3 into elements 4,5 and 6 of real descriptor Descname. If the descriptor were created with fewer than 6 elements it would be expanded automatically.

WRITE/DESCR tblname.tbl Descname/R/4/3 17.3,8.8E2,-.3

would write the numbers 17.3, 880.0, -0.3 into elements 4,5 and 6 of real descriptor Descname of the table file tblname.tbl.
Note, that we had to add the file extension .tbl to the name tblname, since the command WRITE/DESCR defaults the first parameter to an image and appends the file type .bdf if none is given by the user.

Single descriptor elements can also be written in a more direct way, via
frame,descr = value, e.g. to set STEP(2) of image lola.bdf to 1.234, use
lola,step(2) = 1.234
The value can also be an expression made up of constants and elements of any MIDAS data structure, see the subsection gif.

This is how descriptors work at the most basic level. However, in many cases, higher level commands have been implemented to update specific descriptors. The MIDAS command CUTS, which sets the high and low cuts of an image (in descriptor LHCUTS) for displaying or plotting it, is an example of this.

Some of the commands dealing with descriptors are:
READ/DESCR, WRITE/DESCR, SHOW/DESCR, DELETE/DESCR, INFO/DESCR, COPY/DD.

An optional help text can be attached to each descriptor and is then displayed via the READ/DESCR and SHOW/DESCR commands. This text is copied from the original FITS file (if existing) when reading in the data file or can be explicitly set via WRITE/DHELP.



next up previous contents index
Next: Specifying Keywords Up: MIDAS Data Structures Previous: MIDAS Data Structures



Pascal Ballester
Fri Mar 24 17:17:52 MET 1995