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.
Ghostscript error?
I've been receiving the following error when attempting to compile (ps2pdf) my w5 outflows paper:
Error: /rangecheck in --get--Operand stack: pdfmark --dict:20/25(ro)(L)-- --nostringval-- 50Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1878 1 3 %oparray_pop 1877 1 3 %oparray_pop 1861 1 3 %oparray_pop 1755 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- %finish_show --nostringval-- --nostringval-- 8 6 1 --nostringval-- (pdf_text_enum_t) %op_show_continue --nostringval--Dictionary stack: --dict:1153/1684(ro)(G)-- --dict:0/20(G)-- --dict:71/200(L)-- --dict:125/300(L)-- --dict:44/200(L)-- --dict:138/224(L)--Current allocation mode is localLast OS error: 2Current file position is 267478928GPL Ghostscript 8.71: Unrecoverable error, exit code 1
I get the same error with Ghostscript 8.64, but on my laptop, using the fink version, it works. Similarly, there are errors with the postscript, so I'm led to believe it's an error in latex:
$ latex --versionpdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009)kpathsea version 5.0.0Copyright 2009 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).There is NO warranty. Redistribution of this software iscovered by the terms of both the pdfTeX copyright andthe Lesser GNU General Public License.For more information about these matters, see the filenamed COPYING and the pdfTeX source.Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).Compiled with libpng 1.2.39; using libpng 1.2.39Compiled with zlib 1.2.3; using zlib 1.2.3Compiled with xpdf version 3.02pl3
No idea what the cause is but it's time to start documenting steps and looking for a workaround. Compiling on the lappy isn't a good option.
Gildas CLASS
It's absurdly difficult to find help on GILDAS Class, probably because you can't google "class" and most people probably don't label every piece of code with "GILDAS class". Anyway, here are some scripts that I refer back to often: file in August2009BGPS.datfile out August2009fits.dat multipleon error "file out August2009fits.dat"say "READ IN FILES"define character sourcelist*10[300]accept sourcelist /column observed_sources.txton error "continue"get 1001set window -100 160set mask -400 -100 160 400set mode x -400 400set align velocityfor i 1 to 161 say "Working on SOURCE "'i' find /source 'sourcelist[i]' /telescope "CSO 4GHZ IF1" /offset 0 0 /quality 5 average on error "@avplot2 'sourcelist[i]' 'i'; next" base 3 line 0 min plot vis write i! on error "continue"next and file in araya-2004.clsfinddefine character filename*20for i 1 to 20 say "Working on source "'i' get next let filename "araya-2004_"'i'".fits" say "fits write "'filename'" /mode spectrum" fits write 'filename' /mode spectrumnext!file in araya-2002.cls!find!define character filename*20!for i 1 to 42 ! say "Working on source "'i'! get i! let filename "araya-2002_"'i'".fits" ! say "fits write "'filename'" /mode spectrum"! fits write 'filename' /mode spectrum!next
Histogram in Google Spreadsheet
It's not easy to make a histogram in google spreadsheets without replicating data. The "countif" function would be great, except it only allows very simple criteria. However, there's a workaround: =count(Filter('Grades'!V2:V30,'Grades'!V2:V30>0.9)) =count(Filter('Grades'!V2:V30,'Grades'!V2:V30<0.9,'Grades'!V2:V30>0.8)) The Filter() function returns an array, which can be operated on like any other set of cells. It's still not easy to make a nice-looking histogram, but the output of this process is at least usable.
Hosting on my mac
I'm hosting my website off my mac; it should be accessible to the outside world now: eta.colorado.edu. A few things went into this....
- Don't install the fink version. The two versions clash and depending on how you access your computer you could end up looking at entirely different directories (e.g. localhost and eta.colorado.edu referred to different sites for a while)
- The configuration file is /private/etc/apache2/httpd.conf
- I needed to change DirectoryIndex to index.htm (from index.html)
- uncommmented "LoadModule php5_module libexec/apache2/libphp5.so"
- had to allow override so that .htaccess files would work.
How do I print a multi-page postscript?
I want to print a multi-page postscript duplexed and, if possible, two per page. pstopng, pstopdf, and the variants failed me horribly by making postscripts that don't fit the bounding box at all. Any ideas? So far the best I've come up with is switching gnuplot's output to pdf, which is a workaround rather than a solution, but is useful nonetheless: set terminal pdf enhanced dashed
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.
IDL array indexing
array_indices(array, location) instead of that x mod n_e(), y / n_e() crap
IDL colors
To get IDL colors to 'work right' (i.e. a colortable has 255 colors etc), put this in a startup file:
device, true_color = 24, retain = 2, decompose = 0red = [0,1,1,0,0,1]green = [0,1,0,1,0,1]blue = [0,1,0,0,1,0]if not strcmp(getenv('DISPLAY'),'') then $ tvlct, 255*red, 255*green, 255*blue
IDL string conversion
Just a reminder to me: to convert an IDL number to a string, use string! `` s = string(x,format='(F10.5)')`` Also, Julian Date conversion