error while using "solve-field" command

1,172 views
Skip to first unread message

smpi...@gmail.com

unread,
Mar 3, 2014, 7:24:21 AM3/3/14
to astro...@googlegroups.com

Hi Dustin,

After giving solve-field command, I got this error message:


Reading input file 1 of 1: "Haumea_r.9195.0.fits"...
Traceback (most recent call last):
  File "/usr/local/astrometry/bin/image2pnm.py", line 317, in <module>
    sys.exit(main())
  File "/usr/local/astrometry/bin/image2pnm.py", line 314, in main
    mydir, fix_sdss=options.fix_sdss)
  File "/usr/local/astrometry/bin/image2pnm.py", line 242, in convert_image
    (imgtype, errstr) = image2pnm(infile, outfile, sanitized, force_ppm, no_fits2fits, extension, mydir, fix_sdss)
  File "/usr/local/astrometry/bin/image2pnm.py", line 182, in image2pnm
    errstr = fits2fits(infile, sanitized, fix_idr=fix_sdss)
  File "/usr/local/astrometry/python/astrometry/util/fits2fits.py", line 44, in fits2fits
    cards = hdr.ascardlist()
AttributeError: 'Header' object has no attribute 'ascardlist'
augment-xylist.c:586:backtick Failed to run command: /usr/local/astrometry/bin/image2pnm.py --sanitized-fits-outfile /tmp/tmp.sanitized.Em6Q2v --fix-sdss --infile Haumea_r.9195.0.fits --uncompressed-outfile /tmp/tmp.uncompressed.QOHQMt --outfile /tmp/tmp.ppm.Dm5Qwr --ppm
 ioutils.c:669:run_command_get_outputs Command failed: return value 1

Please help . Did I install astrometry.net correctly ?
Let me tell you what I have done/ what I have as follows:

---------------------------------------------------------------------------------------
I have installed anaconda on my machine, which includes Python2.7.
Some lines from my .bashrc file reads like this:

PATH="/home/swapnil/anaconda/bin:/usr/share/sextractor:${PATH}"
export PATH

ASTROMETRY_PYTHON_PATH=/usr/local/astrometry/python
export ASTROMETRY_PYTHON_PATH

----------------------------------------------------------------------------------------------

output of the command :
python -c "import pyfits; print pyfits.__file__; print pyfits.__version__"

             is

/home/swapnil/anaconda/lib/python2.7/site-packages/pyfits-3.2-py2.7-linux-x86_64.egg/pyfits/__init__.pyc
3.2.dev


-------------------------------------------------------------------------------------------------

I am using  file     http://astrometry.net/svn/trunk/src/astrometry/util/fits.py
(after renaming it as pyfits_utils.py)

its location is:

/usr/local/astrometry/python/astrometry/util/pyfits_utils.py

-----------------------------------------------------------------------------------------------------------------

Regards,
Swapnil

Dustin Lang

unread,
Mar 3, 2014, 8:21:44 AM3/3/14
to astro...@googlegroups.com

Argh, it looks like pyfits has changed the API in a backward-compatible way twice from 3.0 to 3.1 to 3.2.  I want to eliminate any use of pyfits, but haven't had a chance yet.

Could you please try editing

/usr/local/astrometry/python/astrometry/util/fits2fits.py

line 44

changing

    cards = hdr.ascardlist()


to:

    cards = hdr.cards

?

Thanks,
--dustin


smpi...@gmail.com

unread,
Mar 4, 2014, 6:21:42 AM3/4/14
to
Hi Dustin,

After making the change which you have mentioned, I ran solve-field command on same FITS file, and
I got this error message now :


Reading input file 1 of 1: "Haumea_r.9195.0.fits"...
Traceback (most recent call last):
  File "/usr/local/astrometry/bin/image2pnm.py", line 317, in <module>
    sys.exit(main())
  File "/usr/local/astrometry/bin/image2pnm.py", line 314, in main
    mydir, fix_sdss=options.fix_sdss)
  File "/usr/local/astrometry/bin/image2pnm.py", line 242, in convert_image
    (imgtype, errstr) = image2pnm(infile, outfile, sanitized, force_ppm, no_fits2fits, extension, mydir, fix_sdss)
  File "/usr/local/astrometry/bin/image2pnm.py", line 182, in image2pnm
    errstr = fits2fits(infile, sanitized, fix_idr=fix_sdss)
  File "/usr/local/astrometry/python/astrometry/util/fits2fits.py", line 54, in fits2fits
    for k in cards.keys():
