# Add ability for dax_imgserv to retrieve images by ids.

XMLWordPrintable

#### Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s: None
• Labels:
• Story Points:
10
• Sprint:
DB_S17_12, DB_S17_01
• Team:
Data Access and Database

#### Description

It is desirable to retrieve images by their identifiers for calexps, deepCoadd, and raw images.

#### Activity

Hide
Kenny Lo added a comment -

The work has been done in DM-7494 by jgates108 (GH tag: dax-F16-2016-11.pre2).

Show
Kenny Lo added a comment - The work has been done in DM-7494 by jgates108 (GH tag: dax-F16-2016-11.pre2).
Hide
Kenny Lo added a comment -

Per John Gates, the issue may have been fully resolved already, just verify.

Show
Kenny Lo added a comment - Per John Gates, the issue may have been fully resolved already, just verify.
Hide
Kian-Tat Lim added a comment -

I gave incorrect formulae for coadds since we need to extract the filterName from our per-filter coadds as well. The code should be:

 filterName = "ugriz"[coaddExposureId%8] patchY = (coaddExposureId//8)%(2**13) patchX = (coaddExposureId//(2**16))%(2**13) tract = coaddExposureId//(2**29) patch = "%d,%d" % (patchX, patchY) 

Note that the code for coadds and that for calexps is different, and each can only be applied to its particular type of id.

Show
Kian-Tat Lim added a comment - I gave incorrect formulae for coadds since we need to extract the filterName from our per-filter coadds as well. The code should be: filterName = "ugriz" [coaddExposureId % 8 ] patchY = (coaddExposureId / / 8 ) % ( 2 * * 13 ) patchX = (coaddExposureId / / ( 2 * * 16 )) % ( 2 * * 13 ) tract = coaddExposureId / / ( 2 * * 29 ) patch = "%d,%d" % (patchX, patchY) Note that the code for coadds and that for calexps is different, and each can only be applied to its particular type of id.
Hide
John Gates added a comment -

Most of the work for locating images by the ids used by the butler to locate the files has been done in DM-7494. KT has provided the following formulas for breaking a single number into the individual components.

field = ccdExposureId % 10000
camcol = (ccdExposureId//10000)%10
filterName = "ugriz"[(ccdExposureId//100000)%10]
run = ccdExposureId//1000000
patch = "%d,%d" % (patchX, patchY)

Show
John Gates added a comment - Most of the work for locating images by the ids used by the butler to locate the files has been done in DM-7494 . KT has provided the following formulas for breaking a single number into the individual components. field = ccdExposureId % 10000 camcol = (ccdExposureId//10000)%10 filterName = "ugriz" [(ccdExposureId//100000)%10] run = ccdExposureId//1000000 patchY = coaddExposureId%(2**13) patchX = (coaddExposureId//(2* 13))%(2 *13) tract = coaddExposureId//(2**26) patch = "%d,%d" % (patchX, patchY)

#### People

Assignee:
Kenny Lo
Reporter:
John Gates
Watchers:
John Gates, Kenny Lo, Kian-Tat Lim