bug in tweakreg (v.1.4.3)?

sifonsifon Member Posts: 1
This is to report that I had to make two changes (locally) in the source file stwcs/distortion/utils.py, and for someone to check those changes. I'm using drizzlepac v2.1.13 with tweakreg v1.4.3

When running tweakreg.TweakReg I got the following:

1)

Traceback (most recent call last): File "do_tweakreg.py", line 4, in <module> tweakreg.TweakReg('*flc.fits',threshold=100,searchrad=4.0) File "/u/sifon/anaconda3/envs/astroconda/lib/python3.5/site-packages/drizzlepac/tweakreg.py", line 827, in TweakReg run(configObj) File "/u/sifon/anaconda3/envs/astroconda/lib/python3.5/site-packages/drizzlepac/util.py", line 219, in wrapper func(*args, **kwargs) File "/u/sifon/anaconda3/envs/astroconda/lib/python3.5/site-packages/drizzlepac/tweakreg.py", line 485, in run xycatalog=refimg.xy_catalog, **kwargs) File "/u/sifon/anaconda3/envs/astroconda/lib/python3.5/site-packages/drizzlepac/imgclasses.py", line 1142, in __init__ self.wcs = utils.output_wcs(wcs_list, undistort=undistort) File "/u/sifon/anaconda3/envs/astroconda/lib/python3.5/site-packages/stwcs/distortion/utils.py", line 44, in output_wcs outwcs = make_orthogonal_cd(ref_wcs) File "/u/sifon/anaconda3/envs/astroconda/lib/python3.5/site-packages/stwcs/distortion/utils.py", line 127, in make_orthogonal_cd scale = (wcs.idcscale) / 3600. # HST pixel scale provided TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'

This I fixed by modifying line 126 from:

if hasattr(wcs, 'idcscale'):

to:

if hasattr(wcs, 'idcscale') and wcs.idcscale is not None:


2)

After fixing that I got the following:

Traceback (most recent call last): File "do_tweakreg.py", line 4, in <module> tweakreg.TweakReg('*flc.fits',threshold=100,searchrad=4.0) File "/u/sifon/anaconda3/envs/astroconda/lib/python3.5/site-packages/drizzlepac/tweakreg.py", line 827, in TweakReg run(configObj) File "/u/sifon/anaconda3/envs/astroconda/lib/python3.5/site-packages/drizzlepac/util.py", line 219, in wrapper func(*args, **kwargs) File "/u/sifon/anaconda3/envs/astroconda/lib/python3.5/site-packages/drizzlepac/tweakreg.py", line 485, in run xycatalog=refimg.xy_catalog, **kwargs) File "/u/sifon/anaconda3/envs/astroconda/lib/python3.5/site-packages/drizzlepac/imgclasses.py", line 1142, in __init__ self.wcs = utils.output_wcs(wcs_list, undistort=undistort) File "/u/sifon/anaconda3/envs/astroconda/lib/python3.5/site-packages/stwcs/distortion/utils.py", line 44, in output_wcs outwcs = make_orthogonal_cd(ref_wcs) File "/u/sifon/anaconda3/envs/astroconda/lib/python3.5/site-packages/stwcs/distortion/utils.py", line 132, in make_orthogonal_cd if hasattr(wcs, 'orientat') and not ignoreHST: NameError: name 'ignoreHST' is not defined

which I fixed by changing line 132 from:

if hasattr(wcs, 'orientat') and not ignoreHST:

to:

if hasattr(wcs, 'orientat') and not hasattr(wcs, 'ignoreHST'):

although I don't know if this is exactly what was intended.


Thanks!

Comments

  • mack@stsci.edumack@stsci.edu Member, Institute_Staff, Moderator_DrizzlePac Posts: 29
    Thanks for your report! I noticed that you have not updated your software in awhile, so this could be the problem.

    DrizzlePac 2.1.13 is from April 2016 and we are up to 2.1.18 from Sept 2017.
    More importantly, the stwcs package had some major changes in October 2016 when the new version of astropy was incorporated which broke a few things. The latest version is now 1.3.2 from July 2017. (Tweakreg is still at 1.4.3, but it seems your issue is in stwcs).

    http://astroconda.readthedocs.io/en/latest/release_notes.html

    I recommend you try reinstalling astroconda and see if that resolves the problem.
    If not, please let us know and I will have the code developer look into the matter.

    Regards, Jennifer

Sign In or Register to comment.