Welcome to iraf.net Sunday, July 23 2017 @ 06:47 PM GMT

Helplog #35 - Using IDENTIFY in Scripts

  • Friday, November 04 2005 @ 02:43 PM GMT
  • Contributed by:
  • Views: 3,127
Help Logs/Tips Question: I am writing some IRAF scripts involving the use of the task "identify". I would like to use the task interactively, as when it is launched from the command line. Everything works fine at the beginning: the task is launched and the graphical window pops up, waiting for the interactive commands. The problem is that whenever I try to mark some features using the "m" key the task does not allow me to type in the wavelength, just as if the enter key is automatically hit, so that the feature wavelength remains INDEF. .... NUMBER: 35
KEYWORDS: identify, scripts
DATE: Fri Nov 4 12:35:45 MST 2005
FROM: valdes

Q: I am writing some IRAF scripts involving the use of the task
"identify". I would like to use the task interactively, as
when it is launched from the command line. Everything works
fine at the beginning: the task is launched and the graphical
window pops up, waiting for the interactive commands. The
problem is that whenever I try to mark some features using the
"m" key the task does not allow me to type in the wavelength,
just as if the enter key is automatically hit, so that
the feature wavelength remains INDEF. Trying to hit "u"
to enter the wavelength is of no help. The keystrokes and
colon commands work fine, but there is no way of typing in
the wavelength for marked features. I also tried to launch
identify through a simple script with just a line: "identify",
and I noticed that at the end (being the "autowrite" parameter
set to "no") the script does not stop waiting for my answer,
but it gets the last entry and directly exits; also this
behaviour suggests that it is just like an enter command
is automatically sent to the task. Could you give me any
suggestion on how to solve this problem? Thank you for all
the help you may provide.

A: This is a common "gotcha" (FAQ) with using IDENTIFY. The
IDENTIFY task reads input from the cursor, from parameters,
and from the standard input of the task. It is this last part,
where it asks for such things as the wavelength, that causes
problems with the simplest way to invoke a script. I suspect
you are doing something like:

cl> cl < myscript.cl

In this case you are redirecting the standard input of the CL
from the terminal to the script file which then causes the problem
you have. There is an easy solution. You must declare the script
as a task as follows:

cl> task $myscript = <path>myscript.cl
cl> myscript # This runs the script

The script must use the .cl extension. The path, such as
home$, is optional but if you don't specify a path then the
script will only run in the directory where the script file
is located. The first $ in the task statement says that the
script does not have parameters. Note there are other ways to
write scripts, which also use the task statement to define them,
that include parameters and is more like a programing language
(see http://iraf.noao.edu/iraf/ftp/iraf/docs/script.pdf).

To repeat, IDENTIFY cannot be used in a script that is executed
by redirection to the cl but can be used in other forms script
invocations.

Helplog #35 - Using IDENTIFY in Scripts | 1 comments | Create New Account

The following comments are owned by whomever posted them. This site is not responsible for what they say.

  • Helplog #35 - Using IDENTIFY in Scripts
  • Authored by: Yoachim on Tuesday, April 11 2006 @ 12:11 AM GMT
I've found that if I just use Pyraf, then interactive task work even if I invoke them with:
cl < file.cl


Privacy Policy
Terms of Use

User Functions

Login