Example Queries for TAP Service

Catalogue in magnitudes of a tile image

Obtaining the catalogue in magnitudes of a tile image by its identifier (9654 in the example):

SELECT * FROM jpas.MagABDualObj WHERE TILE_ID = 9654

Catalogue in magnitudes of an object

Obtaining the catalogue in magnitudes of a known object by its identifier (number 25020 and image 9662 in the example):

SELECT * FROM jpas.MagABDualObj WHERE TILE_ID = 9662 AND number = 25020

Catalogue in f(nu) of a tile image filtering objects with problems

Obtaining the catalogue in f(nu) fluxes of a tile image by its name, filtering objects with problems in its detection:

SELECT m.* FROM jpas.FNuDualObj m, jpas.TileImage i 
WHERE i.tile_id = m.tile_id AND i.name = 'JPAS-T01-05102-v202406_iSDSS' AND (FLAGS[jpas::iSDSS] = 0 OR FLAGS[jpas::iSDSS] = 2048)

Number of objects per magnitude ordered by it

Obtaining the number of objects per magnitude ordering by magnitude:

SELECT ROUND(MAG_AUTO[jpas::iSDSS], 0) AS MAG, COUNT(*) FROM jpas.MagABDualObj GROUP BY MAG ORDER BY MAG

Images filtered by right ascension

Querying all columns and limiting the number of results, up to 50 rows, filtering images by right ascension:

SELECT TOP 50 * FROM jpas.TileImage WHERE ra > 214.8 AND ra < 214.9 

Images filtered by filter

Selecting image by filter using an enumeration to identify the filter:

SELECT * FROM jpas.TileImage 
WHERE filter_id = jpas::uJAVA

Cone search

Joining tables and using geometric functions to do a cone search:

SELECT m.alpha_j2000, m.delta_j2000, m.flux_auto, m.class_star, i.name, i.tile_id 
FROM jpas.FNuDualObj m, jpas.TileImage i 
WHERE m.tile_id = i.tile_id AND CONTAINS(POINT('', m.alpha_j2000, m.delta_j2000), CIRCLE('', 216.3795, 52.8092, .005)) = 1

All detections in reduced individual image for a particular object

Obtaining all the detections in the reduced individual images for a particular object detected in the iSDSS images with identifier (9662-25020):

SELECT f.filter_id, f.name AS filter_name, detect.* 
FROM jpas.MagABIndividual_DualObj detect 
JOIN jpas.ReducedIndividualImage rc ON rc.rc_id = detect.rc_id 
JOIN jpas.Filter f ON rc.filter_id = f.filter_id 
WHERE detect.TILE_ID = 9662 AND detect.TILE_NUMBER = 25020

Objects observed in all filters

Obtaining all the objects observed in all filters that are in tile images with identifier (9662):

SELECT * 
FROM jpas.FnuDualObj 
WHERE arr_contains_null(FLUX_AUTO) = 0 AND arr_contains(0, FLUX_AUTO) = 0 AND TILE_ID = 9662