-->

Sunday, October 18, 2009

#6 on Astro-ph today

IRAS 05358 on astro-ph. Check out my page on the region too.

This week at the Sun

Wednesday, Thursday, Saturday, Sunday @ The Southern Sun: Delicious. The Holler's Haze Smoked Porter is new on tap, and it's delicious. Very smooth, the smoke is pretty subtle (i.e. not overpowering the way most porters are), and it's 6.4%.

Cleveland Brown is back on tap too. It's not as good as I remember, but it will probably be better on nitro.

Still no word on whether the Carne Asada burrito will return.

Friday, October 16, 2009

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

Wednesday, October 14, 2009

Galaxy Map

If you're ever interested in seeing a face-on view of the Milky Way, check out the Spitzer press release. This link is very surprisingly hard to find on google.

Wednesday, August 26, 2009

cython vs f2py

I had a go at optimizing some code this past week, and ended up learning to use both cython and f2py.

f2py is much easier to use. If you want to write a function in fortran and use it in python, all you do is write the code and add specifications using comments in the fortran code.

cython is more natural to code. The code style is C/fortran-like: think in terms of loops instead of arrays. The syntax is python-like, which makes coding somewhat clearer and simpler.

For my code, I found that cython was ~10% slower than fortran.

Check out the plfits in:
http://code.google.com/p/agpy/source/browse/#svn/trunk/

Monday, August 17, 2009

How to make a pretty image

The most difficult requirement to satisfy is WCS matching. Each image has to be in exactly the same pixel space in order to overlay them successfully in an image program. The process is generally to use Montage's mProject to project the images into the same plane, then mAdd with a blank map of a given size so that the dimensions in pixels are identical.

Once that's done, I load the images into GIMP. However, GIMP reads .fits files as 256 bit data - which is essentially useless because most (interesting) images have a dynamical range >~1000. So I usually make images emphasizing the faint emission in log scale with the high and low ends cut off (I use DS9 to determine high/low). I make a second copy showing the details of the very bright regions, again in logscale but it ends up being a different log scale - essentially, my transfer function becomes a broken power law.

The tricks in GIMP are numerous, but primarily two:
1. Rotate the color table ~60 degrees
2. Use images as "Layer Masks" (aka alpha layers) on a solid color background

There's also the nice trick when using radio data of using optical or some other wavelength to provide the high-resolution details, while the radio emission provides the intensity.

Saturday, August 15, 2009

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.

Friday, August 14, 2009

Acquiring DSS images

This is the way to get DSS images:
ESO's batch downloader

Thursday, August 13, 2009

login shell

to change your default login shell, use chsh

Wednesday, August 12, 2009

Quicksilver sounds

To switch sound source from the command line:
switchaudio

Use this to make scripts such as:

#!/bin/bash
/Users/adam/humor/SwitchAudioSource -s "Built-in Line Output"
afplay /Users/adam/humor/losinghorn.wav
/Users/adam/humor/SwitchAudioSource -s "Built-in Output"


Then make triggers in Quicksilver by:

  1. Go to trigger pane, make new hotkey trigger
  2. press "." to allow you to type a command
  3. make sure the action is "Run"
  4. hook up a hotkey
  5. if it doesn't work, just try again. Persist through crashes, they happen often.



Follow-up: You can also control the volume!
http://discussions.apple.com/thread.jspa?threadID=585781
osascript -e 'set volume output volume 100'

Saturday, July 25, 2009

Sunday, July 12, 2009

Year in review

It's been just over a year since I started this blog. I posted a LOT more than I thought I would. Also, I apparently dropped the tradition of reviewing beers. So I'll start by reviewing some beers!

Mountain Sun Hummingbird - a strong honey-ale (meade-beer?) brewed with orange blossom honey. Slightly darker than a typical Belgian Golden but similar in style. The beer is mildly sweet but very drinkable. Hmm... there are flavors I should mention but they escape me.

Mountain Sun/Avery Van Diemens - brewed with Tasmanian Pepper Berry, this is a very curious, semi-dark beer. When I first sampled it, I tasted a little bit of pepper kick at the end, but couldn't really identify any other flavors. Yesterday I sampled it next to a burrito with some somewhat spicy salsa. Somehow, since my mouth was already sensitized to spiciness, the flavor I got was root beer (sassafras?). It was... odd. Pretty good, but I didn't end up purchasing a glass.

Moving on to code. I don't know why I haven't mentioned this, but with my discovery of svn, I started uploading my code to the webternets: agpy is my Google Code page and includes a number of useful python codes, especially readcol and gaussfitter, which I have tested and used extensively since writing them. Python is still a long way from a cohesive astrolib code base, but with individual contributions, the STSCI development group, and APLpy underway, we're getting closer.

Wednesday, July 08, 2009

