Hi all,
Not sure if I am doing something wrong, but when I try to get the sky position of a pixel in my deep_coadd patches they are all the same within the same tract. I made a minimal code to show here…
target_ra = 53.2
target_dec = -28.1
radius = 0.52
region = sphgeom.Region.from_ivoa_pos(f"CIRCLE {target_ra} {target_dec} {radius}")
coadd_datasetrefs_i = butler.query_datasets("deep_coadd",
where="patch.region OVERLAPS region AND band='i'",
bind={"region": region},
with_dimension_records=True,
order_by=["patch"])
num = len(coadd_datasetrefs_i)
for inum in range(num):
coadd = butler.get(coadd_datasetrefs_i[inum])
patch = coadd.getMetadata()['LSST BUTLER DATAID PATCH']
tract = coadd.getMetadata()['LSST BUTLER DATAID TRACT']
wcs = coadd.getWcs()
p1 = wcs.pixelToSky(0.0,0.0)
print(patch, tract, p1)
This produces…
1 5063 (54.0342443848, -28.3506114684)
2 5063 (54.0342443848, -28.3506114684)
3 5063 (54.0342443848, -28.3506114684)
4 5063 (54.0342443848, -28.3506114684)
5 5063 (54.0342443848, -28.3506114684)