entering ‘pauses’ into scripts
Andrew Staunton wrote on Jun 30, 2011
Hi there
in writing a script to group images into groups such as bias,dark,flat, objects I would like to include a feature that allows the user to scan through the group lists in order to see if any frames were misgrouped...I think the easiest way to do this would obviously be to use the 'mosaic' task but I would like to include a 'pause' feature as well...that is to say that if I simply mosaiced my groups as shown in the following code:
(note, the following code is writtten just for the flats and there may be some syntax errors...)
If I implemented the above code, the mosaiced groups would flash by rather quickly with not enough time to check if there was a misgrouping, so this is where I would like to add a 'pause' step and the following as the same code as above with an extra line added...:
and of course in place of <PAUSE> I would like a task that stops the script from progressing until the user gives a simple input such as pressing the 'return' key...
In this way, each group will be mosaiced for as long as the user likes and will only move onto the next group when the 'return' key is pressed..
Is such a feature easy to add or If my above approach isn't workable what alternatives are there?
in writing a script to group images into groups such as bias,dark,flat, objects I would like to include a feature that allows the user to scan through the group lists in order to see if any frames were misgrouped...I think the easiest way to do this would obviously be to use the 'mosaic' task but I would like to include a 'pause' feature as well...that is to say that if I simply mosaiced my groups as shown in the following code:
(note, the following code is writtten just for the flats and there may be some syntax errors...)
stsdas
listLJD=LJD.txt
while(fscan(listLJD,LJD)!=EOF){
listfilter=filter.txt
while(fscan(listfilter,filter)!=EOF){
mosaic ("@"//LJD//"_flat_"//filter//".txt")
}
}
If I implemented the above code, the mosaiced groups would flash by rather quickly with not enough time to check if there was a misgrouping, so this is where I would like to add a 'pause' step and the following as the same code as above with an extra line added...:
stsdas
listLJD=LJD.txt
while(fscan(listLJD,LJD)!=EOF){
listfilter=filter.txt
while(fscan(listfilter,filter)!=EOF){
mosaic ("@"//LJD//"_flat_"//filter//".txt")
<PAUSE>
}
}
and of course in place of <PAUSE> I would like a task that stops the script from progressing until the user gives a simple input such as pressing the 'return' key...
In this way, each group will be mosaiced for as long as the user likes and will only move onto the next group when the 'return' key is pressed..
Is such a feature easy to add or If my above approach isn't workable what alternatives are there?
Mike Fitzpatrick wrote on Jun 30, 2011
Try using the CL 'ukey' parameter which takes input from the terminal (i.e. it blocks until it reads a single keystroke):
printf ("Hit any key to continue .....")
s1 = ukey
Last post on Jun 30, 2011