first orbit!

Date Category Gaming
First successful orbit! Barely had enough fuel for de-orbiting, but hey I landed safely!
screenshot6
screenshot12


Aquarium webcam

I’m headed out of town for a bit and I’d like to keep an eye on my tank. Luckily linux has software that can do that called motion (obtained via apt-get install motion). You can do all sorts of things with it like time lapse photography, stream at whatever fps you like, auto adjust brightness, etc etc. Had to remove the filter from my ps3eye so a little too much IR is showing through, but it should be sufficient to make sure everything isn’t dying, here’s a live picture (refresh to get a new one):

Aquarium!

[iframe src="http://192.168.1.18:8083/?action=stream"]

edit: something to check out in the future for a more permanent solution - zoneminder


OSX mouse lag…

Apparently I’ve been spending my time in OSX gimped by an unnoticed mouse lag. There’s always been something different between windows and OSX when it comes to mouse movement but I could never quite put my finger on it. Was it the mouse acceleration curve, or something else? Just ran across some software thanks to reddit that makes the mouse feel a hell of a lot like windows called SmoothMouse. The only problem is…my mouse bindings for mission control no longer work.

Time to give USB Overdrive another shot…lets hope this reboot doesn’t kill the machine.

EDIT: Kernel did not panic….so far so good…


continued trouble with surface density estimations

Question: does the mass-weighted Sobolev/HSML surface density per-particle along a column make any sense? I’m not so sure it does as the idea of a single SPH particle having it’s own surface density is kind of a stretch in it’s own right. To take a deeper look I ran through the grid calculation again, but this time I returned the grid indexes [x,y] for each particle. I then plotted the calculated (smoothed) $$\Sigma$$ value for each cell vs. the raw per-particle $$\Sigma_{\rm{sob}}$$ value. The result was a little different than I was expecting:
perpixelsobolev
At first I thought it was wrong. But then I took a deeper look at the radial values for Sobolev/Sigma from a previous post (bottom left panel):
sobolevpixels
and realized that they were indeed correct. This is basically telling us that there is signifiant spread in the Sobolev surface density values with a pretty substantial under-estimation as very few of those blue dots lie on the 1-to-1 line. HSML looks very similar, but the normalization is slightly higher. And apparently when one takes the mass-weighted average along a column (with smoothing), the mass contribution spills into neighboring cells pretty significant lowering the sobolev $$\Sigma$$ substantially.

The saga continues…still no clear direction in how to resolve this issue.



customizing matplotlib’s legend()

I am constantly needing to customize the legend() in python. Whether it be changing the marker size, the line width, or the fontsize I’m constantly looking things up. There’s an easy way to set this at the beginning of your script; as an example:
params = {'legend.fontsize' : 16,
'legend.linewidth' : 1.5,
'legend.markerscale' : 3}
rcParams.update(params)
You could easily add other options such as modifying the handlelen (line width), font, etc etc. All options can be found via matplotlib’s legend() api site.

dynamic geometry!

I ran across a program in my downloads and figured it deserved some notation. I’ve only put it to use once when looking into the Toomre-Q parameter (disk stability), but I can see where it may come in handy down the road. It’s basically a geometrical toy set called C.A.R.Metal. You can define angles/lines/circles/vectors/etc., then move those points and everything dynamically adjusts! Great for messing with angles and the like. Here’s an old image from my toying with it for reference:
angle1
So as an example, you could grab one of those points and move it about. As you move it around the numbers corresponding to those angles change and update dynamically.

random header images for homepage

PHP isn’t so bad once you get the hang of it! The use of the glob() function allowed me to query all images in a given folder, and stick them in an array. So now I can dynamically update my header images without having to mess with the PHP code itself. The important segment is found in header.php, or header-xxxx.php depending on what you’re calling:
<?php
$imgarray = glob("./wp-content/headers/homepage/\*.\*",1);
$cnt = count($imgarray);
$rn = rand(0,$cnt-1);
$img = $imgarray[$rn];
?>
FYI glob() requires an absolute path…so you can’t simply use the content_path() function as I was before. However, now I can drop all the images I want into wp-content/headers/homepage and they will automatically be added to the list of possible images. I just have to remember to crop them properly to 1040x250 or they’ll show up as their original size.

mass-weighted Sobolev/HSML column values

Ken suggested I revisit the particles per grid-cell comparison - i.e. Grid vs. Sob, Sob vs. HSML, and Grid vs. HSML. In order to do this so that each grid corresponds to one value, I have to take the mass-weighted average of the Sobolev/HSML values within a given grid-cell:
\begin{equation*} <\Sigma_{\rm{Sob}}>_{\rm{MW}} = \Sigma_\rm{((Sob,or,HSML)}\times \rm{mass})/\Sigma_\rm{mass} \end{equation*}

I then have a single \(\Sigma\) value per grid-cell and can make a direct comparison:

sobolevpixels
(plot made with gal_reduction/tools/sigmacompare.py via PIXELPLOT==1)

In an ideal situation, each line would lie on the one-to-one dotted black line. Unfortunately both Sobolev and HSML values under estimate the grid values. The good news is that there isn’t much difference due to the resolution. We might have to examine more galaxies within our sims in a similar fashion to see if this under prediction takes place at the same surface densities; if that is the case we can easily incorporate some sort of correction factor. But that leads to the question - how many galaxies do we have to look at?

In making this plot I learned how to stick the legend outside of the plot. It’s as simple as passing bbox_to_anchor to the legend() call:
legend(bbox_to_anchor=(0.1,1.05),loc=3,shadow=True,fancybox=True)
this is a tiny bit tricky in that the anchor is attached to the loc. So if loc=3 then the anchor for the box is attached to the bottom left corner of the legend box. Also the x,y coordinates are in absolute figure positions. This is thanks to matplotlib and stack overflow.

Next up was Ken’s concern about the histograms I was sending him. Further inspection showed that simply passing ‘bins=50’ is not necessarily the best idea to properly represent the data. By default hist() takes the min & max of the data then splits it into N bins. The problem here is that if you’re comparing two different datasets then if they span a different range then the binsizes will differ. To circumvent this issues I simply specified the binsize manually via altering my histo() function call a tiny bit:
def histoit(values,COLOR,LABEL,HLS,BINSIZE=0.1):
indexes = where(values>0)[0] ##prevents -inf
vals = log10(values[indexes])
binner = arange(min(vals),max(vals),BINSIZE)
hist(vals,color=COLOR,log=True,
bins=binner,
label=LABEL,histtype='step',lw=1.5,ls=HLS)
With this quick fix the data looks much more comparable, here’s the before and after:

[table] Before,After [/table] better right? hello?


And last but not least, I’ve plotted the gas particle positions for this galaxy at all three resolutions for visual inspection:
ledisks
we go from slightly compressed cloud, to fluffy pancake, to regular pancake!