Monday, December 17, 2012

lit: Tully-Fisher relation in SDSS bands

Pizagno et al., attention-worthy. After skimming through it, I had an idea of running GALFIT through my sample and getting better values of b/a ratios and PA's. I have a pretty good value of the sky, so why not model it?

Sunday, December 16, 2012

Matplotlib: errorbar throws a ValueError: too many values to unpack

I've been working on the errorbars in Matplotlib, and kept getting this error.
To avoid it, check your array dimensions: errorbar(), unlike scatterplot(), keeps on insisting on (x, ) error array dimensions.
1D arrays (vectors) in Numpy can be of shape (x, 1) or (x, ). That's usually interchangeable, but in cases like that, np.reshape(x, (x.shape[0], )) does the trick.
I think hope there is a deep underlying reason for that.

Matplotlib: zorder kwarg

One can pass zorder kwargs in order to change the depth preference of plots/errorbars/etc:
scatter_kwargs = {"zorder":100}
error_kwargs = {"lw":.5, "zorder":0}

scatter(X,Y,c=Z,**scatter_kwargs)
errorbar(X,Y,yerr=ERR,fmt=None, marker=None, mew=0,**error_kwargs )

Matplotlib: no edge for marker

"edgecolor = None" sets the point edge colour to the default value, which is black. "edgecolor = "none"" removes the border altogether. I can't stand stuff like this.

Tuesday, December 4, 2012

The select for my TF sample

SELECT m.califa_id, h.name, h.hubtype FROM mothersample as m, nadine as n, morph as h, flags_new as f where (n.ba > 0.3) and n.califa_id = m.califa_id and h.hubtype = 'S' and n.califa_id = h.califa_id and f.sum = 0 and f.califa_id = n.califa_id
edit: here's the new one, selecting galaxies with available kinematics data from CALIFA: SELECT distinct h.rowid, n.ba, h.name, j.name, f.sum, n.ba, h.hubtype FROM nadine as n, flags_new as f, morph as h, tf_maps_list as j where h.name =j.name and h.hubtype='S' and h.califa_id = n.califa_id and n.ba > 0.3 and n.ba < 0.9 and f.sum = 0 and f.califa_id = n.califa_id

Pyfits clobber=True keyword

Permits overwriting existing file, if set. e.g.: hdu.writeto(filename+'.fits', clobber=True)