`` map = readfits('MOSAIC.fits',hdr) crpix1 = sxpar(hdr,'CRPIX1') crpix2 = sxpar(hdr,'CRPIX2') crval1 = sxpar(hdr,'CRVAL1') crval2 = sxpar(hdr,'CRVAL2') cd1_1 = sxpar(hdr,'CD1_1') cd2_2 = sxpar(hdr,'CD2_2') x = lindgen(n_e(map[,0])) y = lindgen(n_e(map[0,])) l = (x-crpix1)*cd1_1+crval1-360 b = (y-crpix2)*cd2_2+crval2 imdisp,map,/axis,xrange=[max(l),min(l)],yrange=[min(b),max(b)],range=[-1,8]`` This code makes use of imdisp.pro.
Marc Pound's toolbox
This is neat: Line Ratio as a function of density, incident flux from Marc Pound. Sadly, straight CO 3-2 intensity isn't included, but perhaps I can create that myself.
mathematica
//. and /. use 'rules' of the form {x->y} for substitutions how do you make the layout of a page look nice? How do you change line spacing?
Mathematica & Series expansions
Mathematica does something stupid and incomprehensible (to me) with their series expansions. For no clear reason, it makes the O[x]n uneditable, and adds a bunch of formatting things that prevent you from copying & pasting the expression and then solving for a variable. Argh. While this is repairable using the "show expression" tool (Shift-Apple-E), it's a pain and "show expression" is not meant to be human readable.
matplotlib 64 bit installs never work
a clue as to why: functional ft2font.so: $ otool -L /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so: /usr/local/lib/libfreetype.6.dylib (compatibility version 10.0.0, current version 10.22.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) /usr/local/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.14.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) nonfunctional ft2font.so: $ otool -L /Users/adam/repos/yt/yt-i386/lib/python2.7/site-packages/matplotlib/ft2font.so/Users/adam/repos/yt/yt-i386/lib/python2.7/site-packages/matplotlib/ft2font.so: /Users/adam/repos/yt/yt-i386/lib/libfreetype.6.dylib (compatibility version 13.0.0, current version 13.2.0) /Users/adam/repos/yt/yt-i386//lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) /usr/local/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.14.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) /usr/local/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) The culprit is the difference between those two (maybe?): $ file /usr/local/lib/libgcc_s.1.dylib/usr/local/lib/libgcc_s.1.dylib: Mach-O universal binary with 4 architectures/usr/local/lib/libgcc_s.1.dylib (for architecture i386): Mach-O dynamically linked shared library i386/usr/local/lib/libgcc_s.1.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64/usr/local/lib/libgcc_s.1.dylib (for architecture ppc): Mach-O dynamically linked shared library ppc/usr/local/lib/libgcc_s.1.dylib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64$ otool -L /usr/local/lib/libgcc_s.1.dylib/usr/local/lib/libgcc_s.1.dylib: /usr/local/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9)
Mercurial - behave like SVN?
I'm trying to use hooks to make mercurial behave like svn when committing. I like the idea that I can commit changes to my cloned repo while I'm away from the internet, but I never want that behavior when I do have internet access. Therefore, I want to attempt to pull before updating and attempt to push after committing. Every time. I have been consistently very unhappy with the hg merge command. [hooks]precommit = hg pull; hg uppostcommit= hg pushpost-pull = hg up However, this doesn't work. precommit freezes with the error waiting for lock on working directory of [dir] held by [procnum] and pre-commit results in other errors: running hook pre-commit: hg pull; hg uppulling from [source]searching for changesno changes foundrunning hook post-pull: hg upabort: outstanding uncommitted mergeswarning: post-pull hook exited with status 255abort: outstanding uncommitted mergeswarning: pre-commit hook exited with status 255 AG
mercurial merge
AG My most hated behavior of mercurial:
searching for changesadding changesetsadding manifestsadding file changesadded 1 changesets with 3 changes to 3 files (+1 heads)(run 'hg heads' to see heads, 'hg merge' to merge)remote: 1 changesets foundrunning hook post-pull: hg upabort: crosses branches (merge branches or use --clean to discard changes)warning: post-pull hook exited with status 255$ hg mergeabort: outstanding uncommitted changes (use 'hg status' to list changes)$ hg commitnothing changed
Solution: `` hg merge --force `` Hopefully there are other solutions that I'll eventually add to this.
Merging postscripts
This is essential and really difficult to find answers to, but this guy gave it: http://ludo.qix.it/archive/2005/08/merge-postscript-files.html The keywords I would have liked to see: "merge postscripts into multi-page document" or "combine postscript multiple page" e.g. gs -sDEVICE=pswrite -sOutputFile=output.ps -dNOPAUSE -dBATCH file1.ps file2.ps file3.psorgs -sDEVICE=pswrite -sOutputFile=05358spectra.ps -dNOPAUSE -dEPSFitPage -dBATCH `ls 05358_*.eps`(the added option is to make sure the .eps isn't cropped)
meta
Why a blog? I've been strongly opposed to blogs for the longest time (after all, Desert Strike coined the word BLOG as an acronym for building), so why use one now? 1. link power - more links to my own pages if done correctly 2. google owns the blogger 2.a. google made it really easy 3. it's easier to add content here than to my real 'web page' which is already too content-heavy. Still, my web page is more useful for displaying code, my cv, etc. 4. needed a place to post beer reviews / brewing related content that doesn't fit on a normal web page unless I made a blog there 5. easiest way to take notes that I can't just accidentally delete... and now that I've made this post, 6. because I like metahumour
Molecular Clouds
I'm starting a blog on Molecular Clouds partly for the International Year of Astronomy. Ideally, I'd like to present a tour of the W3/4/5 region, but at the moment that's more of a research blog than a public blog. This is partly in response to Pamela Gay's request for astronomy blog feeds. I've generally spent more time maintaining my personal web page than my blog pages. The most interesting are: W5 P Cygni Some pictures but feel free to browse around.