View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

more syntax problems..

Andrew Staunton wrote on Dec 13, 2010

Hi there

I created a script that worked on IRAF on my laptop using IRAF v2.14.1.

However, when I tried to run the same script on one of my university computers with IRAF v2.12.2a-EXPORT I am getting error:
parameter 'missing' not found
cl ()
cl()

I think it may be that I used some syntax that is not supported by this version..
the following lines of code are taken from the script:

if (s1 == "flat"){
hselect ("@all.txt", "$I", "IMAGETYP ?= '*"//s1//"*' & FILTERS != 1", missing="",>>"flatfilters.txt")
hselect ("@all.txt", "$I", "IMAGETYP ?= '*"//s1//"*' & GRISMNR != 1", missing="",>>"flatgrism.txt")
}
else if (s1 == "FLAT"){
hselect ("@all.txt", "$I", "IMAGETYP ?= '*"//s1//"*' & FILTERS != 1", missing="",>>"flatfilters.txt")
hselect ("@all.txt", "$I", "IMAGETYP ?= '*"//s1//"*' & GRISMNR != 1", missing="",>>"flatgrism.txt")
}
else
print (" ")

can anyone tell me is the '*"//s1//"*' syntax supported by IRAF v2.12.2a-EXPORT or where else the problem might be..?

Thanks

Andrew

Mike Fitzpatrick wrote on Dec 13, 2010

The 'missing' parameter was added in v2.14, so specifying it for the version of the task in v2.12 without that parameter is an error. Assuming you are using the ECL under v2.12.2a (it wasn't the default until v2.13), you can remove the use of 'missing' from the HSELECT calls and add the lines


    iferr {
        hselect.missing = ""
    } then {
        ;
    }


Note however this will be a different syntax error under v2.12 using the old CL.

My guess is, simply removing the use of the 'missing' parameter will be good enough.

Andrew Staunton wrote on Dec 13, 2010

Thanks

Indeed, it uses the old CL..

can you tell me how I can resolve the problem with that in mind?!

Mike Fitzpatrick wrote on Dec 13, 2010

The best you can do is remember to manually set the 'missing' param on your v2.14 system, and then don't use the param in the script itself. Otherwise, try to get the university to update 8-)

Andrew Staunton wrote on Dec 13, 2010

I've encountered another problem caused by downgrading my script for use on IRAF v2.14.1 to v2.12.2a...

the relevant lines from the script are:

list="uniqueobject.txt"
while (fscan(list,s1) != EOF){

if (s1 == "skyflat"){
hselect ("@object.txt", "$I", "OBJECT ?= '*"//s1//"*' && FILTERS != 1",>>"flatfilters.txt")
hselect ("@object.txt", "$I", "OBJECT ?= '*"//s1//"*' && GRISMNR != 1",>>"flatgrism.txt")
}
else if (s1 == "ff"){
hselect ("@object.txt", "$I", "OBJECT ?= '*"//s1//"*' && FILTERS != 1",>>"flatfilters.txt")
hselect ("@object.txt", "$I", "OBJECT ?= '*"//s1//"*' && GRISMNR != 1",>>"flatgrism.txt")
}
else
print (" ")
}

Where uniqueobject contains a list of object values such as:
sxUma
sf
saturn
lampada
etc....
There are quite a few more 'else if' statements in the actual script in an attempt to cover all possible commonly used values to indicate flat frames..
The problem is that I have the word 'saturn' in my uniqueobject list and although all images of the saturn object are spectral (have grismnr !=1), they obviously do not match the first criterion of hselect - as all images of saturn have OBJECT = 'saturn', yet for some reason all names of saturn frames are still being written to flatgrism.txt...
This didn't happen when I ran the original script on v2.14.1 but the only difference between these lines of code and that of the original script is that the parameter 'missing' is not included in these hselect calls..

Any suggestions as to the problem are greatly appreciated.

Andrew

Mike Fitzpatrick wrote on Dec 13, 2010


if (s1 == "skyflat"){
hselect ("@object.txt", "$I", "OBJECT ?= '*"//s1//"*' && FILTERS != 1",>>"flatfilters.txt")
hselect ("@object.txt", "$I", "OBJECT ?= '*"//s1//"*' && GRISMNR != 1",>>"flatgrism.txt")
}
:
:


I don't quite understand why there are if-statements here (perhaps your code does something different later on...) since the hselect calls are all the same regardless of the value of 's1'. This isn't your problem though.


The problem is that I have the word 'saturn' in my uniqueobject list and although all images of the saturn object are spectral (have grismnr !=1), they obviously do not match the first criterion of hselect - as all images of saturn have OBJECT = 'saturn', yet for some reason all names of saturn frames are still being written to flatgrism.txt...


I'm not sure why you say they don't match: You say for saturn you have 'grismnr != 1' which satisfies the second expression, and the match against the OBJECT keyword should match the first expression by virtue of the fact the if-clause says 's1' is 'saturn' and the string match '*' should match zero-or-more characters. Was there a typo in your question or were you expecting something else to happen?

Last post on Dec 13, 2010