View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Problem with Display in .cl script

Elden Paul Iverson wrote on Jul 10, 2007

A buddy and I are working on automating our reduction/phot process but are being hung up. In the example portion below we want the script to walk through our flatB images, throw the images 1-by-1 to ds9, and ask if we want to keep or discard it. We are having trouble a the display command. It asks if we want to display img with flatBwhatever as the default (i.e. img(flatB-000126.fits): ). If we do a carriage return the script moves on and displays the image and then prompts us whether or not we want to keep it (i.e. post-cr it acts as it should). We want to remove the verification img(flatBwhatever) prompt.

___________________________________________________________________
int temp

sections flatB*
if (sections.nimages > 0){
hselect flatB* $I yes >> datalistB
list = "datalistB"
while (fscan(list,img) != EOF){
display (img, 1)
print ("Keep this flat? (0 if no, 1 if yes)")
scanf ("%d",temp)
if (temp == 0)
del (img)
}
}
;

del datalistB
________________________________________________________________

Mike Fitzpatrick wrote on Jul 10, 2007

It's only a code snippet, but from what you posted I can imagine a number of scenarios that might cause the problem, and may depend on whether this is part of a procedure script or one you run using redirection (e.g. "cl < myscript.cl"):

1) The line using HSELECT to generate the file list should have the file 'datalistB' in quotes so that it won't be interpreted as a script variable.
2) Purely stylistic, but you should use SECTIONS or FILES to get the file list
3) If 'img' isn't declared as a string variable you'll get a prompt for it each time it is referenced. Same if 'img' is declared as a query parameter (i.e. in the arg list for a procedure script).
4) I'm not sure what to make of "img(flatB-000126.fits)", are the parens really part of the prompt in some way?? How are you running this? Is 'img' declared as a string variable of some kind?

-Mike

Elden Paul Iverson wrote on Jul 10, 2007

Thanks

I was running this outside of a procedure and with the changes in 3. fixed the problem (1. did not help without 3.).

I am curious if you have an example of using the sections or files command in a way similar to what I needed.

-Paul

Mike Fitzpatrick wrote on Jul 10, 2007

Try

sections (*flatB*", opt="fullname", > "datalistB")


-Mike

Elden Paul Iverson wrote on Jul 10, 2007

Actually...I see how it would be used.

Thanks

-Paul

Elden Paul Iverson wrote on Jul 10, 2007

Thanks

It helped clean up my flatcheck script.

-Paul

Elden Paul Iverson wrote on Jul 10, 2007

sections seems to move much slower than using hselect. Does anyone know the clock speeds on these commands?

-Paul

Mike Fitzpatrick wrote on Jul 10, 2007

Should be at least as fast as HSELECT, both tasks need to loop through the images and open them in the same way. Images on an NFS-mounted disk are sometimes slower to access (and would be true in either task).

-Mike

Last post on Jul 10, 2007