Dienstag, 24. April 2018

Gaia DR2 day0 queries cut and paste

# get all stars with good parallaxes and RGC>12 kpc
SELECT top 100000 *
FROM gdr2mock.main
   WHERE
     parallax/parallax_error  > 8.
      AND
      sqrt( power(8.2-(1./parallax)*cos(l/57.29),2) + power((1./parallax)*sin(l/57.29),2.) )> 12.
      AND
     random_index between 1 and 100000



# find the Ophiuchus stream
select *
from gaiadr2.gaia_source
where
l between 1 and 9
and
b between 27 and 34
and
1./(7.2+0.66*(6.5-l)) < parallax + 2*parallax_error
AND
1./(7.2+0.66*(6.5-l)) > parallax - 2*parallax_error


# get all stars with good parallaxes and RGC>12 kpc
SELECT top 100000 *
FROM gdr2mock.main
   WHERE
     parallax/parallax_error  > 8.
      AND
      sqrt( power(8.2-(1./parallax)*cos(l/57.29),2) + power((1./parallax)*sin(l/57.29),2.) )> 12.
      AND
     random_index between 1 and 100000



# find the Ophiuchus stream
select * 
from gaiadr2.gaia_source
where
l between 1 and 9
and
b between 27 and 34
and
1./(7.2+0.66*(6.5-l)) < parallax + 2*parallax_error
AND
1./(7.2+0.66*(6.5-l)) > parallax - 2*parallax_error 

select *
from gaiadr2.vari_rrlyrae left outer join gaiadr2.gaia_source on (gaiadr2.vari_rrlyrae.source_id = gaiadr2.gaia_source.source_id)

select *
from gaiadr2.vari_cepheid left outer join gaiadr2.gaia_source on (gaiadr2.vari_cepheid.source_id = gaiadr2.gaia_source.source_id)

select *
from user_hrix.apogee_the_payne_coords left outer join gaiadr2.gaia_source on (user_hrix.apogee_the_payne_coords.source_id = gaiadr2.gaia_source.source_id)

select *
from gaiadr2.gaia_source 
WHERE 
random_index between 1 and 600000

select *
from gaiadr2.gaia_source 
WHERE 
radial_velocity IS NOT NULL
and 
random_index between 1 and 600000


select ra,dec,l,b,parallax,parallax_error,pmra,pmra_error,pmdec,pmdec_error,phot_g_mean_mag,phot_bp_mean_mag,phot_rp_mean_mag
from gaiadr2.gaia_source 
where parallax > 20. 


select ra,dec,l,b,parallax,parallax_error,pmra,pmra_error,pmdec,pmdec_error,phot_g_mean_mag,phot_bp_mean_mag,phot_rp_mean_mag,radial_velocity,radial_velocity_error,teff_val
from gaiadr2.gaia_source 
where
radial_velocity IS NOT NULL

select ra,dec,l,b,parallax,parallax_error,pmra,pmra_error,pmdec,pmdec_error,phot_g_mean_mag,phot_bp_mean_mag,phot_rp_mean_mag
from gaiadr2.gaia_source 
where parallax > 10.


# select RC stars around sag
SELECT source_id,ra,dec,parallax,parallax_error,pmra,pmra_error,pmdec,pmdec_error,phot_g_mean_mag,bp_rp,phot_variable_flag,teff_val
FROM gaiadr2.gaia_source
WHERE
(l < 20) or (l>352)
and
b between -45 and 25
AND phot_g_mean_mag + 1.27 -1.5* (bp_rp) between 17.1 and 17.6
and
power( (pmra+2.7)*(pmra+2.7)+(pmdec+1.4)*(pmdec+1.4), 0.5) < 0.7

Keine Kommentare:

Kommentar veröffentlichen