LSSTDESC / SprintWeek2020

Meeting repository for the LSST DESC 2020 Sprint Week
Apache License 2.0
2 stars 0 forks source link

[SPRINT] Sky Coordinates of DC2 calexps and deepCoadds in Jupyter Hub #40

Open BrunoSanchez opened 3 years ago

BrunoSanchez commented 3 years ago

Sky Coordinates of DC2 in Jupyter Hub

Mapping Sky Coordinates to DC2 deepCoadd in Jupyter Hub

Contacts: @shuliu2017 @BrunoSanchez Day/Time: Synchronous, PT/EST, Wednesday Main communication channel: desc-dc2-dia GitHub repo: https://github.com/LSSTDESC/dia_improvement/blob/sprint/tutorials/DC2-sky_coordinate.ipynb /global/cfs/cdirs/desc-sn/dia/data/shl159/sprint/DC2-sky_coordinate.ipynb

Goals and deliverable

We want to produce calexps and deepCoadds from DC2. Given a list of sky coordinates, what is the the proper method to use to find the DC2 deepCoadd/calexp images in LSST Jupyter hub? More specifically, we want to answer:

  1. Given a list of sky coordinates, how can we get the (tract, patch, filter) information of the deepCoadds that covering these positions in LSST Jupyter hub?
  2. Given a list of sky coordinates, how can we get the (visit, detector, filter) information of the calexp that covering these positions in LSST Jupyter hub?
  3. For a coordinate which lies near the edge of the image, how can we check it is near the edge and set flag to that coordinate?

Resources and skills needed

Anyone interested in learning about DC2 dataset. It might be required to have access to Jupyter Hub at Cori NERSC.

Detailed description

BrunoSanchez commented 3 years ago

For people interested in this sprint we are meeting in DESC 26 zoom room at 2 PM EST!

BrunoSanchez commented 3 years ago

Maybe this helps

def ra_dec_box_to_xy(wcs, box, ra, dec):
    # build the array of XY coordinates in FoV for SNe
    sncoord = [geom.SpherePoint(r, d, geom.degrees) for r, d in zip(ra, dec)]
    snxy = [wcs.skyToPixel(coord) for coord in sncoord]
    x = [acoord.x for acoord in snxy]
    y = [acoord.y for acoord in snxy]
    in_ccd = [box.contains(geom.Point2I(acoord)) for acoord in snxy]

    return x, y, in_ccd
BrunoSanchez commented 3 years ago

This queries could speed up your script:

cal_wcs = butler.get('deepCoadd_wcs', dataId=dataId)
BrunoSanchez commented 3 years ago

c1 = cal_wcs.pixelToSky(x=cal_box.beginX, y=cal_box.beginY)
c2 = cal_wcs.pixelToSky(x=cal_box.beginX, y=cal_box.endY)
c3 = cal_wcs.pixelToSky(x=cal_box.endX, y=cal_box.beginY)
c4 = cal_wcs.pixelToSky(x=cal_box.endX, y=cal_box.endY)
ra1  = c1.getRa().asDegrees()
dec1 = c1.getDec().asDegrees()
ra2  = c2.getRa().asDegrees()
dec2 = c2.getDec().asDegrees()
ra3  = c3.getRa().asDegrees()
dec3 = c3.getDec().asDegrees()
ra4  = c4.getRa().asDegrees()
dec4 = c4.getDec().asDegrees()
shuliu2017 commented 3 years ago

get bounding box: bbox = butler.get('deepCoadd_bbox', dataId=dataId=dataId)

shuliu2017 commented 3 years ago

another method to extract coadd infomation:DRP image processing resource estimator, extract_coadds