Welcome to iraf.net Tuesday, April 30 2024 @ 08:43 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Still prompt hidden parameter
   
mz79
 07/21/2009 11:39AM (Read 3416 times)  
+----
Newbie

Status: offline


Registered: 07/21/2009
Posts: 7
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?

 
Profile Email
 Quote
fitz
 07/21/2009 11:39AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
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

 
Profile Email
 Quote
mz79
 07/21/2009 11:39AM  
+----
Newbie

Status: offline


Registered: 07/21/2009
Posts: 7
Thanks Mike for the reply,But, how can I redirecting an input file of newlines to a task?I tried e.g.
[code:1:a8558a3098]apextract> print("yes") | apsum dummy.fits find+[/code:1:a8558a3098]
and
[code:1:a8558a3098]apextract> ! echo > newlines.txt
apextract> apsum dummy.fits find+ < newlines.txt
[/code:1:a8558a3098]
but still there was the prompt for find!?

 
Profile Email
 Quote
fitz
 07/21/2009 11:39AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
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[code:1:31d0538395]cl> apparams.ansfind="NO"[/code:1:31d0538395]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

 
Profile Email
 Quote
mz79
 07/21/2009 11:39AM  
+----
Newbie

Status: offline


Registered: 07/21/2009
Posts: 7
Sorry, but it doesn't work Frown .It has no effect.[code:1:48b2d3d570]cl> apparams.ansfind="NO"
cl> apsum dummy.fits[/code:1:48b2d3d570]
resulting in a prompt, in contrast to
[code:1:48b2d3d570]cl> apsum dummy.fits find-[/code:1:48b2d3d570]
without an apfind prompt. Shouldn't this be the same?By the way I like to set this parameter to "yes/YES".
[code:1:48b2d3d570]cl> apparams.ansfind="YES"
cl> apsum dummy.fits[/code:1:48b2d3d570]
or
[code:1:48b2d3d570]cl> apsum dummy.fits find+[/code:1:48b2d3d570]
But now in both cases there is still a prompt!?

 
Profile Email
 Quote
fitz
 07/21/2009 11:39AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
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.

 
Profile Email
 Quote
valdes
 07/21/2009 11:39AM  
+++++
Active Member

Status: offline


Registered: 11/11/2005
Posts: 728
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.[code:1:2bf375fdae]
cl> apparams.ansfind = "NO"
cl> apparams.initialize = no
cl> apsum dummy.fits
[/code:1:2bf375fdae]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

 
Profile Email
 Quote
mz79
 07/21/2009 11:39AM  
+----
Newbie

Status: offline


Registered: 07/21/2009
Posts: 7
Yes, this works! Big Grin
Thanks!

 
Profile Email
 Quote
   
Content generated in: 0.28 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login