| | 216 | == Make a colour-colour and colour-magnitude diagram of a stellar locus == |
| | 217 | |
| | 218 | {{{ |
| | 219 | region 17 35 2 |
| | 220 | avextract RA DEC g g:err r r:err z z:err |
| | 221 | # Define a logical vector to filter out "good" objects |
| | 222 | # Normally want to avextract & check the 'flag' vector, too, but |
| | 223 | # at the moment flag seems to be all 0 |
| | 224 | set in = g<20 && g:err<0.2 && r:err < 0.2 && z:err & 0.2 |
| | 225 | # Compute colours |
| | 226 | set gr = g-r |
| | 227 | set rz = r-z |
| | 228 | # Filter subsets |
| | 229 | subset gr_good = gr if (in) |
| | 230 | subset rz_good = rz if (in) |
| | 231 | # Plot a colour-colour diagram |
| | 232 | limits -1 3 -1 2 |
| | 233 | box |
| | 234 | plot gr_good rz_good |
| | 235 | # Write vectors to file |
| | 236 | write -f "%9.6f %9.6 %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f" PS1_17_35.dat RA DEC g g:err r r:err z z:err |
| | 237 | # Filter out nans |
| | 238 | !grep -v 'nan' PS1_17_35.dat > PS1_17_35_clean.dat |
| | 239 | }}} |
| | 240 | |
| | 241 | To get a control sample of the same region from SDSS, run this SQL query via the [http://cas.sdss.org/astrodr7/en/tools/search/sql.asp SDSS sql search] |
| | 242 | (the flag-checking part is the official recommendation from [http://cas.sdss.org/astrodr7/en/help/docs/realquery.asp#flags SDSS sample query]) |
| | 243 | {{{ |
| | 244 | select psfmag_g, psfmagerr_g, psfmag_r, psfmagerr_r, psfmag_z, psfmagerr_z into mydb.PS1_compare_CMD from star |
| | 245 | where ra between 15 and 19 |
| | 246 | and dec between 33 and 37 |
| | 247 | AND ((flags_r & 0x10000000) != 0) |
| | 248 | AND ((flags_r & 0x8100000c00a4) = 0) |
| | 249 | AND (((flags_r & 0x400000000000) = 0) or (psfmagerr_r <= 0.2)) |
| | 250 | }}} |
| | 251 | |
| | 252 | AND (((flags_r & 0x100000000000) = 0) or (flags_r & 0x1000) = 0) |
| | 253 | |