Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

SingularMatrixError on each aplpy.FITSFigure call #2

astrofrog opened this Issue Jan 7, 2011 · 5 comments


None yet
4 participants

astrofrog commented Jan 7, 2011

User guilalune reported that under Linux Debian, with the GTKAgg backend, APLpy returns the following exception:

Traceback (most recent call last):
File "/home/guillaume/Python/workspace/Hi-Gal_tests/src/racine/__init__.py", line 53, in <module>
gc = aplpy.FITSFigure('/home/guillaume/Python/tutorial_aplpy/fits/2MASS_k.fits')
File "/usr/lib/python2.6/site-packages/APLpy-0.9.4-py2.6.egg/aplpy/aplpy.py", line 177, in __init__
File "/usr/lib/python2.6/site-packages/APLpy-0.9.4-py2.6.egg/aplpy/aplpy.py", line 896, in set_theme
File "/usr/lib/python2.6/site-packages/APLpy-0.9.4-py2.6.egg/aplpy/ticks.py", line 89, in set_tick_color
for line in self._ax1.xaxis.get_ticklines():
File "/usr/lib64/python2.6/site-packages/matplotlib/axis.py", line 836, in get_ticklines
return self.get_majorticklines()
File "/usr/lib64/python2.6/site-packages/matplotlib/axis.py", line 817, in get_majorticklines
ticks = self.get_major_ticks()
File "/usr/lib64/python2.6/site-packages/matplotlib/axis.py", line 894, in get_major_ticks
numticks = len(self.get_major_locator()())
File "/usr/lib/python2.6/site-packages/APLpy-0.9.4-py2.6.egg/aplpy/ticks.py", line 139, in __call__
self.axis.apl_tick_spacing = default_spacing(self.axis.get_axes(), self.coord)
File "/usr/lib/python2.6/site-packages/APLpy-0.9.4-py2.6.egg/aplpy/ticks.py", line 159, in default_spacing
px, py, wx, wy = axis_positions(wcs, coord, False, xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax)
File "/usr/lib/python2.6/site-packages/APLpy-0.9.4-py2.6.egg/aplpy/ticks.py", line 313, in axis_positions
x_world, y_world = wcs_util.pix2world(wcs, x_pix, y_pix)
File "/usr/lib/python2.6/site-packages/APLpy-0.9.4-py2.6.egg/aplpy/wcs_util.py", line 147, in pix2world
return wcs.wcs_pix2sky(x_pix, y_pix, 1)
File "/usr/lib64/python2.6/site-packages/pywcs/pywcs.py", line 524, in wcs_pix2sky
*args, **kwargs)
File "/usr/lib64/python2.6/site-packages/pywcs/pywcs.py", line 473, in _array_converter
sky = func(xy, origin)
File "/usr/lib64/python2.6/site-packages/pywcs/pywcs.py", line 523, in <lambda>
return self._array_converter(lambda xy, o: self.wcs.p2s(xy, o)['world'],
_pywcs.SingularMatrixError: Linear transformation matrix is singular

The problem disappeared when using the TkAgg backend


astrofrog commented Mar 11, 2012

@ebressert @keflavich - could either of you try this? Basically just try an plot 2MASS_k.fits from the tutorial data with the GTKAgg backend on a Linux system. If you don't see this error, feel free to close the issue.


keflavich commented Mar 12, 2012

@astrofrog - no luck, can't get pygtk to install (on linux or mac)


ebressert commented Mar 12, 2012

Just installed pyGTK on my system. I'll test out the latest code
tonight or tomorrow.


On Mon, Mar 12, 2012 at 4:51 PM, Adam Ginsburg

@astrofrog - no luck, can't get pygtk to install (on linux or mac)

Reply to this email directly or view it on GitHub:
#2 (comment)

European Southern Observatory
ebresser@eso.org | +49.89.3200.6858


astrofrog commented Mar 16, 2012

I installed PyGTK on my machine and couldn't reproduce the issue. I'm going to close the issue, and if someone runs into it, they can either open this issue again, or open a new ticket.

@astrofrog astrofrog closed this Mar 16, 2012


saimn commented Jul 10, 2012

I and @yannick1974 are also facing this bug when using the GTKAgg backend. The bug comes from pywcs and the french locale ('fr_FR@UTF8'), as detailed in astropy/astropy#313

astrofrog referenced this issue in astrofrog/aplpy Feb 23, 2013

Merge pull request #2 from astrofrog/update-testing
Fix package init to not import py.test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment