aboutsummaryrefslogtreecommitdiff
path: root/pkg/xtools/doc/xtmaskname.hlp
blob: ddc8a07cf0085ab644e0e48e388a1035a0e8626a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.help xt_maskname Mar07 xtools
.ih
NAME
.nf
xt_maskname -- create mask name 
.fi
.ih
SYNOPSIS
.nf
procedure xt_maskname (fname, extname, mode, mname, maxchar)

char	fname[ARB]			#I File name
char	extname[ARB]			#I Default pixel mask extension name
int	mode				#I Mode
char	mname[maxchar]			#O Output mask name
int	maxchar				#I Maximum characters in mask name
.fi
.ih
DESCRIPTION
This routine encapsulates creating a mask name from a user specified
name, an optional extension name, and an optional environment variable.
It checks if an explicit format is desired based on the presence of a
".pl" extension for a pixel list file or the FITS kernel parameter
"type=mask" (with the equal sign possibly escaped) for a FITS extension.
If neither is specified then the default is a FITS extension unless the
environment variable "masktype" is set to "pl".  If the application
does not specify an extension name for FITS format the name "pl" is used.

If the "masktype" environment variable is "pl" and the application requests
an extension name then a directory with the specified filename is used (and
created for a new mask) and the pixel list filename is the extension name.
For example, if the filename is "obj1234" and the extension name is "im1"
then the mask name is "obj1234/im1.pl".  As a fallback if a directory
cannot be accessed the filename will have the form <fname>_<extname>.pl.

Typically an application that specifically was designed to handle
multi-extension FITS (MEF) files will use the same extension name for
a mask as for the image extension to which it applies.
.ih
EXAMPLES
1. When "masktype" is undefined and creating a new mask:

.nf
               fname extname		mname
  --------------------------------------------------------
                 abc ""         -->     abc[pl,type=mask]
                 abc "def"      -->     abc[def,type=mask]
  abc[def,type=mask] ""         -->     abc[def,type=mask]
            abc[def] "ghi"      -->     abc[def,type=mask]
              abc.pl ""         -->     abc.pl
              abc.pl "def"      -->     abc.pl
.fi

2. When "masktype=pl" and creating a new mask:

.nf
               fname extname		mname
  --------------------------------------------------------
                 abc ""         -->     abc.pl
                 abc "def"      -->     abc/def.pl
  abc[def,type=mask] ""         -->     abc/def.pl
            abc[def] "ghi"      -->     abc/def.pl
              abc.pl ""         -->     abc.pl
              abc.pl "def"      -->     abc.pl
.fi

3. When reading a mask it looks for either format unless an explicit
".pl" extension is included.

.nf
               fname extname		mname
  --------------------------------------------------------
                 abc ""         -->     abc[pl]
                 abc "def"      -->     abc[def]
  abc[def,type=mask] ""         -->     abc[def,type=mask]
            abc[def] "ghi"      -->     abc[def]
              abc.pl ""         -->     abc.pl
              abc.pl "def"      -->     abc.pl
                 abc ""         -->     abc.pl
                 abc "def"      -->     abc/def.pl
            abc[def] ""         -->     abc/def.pl
            abc[def] "ghi"      -->     abc/def.pl
            abc[def] ""         -->     abc_def.pl
.fi
.endhelp