I want to automatically extract figures from papers, but of course most papers come in .pdf, not .ps form... This site has a great tool for extracting figures from .ps papers: http://www-hermes.desy.de/notes/extras/postscript.html If anyone can tell me how to do the same thing for .pdfs (automatically extract figures from pdfs) I'd appreciate it. Update 12/13/08: One solution is listed at http://ubuntuforums.org/showthread.php?t=884002: use pdfimages, part of the xpdf package.
Failure to compile 64 bit gtk on mac os
Attempted to install gtk+-2.17.2 on my mac. Had to install: glib-2.21.2 which would not let me compile with multiple architectures, and pkgconfig-0.9.0, which won't configure because: configure: configuring in glib-1.2.8configure: running /bin/sh './configure' --prefix=/usr/local CC= CFLAGS= LDFLAGS= --cache-file=/dev/null --srcdir=.configure: warning: CC=: invalid host typeconfigure: warning: CFLAGS=: invalid host typeconfigure: error: can only configure for one host and one target at a timeconfigure: error: /bin/sh './configure' failed for glib-1.2.8 which is bs because I don't have any compiler flags set.
So, gtk+ seems hopeless. UPDATE: 0.9.0 is not the latest version, 0.23.0 is. Dumb version numbering.
GTK is absurd to install. You need:
- pkg-config
- glib
- cairo
- pixman
- pango (MUST be installed AFTER cairo)
- atk
- libtiff
- libjpg
- jpeg2000 - but I just passed a flag to not do this because it didn't install right. --without-libjasper
- fontconfig I mean, really? at this point it's just ridiculous....
and finally, it died with this: checking Pango flags... configure: error:
- ::
- *** Pango not found. Pango built with Cairo support is required *** to build GTK+. See http://www.pango.org for Pango information.
which meant that I had to reinstall Pango because I had installed it before Cairo.
I believe this is where the term dependency hell comes from.
Also, I don't think any of these are x86-64 compatible.
Then I'm STILL not done. PyGTK dies with an import error on dsextras, which a painful google search traces to pygobject. pygobject makes and installs fine.... but then I find out it installed to /usr/local/lib/python2.6/site-packages/gtk-2.0/, which is obviously not on my python path since I installed a framework.
So: ./configure --prefix=/Library/Frameworks/Python.framework/Versions/2.6/ in both pygobject and pygtk.
Oh, guess what? Need pycairo too. What happens there? What you'd guess:
ld warning: in /Developer/SDKs/MacOSX10.5.sdk/usr/local/lib/libcairo.dylib, file is not of required architecture
so when I configure pygtk:
- The following modules will be built:
- atk
- pango
- The following modules will NOT be built:
- pangocairo
- gtk
- gtk.glade
- gtk.unixprint
Damn. That blows.
python-64 -c "import gtk" ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/gtk-2.0/glib/\_glib.so, 2): no suitable image found. Did find: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/gtk-2.0/glib/\_glib.so: mach-o, but wrong architecture
FAIL.
fermentation
ideas + beer. Same process. They catalyze each other.
figure*
to make figures/deluxetables span the page in LaTeX: \begin{figure*} ... \end{figure*}
Filled step plots in matplotlib
It's not possible to do a simple filled step plot in matplotlib using default commands. Workaround:
def steppify(arr,isX=False,interval=0): """ Converts an array to double-length for step plotting """ if isX and interval==0: interval = abs(arr[1]-arr[0]) / 2.0 newarr = array(zip(arr-interval,arr+interval)).ravel() return newarrplot(xx,yy,linestyle='steps-mid',color='b',linewidth=1.5)fill_between(steppify(xx[x1:x2],isX=True), steppify(yy[x1:x2])*0, steppify(yy[x1:x2]), facecolor='b',alpha=0.2)
finally got matplotlib to install...
the key is reading the readme, not just the make.osx file.
These commands Just Work: make -f make.osx PYVERSION=2.6 PREFIX=/Users/adam/repos/mpl_dependencies/ fetch deps mpl_install_stdmake -f make.osx PYVERSION=2.7 PREFIX=/Users/adam/repos/mpl_dependencies/ fetch deps mpl_install_std
while, e.g., this one: make -f make.osx PYVERSION=2.6 PREFIX=/Users/adam/repos/mpl_dependencies/ fetch deps mpl_install didn't. I guess because that one doesn't actually install anything.
find and xargs
pretty useful info on find and xargs, e.g. find /scratch/adam_work/ -name 'mmm*sav' | xargs rm
First!
First post by me on my own BLDG! I should transition to this address eventually...
First paper accepted
My Comps II paper on IRAS 05358+3543 was accepted by ApJ on Wednesday. It will show up on arxiv in a few days and I'll post the link then. Unfortunately, there were significant problems rendering the paper, so I recommend downloading my version. Also, working on the HISA KDA... I have a nice section of cutouts
FITS manipuation with imagemagick, gimp, etc.
It is possible to convert .fits files to .png, .jpg, etc: `` convert -normalize a.fits a.png `` To get things to come out nicely, you have to do the scaling essentially by hand in python/idl/iraf. DS9 is only useful for finding out what scaling you want to use; past that it's pretty much not useable. To make colors look nice in the GIMP, use solid background layers with your image as the alpha mask. Then put your image in with itself as an alpha mask so you can easily control the whiteness (saturation) of the color you've selected. I'll be blogging about this more as I prep my next entry for the NRAO photo contest.