Mask creation from a list of star positions
Frank Valdes wrote on Dec 17, 1998
Q: I need to mask out stars in an 11x22 arcmin field,
and my question is, how do I make circular masks
for each of the stars in the image! For example, I
can easily use daofind to find objects: since the
CCD is so large, I get about 1000 objects.
Previously, I've used "plcreate" in xray.ximages,
with a regions file containing entries such as
circle 788.757 2.920 5.0
circle 1441.499 2.870 5.0
circle 1203.850 10.725 5.0
A: I think your best approach is to continue to use PLCREATE. So your question
really is how to make a regions file from another text file containing
coordinates. One way to do this is with the IRAF command language.
The simplest command method, using already defined variables in the CL,
is
cl> list="coords.dat"
cl> while (fscan (list, x, y) != EOF)
>>> printf ("circle %g %g 5.0\n", x, y, >> "regions.dat")
cl> list=""
The first statement assigns a text file, in this example of just x and y
values, to a list variable (think of this as opening the file).
Then each line is "scanned" putting the first two values in the real
variables x and y. Without {} only the next statement is part of the loop.
The printf statement formats and appends the formated string to the
file regions.dat. The last statement "closes" the input file.
You can type these commands interactively as shown or put them into a file
(without the cl> and >>> prompts). In the latter
case it is convention to use a .cl extension; i.e. mkcircles.cl. To
execute simple commands in a file use
cl> cl < mkcircles.cl
which redirects the file to a cl interpreter.
Of course there is room for much more sophistication. If you want to read
about some of the CL scripting options see
ftp://iraf.noao.edu/iraf/docs/script.ps.Z
Last post on Dec 17, 1998