Error when running astrometry.net 0.64

305 views
Skip to first unread message

Jared Hand

unread,
Mar 27, 2016, 5:30:07 PM3/27/16
to astrometry
Hello!

I have been using astrometry.net 0.50 for the past six months or so, and recently ran into issues with my computer and reinstalled astrometry.net via homebrew.  The version I installed is 0.64.  When I try running the solve-field... I get the following error:

Reading input file 1 of 1: "3C_279V_000206853.FIT"...

Base: "./3C_279V_000206853", basefile "3C_279V_000206853.FIT", basedir ".", suffix "FIT"

Checking if file "3C_279V_000206853.FIT" ext 0 is xylist or image: image

  (not xyls because: FITS file does not have any extensions)

Running: /usr/local/bin/image2pnm.py --sanitized-fits-outfile /tmp/tmp.sanitized.7eE4cV --fix-sdss --infile 3C_279V_000206853.FIT --uncompressed-outfile /tmp/tmp.uncompressed.lMRbIR --outfile /tmp/tmp.ppm.6uZyyt --ppm

sh: sysctl: command not found

Header has 47 cards

Traceback (most recent call last):

  File "/usr/local/bin/image2pnm.py", line 323, in <module>

    sys.exit(main())

  File "/usr/local/bin/image2pnm.py", line 320, in main

    mydir, fix_sdss=options.fix_sdss)

  File "/usr/local/bin/image2pnm.py", line 248, in convert_image

    (imgtype, errstr) = image2pnm(infile, outfile, sanitized, force_ppm, no_fits2fits, extension, mydir, fix_sdss)

  File "/usr/local/bin/image2pnm.py", line 184, in image2pnm

    errstr = fits2fits(infile, sanitized, fix_idr=fix_sdss)

  File "/usr/local/Cellar/astrometry-net/HEAD/lib/python/astrometry/util/fits2fits.py", line 86, in fits2fits

    hdu.scale('int16', '', bscale, bzero)

  File "/usr/local/lib/python2.7/site-packages/pyfits/hdu/image.py", line 383, in scale

    bzero=bzero, blank=None)

  File "/usr/local/lib/python2.7/site-packages/pyfits/hdu/image.py", line 441, in _scale_internal

    self.data += -_zero

TypeError: Cannot cast ufunc add output from dtype('float64') to dtype('uint16') with casting rule 'same_kind'

augment-xylist.c:588:backtick Failed to run command: /usr/local/bin/image2pnm.py --sanitized-fits-outfile /tmp/tmp.sanitized.7eE4cV --fix-sdss --infile 3C_279V_000206853.FIT --uncompressed-outfile /tmp/tmp.uncompressed.lMRbIR --outfile /tmp/tmp.ppm.6uZyyt --ppm

 ioutils.c:567:run_command_get_outputs Command failed: return value 1


Any ideas as to what could be causing this?

Dustin Lang

unread,
Mar 28, 2016, 8:44:44 AM3/28/16
to astrometry
Hi,

That looks like a bug in pyfits.

You could try installing a new version of pyfits, or avoid this part of the code via

solve-field --no-fits2fits [...]

cheers,
--dustin


Jared Hand

unread,
Apr 5, 2016, 12:15:53 PM4/5/16
to astrometry
Thanks Dustin!

I was able to correct the issue by installing pyfits 3.3 (I had pyfits 3.4 installed)

-Jared

Nick K

unread,
Oct 27, 2016, 4:22:15 AM10/27/16
to astrometry

This is caused by a default casting rule change in numpty/python:
"Default casting rule change

Default casting for inplace operations has changed to 'same_kind'. For instance, if n is an array of integers, and f is an array of floats, then n += f will result in a TypeError, whereas in previous Numpy versions the floats would be silently cast to ints. In the unlikely case that the example code is not an actual bug, it can be updated in a backward compatible way by rewriting it as np.add(n, f, out=n, casting='unsafe'). The old 'unsafe'default has been deprecated since Numpy 1.7."

So the code needs an update to cope with this - switching back to pyfits 3.3 I assume simply reverts back the version of numpty being used..

Dustin Lang

unread,
Oct 27, 2016, 8:28:33 AM10/27/16
to astrometry
That bug is within the pyfits code, and the pyfits version should be totally independent of the numpy version.

Not much I can do about it other than not use pyfits.

cheers,
--dustin


Reply all
Reply to author
Forward
0 new messages