Execution error.

173 views
Skip to first unread message

Giacomo Succi

unread,
Jan 20, 2017, 5:04:59 PM1/20/17
to astrometry
Hi everyone.
I've tried to run the new version (0.70) on my Fedora 25 Astronomy Spin, but I have the following error:

[giacomo@lothlorien ~]$ solve-field -v helio_4.fit  
Reading input file 1 of 1: "helio_4.fit"...
Base: "./helio_4", basefile "helio_4.fit", basedir ".", suffix "fit"
Checking if file "helio_4.fit" ext 0 is xylist or image: image
 (not xyls because: FITS file does not have any extensions)
Running: /usr/local/astrometry/bin/image2pnm --infile helio_4.fit --uncompressed-outfile /tmp/tmp.uncompressed.POPTdK --outfile /tmp/tmp.ppm.MpluLO --ppm --mydir /usr/l
ocal/astrometry/bin/solve-field
Traceback (most recent call last):
 File "/usr/local/astrometry/bin/image2pnm", line 15, in <module>
   sys.exit(main())
 File "/usr/local/astrometry/lib/python/astrometry/util/image2pnm.py", line 273, in main
   mydir=dirs)
 File "/usr/local/astrometry/lib/python/astrometry/util/image2pnm.py", line 201, in convert_image
   comp = uncompress_file(infile, uncompressed)
 File "/usr/local/astrometry/lib/python/astrometry/util/image2pnm.py", line 81, in uncompress_file
   typeinfo = filetype_short(infile)
 File "/usr/local/astrometry/lib/python/astrometry/util/filetype.py", line 49, in filetype_short
   ft = filetype(fn)
 File "/usr/local/astrometry/lib/python/astrometry/util/filetype.py", line 23, in filetype
   (rtn,out,err) = run_command(cmd)
 File "/usr/local/astrometry/lib/python/astrometry/util/run_command.py", line 56, in run_command
   out = ''.join(outbl)
TypeError: sequence item 0: expected str instance, bytes found
augment-xylist.c:589:backtick Failed to run command: /usr/local/astrometry/bin/image2pnm --infile helio_4.fit --uncompressed-outfile /tmp/tmp.uncompressed.POPTdK --outf
ile /tmp/tmp.ppm.MpluLO --ppm --mydir /usr/local/astrometry/bin/solve-field
ioutils.c:567:run_command_get_outputs Command failed: return value 1
[giacomo@lothlorien ~]$

With older Fedora and Astronomy.net, Fedora 24 Astronomy Spin and Astronomy.net 0.67, I didn't had issues :\.

Thanks a lot in advance.

Best regards
Giacomo Succi

Dustin Lang

unread,
Jan 22, 2017, 11:50:05 AM1/22/17
to astrometry
Ahhhh, this might be a python2 vs python3 issue.  What do you get with:

python --version

?

If 'python' is python3 on your system, I might need to fix a couple of bugs to be py3 compatible.

thanks,
--dustin


Giacomo Succi

unread,
Jan 22, 2017, 3:58:34 PM1/22/17
to astrometry
Fedora 25 have Python 3 as default python.

The "dumps" are:

[giacomo@lothlorien ~]$ python --version
Python 3.5.2 :: Anaconda 4.2.0 (64-bit)
[giacomo@lothlorien ~]$ python
python                                        python3.5m                                    python3-mako-render
python2                                       python3.5m-config                             python3-pyflakes
python2.7                                     python3.5m-x86_64-config                      python3-pyinotify
python2.7-config                              python3-alembic                               python3-sip
python2-config                                python3-cairosvg                              python3-webassets
python3                                       python3-chardetect                            python-argcomplete-check-easy-install-script
python3-2to3                                  python3-config                                python-config
python3.5                                     python3-coverage                               
python3.5-config                              python3-isympy                                 
[giacomo@lothlorien ~]$

Giacomo Succi

unread,
Jan 22, 2017, 4:14:11 PM1/22/17
to astrometry
Ok. My apologies.
After I've post the message I've notice the fact that my system use the Anaconda's python instead of the system wide one.
I've removed the Anaconda package and now it works.
I had to rebuild it ok, but it works. Also the latest GitHub package.