AttributeError: '_CardAccessor' object has no attribute 'keys'
augment-xylist.c:586:backtick Failed to run command: /usr/local/astrometry/bin/image2pnm.py --sanitized-fits-outfile /tmp/tmp.sanitized.RrbGcI --fix-sdss --infile Haumea_r.9195.0.fits --uncompressed-outfile /tmp/tmp.uncompressed.1mOpNT --outfile /tmp/tmp.ppm.BLaao5 --ppm

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

 - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


When I tried --no-fits2fits option, I got another error message:



$ solve-field --no-fits2fits Haumea_r.9195.0.fits


Reading input file 1 of 1: "Haumea_r.9195.0.fits"...
Computing image percentiles...
/bin/sh: pnmfile: command not found
augment-xylist.c:586:backtick Failed to run command: pnmfile /tmp/tmp.ppm.BckD4a
 ioutils.c:666:run_command_get_outputs Command not found: pnmfile /tmp/tmp.ppm.BckD4a

 - - - - - - - - - - - - - -- - - - - - - - - - - - - - - -

What is wrong ?


Bye the way, I am giving "solve-field" command from a directory which contains INDEX files (series 42xx).
Can I run "solve-field" command from any directory which contains a FITS file ?

=======================================================================

Also, I want to make a small note :
on my computer,

/usr/local/astrometry/bin

contains (other files not listed here):

fits2fits.py
image2pnm.py
removelines.py
uniformize.py

=======================
and this location
/usr/local/astrometry/python/astrometry/util
also contains same files (other files not listed here) :

fits2fits.py  
image2pnm.py
removelines.py
uniformize.py

Does this make any conflict ?


Regards,
Swapnil

Dustin Lang

unread,
Mar 4, 2014, 9:04:26 AM3/4/14
to astro...@googlegroups.com
Ok, thanks for trying that pyfits change.  Too bad it didn't work.

I will see if I can come up with a quick fix for that.

The "pnmfile" error is because the Astrometry.net code requires the "netpbm" utilities to be installed, including "pnmfile".

If you look at those .py files in /usr/local/astrometry/bin, I think you will see that they are symbolic links to the real files in python/util.

cheers,
--dustin

smpi...@gmail.com

unread,
Mar 5, 2014, 7:05:39 AM3/5/14
to astro...@googlegroups.com

Hi Dustin,

After reinstalling astrometry.net, and giving following command,

                $ solve-field --no-fits2fits Haumea_r.9195.0.fits


I got following message.
Please have a look.

Two files are created now:
Haumea_r.9195.0.axy   &  Haumea_r.9195.0-objs.png


Also, I have installed netpbm. I don't know why below message says:
cairoutils.c:683:cairoutils_read_ppm_stream: cairoutils.c:683:cairoutils_read_ppm_stream: Netpbm is not available; can't read PPM imagesNetpbm is not available; can't read PPM images

Regards,
Swapnil

=================================================================

Reading input file 1 of 1: "Haumea_r.9195.0.fits"...
Computing image percentiles...
Extracting sources...
simplexy: found 360 sources.
cairoutils.c:683:cairoutils_read_ppm_stream: cairoutils.c:683:cairoutils_read_ppm_stream: Netpbm is not available; can't read PPM imagesNetpbm is not available; can't read PPM images

cairoutils.c:683:cairoutils_read_ppm_stream: cairoutils.c:683:cairoutils_read_ppm_stream: Netpbm is not available; can't read PPM imagesNetpbm is not available; can't read PPM images

