Help support

Should you have any question, please contact the Euclid Helpdesk

Query examples

1. Cone search around NGC 6505 ("Altieri's ring") using a 0.1 degrees radius

Note that radius unit is decimal degrees.

Target table: mer_catalogue

Query:
SELECT right_ascension, declination, object_id, vis_det, det_quality_flag, flux_detection_total, flux_vis_sersic, flux_y_sersic, flux_j_sersic, flux_h_sersic,  segmentation_map_id, segmentation_area, kron_radius, DISTANCE(267.78, 65.53, right_ascension, declination) AS dist
FROM mer_catalogue
WHERE DISTANCE(267.78, 65.53, right_ascension, declination) < 0.1

2. Photometric redshift classification in a 0.1 degrees radius centred on NGC 6505 ("Altieri's ring")

Target table: mer_catalogue

Query:
SELECT mer.right_ascension, mer.declination, phz_class.*
FROM mer_catalogue AS mer
JOIN phz_classification AS phz_class USING (object_id)
WHERE DISTANCE(267.78, 65.53, mer.right_ascension, mer.declination) < 0.1

3. Count candidate stars in the phz_star_sed catalogue

Target table: phz_star_sed

Query:
SELECT count(*)
FROM phz_star_sed
WHERE phz_star_prob > 0.9

4. Select 10 sources with relative spectral redshift error < 10%

Target table: mer_catalogue

Query:
SELECT TOP 10 cat1.right_ascension, cat1.declination, cat1.point_like_prob, cat1.det_quality_flag, cat1.spurious_flag,
cat1.flux_detection_total, cat1.mumax_minus_mag, cat1.vis_det, cat1.flux_vis_2fwhm_aper, cat2.spe_z, cat2.spe_z_err
FROM mer_catalogue as cat1
JOIN spectro_zcatalog_spe_galaxy_candidates AS cat2 USING(object_id)
WHERE cat2.spe_z/cat2.spe_z_err > 10.0

5. Select top 20 brightest sources by flux_vis_sersic

Target table: mer_catalogue

Query:
SELECT TOP 20 right_ascension, declination, flux_vis_4fwhm_aper, flux_vis_psf, flux_vis_sersic, flux_detection_total,
det_quality_flag, spurious_flag, vis_det
FROM mer_catalogue
WHERE NULLIF(flux_vis_sersic, 'NaN') > 0.0
ORDER BY flux_vis_sersic DESC

6. Cone search to obtain the spectra (which can be downloaded via DataLink) of objects with 1 < z < 1.1 around a given position

Target table: spectra_source

Query:
SELECT spec.ra_obj, spec.dec_obj, spec.source_id, phz.phz_median, mer.flux_h_4fwhm_aper
FROM spectra_source AS spec
JOIN phz_photo_z AS phz
  ON spec.source_id = phz.object_id
JOIN mer_catalogue AS mer
  ON spec.source_id = mer.object_id
WHERE phz.phz_median BETWEEN 1.0 AND 1.1
AND DISTANCE(ra_obj, dec_obj, 75.0, -45.0) < 6.0

7. Get mosaic information (like tile_index) for the VIS observations that include a selected target by coordinates

Target table: spectra_source

Query:
SELECT *, DISTANCE(ra, dec, 267.78, 65.53) AS dist
FROM sedm.mosaic_product
WHERE DISTANCE(267.78, 65.53, ra, dec) < 0.5
AND instrument_name = 'VIS'

8. Photometric object classification for the sources that are likely galaxies detected in tile_index = 102158889

Target table: mer_catalogue

Query:
SELECT mer_cat.right_ascension, mer_cat.declination, mer_cat.segmentation_map_id, phz_class.object_id, phz_class.phz_star_prob, phz_class.phz_gal_prob, phz_class.phz_qso_prob
FROM catalogue.mer_catalogue AS mer_cat
JOIN phz_classification AS phz_class USING (object_id)
WHERE mer_cat.segmentation_map_id / 1000000 = 102158889 AND phz_class.phz_gal_prob > 0.8
ORDER BY phz_class.phz_gal_prob DESC