Still prompt hidden parameter
mz79 wrote on Jul 21, 2009
Dear IRAF Support,
I have the problem that some hidden parameters are still prompted, e.g.:
apextract> apsum dummy.fits find+
apextract> Find apertures for dummy? (yes):
This prompt is nasty and redundant since the hidden parameter was already defined in the call line.
However, when setting the hidden parameter to 'no' via
apextract> apsum dummy.fits find-
this parameter is not prompted!?
I think this is not normal. How can this problem be solved?
I have the problem that some hidden parameters are still prompted, e.g.:
apextract> apsum dummy.fits find+
apextract> Find apertures for dummy? (yes):
This prompt is nasty and redundant since the hidden parameter was already defined in the call line.
However, when setting the hidden parameter to 'no' via
apextract> apsum dummy.fits find-
this parameter is not prompted!?
I think this is not normal. How can this problem be solved?
Mike Fitzpatrick wrote on Jul 21, 2009
I was hoping Frank would reply by now. This isn't actually a parameter prompt in the usual sense, but a prompt printed by the task directly. I agree that logically because of the parameter setting this should be suppressed, since this is Frank's task I'll leave it to him to change for the next release. For now, redirecting an input file of newlines can be used to automatically answer the prompts from within scripts. Hope this helps.
-Mike
-Mike
mz79 wrote on Jul 21, 2009
Thanks Mike for the reply,
But, how can I redirecting an input file of newlines to a task?
I tried e.g.
and
but still there was the prompt for find!?
But, how can I redirecting an input file of newlines to a task?
I tried e.g.
apextract> print("yes") | apsum dummy.fits find+and
apextract> ! echo > newlines.txt
apextract> apsum dummy.fits find+ < newlines.txt
but still there was the prompt for find!?
Mike Fitzpatrick wrote on Jul 21, 2009
On a second look, Frank appears to be getting clever in the parameter usage and this isn't strictly the prompt I thought it was. I now think the prompt is supposed to be answered by the value from the 'apparams' pset and specifically the 'ansfind' parameter (default is yes). Try doing
before running the task. The upper-case is important but should suppress the prompt an force the answer to always be no.
If you still have problems, I'll leave it to Frank to explain his cleverness 8-).
-Mike
cl> apparams.ansfind="NO"before running the task. The upper-case is important but should suppress the prompt an force the answer to always be no.
If you still have problems, I'll leave it to Frank to explain his cleverness 8-).
-Mike
mz79 wrote on Jul 21, 2009
Sorry, but it doesn't work :( .It has no effect.
resulting in a prompt, in contrast to
without an apfind prompt. Shouldn't this be the same?
By the way I like to set this parameter to "yes/YES".
or
But now in both cases there is still a prompt!?
cl> apparams.ansfind="NO"
cl> apsum dummy.fitsresulting in a prompt, in contrast to
cl> apsum dummy.fits find-without an apfind prompt. Shouldn't this be the same?
By the way I like to set this parameter to "yes/YES".
cl> apparams.ansfind="YES"
cl> apsum dummy.fitsor
cl> apsum dummy.fits find+But now in both cases there is still a prompt!?
Mike Fitzpatrick wrote on Jul 21, 2009
Frank tells me there *is* a way to suppress the prompt, but it isn't an obvious solution. He promises to reply as soon as he can.
Francisco Valdes wrote on Jul 21, 2009
Hello,
As Mike says, the parameter mechanism is rather tricky. The answer provided by Mike was close. You also need to set a second parameter.
The same logic applies to other parameters. Note that other tasks in the package may use different hidden parameter sets. In particular, the "all-in-one" version of the various operations is APALL which uses the parameter set APALL1. But the logic is the same; set initialize to no so that it doesn't reset the ansXXX parameters that you want to set.
Yours,
Frank Valdes
As Mike says, the parameter mechanism is rather tricky. The answer provided by Mike was close. You also need to set a second parameter.
cl> apparams.ansfind = "NO"
cl> apparams.initialize = no
cl> apsum dummy.fits
The same logic applies to other parameters. Note that other tasks in the package may use different hidden parameter sets. In particular, the "all-in-one" version of the various operations is APALL which uses the parameter set APALL1. But the logic is the same; set initialize to no so that it doesn't reset the ansXXX parameters that you want to set.
Yours,
Frank Valdes
mz79 wrote on Jul 21, 2009
Yes, this works! :D
Thanks!
Thanks!
Last post on Jul 21, 2009