Welcome to iraf.net Saturday, April 27 2024 @ 09:26 PM GMT
piverson |
07/10/2007 05:24PM (Read 6130 times)
|
|
|
Status: offline
Registered: 07/10/2007
Posts: 42
|
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 flatB[i:d6ce0d2c37]whatever[/i:d6ce0d2c37] 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(flatB[i:d6ce0d2c37]whatever[/i:d6ce0d2c37]) prompt.
___________________________________________________________________
int tempsections 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
________________________________________________________________
|
|
|
|
fitz |
07/10/2007 05:24PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
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
|
|
|
|
piverson |
07/10/2007 05:24PM
|
|
|
Status: offline
Registered: 07/10/2007
Posts: 42
|
ThanksI 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
|
|
|
|
fitz |
07/10/2007 05:24PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Try[code:1:fae15c3e14]sections (*flatB*", opt="fullname", > "datalistB")[/code:1:fae15c3e14] -Mike
|
|
|
|
piverson |
07/10/2007 05:24PM
|
|
|
Status: offline
Registered: 07/10/2007
Posts: 42
|
Actually...I see how it would be used. Thanks-Paul
|
|
|
|
piverson |
07/10/2007 05:24PM
|
|
|
Status: offline
Registered: 07/10/2007
Posts: 42
|
ThanksIt helped clean up my flatcheck script.-Paul
|
|
|
|
piverson |
07/10/2007 05:24PM
|
|
|
Status: offline
Registered: 07/10/2007
Posts: 42
|
sections seems to move much slower than using hselect. Does anyone know the clock speeds on these commands?-Paul
|
|
|
|
fitz |
07/10/2007 05:24PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
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
|
|
|
|
| |
|
Content generated in: 0.23 seconds |
|