% @(#)filena.alq	19.1 (ESO-IPG) 02/25/03 14:03:20 

Filenames in  MIDAS consist of a name and a type separated by a dot (`.').
Their format must be either the internal Midas format or FITS.

The default file types are

   for images      `.bdf'
   for tables      `.tbl' 
   for fit files   `.fit'
   for catalogs    `.cat' 
   for procedures  `.prg'
   for FITS files  `.mt'

but the Midas data files may have different types as well.

Caution: If you use filenames without a file type they are internally 
expanded by appending `.bdf', therefore, Midas table commands will protest...


On Unix systems you may also work with compressed files directly.
So, if you have your Midas image `galaxy.bdf' compressed via the Unix 
utility `compress' (which renames the compressed image to `galaxy.bdf.Z'), 
then you can e.g. read the descriptors of it via the Midas command:
READ/DESCR galaxy.bdf.Z 


The file name is an alphanumerical string.
However, a name consisting only of digits or using any of the characters 
+ - * ^ ` ! | \ ( ) [ ] $ # , ; 
should be avoided, because these symbols will cause problems in some Midas
commands (e.g. COMPUTE/IMAGE).
If you do want to use a name with these special chars. in a COMPUTE/IMAGE
command, then you have to enclose the full name in quotes, e.g.:
COMPUTE/IMA &a = 12 + "quasar01+12.bdf" .

Use: @a checkname myname
if you want to test a file name `myname' for Midas conformity.
But if you do have a filename with `bad' characters, giving the full filename
with the filetype and enclosing it in double quotes will always work.

The length of these names is, in principle, limited to 60 characters for
MIDAS applications (which used to be the size of keywords IN_A, OUT_A, ...).
This length refers to the true filename. The inclusion of pathnames which can
make a file name really loooong, should be avoided. Instead, use the
command SET/MIDAS DPATH=... EPATH=... PATH=...
which defines directories for data files, executables and procedures similar
to the Unix PATH variable (see the HELP of SET/MIDAS for details).
Also with the Midas command CHANGE/DIRECTORY you can move around on the disk.

Besides the usual conversion of FITS files to Midas format via the commands
INDISK/FITS or INTAPE/FITS, files in FITS format can also be used directly 
in Midas commands, they are internally converted to the internal Midas format 
and then processed in the usual way.
FITS files can be modified and stored back in FITS format.
The extensions of FITS files can also be accessed directly but not modified
(you would have to use OUTDISK/SFITS to recombine FITS extensions into a 
FITS file on disk). 
The syntax for specifying extensions follows the FITSIO standard,
i.e. "filename.type[extens]" to access the extension `extens' of FITS file
`filename.type'. The string `extens' represents either an integer no. 
indicating the no. of the extension (counting starts with 1) or a string 
referring to the contents of the FITS keyword EXTNAME in an extension.
Assuming that an extension with EXTNAME set to "quality" is the 3rd extension
of a given file, then
"filename.type[3]" as well as "filename.type[quality]" 
will both access the same extension.
Use the command INFO/IMAGE (in Midas) to list all extensions of a FITS file.

Subframes of images can be used in all Midas commands and are specified via
the syntax `name[x1:x2]', `name[x1,y1:x2,y2]' or `name[x1,y1,z1:x2,y2,z2]',
i.e. max. 3 dimensions are supported. The coordinates are given in the usual
Midas format, e.g. `name[<,@10:>,@20]' is o.k.
A short form exists to extract "natural" subframes of an image, e.g. a full
line in x-direction from a 2-dim image and a full xy-plane from a cube via 
`name@no' where no is the no. of a line or the no. of a plane (beginning at 1).
For example,
Midas 100> statist/image lola@22
will do statistics on line no. 22 if lola is a 2-dim frame or statistics on
xy-plane no. 22 if lola is a 3-dim cube.

However, subframes of FITS extensions cannot be accessed that way!
That means, "tst0012.mt[3][@1,@1,<:@4,@2,<]" will NOT work currently, you would
have to use the EXTRACT command for that purpose.
