Submit a Story  :  IRAF Links  :  Past Polls  :  Calendar  :  Advanced Search  
     iraf.net
FAQ
 Forum FAQForum FAQ   Forum SearchForum Search   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error message with PyRaf wregister command

 
Post new topic   Reply to topic    iraf.net Forum Index -> General IRAF
View previous topic :: View next topic  
Author Message
VASIMR



Joined: 10 May 2011
Posts: 1

PostPosted: Tue May 10, 2011 3:24 pm    Post subject: Error message with PyRaf wregister command Reply with quote

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.")


The call in the python script is as follows:
Code:

iraf.wregister(ListC, "template.fits", ListR, con=0, xxo=3, xyo=3, yyo=3, yxo=3, flux="no")

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:
Code:

wreg @list.1025902.1.c template.fits @list.1025902.1.r con=0 xxo=3 xyo=3 yyo=3 yxo=3 flux=no

If anyone has an idea of what is is going wrong here, please let me know. Thanks.
Back to top
View user's profile Send private message
sontag



Joined: 14 Jan 2011
Posts: 8

PostPosted: Thu Jun 09, 2011 3:21 pm    Post subject: Reply with quote

Hi Vasimr,

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.

Cheers,
Chris
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    iraf.net Forum Index -> General IRAF All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2009 phpBB Group
 Copyright © 2005-2011 iraf.net
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.12 seconds