[giacomo@lothlorien ~]$ python --version
Python 2.7.12
[giacomo@lothlorien ~]$ python
python                    python2-config            python3.5-config          python3-alembic           python3-coverage          python3-pyinotify
python2                   python3                   python3.5m                python3-cairosvg          python3-isympy            python3-sip
python2.7                 python3-2to3              python3.5m-config         python3-chardetect        python3-mako-render       python3-webassets
python2.7-config          python3.5                 python3.5m-x86_64-config  python3-config            python3-pyflakes          python-config
[giacomo@lothlorien ~]$

It seems that the Anaconda package it's not really compatible with Astronomy.net. At least the version 4.2.0.

I'm sorry to have "bother" :P.
Thanks again for your reply!

Clear skies!

Dustin Lang

unread,
Jan 22, 2017, 4:35:17 PM1/22/17
to astrometry
Thank you for the bug report!  I will try to improve the python3 compatibility -- it shouldn't take *too* much work to be compatible with both.

cheers,
--dustin

Giacomo Succi

unread,
Jan 23, 2017, 2:49:22 PM1/23/17
to astrometry
Thanks to you for your amazing work!!!

Katherine Alatalo

unread,
Apr 15, 2017, 1:22:05 AM4/15/17
to astrometry
I am finding a very similar issue. Also using Python 3. Attempting to install this on mac os X Sierra w/ combination of Macports, Python 3.5.2 and running into this error:

kalatalo@~/bin/astrometry/bin > solve-field --scale-low 10 ../examples/apod4.jpg 
Reading input file 1 of 1: "../examples/apod4.jpg"...
Traceback (most recent call last):
  File "/Users/kalatalo/bin/astrometry/bin/image2pnm", line 15, in <module>
    sys.exit(main())
  File "/Users/kalatalo/bin/astrometry/lib/python/astrometry/util/image2pnm.py", line 273, in main
    mydir=dirs)
  File "/Users/kalatalo/bin/astrometry/lib/python/astrometry/util/image2pnm.py", line 201, in convert_image
    comp = uncompress_file(infile, uncompressed)
  File "/Users/kalatalo/bin/astrometry/lib/python/astrometry/util/image2pnm.py", line 81, in uncompress_file
    typeinfo = filetype_short(infile)
  File "/Users/kalatalo/bin/astrometry/lib/python/astrometry/util/filetype.py", line 49, in filetype_short
    ft = filetype(fn)
  File "/Users/kalatalo/bin/astrometry/lib/python/astrometry/util/filetype.py", line 23, in filetype
    (rtn,out,err) = run_command(cmd)
  File "/Users/kalatalo/bin/astrometry/lib/python/astrometry/util/run_command.py", line 56, in run_command
    out = ''.join(outbl)
TypeError: sequence item 0: expected str instance, bytes found
augment-xylist.c:589:backtick Failed to run command: /Users/kalatalo/bin/astrometry/bin/image2pnm --infile ../examples/apod4.jpg --uncompressed-outfile /tmp/tmp.uncompressed.pHKJYF --outfile /tmp/tmp.ppm.AXaDox --ppm --mydir /Users/kalatalo/bin/astrometry/bin/solve-field
 ioutils.c:567:run_command_get_outputs Command failed: return value 1


Dustin Lang

unread,
Apr 15, 2017, 6:44:16 AM4/15/17
to astrometry
Yes, sorry, the code *still* hasn't been made compatible with python3.  If you can use python2, it should work fine.

cheers,
--dustin


Dustin Lang

unread,
Apr 15, 2017, 10:54:58 AM4/15/17
to astrometry
Actually.... if you can grab master now, please give it a shot.  I did some work on the python3 compatibility this morning.
thanks,
--dustin



ben.en...@gmail.com

unread,
May 9, 2017, 5:30:26 PM5/9/17
to astrometry
Did your Python 3.5 fix make it into the Homebrew package or is this still an outstanding issue?  Using Python 3.5.2 :: Anaconda custom (x86_64) and a fresh Homebrew install I get the error:

Traceback (most recent call last):
  File "/usr/local/bin/image2pnm", line 15, in <module>
    sys.exit(main())
  File "/usr/local/lib/python/astrometry/util/image2pnm.py", line 273, in main
    mydir=dirs)
  File "/usr/local/lib/python/astrometry/util/image2pnm.py", line 201, in convert_image
    comp = uncompress_file(infile, uncompressed)
  File "/usr/local/lib/python/astrometry/util/image2pnm.py", line 81, in uncompress_file
    typeinfo = filetype_short(infile)
  File "/usr/local/lib/python/astrometry/util/filetype.py", line 49, in filetype_short
    ft = filetype(fn)
  File "/usr/local/lib/python/astrometry/util/filetype.py", line 23, in filetype
    (rtn,out,err) = run_command(cmd)
  File "/usr/local/lib/python/astrometry/util/run_command.py", line 56, in run_command
    out = ''.join(outbl)
