Monday, November 24, 2008

.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.

Thursday, November 20, 2008

MOVIES!

Making movies is surprisingly difficult. No matter what language you use, apparently true movie files can only be made by stringing together images, i.e. there is no native movie-producing feature. Gnuplot can do some simple animations but to do anything sophisticated you need to start delving into variables, and for that I switch to a real language.

So, I returned to python. As usual, it took no more than a few hours of coding and learning to come up with something. But it bothers me that it took that long: I still think python is most deficient in its failure to create a default column-text reader like 'readcol' in IDL. I can't complain that much, though: I wrote my own in about 5 minutes.

Anyway, the key is to use the .set_xdata and .set_ydata functions of a plot to update a canvas. I still don't have nearly as high a plotting speed as I'd like, but it works alright if I don't display to screen. Probably a different backend would be more effective but I don't like to mess with backends.

I use savefig(filename,dpi=50) to reduce the image quality so that it's easier for the animator to handle.

ImageMagick's convert can be used to stitch any kind of image into a movie given that you've installed an mpeg2 encoder (fink gave me mpeg2vidcodec ). The command is very simple:

convert -size 300x300 *.png movie.mpg


I had to use a smaller image size because a series of 1000x12kb files somehow chomped ~6-8 GB of RAM and swap space.

Monday, November 17, 2008

Screen cont'd

Guide to screen

Particularly useful features:

Scrollback:

