radio-astro / sourcery

Tools for creating high fidelity source catalogues from radio interferometric datasets
GNU General Public License v2.0
2 stars 1 forks source link

numpy.linalg.linalg.LinAlgError: Singular matrix #16

Open IanHeywood opened 7 years ago

IanHeywood commented 7 years ago

After the second run of PyBDSM:

Please check these islands. If they are valid islands and
should be fit, try adjusting the flagging options (use
show_fit with "ch0_flagged=True" to see the flagged Gaussians)
or enabling the wavelet module (with "atrous_do=True").
To include empty islands in output source catalogs, set
incl_empty=True in the write_catalog task.
WARNING: VerifyWarning: Card is too long, comment will be truncated. [astropy.io.fits.card]
--> Wrote FITS file '/data/VELA_1/hey036/ASKAP/CDFS_2102/data_images/sourcery/img_2016-09-23_143717_beam9_CDFS_T0-0A_wtspec.ms_data-MFS-image_2016-10-22-19/img_2016-09-23_143717_beam9_CDFS_T0-0A_wtspec.ms_data-MFS-image.gaul.fits'
Loading /tmp/tmpUtsRbs.txt: ASCII table
Loading /tmp/tmpCRm9fN.txt: ASCII table
Traceback (most recent call last):
  File "/data/VELA_2/hey036/Software/sourcery/bin/sourcery", line 5, in <module>
    main()
  File "/data/VELA_2/hey036/Software/sourcery/lib/python2.7/site-packages/Sourcery/main.py", line 295, in main
    pmodel, nmodel, step = mc.get_reliability()
  File "/data/VELA_2/hey036/Software/sourcery/lib/python2.7/site-packages/Sourcery/reliabilityestimates.py", line 454, in get_reliability
    pcov = utils.gaussian_kde_set_covariance(positive.T, cov)
  File "/data/VELA_2/hey036/Software/sourcery/lib/python2.7/site-packages/Sourcery/utils.py", line 142, in __init__
    stats.gaussian_kde.__init__(self, dataset)
  File "/usr/lib/python2.7/dist-packages/scipy/stats/kde.py", line 188, in __init__
    self.set_bandwidth(bw_method=bw_method)
  File "/usr/lib/python2.7/dist-packages/scipy/stats/kde.py", line 498, in set_bandwidth
    self._compute_covariance()
  File "/data/VELA_2/hey036/Software/sourcery/lib/python2.7/site-packages/Sourcery/utils.py", line 145, in _compute_covariance
    self.inv_cov = pylab.linalg.inv(self.covariance)
  File "/usr/lib/python2.7/dist-packages/numpy/linalg/linalg.py", line 520, in inv
    ainv = _umath_linalg.inv(a, signature=signature, extobj=extobj)
  File "/usr/lib/python2.7/dist-packages/numpy/linalg/linalg.py", line 90, in _raise_linalgerror_singular
    raise LinAlgError("Singular matrix")
numpy.linalg.linalg.LinAlgError: Singular matrix
Sebokolodi commented 7 years ago

@IanHeywood, I think I know what the problem is but I need to check if this is the case before I commit the changes. Please, can you refer me to the image and the settings you used.

IanHeywood commented 7 years ago

@Sebokolodi, thanks, I have emailed you a link.

The settings were simple:

sourcery -i img_2016-09-23_143717_beam9_CDFS_T0-0A_wtspec.ms_data-MFS-image.fits -p img_2016-09-23_143717_beam9_CDFS_T0-0A_wtspec.ms_data-MFS-psf.fits -apsf