TypeError: sequence item 0: expected str instance, bytes found

When I revert to Python 2.7 it works fine.  Thanks for your time!!  Apologies if I have overlooked something...

Dustin Lang

unread,
May 9, 2017, 9:12:20 PM5/9/17
to astrometry
Not yet...

but I think if you do:

brew install astrometry.net --HEAD

you should get the latest version?

cheers,
--dustin


ben.en...@gmail.com

unread,
May 10, 2017, 5:29:26 PM5/10/17
to astrometry
Gave HEAD a shot.  Now I'm getting the following error with solve-field:

Read file stdin: 2370 x 1428 pixels x 1 color(s); maxval 255
Using 8-bit output
Extracting sources...
simplexy: found 53 sources.
/usr/local/lib/python/astrometry/util/removelines.py:23: RuntimeWarning: divide by zero encountered in log
  logpoisson = k*np.log(mean) - mean - np.array([sum(np.arange(kk)) for kk in k])
/usr/local/lib/python/astrometry/util/removelines.py:23: RuntimeWarning: invalid value encountered in multiply
  logpoisson = k*np.log(mean) - mean - np.array([sum(np.arange(kk)) for kk in k])
/usr/local/lib/python/astrometry/util/removelines.py:24: RuntimeWarning: invalid value encountered in less
  badbins = occupied[logpoisson < logcut]
WARNING: AstropyDeprecationWarning: The new_table function is deprecated and may be removed in a future version.
        Use :meth:`BinTableHDU.from_columns` for new BINARY tables or :meth:`TableHDU.from_columns` for new ASCII tables instead. [astrometry.util.fits]
Traceback (most recent call last):
  File "/usr/local/bin/removelines", line 15, in <module>
    sys.exit(main())
  File "/usr/local/lib/python/astrometry/util/removelines.py", line 76, in main
    cut=opt.cut, ext=opt.ext)
  File "/usr/local/lib/python/astrometry/util/removelines.py", line 52, in removelines
    T.writeto(outfile)
  File "/usr/local/lib/python/astrometry/util/fits.py", line 522, in write_to
    add_nonstructural_headers(header, T.header)
  File "/usr/local/lib/python/astrometry/util/fits.py", line 139, in add_nonstructural_headers
    for card in fromhdr.ascardlist():
AttributeError: 'Header' object has no attribute 'ascardlist'
augment-xylist.c:589:backtick Failed to run command: /usr/local/bin/removelines -e 1 /tmp/tmp.xyls.GBsySN /tmp/tmp.removelines.saROos
 ioutils.c:567:run_command_get_outputs Command failed: return value 1

I saw that you recommended changing ascardlist() to cards in another thread (https://groups.google.com/forum/#!topic/astrometry/IRuvl6AvZf4), but that yielded the same error the other person was seeing (keys something something).  I'm using pyfits 3.4.  I couldn't tell from the other thread if this issue was fixed or addressed yet.  Sorry I'm easily stumped...  I appreciate the help.

Dustin Lang

unread,
May 11, 2017, 12:51:01 AM5/11/17
to astrometry
sorry for all the trouble... we try to support different FITS readers, but apparently don't succeed very well.

Could you try
    pip install fitsio
?  That's a different FITS reader that wraps the cfitsio package into python, https://github.com/esheldon/fitsio

cheers,
--dustin

ben.en...@gmail.com

unread,
May 11, 2017, 4:33:53 PM5/11/17
to astrometry
Success!  Thanks for the help.  Just for feedback, I still get the divide by zero warnings in removelines.py:23, but it solves just fine. Thanks again! 

Hans

unread,
Jun 4, 2017, 4:40:06 AM6/4/17
to astro...@googlegroups.com
FYI this also helps Ubuntu 14.04.5 LTS


On Thursday, May 11, 2017 at 6:51:01 AM UTC+2, Dustin Lang wrote:
Could you try
    pip install fitsio

Pip brought in fitsio-0.9.11 and no more missing ascardlist attributes.

-- Hans
Reply all
Reply to author
Forward
0 new messages