# # Finding Brown dwarfs in 2MASS by using TAP service to query and # crossmatch data. # Authors: Hendrik Heinl and Markus Demleitner. # # This script is part of the EuroVO tutorial about browndwarfs and # demonstrates how to identify brown dwarfs candidates from 2MASS and # crossmatch the results with SDSS and SIMBAD. Though originally # designed to work with Topcat, here are the steps following a Makefile # script using the stilts library. # We decided to embed the stilts part into a Makefile, because this # gives us a few desirable features during devolpment and maintenance. # # Any questions, comments and critics go to gavo@ari.uni.heidelberg.de # # Acknowledgments go to Marc Taylor for TOPCAT and the underlaying # library STILTS, and the GAVO project settled at the Astronomical # Computing Institut at the University of Heidelberg. # Depending on the installation and the system, the path to STILTS can # be defined once here. If you already set the variable STILTS in your # environment, this setting will be used instead. STILTS?=/usr/share/stilts/stilts # Define target t3.vot: # Fast query: searching 2MASS and crossmatching with SDSSdr7 tq.vot: $(STILTS) tapquery \ tapurl='http://dc.zah.uni-heidelberg.de/__system__/tap/run/tap' \ omode=out \ out=tq.vot \ ofmt=vot \ adql="SELECT * \ FROM sdssdr7.sources AS sdss \ JOIN ( SELECT TOP 100000 \ tm.raj2000, tm.dej2000 \ FROM twomass.data AS tm \ WHERE 1=CONTAINS( \ POINT('ICRS', tm.raj2000, tm.dej2000), \ CIRCLE ('ICRS', 127.0000, 1.2000, 2.0)) \ AND tm.jmag > 15.3 \ AND tm.jmag-tm.kmag > 0.8 ) AS ttm \ ON 1=CONTAINS ( \ POINT('ICRS', sdss.ra, sdss.dec), \ CIRCLE('ICRS', ttm.raj2000, ttm.dej2000, 2./3600.)) \ AND sdss.i - sdss.z BETWEEN 1.5 AND 2 \ AND sdss.r - sdss.i BETWEEN 1.5 AND 4.5" # First query: Searching 2MASS t1.vot: $(STILTS) tapquery \ tapurl='http://dc.zah.uni-heidelberg.de/__system__/tap/run/tap' \ omode=out \ out=t1.vot \ ofmt=vot \ adql="SELECT TOP 100000\ tm.raj2000, tm.dej2000 \ FROM twomass.data AS tm \ WHERE 1=CONTAINS( \ POINT('ICRS', tm.raj2000, tm.dej2000), \ CIRCLE ('ICRS', 127.0000, 1.2000, 2.0)) \ AND jmag > 15.3 \ AND jmag-kmag > 0.8 " # Crossmatch with SDSS. t2.vot:t1.vot $(STILTS) tapquery \ tapurl='http://dc.zah.uni-heidelberg.de/__system__/tap/run/tap' \ omode=out \ nupload=1 \ upload1=t1.vot \ upname1=tab \ out=t2.vot \ ofmt=vot \ adql="SELECT \ tm.* , sdss.*\ FROM sdssdr7.sources as sdss \ JOIN tap_upload.tab AS tm \ ON 1=CONTAINS( \ POINT('ICRS', sdss.ra, sdss.dec), \ CIRCLE('ICRS', tm.raj2000, tm.dej2000, 2./3600.)) \ AND sdss.i - sdss.z BETWEEN 1.5 AND 2 \ AND sdss.r - sdss.i BETWEEN 1.5 AND 4.5 " #Crossmatch with SIMBAD t3.vot:t2.vot $(STILTS) tapquery \ tapurl='http://simbad.u-strasbg.fr/simbad/sim-tap' \ omode=out \ nupload=1 \ upload1=t2.vot \ upname1=t1\ out=t3.vot \ ofmt=vot \ adql="SELECT \ TOP 1000 \ pb.otype , tj.* \ FROM basic AS pb \ RIGHT OUTER JOIN tap_upload.t1 AS tj \ ON 1=CONTAINS( \ POINT('ICRS', pb.ra, pb.dec), \ CIRCLE ('ICRS', tj.raj2000, tj.dej2000, 5./3600.))" t4.vot: $(STILTS) tapquery \ tapurl='http://simbad.u-strasbg.fr/simbad/sim-tap' \ omode=out \ out=t4.vot \ ofmt=vot \ adql="SELECT \ TOP 1000 \ pb.otype \ FROM basic AS pb \ " t3a.vot:t2.vot $(STILTS) coneskymatch \ ifmt=votable \ istream=false \ in=t2.vot \ omode=out \ out=t3a.vot \ ofmt=vot \ ra=raj2000 \ dec=dej2000 \ sr=0.000416667 \ find=all \ copycols=* \ scorecol=0 \ erract=abort \ ostream=false \ fixcols=all \ servicetype=cone \ serviceurl=http://vo.bsdc.icranet.org/wdsdss10/q/cone/scs.xml? \ verb=3 \ emptyok=true clean: rm -f *.vot