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
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/", 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/", line 147, in __init__
File "/home/shalmalee/anaconda3/lib/python3.7/site-packages/astropy/wcs/", 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 :

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


  • 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.

  • 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.