# Run with jystilts (java -jar jystilts.jar) # Jar file: http://www.starlink.ac.uk/stilts/jystilts.jar # Recreates colour magnitude diagram from Gaia Collaboration 2016b paper. from stilts import * # Set up the ADQL (copied from the paper). query = """ select gaia.source_id, gaia.hip, gaia.phot_g_mean_mag+5*log10(gaia.parallax)-10 as g_mag_abs_gaia, gaia.phot_g_mean_mag+5*log10(hip.plx)-10 as g_mag_abs_hip, hip.b_v from gaiadr1.tgas_source as gaia inner join public.hipparcos_newreduction as hip on gaia.hip = hip.hip where gaia.parallax/gaia.parallax_error >= 5 and hip.plx/hip.e_plx >= 5 and hip.e_b_v > 0.0 and hip.e_b_v <= 0.05 and 2.5/log(10)*gaia.phot_g_mean_flux_error/gaia.phot_g_mean_flux <= 0.05 """ # Run the TAP query at GACS (note 100krow limit) colormag = tapquery(tapurl='http://gea.esac.esa.int/tap-server/tap', adql=query, sync=True) # Plot the result. plot2plane(layer1='mark', in1=colormag, x1='b_v', y1='g_mag_abs_gaia', yflip=True)