Posted: Tue May 10, 2011 3:24 pm Post subject: Error message with PyRaf wregister command
Hi,
I am having problems calling the PyRaf wregister command from a python script. I have a list of images that I want to apply the command to, when I do so to individual image sets in the list, I receive this error:
Quote:
Transforming image 1025902p.1.1 to image 1025902p.1.1.r.fits
Using transform 1025902p.1.1 in database tmpdb67666d
Killing IRAF task `delete'
Traceback (most recent call last):
File "CombineImages.py", line 152, in <module>
Wreg()
File "CombineImages.py", line 98, in Wreg
iraf.wreg(imNameC, "template.fits", imNameR, con=0, xxo=3, xyo=3, yyo=3, yxo=3, flux="no")
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 699, in __call__
return apply(self.run,args,kw)
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 302, in run
self._run(redirKW, specialKW)
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 1372, in _run
self._runCode()
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 1387, in _runCode
apply(self._clFunction, parList, kw)
File "<CL script immatch.wregister>", line 172, in wregister
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 699, in __call__
return apply(self.run,args,kw)
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 302, in run
self._run(redirKW, specialKW)
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 744, in _run
"\n" + str(value))
pytools.irafglobals.IrafError: Error running IRAF task delete
IRAF task terminated abnormally
ERROR (741, "Cannot open file (tmps267666b)")
And when trying to feed it a list of image names (perhaps the command is not meant to take the argument), I recieve:
Quote:
Warning: Attempt to delete a nonexistent file (tmps171971a)
Killing IRAF task `wcsxymatch'
Traceback (most recent call last):
File "CombineImages.py", line 168, in <module>
Wreg()
File "CombineImages.py", line 119, in Wreg
iraf.wregister(ListC, "template.fits", ListR, con=0, xxo=3, xyo=3, yyo=3, yxo=3, flux="no")
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 699, in __call__
return apply(self.run,args,kw)
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 302, in run
self._run(redirKW, specialKW)
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 1372, in _run
self._runCode()
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 1387, in _runCode
apply(self._clFunction, parList, kw)
File "<CL script immatch.wregister>", line 149, in wregister
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 699, in __call__
return apply(self.run,args,kw)
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 302, in run
self._run(redirKW, specialKW)
File "/usr/astro/sl-stsci/lib/python2.6/site-packages/pyraf/iraftask.py", line 744, in _run
"\n" + str(value))
pytools.irafglobals.IrafError: Error running IRAF task wcsxymatch
IRAF task terminated abnormally
ERROR (1, "The number of output coords files and input images is not the same.")
Where ListC and ListR are either lists of strings, or are just strings themselves (i.e. ListC = "image1.fits"). Which was modeled after an iraf command that works perfectly:
I don't see a reply here, but I am guessing that is because this was sent to the wrong forum. If the command works perfectly in the IRAF cl, but it has problems in PyRAF, then it is most likely a PyRAF issue, not an IRAF issue. Sorry for the wait, I would have guessed someone following these forums would have directed you to STScI by now.
Nonetheless, we should be able to help you. This sounds like a (hopefully simple) issue passing arguments to wregister. Note that since wreg takes standard IRAF parameters, you cannot pass it a Python list as an argument.
If for example ListC is something like "['file-a', file-'b', 'file-c']", to send that information to wreg, you will want to first change it to a text file like "@listc" which contains those three filenames in it. If wreg was a Python task, it would much more likely understand being sent a Python list as an argument.
If that doesn't fix this for you, please create the smallest possible Python script which reproduces the problem, and send your help request to help@stsci.edu.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum