*UPDATE Table SET z = z/300000 where abs(z) > 2*

## Monday, May 28, 2012

### Set values to null in SQLite; table updating

## Saturday, May 26, 2012

### SDSS axis ratio measures

*
The model fits yield an estimate of the axis ratio and position angle of each object, but it is useful to have model-independent measures of ellipticity. In the data released here, frames provides two further measures of ellipticity, one based on second moments, the other based on the ellipticity of a particular isophote. The model fits do correctly account for the effect of the seeing, while the methods presented here do not.*

The first method measures flux-weighted second moments, defined as:

- Mxx = x^2/r^2
- Myy = y^2/r^2
- Mxy = x^y/r^2

In the case that the object's isophotes are self-similar ellipses, one can show:

- Q = Mxx - Myy = [(a-b)/(a+b)]cos2φ
- U = Mxy = [(a-b)/(a+b)]sin2φ

where a and b are the semi-major and semi-minor axes, and φ is the position angle. Q and U are Q and U in PhotoObj and are referred to as "Stokes parameters." They can be used to reconstruct the axis ratio and position angle, measured relative to row and column of the CCDs. This is equivalent to the normal definition of position angle (East of North), for the scans on the Equator. The performance of the Stokes parameters are not ideal at low S/N. For future data releases, frames will also output variants of the adaptive shape measures used in the weak lensing analysis of Fischer et al. (2000), which are closer to optimal measures of shape for small objects.

Isophotal Quantities*A second measure of ellipticity is given by measuring the ellipticity of the 25 magnitudes per square arcsecond isophote (in all bands). In detail, frames measures the radius of a particular isophote as a function of angle and Fourier expands this function. It then extracts from the coefficients the centroid (isoRowC,isoColC), major and minor axis (isoA,isoB), position angle (isoPhi), and average radius of the isophote in question (Profile). Placeholders exist in the database for the errors on each of these quantities, but they are not currently calculated. It also reports the derivative of each of these quantities with respect to isophote level, necessary to recompute these quantities if the photometric calibration changes.
*

## Thursday, May 24, 2012

### Including source code in LaTeX document

*\begin{verbatim}/\end{verbatim}*commands. However, updating the source from the script directly is way neater . I use the

*listings*package to do this.

### Counting occurences of a particular word in a file

i had to calculate how many objects NED database found near determined positions had no definite redshifts. I parsed the NED output files using NED_batch_compact_parser.py by Min-Su Shin.

NED writes out*None*for quantities it does not find, so I used

*grep -o None ned_output.txt | wc -w*

## Wednesday, May 23, 2012

### NED batch job form

It's amazing what contrived workarounds are constructed in public astronomical databases in order to avoid letting people see and harness the SQL underneath. Here's a setup file for NED batch jobs tool I made to work finally:

OUTPUT_FILENAME test.csv OUTPUT_OPTION compact COMPRESS_OPTION none INPUT_COORDINATE_SYSTEM equatorial OUTPUT_COORDINATE_SYSTEM equatorial INPUT_EQUINOX J2000.0 OUTPUT_EQUINOX J2000.0 EXTENDED_NAME_SEARCH yes OUTPUT_SORTED_BY Distance_to_search_center REDSHIFT_VELOCITY 1000.0 SEARCH_RADIUS 0.05 BEGIN_YEAR 1900 END_YEAR 2012 IAU_STYLE S FIND_OBJECTS_NEAR_POSITION 177.34806988d; -1.08377011d; 0.05 REDSHIFT Unconstrained UNIT z INCLUDE INCLUDE ALL Galaxies X GClusters X Supernovae _ QSO X AbsLineSys _ GravLens _ Radio _ Infrared _ EmissnLine X UVExcess X Xray X GammaRay _ GPairs _ GTriples _ GGroups _ END_INCLUDE EXCLUDE Galaxies _ GClusters _ Supernovae _ QSO _ AbsLineSys _ GravLens _ Radio _ Infrared _ EmissnLine _ UVExcess _ Xray _ GammaRay _ GPairs _ GTriples _ GGroups _ END_EXCLUDE END_OF_DATA END_OF_REQUESTS

### Left outer joins in SDSS

I was selecting two samples from the SDSS DR7: one which was only redshift-selected, and another which had no cuts in redshift, but was diameter-limited. I wanted to keep the redshift information for the diameter-limited sample (wherein not all galaxies have spectroscopic redshifts), if it was available for a particular galaxy. Hence, outer joins.