SUCCESS! 64 bit python with 64 bit tcl/tk!!!

After a long, tedious process (see previous posts), I got 64 bit python, 64 bit tcl/tk, and 64 bit tkinter all to work! I can now use the TkAgg backend in matplotlib!

Python 64 bit on Mac OS X: Sam Skillman's post

Tcl/Tk 64 bit: a post on the tcl/tk forums

tkinter 64 bit: python bug report 4017 (last two posts give the solution) and my posted solution

Sunday, July 05, 2009

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.8
configure: running /bin/sh './configure' --prefix=/usr/local CC= CFLAGS= LDFLAGS= --cache-file=/dev/null --srcdir=.
configure: warning: CC=: invalid host type
configure: warning: CFLAGS=: invalid host type
configure: error: can only configure for one host and one target at a time
configure: 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.

Thursday, July 02, 2009

Installing 64 bit tcl/tk on Mac OS X

Everything is described in this post:
http://www.nabble.com/Error-compiling-tk-8.5.7-on-Mac-OS-X-10.5-td23790967.html


But here's a script too:

curl -O 'http://osdn.dl.sourceforge.net/sourceforge/tcl/t{cl,k}8.5.7-src.tar.gz'
for f in t*8.5.7*.gz; do tar zxf $f; done
cd tcl8.5.7/unix/
./configure --enable-framework --enable-64-bit
cd tk8.5.7/unix/
./configure --enable-framework --enable-64-bit
make -j 4 -C tcl8.5.7/unix
make -j 4 -C tk8.5.7/unix
sudo make install -C tcl8.5.7/unix
sudo make install -C tk8.5.7/unix


Concerns:
-might be necessary to do this in the macosx directory for some reason, though Aqua doesn't support 64 bits
-have to recompile python to get _tkinter to work (see a later post)

Monday, June 29, 2009

Make PDFs open with the thumbnails window open

Neat trick I picked up from here:
http://www.ghostscript.com/~ghostgum/pdftips.htm

Add this code:

\special{! /pdfmark
[/View [/XYZ null null 1] % unspecified x and y offset, 100% zoom
/Page 1
/PageMode /UseThumbs % /UseNone /UserOutlines /UseThumbs /FullScreen
/DOCVIEW pdfmark
}

to a LaTeX document (probably near the top) and when you ps2pdf it, it will open the PDF with the thumbnail bar open. This is very useful for proofreading after you latex a file. Of course, xdvi also works well for this, but xdvi is VERY unstable on the Mac. At least adobe, being a native Mac program, doesn't crash as often.

Monday, June 15, 2009

Art mimicing reality

An artist who likes painting astronomical objects:
Marianne Beacham Gallery

Sunday, June 14, 2009

Comps 2 reflections

Comps 2 included some successes and some failures.

The most successful part of my Comps preparation was the Monday talk. The previous talk on Tuesday was somewhat helpful in terms of realizing that I needed larger figure axes, but otherwise provided no useful feedback. The Monday talk allowed me to realize what needed to be done to make my talk accessible to a larger audience.

At the defense, I ended up going only ~40 minutes despite having gone far over time in the Monday version and spending ~5 minutes answering questions from Don and Mike. I think that was a good thing; I didn't need to say anything more even though there was an enormous amount of additional material I could have covered.

The main change I made from Monday to Friday was reorganizing such that I discussed the largest scales first and zoomed in, and I spent much more time discussing the larger context of my work. Unfortunately, I also spent most of the week before the presentation determining the larger context and reading papers. Ideally, I would have done that before handing in the paper.

The closed door Q&A section went OK but not great. There were a few important bits of information related to the IMF that I didn't know off the top of my head - e.g. the ratio of total # of stars to the # of B stars. I got the lowest mass star (.07) confused with the most common star mass (.3). I wasn't particularly able to integrated the IMF on the board either. I didn't remember the Jeans mass-temperature and mass-density relationships but was able to derive them quickly enough.

Probably the biggest problem was dealing with a question about the partition function - specifically how did the partition function come into play in the column density equation. I didn't come up with the right answer at all, and in particular quoted the wrong distribution. However, I think a big part of what they expected to hear was a dependence on temperature AND degeneracy, and I never explicitly mentioned degeneracy. It turned out that the equation I had quoted in both the paper and the talk was correct, but I couldn't come anywhere close to proving that on the spot.

My expected result is therefore a low pass, though it was not made explicit. That's rather unfortunate as it's possible that another month of preparation could have gotten me the high pass, but at the same time, it's well worth having the project done.

Tuesday, June 02, 2009

Most important astronomical publications

I'm interested to hear input on this. Some I know of:
Cardelli, Clayton, Mathis 1989 - determined interstellar extinction law
Kurucz 1993 - possibly a book? Stellar atmosphere calculations