cl Script
craigswenson wrote on Jul 11, 2007
I've been searching the forums, but can't find an answer to my question. I'm writing several cl scripts and would like to know if it is possible to enter a carriage return command into my script.
I'm using DAOPhot and after almost every command I run, whether is be pstselect, psf, etc., I have to hit return 8 or so times, just to accept all of the default values and I would like to bypass having to do that.
Does a command line command for 'carriage return' even exist in IRAF scripting language?
Thanks.
I'm using DAOPhot and after almost every command I run, whether is be pstselect, psf, etc., I have to hit return 8 or so times, just to accept all of the default values and I would like to bypass having to do that.
Does a command line command for 'carriage return' even exist in IRAF scripting language?
Thanks.
Mike Fitzpatrick wrote on Jul 11, 2007
The prompts are issued when the required query parameter isn't supplied on the command line or aren't satisfied properly in the pset if one is being used. If you get the prompt then I'd look first at how you're calling the tasks in the script (or post an example here). Otherwise, you can always redirect input from a file of newlines at the risk of responding to too few/many prompts, or change the 'mode' parameter of the task params so they're not queried at all (and risk it just not running properly).
Cheers,
-Mike
Cheers,
-Mike
craigswenson wrote on Jul 11, 2007
I'm not sure what you mean by setting the mode not to query at all. How do I do that? I assume that you're referring to the (mode=ql that is the last parameter in many of the parameter files. What other options are available?
Thanks
Thanks
Mike Fitzpatrick wrote on Jul 11, 2007
A value of 'h' will mean "hidden", i.e. you won't be prompted. Note however there is a difference between the task 'mode' parameter that affects all parameters and how/whether they are learned (the 'l' in "ql", where 'q' is "query") and stored in the uparm directory, and the mode of an individual parameter. You can change the latter by doing e.g.
And then the 'image' param will now be hidden (but may not have a valid value!)
-Mike
daophot> pstselect.image.p_mode="h"And then the 'image' param will now be hidden (but may not have a valid value!)
-Mike
craigswenson wrote on Jul 11, 2007
Thanks Mike, that does exactly what I want it to do, but, I have one more question. How do I 'unhide' an individual parameter file? Do I set p_mode="ql" just like I would for the task 'mode' parameter if I want to be queried again, or does it have its own set of commands that I need to know.
Thanks in advance.
Thanks in advance.
Mike Fitzpatrick wrote on Jul 11, 2007
The p_mode is an attribute of an individual parameter (the full set is: "p_name", "p_type", "p_mode", "p_value", "p_minimum", "p_maximum", "p_prompt", "p_filename", "p_length", "p_default", "p_xtype"), the 'mode' parameter applies to how the CL treats the param file for the entire task. More properly p_mode should be set to 'a' (auto) if you want to be asked for the value each time, and 'h' to hide the prompt. These can be combined with 'l' to learn the value but note that when you change a p_<attr> it affects only the version in your uparm directory and the change will be lost when you unlearn the task or do a new MKIRAF.
For fun, try setting the 'mode' param for a task to be 'm' and see what happens, e.g.
Cheers,
-Mike
For fun, try setting the 'mode' param for a task to be 'm' and see what happens, e.g.
cl> dir mode=mCheers,
-Mike
Last post on Jul 11, 2007