## Compiling MOOG on OSX

Just a quick post for those who want to compile Chris Sneden‘s spectral line analysis package MOOG. Chris provides many helpful Makefiles with the code, including a few for Mac computers. The problem is it assumes we’re using the g77 FORTRAN compiler. Most new Macs will only deal with 64-bit binaries, so we have to use gfortran instead. Just changing the FC variable in the Makefile results in the dreated “symbol not found” errors:

[...]
"_sm_ylabel_", referenced from:
_binplot_ in Binplot.o
_specplot_ in Specplot.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [MOOG] Error 1


## The Great Eclipse of 2017

Sixteen hours of driving is a lot. That’s how long it took us to drive the 888 miles from Pasadena, CA to Mackay, ID. But that’s what you do to see an event like the 2017 eclipse. Sure, we could have flown to Sun Valley or Boise, then drive, but we were bringing telescopes and other equipment, so we rented a Ford Expedition EL (the EL stands for “Extra Long”), packed up the family, and began the long drive across some of the most beautiful parts of the US. This is a journal of the travel and event.

Saturday, August 19th

The world’s largest thermometer, Baker, CA

Our first leg took us East on highway 210 to San-Bernardino, then up the 15 to Las Vegas. We stopped for the first time in Baker, CA. Famous for Alien Jerky (which we didn’t stop to try) and the World’s Tallest Thermometer. Pictured at right, you can’t quite tell that it’s nearly 100 F (38 C). Not much more time than to gas up, get some snacks for the road and then head out. We’re on a tight schedule!

The road continued on through the Mojave desert. I can still remember driving through this hot, dry landscape with our old 1992 Toyota Corolla (sans AC) on my drive to SoCal back in 2005. This time, we’ve got the Ford Expedition complete with cooled seats. It makes for quite a different driving experience. Continue reading

## What, If Anything, Does Dust Tell Us about Supernovae

Here’ s a talk I gave at a recent Type Ia supernova progenitors workshop held at Carnegie. I talk about the rather perplexing properties of interstellar dust as inferred by using type Ia’s a “standard crayons”.  Or is it really all that perplexing? These findings can also be found in more detail here.

## Got an old iSight?

Reading some online reviews of CMOS and CCD detectors for amateur telescopes, I often came across words to the effect of “basically a glorified web-cam”. It got me to thinking: my old iSight camera (the cylindrical ones we used to buy before they were built in to all Apple products) might fit into an eyepiece holder.

Alas, it was just a little too wide to fit in. But thanks to they guys at our machine shop, I soon had an adapter. Made from some scrap aluminum using a lathe.

The next step was to remove the lens from the iSight. The reason is that the camera will take the place of the eyepiece, and so the image from the telescope will be made directly on the CCD and you don’t want a lens in the way. Luckily, there are YouTube instructions for doing this, so I wasn’t flying blind. Continue reading

## A Tale of Three Samplers

A triangle plot that shows the covariance between model parameters.

This summer, I hired an undergraduate student to look into calibrating our CSP supernovae. I wanted to do some more sophisticated models and so we looked into a few MCMC modules for python: pystan, pymc, and emcee.

Each has its plusses and minuses. In fact, I found myself wanting to merge all three together into one system. So, in case anyone out there is wondering which of these to delve into, I’m posting a summary of the three. Also, I’ve been having fun with ipython notebooks for teaching this to my students and have made three versions of the same tutorial: fitting a linear model to data. You can look at each one here:

## From g77 to gfortran

Lots of friends and colleagues have been happily using g77 as their fortran compiler for years. Now, however, you can’t find an up-to-date g77 compiler very easily and we’re all supposed to start using gfortran. Here’s some tips for getting your old .f files to compile:

