scripting
douglas brenner wrote on Sep 25, 2008
I have been writing simple cl scripts without too much trouble (Although I never could get a script to run hselect)
Now I've written my own working cl procedure which I can't call from a script.
I get an "INTERNAL ERROR: parser gagged.
Suggestions?
PROCEDURE:
procedure align(name)
string name
begin
string filename
noao
imred
crutil
stsdas
analysis
fourier
dither
images
imgeom
filename = name
crosscor (input1 = "/Users/dsb/data/fiducal/meanflat.fits[924:1124,924:1124]", input2 = filename//"[0][924:1124,924:1124]", output = "/Users/dsb/data/fiducal/corr.fits[0,overwrite]", verbose = no)
magnify (input = "/Users/dsb/data/fiducal/corr.fits", output = "/Users/dsb/data/fiducal/mcorr.fits[0,overwrite]", xmag = 3, ymag = 3, interp = "linear")
imextreme (image = "/Users/dsb/data/fiducal/mcorr.fits", verbose = yes);
end
SCRIPT"
#! /scisoft/all/packages/iraf/irafbin/bin.macintel/cl.e -f
noao
imred
crutil
stsdas
analysis
fourier
dither
task align = /Users/dsb/datapipeline/align.cl
printf ("align %s\n ", args) | cl()
logout
Now I've written my own working cl procedure which I can't call from a script.
I get an "INTERNAL ERROR: parser gagged.
Suggestions?
PROCEDURE:
procedure align(name)
string name
begin
string filename
noao
imred
crutil
stsdas
analysis
fourier
dither
images
imgeom
filename = name
crosscor (input1 = "/Users/dsb/data/fiducal/meanflat.fits[924:1124,924:1124]", input2 = filename//"[0][924:1124,924:1124]", output = "/Users/dsb/data/fiducal/corr.fits[0,overwrite]", verbose = no)
magnify (input = "/Users/dsb/data/fiducal/corr.fits", output = "/Users/dsb/data/fiducal/mcorr.fits[0,overwrite]", xmag = 3, ymag = 3, interp = "linear")
imextreme (image = "/Users/dsb/data/fiducal/mcorr.fits", verbose = yes);
end
SCRIPT"
#! /scisoft/all/packages/iraf/irafbin/bin.macintel/cl.e -f
noao
imred
crutil
stsdas
analysis
fourier
dither
task align = /Users/dsb/datapipeline/align.cl
printf ("align %s\n ", args) | cl()
logout
douglas brenner wrote on Sep 25, 2008
The logout command should have been logout | cl().
Mike Fitzpatrick wrote on Sep 25, 2008
For the record, the pipe to the cl() of the logout command shouldn't be necessary. I suspect that the wrapper script calling it was missing a newline at the end of the file (this happens sometimes to emacs users). Adding the pipe may have just rewritten the file with the proper newline.
-Mike
-Mike
Last post on Sep 25, 2008