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.
Articles by Adam (keflavich@gmail.com)
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*blueIDL 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
IDL syntax highlighting in VIM
I've edited my idlang.vim to auto-identify files that start with a semicolon. Add Line 19: `` syn match idlangStatement "^s*;s"`` Line 61/2 (allow spaces before ;): syn match idlangComment "\s*[\;].*$" contains=idlangTodo AG
IDL-to-Python
astrobetter started up an idl-to-python guide on their wiki.
.inputrc
New unix stuff! This is, again, stuff I'd searched for forever but never found the right collection of terms. This is what bash readline is REALLY all about. if you make an inputrc file, you can get awesome readline capabilities (similar to ipython). This post at lifehacker showed me how to do it. This site has a more complete description of how to use readline/inputrc. Even better: VI command line editing. There's also something called magic space but I don't know what purpose it serves all the time... it will replace 'magic' characters like !* and !& and !! with whatever command they represent if you hit space immediately after typing them (explained better here). Wow. Awesome.