[AstroPy] tweakshifts in writeCoordFile()--IndexError: invalid index to scalar variable

Warren J. Hack hack at stsci.edu
Wed Jun 22 10:43:04 EDT 2011


Hello,

This error comes from a problem with how the coordinate lists are 
created within 'tweakshifts' and only shows up when there is only 1 
identified source in a chip given the object finding parameters provided 
when that task was run.  This task will be replaced shortly (end of this 
summer?) with a new Python, WCSLIB-based task, so no effort will be 
going into fixing any bugs found in using this task.  There are a couple 
of parameters in 'tweakshift' that provide some control over the object 
finding algorithm in 'daofind' (and 'sextractor', depending on which you 
use); namely, fwhmpsf, sigma, datamin, datamax, threshold and nsigma.  
Varying these can usually result in more than a single object being 
detected, assuming more than 1 object exists in the field of view at 
all.   This will then allow 'tweakshifts' to at least get past this 
problem.

As a side note, there are many other ways of specifying the names of the 
input images other than building an association (ASN) table, most of 
which are easier to use and manage.  Please review the help provided for 
this task, something which is made easiest by using the EPAR GUI and 
clicking on the 'tweakshift help' button at the top.  For example, you 
can run 'tweakshifts' with '*flt.fits' as the input. The ASN table 
actually gets stored as a binary FITS table for cases where you want to 
keep track of the shifts computed in the same file, rather relying on 
than the more convenient ASCII shift file that gets written by 
'tweakshifts'.

If you have any further questions or problems with this task, please 
feel free to email them 'help at stsci.edu' and I will be glad to continue 
working with you to help you use this task as successfully as possible.

Warren Hack
Science Software Branch
Space Telescope Science Institute

> From: Steve White <stevan.white at googlemail.com>
> Date: June 20, 2011 5:44:16 AM EDT
> To: <astropy at scipy.org>
> Subject: [AstroPy] tweakshifts in writeCoordFile()--IndexError: 
> invalid index to scalar variable
>
> Hi!
>
> I'm trying to create a shifts file along the lines of the
>     Multidrizzle Handbook 5.5.3.6 Tweakshifts
> http://www.stsci.edu/hst/HST_overview/documents/multidrizzle/ch56.html#251052 
>
>
> Tweakshifts gets stuck in a strange place deep in the python code.
> I can't tell if I'm missing some step or if there is a bug in the code.
>
> Iraf 2.14.1 is installed (but also tried 2.15.a1) with stsdas and
> tables v 3.13 and pytools SVN revision 11593.
> Here, for example, the input files are from HST proposal 6431.
>
> First I determined which files correspond to a single pointing, and 
> feed that
> list into
>     asnt = asnutil.ASNTable( files, output = out_prefix ),
>        asnt.create()
>        asnt.write()
> to create asn table files.
>
> When I run tweakshifts on the ASN files thus produced,
>     --> tweakshifts u34l390250_asn.fits undistort=yes mode=h
> it does some stuff then dies, as listed below.
>
> I also attach the ASN file (which seems to consist of mixed text and 
> binary).
>
> Thanks!
> ----------------------------------------------------------
> --> tweakshifts u34l390250_asn.fits undistort=yes mode=h
> xyxin:  INDEF    xyyin:  INDEF
> fitgeometry:  rscale
> Tweakshifts Version  0.7.3 (19 Aug 2010)
>
> + MAKEWCS Version 1.1.7 (6 Jul 2010)
> -Updating image  u34l3901m_c0m.fits[sci,1]
> - IDCTAB: Distortion model from row 25 for chip 1 : F555W and CLEAR
> - OFFTAB: Offset interpolated from rows 9 and 13
> - IDCTAB: Distortion model from row 165 for chip 3 : F555W and CLEAR
> - OFFTAB: Offset interpolated from rows 11 and 15
> ...
> Setting up output name:  u34l390250_drz.fits
> Starting PyDrizzle Version  6.3.7 (3-Jan-2011)  at  10:02:52 (20/06/2011)
> - IDCTAB: Distortion model from row 25 for chip 1 : F555W and CLEAR
> - OFFTAB: Offset interpolated from rows 9 and 13
> - IDCTAB: Distortion model from row 95 for chip 2 : F555W and CLEAR
> ...
> Drizzle parameters have been calculated. Ready to .run()...
> Finished calculating parameters at  10:02:55 (20/06/2011)
>
>> WARNING: Pixel stack overflow at position 493,431
>
>    Computing undistorted target positions for  322 objects.
> ...
>    Computing undistorted target positions for  1 objects.
> Traceback (innermost last):
>  File "<CL script CL1>", line 1, in <module>
>  File "/opt/iraf/extern/stsdas/pkg/analysis/dither/tweakshifts_iraf.py",
> line 217, in tweak_iraf
>    fitbox        = _fitbox)
>  File "/opt/iraf/extern/stsdas/python/tweak.py", line 625, in run
>    shift_dict = runCatalog(flist,refname,match_pars)
>  File "/opt/iraf/extern/stsdas/python/tweak.py", line 861, in runCatalog
>    writeCoordFile(cxylist, fluxes, coordname)
>  File "/opt/iraf/extern/stsdas/python/tweak.py", line 252, in 
> writeCoordFile
>    cstr = str(coord[0])+'    '+str(coord[1])+'    '+str(flux) +'\n'
> IndexError: invalid index to scalar variable.
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20110622/a86e0421/attachment.html>


More information about the AstroPy mailing list