Status: offline
Registered: 12/20/2005
Posts: 23
|
Hi all,Before any reduction of CCD frames it is usually necessary to check the quality of frames and its image type (e.g. not to do flatcombine when the flat is overexposed or if it is in fact the arc exposure with wrong header...). Sometimes more detailed execution is required by running implot on different collumns and lines (e.g. when the aperture position is shifted you cannot use the aperture template for the same configuration -esp. for echelle order traces).Does anybody have a solution how to do the preview in a interactive way (running e.g. implot ) with the capability of rejecting particular bad frames while creating @-lists ?Moreover it would be nice to run the check only by plotting quickly particular line or collumn and when some doubts occur you could go to more detailed execution by another key.Or to have the possibility to type after quick preview something like
F or C or O or Z (its a correct flat, comp, Object or zero ) some other key for bad file (e.g. space or enter) and this would add the current filename to the respective lists of files used to @list in parameters I have seen only some examples of asking question yes, no in cl scripts but not how to respond and recognize more keys immediately .I suppose many people here were working on some pipelines - can you send some stubs or links to examples ?Petr Skoda
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Hi Petr,Of course, the exact task you describe doesn't exist, but all the pieces you need could be done in a CL script pretty easily (e.g. PROW/PCOL for a quick plot, IMPLOT for interactive examination, and command input to make the whole thing interactive. Most scripts would use print() to print a prompt and scan() to read the response, but if what you want is something more like the cursor keystroke command, you can use the under-appreciated 'ukey' parameter of the CL.For instance, assuming you're looping over a list of images in the script you could do something like[code:1:9253a71220]
for (ch = "d"; ch != "n"; ch = cl.ukey) {
print ("")
switch (ch) {
case "?": print ("help for commands here...")
case "h": imheader (imname, long+)
case "e": imexamine (imname, 1)
case "d": display (imname, 1, fill+)
case "n": break # next image
case "q": goto cleanup
case "s": imstat (imname)
}
printf ("Command? ")
}
[/code:1:9253a71220]The ukey param takes a single char as input and the above code shows how you might construct a command loop with it. In your task, you might do a PCOL plot by default and have the 's' save the image to the processed output list and 'i' drop into IMPLOT. For a better idea of what ukey does, type "=ukey" at the CL prompt and then type a key afterwards.Hope this helps,
Cheers,
-Mike
|
Status: offline
Registered: 12/20/2005
Posts: 23
|
Thank you Mike!
It is fantastic - exactly what I wanted.I have played with it (currently preparing the required task) but one subtle week point is the "[b:abfb7c6a10]case[/b:abfb7c6a10]" argument:
As I understand it works well for single keystrokes of letters but when I just press ENTER (to go the default way) it complains on wrong argument (when printing ch it gives "\015"). [code:1:abfb7c6a10]
switch (ch) {
case "h": imhead(...)
case "\015": print ("ENTER pressed")
[/code:1:abfb7c6a10]does not work Is there still a solution for this ?
------------------------------
BTW - I have noticed the switch/case statement as shown above does not work in simple scripts run through
[code:1:abfb7c6a10]
cl<myscript.cl
[/code:1:abfb7c6a10]I had to declare it as procedure script including the defiition of task. Why it does not work, but [b:abfb7c6a10] if [/b:abfb7c6a10] or [b:abfb7c6a10]for[/b:abfb7c6a10] or [b:abfb7c6a10]while[/b:abfb7c6a10] statements work? I could not found any example cl script with switch in IRAF source and help "switch" is confusing a little...
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Hi Petr,The newline is typed as a char string internally, try something like[code:1:9d8f21ea8d]
for (ch = "h"; ch != "q"; ch = cl.ukey) {
if (ch < "a") {
print ("got a newline")
} else {
switch (ch) {
:
[/code:1:9d8f21ea8d]to trap it as a special case (i.e. "\015" is less than the ASCII char 'a').Cheers,
-Mike
|