• Use the following command-line arguments when invoking the gfortran compiler to get better compatibility:
gfortran -ffixed-line-length-none -fdefault-real-8 -std=legacy -fd-lines-as-comments
• Two commonly used argument names for the OPEN() procedure have changed. Instead of specifying NAME=FNAME, use FILE=FNAME and instead of using TYPE=, use STATUS=.
• When linking with external libraries, you may find “symbol not found” errors, even though you know those symbols are defined in the library. This likely has to do with how many underscores (_) are in the symbol name. gfortran has some switches than can help:  -fsecond-underscore, -fno-second-underscore, depending on what the error reports and what the symbols are called in the library (use the ‘nm’ or ‘ldd’ command on the library to show it’s contents).

## AASTeX, BibTeX, and Journal style

I’ve now got a winning strategy for citations:  BibDesk, AASTeX, and a python script to clean it all up.

Keeping track of citations is a pain, but there are lots of great tools out there for keeping them all straight and eventually importing them into your papers.  For a while I was a big fan of Papers for Macs. But when I put it into practice, exporting to a BibTeX database and importing into an AASTeX manuscript, I was disappointed. Mostly because Papers fetches data from ADS, but doesn’t use the AASTeX macros for the different journal names. And I couldn’t customize it. Annoying.

That’s when I tried another combination: BibDesk (part of the MacTeX package). It’s a lot like Papers, though with less bells and whistles. But you can’t beat the price (free) and it has this really nice feature:  highlight any citation string (like 2011AJ….141…19B), right-click, and choose “Add to BibDesk”. Voila! Citation is imported from ADS complete with AASTeX journal macros.

There’s just one little problem:  the resulting \bibitem entries have all the author names. The ApJ and AJ Journal styles like to have one, two, three, four, or two with “et al.”. So I wrote a python script to parse a .bbl file and output it with the author entries all fixed up. You might ask:  why not update the BibTeX database instead. Well, I thought about that, but decided I wanted to keep the database in tact, in case I ever want to find someone deep down in the author list (like, say, me). So here’s my magic recipe:

1. Use BibDesk to maintain your .bib database:
1. Add entries using the magic right-click-on-ADS-string
2. Add entries by copying BibTeX entries to the clipboard.
3. Merge previous BibTeX databases
2. Use bibtex command as usual to build your .bbl file from your .tex manuscript.
3. Run my python script:
fix_authors ms.bbl
(it will make a backup of the original file:  ms.bbl.backup)
4. Re-run latex again. Maybe do that a couple of times. Just to be sure.

## Astronomy Lecture Series

Something I’ve worked hard on is the Carnegie Astronomy Lecture Series.  This is a very popular series of talks given primarily by Carnegie Astronomers on all sorts of astronomical topics.  They are usually given at the Huntington Library and Botanical Gardens and recently have been so full that people have been turned away.

The Huntington makes audio recordings and publishes when in iTunes U, but that doesn’t really work well in astronomy, which is highly visual.  So that’s when I decided to try and pair the Keynote/PowerPoint slides with the audio.  There here’s the result.

http://www.obs.carnegiescience.edu/news/huntington_online

## Beautiful Math

Installed a WordPress plugin called jetpack because it’s supposed to allow you to embed latex formulas in your posts/pages.  This alone could bring me over for good from plone.  So…  let’s give a try by writing out the bend equation I came up with:

$y\left(t\right) = \frac{\left(s_0 + s_1\right)}{2}t + \frac{\tau}{2}\left(s_1 - s_0\right)\ln\left[\cosh\left(\frac{t-t_{max}}{\tau}\right)\right] + c$

Whoa!  It worked!

## Pyflot anyone?

So this flot thing is pretty cool.  But I hate working in JS and most of my web tinkering is using Django, which is python-based.  So I wrote a quick and dirty module for generating flot output based on a python class.  Here’s how I reproduce their first flot example:

p1 = pyflot.Plot()
x1 = np.arange(0,14,0.5); y1 = np.sin(x1)
x2 = [0,4,8,9]; y2 = [3,8,5,13]
x3 = [0,7,None,7,12]; y3 = [12,12,None,2.5,2.5]
p1.plot(x1,y1,'-')
p1.plot(x2,y2,'-')
p1.plot(x3,y3,'-')
p1.htmlout('example1.html')

And here’s the output html to compare.