Jusas / astrometry-api-lite

Astrometry.net API lite
MIT License
15 stars 4 forks source link

Astropy python error #3

Closed rankinstudio closed 6 years ago

rankinstudio commented 6 years ago

Any idea on this one?

[Jobs] Checked out work item 4 [Jobs] calling: solve-field -D /tmp/astrometry-temp/4 -o 4 --wcs /tmp/astrometry-temp/4/wcs -S /tmp/astrometry-temp/4/solved -l 300 --scale-units arcsecperpix --scale-low 0 --scale-high 5.0440000000000005 --temp-dir /tmp/astrometry-temp/4/solver-temp /tmp/astrometry-queue/667307717fc0a18c7f2714e0b7bf81d7.fits [Jobs] Reading input file 1 of 1: "/tmp/astrometry-queue/667307717fc0a18c7f2714e0b7bf81d7.fits"... [Jobs] Nothing to process [Jobs] Nothing to process [Jobs] Worker exiting [Jobs] Worker exiting [Jobs] Nothing to process [Jobs] Worker exiting [Jobs] Active worker count: 3/4 [Jobs] Active worker count: 2/4 [Jobs] Active worker count: 1/4 [Api] POST /api/submissions/4 200 3.159 ms [Api] POST /api/jobs/4 200 3.398 ms [Api] POST /api/jobs/4 200 2.929 ms [Api] POST /api/jobs/4 200 2.905 ms [Api] POST /api/jobs/4 200 3.302 ms [Api] POST /api/jobs/4 200 3.499 ms [Api] POST /api/jobs/4 200 3.006 ms [Jobs] Header has 11 cards [Jobs] Traceback (most recent call last): [Jobs] File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main [Jobs] "main", fname, loader, pkg_name) [Jobs] File "/usr/lib/python2.7/runpy.py", line 72, in _run_code [Jobs] exec code in run_globals [Jobs] File "/usr/lib/python2.7/dist-packages/astrometry/util/image2pnm.py", line 323, in [Jobs] sys.exit(main()) [Jobs] File "/usr/lib/python2.7/dist-packages/astrometry/util/image2pnm.py", line 320, in main [Jobs] mydir, fix_sdss=options.fix_sdss) [Jobs] File "/usr/lib/python2.7/dist-packages/astrometry/util/image2pnm.py", line 248, in convert_image [Jobs] (imgtype, errstr) = image2pnm(infile, outfile, sanitized, force_ppm, no_fits2fits, extension, mydir, fix_sdss) [Jobs] File "/usr/lib/python2.7/dist-packages/astrometry/util/image2pnm.py", line 184, in image2pnm [Jobs] errstr = fits2fits(infile, sanitized, fix_idr=fix_sdss) [Jobs] File "/usr/lib/python2.7/dist-packages/astrometry/util/fits2fits.py", line 86, in fits2fits [Jobs] hdu.scale('int16', '', bscale, bzero) [Jobs] File "/usr/lib/python2.7/dist-packages/astropy/io/fits/hdu/image.py", line 384, in scale [Jobs] bzero=bzero, blank=None) [Jobs] File "/usr/lib/python2.7/dist-packages/astropy/io/fits/hdu/image.py", line 442, in _scale_internal [Jobs] self.data += -_zero [Jobs] TypeError: [Jobs] Cannot cast ufunc add output from dtype('int32') to dtype('uint16') with casting rule 'same_kind' [Jobs] augment-xylist.c:588:backtick Failed to run command: /usr/bin/python -m astrometry.util.image2pnm --sanitized-fits-outfile /tmp/astrometry-temp/4/solver-temp/tmp.sanitized.Lj05Q8 --fix-sdss --infile /tmp/astrometry-queue/667307717fc0a18c7f2714e0b7bf81d7.fits --uncompressed-outfile /tmp/astrometry-temp/4/solver-temp/tmp.uncompressed.9SS97t --outfile /tmp/astrometry-temp/4/solver-temp/tmp.ppm.vzOipP --ppm [Jobs] ioutils.c:567:run_command_get_outputs Command failed: return value 1 [Jobs] Child process exited with code 255 [Jobs] Solve-field failed [Jobs] Job marked as failure, error information updated [Jobs] Cleaning up /tmp/astrometry-temp/4 [Jobs] Worker exiting [Jobs] Active worker count: 0/4

Jusas commented 6 years ago

Yeah, this needs to be dealt with.

The core of the error seems to be in /usr/lib/python2.7/dist-packages/astropy/io/fits/hdu/image.py - meaning it's in the astropy package, and I believe the problem manifests itself due to an incompatibility with the installed version of python numpy package.

This issue is probably relevant and probably deals with the same problem: https://github.com/matthewearl/faceswap/issues/5

I'll have to see what would be the best way to solve this problem.

As a temporary workaround, if your software has a setting for it, please try uploading the image either as JPEG or PNG. FITS format conversion with astropy is the issue.

rankinstudio commented 6 years ago

I'm trying to test in SGP, but there is no option for this. Do you know of another application that I can quickly do solve tests with? Thanks!

Jusas commented 6 years ago

You can try Ansvr, which uses a cygwin build of astrometry.net.

Unfortunately I haven't had the time to dig into this for the last few days but this issue is still on the top of my priority list.

rankinstudio commented 6 years ago

Sorry I wasn't more clear. I'm trying to test solves in sequence generator pro pointed at Astrometry Api Lite, but it doesn't upload in JPG. Do you know of one other than Ekos that will upload in JPG for testing?

Cheers

rankinstudio commented 6 years ago

This is an issue whether or not I use a JPG upload option.

Jusas commented 6 years ago

This should be fixed in HEAD, but I've not created a new release yet - still need to test emerged data corruption issue fixes with sqlite, as soon as I'm fairly confident that the fixes work I'll make a new release.