libpng warning: Image width is zero in IHDR
libpng warning: Image height is zero in IHDR
libpng error: Invalid IHDR data
*** longjmp causes uninitialized stack frame ***: /usr/local/astrometry/bin/plotxy terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x36e7302547]
/lib64/libc.so.6[0x36e73024d9]
/lib64/libc.so.6(__longjmp_chk+0x33)[0x36e7302443]
/usr/lib64/libpng12.so.0(png_error+0x9b)[0x36eb61c30b]
/usr/lib64/libpng12.so.0(png_set_IHDR+0x73)[0x36eb6070c3]
/usr/local/astrometry/bin/plotxy[0x41634e]
/usr/local/astrometry/bin/plotxy[0x41645e]
/usr/local/astrometry/bin/plotxy[0x407282]
/usr/local/astrometry/bin/plotxy[0x406d1b]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x36e721ecdd]
/usr/local/astrometry/bin/plotxy[0x4067a9]
======= Memory map: ========
00400000-00512000 r-xp 00000000 08:02 410830                             /usr/local/astrometry/bin/plotxy
00712000-007dc000 rw-p 00112000 08:02 410830                             /usr/local/astrometry/bin/plotxy
007dc000-007e1000 rw-p 00000000 00:00 0
01bac000-01bcd000 rw-p 00000000 00:00 0                                  [heap]
302b200000-302b216000 r-xp 00000000 08:02 32858                          /lib64/libgcc_s-4.4.7-20120601.so.1
302b216000-302b415000 ---p 00016000 08:02 32858                          /lib64/libgcc_s-4.4.7-20120601.so.1
302b415000-302b416000 rw-p 00015000 08:02 32858                          /lib64/libgcc_s-4.4.7-20120601.so.1
36e6e00000-36e6e20000 r-xp 00000000 08:02 32898                          /lib64/ld-2.12.so
36e701f000-36e7020000 r--p 0001f000 08:02 32898                          /lib64/ld-2.12.so
36e7020000-36e7021000 rw-p 00020000 08:02 32898                          /lib64/ld-2.12.so
36e7021000-36e7022000 rw-p 00000000 00:00 0
36e7200000-36e738a000 r-xp 00000000 08:02 32899                          /lib64/libc-2.12.so
36e738a000-36e7589000 ---p 0018a000 08:02 32899                          /lib64/libc-2.12.so
36e7589000-36e758d000 r--p 00189000 08:02 32899                          /lib64/libc-2.12.so
36e758d000-36e758e000 rw-p 0018d000 08:02 32899                          /lib64/libc-2.12.so
36e758e000-36e7593000 rw-p 00000000 00:00 0
36e7600000-36e7602000 r-xp 00000000 08:02 32913                          /lib64/libdl-2.12.so
36e7602000-36e7802000 ---p 00002000 08:02 32913                          /lib64/libdl-2.12.so
36e7802000-36e7803000 r--p 00002000 08:02 32913                          /lib64/libdl-2.12.so
36e7803000-36e7804000 rw-p 00003000 08:02 32913                          /lib64/libdl-2.12.so
36e7a00000-36e7a17000 r-xp 00000000 08:02 32901                          /lib64/libpthread-2.12.so
36e7a17000-36e7c17000 ---p 00017000 08:02 32901                          /lib64/libpthread-2.12.so
36e7c17000-36e7c18000 r--p 00017000 08:02 32901                          /lib64/libpthread-2.12.so
36e7c18000-36e7c19000 rw-p 00018000 08:02 32901                          /lib64/libpthread-2.12.so
36e7c19000-36e7c1d000 rw-p 00000000 00:00 0
36e7e00000-36e7e83000 r-xp 00000000 08:02 21529                          /lib64/libm-2.12.so
36e7e83000-36e8082000 ---p 00083000 08:02 21529                          /lib64/libm-2.12.so
36e8082000-36e8083000 r--p 00082000 08:02 21529                          /lib64/libm-2.12.so
36e8083000-36e8084000 rw-p 00083000 08:02 21529                          /lib64/libm-2.12.so
36e8a00000-36e8a15000 r-xp 00000000 08:02 32909                          /lib64/libz.so.1.2.3
36e8a15000-36e8c14000 ---p 00015000 08:02 32909                          /lib64/libz.so.1.2.3
36e8c14000-36e8c15000 r--p 00014000 08:02 32909                          /lib64/libz.so.1.2.3
36e8c15000-36e8c16000 rw-p 00015000 08:02 32909                          /lib64/libz.so.1.2.3
36ea600000-36ea602000 r-xp 00000000 08:02 32911                          /usr/lib64/libXau.so.6.0.0
36ea602000-36ea802000 ---p 00002000 08:02 32911                          /usr/lib64/libXau.so.6.0.0
36ea802000-36ea803000 rw-p 00002000 08:02 32911                          /usr/lib64/libXau.so.6.0.0
36eae00000-36eae1d000 r-xp 00000000 08:02 32912                          /usr/lib64/libxcb.so.1.1.0
36eae1d000-36eb01d000 ---p 0001d000 08:02 32912                          /usr/lib64/libxcb.so.1.1.0
36eb01d000-36eb01e000 rw-p 0001d000 08:02 32912                          /usr/lib64/libxcb.so.1.1.0
36eb200000-36eb337000 r-xp 00000000 08:02 32914                          /usr/lib64/libX11.so.6.3.0
36eb337000-36eb537000 ---p 00137000 08:02 32914                          /usr/lib64/libX11.so.6.3.0
36eb537000-36eb53d000 rw-p 00137000 08:02 32914                          /usr/lib64/libX11.so.6.3.0
36eb600000-36eb625000 r-xp 00000000 08:02 32910                          /usr/lib64/libpng12.so.0.49.0
36eb625000-36eb825000 ---p 00025000 08:02 32910                          /usr/lib64/libpng12.so.0.49.0
36eb825000-36eb826000 rw-p 00025000 08:02 32910                          /usr/lib64/libpng12.so.0.49.0
36ec200000-36ec226000 r-xp 00000000 08:02 32907                          /lib64/libexpat.so.1.5.2
36ec226000-36ec425000 ---p 00026000 08:02 32907                          /lib64/libexpat.so.1.5.2
36ec425000-36ec428000 rw-p 00025000 08:02 32907                          /lib64/libexpat.so.1.5.2
36ece00000-36ece09000 r-xp 00000000 08:02 32915                          /usr/lib64/libXrender.so.1.3.0
36ece09000-36ed009000 ---p 00009000 08:02 32915                          /usr/lib64/libXrender.so.1.3.0
36ed009000-36ed00a000 rw-p 00009000 08:02 32915                          /usr/lib64/libXrender.so.1.3.0
3fe2400000-3fe2498000 r-xp 00000000 08:02 33705                          /usr/lib64/libfreetype.so.6.3.22
3fe2498000-3fe2697000 ---p 00098000 08:02 33705                          /usr/lib64/libfreetype.so.6.3.22
3fe2697000-3fe269d000 rw-p 00097000 08:02 33705                          /usr/lib64/libfreetype.so.6.3.22
3fe2800000-3fe2834000 r-xp 00000000 08:02 33706                          /usr/lib64/libfontconfig.so.1.4.4sh: line 1: 24455 Done                    /usr/local/astrometry/bin/plotxy -I /tmp/tmp.ppm.Bgqklo -i ./Haumea_r.9195.0.axy -C red -w 2 -N 50 -x 1 -y 1 -P
     24456 Aborted                 (core dumped) | /usr/local/astrometry/bin/plotxy -i ./Haumea_r.9195.0.axy -I - -w 2 -r 3 -C red -n 50 -N 200 -x 1 -y 1 > ./Haumea_r.9195.0-objs.png
solve-field.c:332:plot_source_overlay Plotting command failed
 solve-field.c:138:run_command Command was: "/usr/local/astrometry/bin/plotxy -I /tmp/tmp.ppm.Bgqklo -i ./Haumea_r.9195.0.axy -C red -w 2 -N 50 -x 1 -y 1 -P | /usr/local/astrometry/bin/plotxy -i ./Haumea_r.9195.0.axy -I - -w 2 -r 3 -C red -n 50 -N 200 -x 1 -y 1 > ./Haumea_r.9195.0-objs.png"

 solve-field.c:137:run_command Command exited with exit status 134
Solving...
You must list at least one index in the config file (/usr/local/astrometry/bin/../etc/backend.cfg)
solve-field.c:523:run_backend backend failed.  Command that failed was:
  /usr/local/astrometry/bin/backend ./Haumea_r.9195.0.axy
 ioutils.c:669:run_command_get_outputs Command failed: return value 255

Dustin Lang

unread,
Mar 5, 2014, 10:09:09 AM3/5/14
to astro...@googlegroups.com
You probably also need the netpbm "devel" package.  After that, re-build the code with:

make reconfig
make

cheers,
--dustin

Reply all
Reply to author
Forward
0 new messages