ctrl-a [
[scroll keys]


Switch to a numbered screen (doesn't work for me so far):

ctrl-a [number]

Sunday, November 16, 2008

Ultimate today

We went 2-1 in the tournament, losing the final in a windy game on universe point, 15-14. We won the first game 13-5 or 13-6, and the second by a similarly wide margin. I think I scored 15-20 points on the day and threw an additional few. 2-3 drops and 3-4 throwaways to balance that out. Pretty good on the whole for what was probably my last ultimate of the season.

Of course, that made me very exhausted for the review session this evening. Oh well, I think it worked out. I need to remember to come up with (and post!) a clear explanation of why you can use that silly little triangle to come up with the translation between angle on the sky and image size.

Thursday, November 13, 2008

Eta Carinae

Post #4 and I'm diverging from the purported theme. But it's Eta Carinae, it must be discussed!

Eta Carinae is the most amazing object in the sky, in my opinion. It has been the most active nearby (around 2 kiloparsecs, or 6000 light-years, distant - close only relative to, say, the Galactic Center or other galaxies) object in the past few centuries. In 1840 it brightened by a few magnitudes, and it has been discovered since then that this event was a huge explosion.

But it wasn't a 'normal' explosion. Most exploding stars blow up and die in supernovae. Those are awesome events that sometimes completely annihilate a star and sometimes leave a black hole or neutron star behind.

This explosion was nearly as powerful as a supernova, but the star is still there. And it turns out that there are TWO stars there. There are a number of different theories going around, but this system is incredibly difficult to observe because there's just so much stuff there.

The prevailing theory is that there are two stars, one around 80 solar masses, the other around 20. Either one of these on its own would be pretty big, hot, and impressive. Two together is something pretty impressive - but actually not that uncommon.

Other pairs of hot, massive stars are observed frequently. One example is WR 40, in which two 80 solar mass stars are orbiting one another. The curious thing is that most of these massive stars have very circular orbits, but in Eta Carinae the small star has a very eccentric orbit around the large star.

One explanation for this - which is not widely accepted yet because it's very hard to confirm, but it's plausible - is that Eta Carinae used to be a nearly equal-mass binary system like WR40, but one of the stars blew off its outer envelope (the outer part of the star) in a huge explosion, and when it lost this mass its orbit changed. One bit of evidence in favor of this hypothesis is that the small star has a very fast wind - 3000 km/s, which is faster than any normal star's wind. Wolf Rayet stars have winds that fast, though, and they are stars with blown-off envelopes. It's going to take a lot of skilled observations to confirm this, though.

Another neat thing is that the smaller star disappears on its closest approach to the large star. Why? The large star is losing mass at a very fast rate - about a Jupiter mass every year! That's more than a million times as fast as the sun is losing its mass in the Solar Wind. All of this mass loss has an interesting result - you can't see the star, you only see the outside of its wind. But the small star passes inside the 'sphere' that is producing the wind, and so it's as though the small star was going inside the large one! You don't see it at all during closest approach.

I get excited about this star... I'd like to add a lot more on it, and so you might see Luminous Blue Variables as a recurring theme on this blog. I hope to post a lot of pictures and add some links to references too.

BASH discoveries, readline questions

1. shopt -p
Maybe my hostname completion worked and then stopped working because the bash option hostcomplete was not set. Duh! Why? I don't know. Anyway, shopt -s hostcomplete solves the problem.

nocaseglob is also pretty cool (case insensitive tab completion)

2. it's really hard to search for readline stuff on google. Can anyone explain to me how BASH readline works? I would REALLY like to make bash readline work like ipython, in which you can start typing a command and hit the 'up' key to search through the history for anything beginning with the stuff you've typed up to that point. But I can't even find documentation for the ipython readline! Any hints, anyone?

3. my desktop at work blocks ssh connections. I can ssh into some computers and then into it, but not directly into it.

...as usual, I made a list where not-a-list would have sufficed, and I had to add the last thing because a 2-item list is dumb.

Wednesday, November 12, 2008

Why do astronomers have such a strong presence on the web?

I'm not making this a complete post, just a few examples of blogs and websites I'm aware of. But we do have a strong presence on the web - astronomers have an unusually high google ranking etc. Is it just because 'we' were here first ('we' excludes me, I'm just jumping on the bandwagon and getting a free ride)?

Examples:
Pamela Gay
Dr Lisa

Science writers who write on astronomy:
Dave Mosher

Sunday, November 9, 2008

Galactic Center Photo Contest


The NRAO Photo Contest

The Galactic Center and the surrounding Central Molecular Zone comprise the most active star formation region in the Milky Way. This 2 x 1 degree field was imaged at 20 cm (purple) with the NRAO Very Large Array, tracing H II regions that are illuminated by hot, massive stars, supernova remnants, and synchrotron emission. Emission at 1.1 mm (orange) was observed with the Caltech Submillimeter Observatory and highlights cold (20-30 K) dust associated with molecular gas. Some of this material will form stars within in the next few million years; the remainder will be blown away. The diffuse cyan and colored star images are from the Spitzer Space Observatory's Infrared Array Camera. The cyan is primarily emission from stars, the point sources, and from polycyclic aromatic hydrocarbons (PAHs), the diffuse component.

My view of the Galactic Center is the winner of this year's NRAO photo contest. It displays a multiwavelength view of the galactic center. The caption at the NRAO photo contest (reproduced above) describes it well, but I will go into further depth here.

The 'arches' are the large purple filamentary structures seen near the brightest point in the map, Sgr A*, the center of our galaxy. They are thought to be large scale magnetic fields possibly generated by winds from hot stars. Farhad Yusef-Zadeh, my collaborator on the photo, leads the study of radio emission from the Galactic Center.

The orange color is 1.1mm emission, which means that we're seeing something completely different. This light actually comes from dust. We usually see dust in absorption because in the optical, it blocks light. There is so much dust between us and the Galactic Center that we can't see it at all at optical wavelengths.

Sagittarius B2 is the bright blob just to the left of center. It is the most massive collection of gas and dust in our galaxy. It is full of different types of molecules including complex organic molecules. A new generation of massive stars is thought to be forming there.

Spitzer's 8 micron view is presented in cyan. Mostly this comes from PAH, Polycyclic Aromatic Hydrocarbon, emission. PAHs are big molecules with lots of Carbon and Hydrogen chained together. Stars are visible at these wavelengths because the dust isn't as effective at blocking out infrared light - but look closely at the orange regions on the right side of the image. You might notice that not only is there dust there, but there's also less PAH emission visible. This is because on the right side of the Galactic Center, the spiral arm is behind the dust, and on the left side it is in front. When dust blocks out infrared light, the object we see is called an 'infrared dark cloud'. These clouds are usually places where star formation has not yet started, but will soon.

This image was created using GIMP, the Gnu Image Manipulation Program, using a variety of layers, opacities, etc.