photo-z in particular area

33 views
Skip to first unread message

Alina

unread,
Oct 3, 2024, 10:38:12 AM10/3/24
to DECam Legacy Survey
Hi,
I would like to ask again for a help, as I tried a few complicated ways to download data, but for sure it must be more efficient and better way to do it. I am interesting in photometric redshifts for particular area, the catalogues ls_dr9.photo_z and ls_dr9.photo_z_9p1.
Is any easy query where I could put ra dec and it gives me output photo-z for the object in this area?
thanks!
Alina

Dustin Lang

unread,
Oct 3, 2024, 10:53:42 AM10/3/24
to Alina, DECam Legacy Survey
Hi,

The example query shown in the Datalab interface does an RA,Dec,radius query:

To get all sources within 5 arcminutes = 0.083 degrees of RA,Dec = 20, 30 degrees,

SELECT * FROM ls_dr9.photo_z WHERE 't' = Q3C_RADIAL_QUERY(ra, dec, 20.0, 30.0, 0.083)

If you have a list of RA,Dec position that you want to find photo-z values for, then you want to use the "cross-match" service.

cheers,
dustin



--
You received this message because you are subscribed to the Google Groups "DECam Legacy Survey" group.
To unsubscribe from this group and stop receiving emails from it, send an email to decam-legacy-su...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/decam-legacy-survey/a481e36b-361d-4443-ba8f-f4dea6949a81n%40googlegroups.com.

Jesse Palmerio

unread,
Dec 20, 2024, 4:23:06 PM12/20/24
to DECam Legacy Survey
Dear Dustin,

I have some follow-up questions/remarks, as I'm trying to do essentially the same thing and my attempts might be useful for other people.
I want to get the photo-z for sources in a given cone (ra,dec,radius) from a python script.

1) Your example uses the Datalab interface, if I've understood correctly, to perform the same query from a python script one would need to use the datalab client

2) The query does not work in your example, I think because the ls_dr9.photo_z table does not contain the ra,dec columns. My approach to solving this would be to query the ls_dr9.tractor table with the ra,dec,radius and get the release,brickid,objid for each object in the table to make a unique identifier hash as suggested, and then use this hash to query the ls_dr9.photo_z. Are you aware of a simpler way than this?

3) In general, is there a scriptable way to get the photo-z information for sources in the legacy survey Tractor or Sweep tables?

Cheers,

Jesse

PS: Thank you for all the work you've done for the community over the years, I particularly appreciate the astrometry.net service.

Dustin Lang

unread,
Dec 20, 2024, 4:34:46 PM12/20/24
to Jesse Palmerio, DECam Legacy Survey
Hi Jesse,

Right, the photo-z table is an add-on table so you would need to search in the ls_dr9.tractor table and then join on the "ls_id".

I'm not familiar with the datalab python client but that sounds likely for how you would script this up in Python.

The photo-z and tractor catalogs are released as large files covering RA,Dec rectangles on the sky - either the raw "brick" formats, 0.25 x 0.25 degrees, or the "sweeps" that gather up tens of square degrees to make a more manageable number of files.

Alternatively... and I hesitate to point out the availability of this interface... you can use the service that the sky viewer uses to generate a JSON result... this is meant for use by web browsers so it may be trimmed to 1000 objects.

cheers,
dustin


Jesse Palmerio

unread,
Dec 21, 2024, 7:16:31 AM12/21/24
to DECam Legacy Survey
Thanks Dustin,

I was able to get what I wanted.
Here is a minimal working example for those interested (note you need to have a logged in datalab account for this to work, follow the readme here):

from dl import queryClient as qc
result = qc.query(sql="""
SELECT TOP 10
    t.ls_id,
    t.ra,
    t.dec,
    p.z_phot_median
FROM
    ls_dr10.tractor AS t
JOIN
    ls_dr10.photo_z AS p
ON
    t.ls_id = p.ls_id
WHERE
    't' = Q3C_RADIAL_QUERY(t.ra, t.dec, 20, 30, 0.083);
"""
)

Cheers,

Jesse

Dustin Lang

unread,
Dec 21, 2024, 8:10:23 AM12/21/24
to Jesse Palmerio, DECam Legacy Survey
Hi Jesse,

Thanks for the example code!  That's fantastic.

cheers,
dustin

Reply all
Reply to author
Forward
0 new messages