Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Error while using Tweakback

shalmalee.kapseshalmalee.kapse Member Posts: 2
Hi.
I am running tweakback on the science drizzled images I obtained from the tweakreg.TweakReg(). However, I am constantly facing the following error:
TweakBack Version 0.4.0(14-Oct-2014) started at: 20:59:54.185 (22/08/2019)

Traceback (innermost last):
File "", line 1, in
File "/home/shalmalee/anaconda3/lib/python3.7/site-packages/drizzlepac/tweakback.py", line 193, in tweakback
orig_wcs = wcsutil.HSTWCS(drzfile,ext=sciext,wcskey=orig_wcskey)
File "/home/shalmalee/anaconda3/lib/python3.7/site-packages/stwcs/wcsutil/hstwcs.py", line 147, in __init__
key=self.wcskey)
File "/home/shalmalee/anaconda3/lib/python3.7/site-packages/astropy/wcs/wcs.py", line 438, in __init__
colsel=colsel, warnings=False)
TypeError: WCSBase.__init__() argument 2 must be str, not None

I have followed the original drizzlepac documentation and the syntax of the tweakback which is :
tweakback.tweakback()

Could anyone suggest anything to solve this? Thanks in advance.

Comments

  • mcaramcara Member Posts: 5
    edited August 30
    Hi Shalmalee,

    It is difficult to answer this question without a detailed description of all the steps. However, this error is due to the fact that there is only one WCS in the drizzled image.

    Normally, tweakback expects you to provide the "original" WCS (the WCS in the drizzled image _before_ it was aligned using tweakreg) through the 'origwcs' parameter. If you leave that field empty, it will try to find the "previous" WCS (before alignment) itself. However, it does not find one and therefore the code crashes.

    Assuming you did run tweakreg on the drizzled image (in order to align it to something else), most likely cause of this issue is that you did not set 'updatehdr' to True in tweakreg and therefore tweakreg did not update the header of the drizzled image with a new, aligned WCS.

    Mihai
  • shalmalee.kapseshalmalee.kapse Member Posts: 2
    Hi Mahai,
    Yes, not updating the header was the issue. Thanks for the clarification. :)

Sign In or Register to comment.