LSST constants - where are they defined?

Dears, rather than writing them by hand, I’d like to import LSST-related constants…

What I’m trying to do is something like:

from lsst.??? import PATCH_WIDTH, PIXEL_SCALE, ..   # 13.7 arcmin, 0.2 pix/arcsec, ..

Do we have these quantities defined in a module deep down somewhere? Went through the docs but could not find them and tutorial notebooks usually hardcode these quantities by hand.

As always, thank you a lot my friends!

All the bests,
Peppe

Hi Peppe-

There is not a single location where such quantities are gathered. Because the pipelines are generalized to (potentially) work on any imaging dataset, important “constants” will depend on the dataset, camera, skymap definition, etc. for the particular data being processed. However, the types of quantities you are looking for are available as parts of metadata associated with images.

For example, to retrieve the pixel scale for a calexp image, you could do the following:

from lsst.daf.butler import Butler
butler = Butler("dp02", collections="2.2i/runs/DP0.2")
dataId = {'visit': 192350, 'detector': 175, 'band': 'i'}
calexp = butler.get('calexp', dataId=dataId)
pixscale = calexp.wcs.getPixelScale()
pixscale.asArcseconds()

The above snippet should print “0.19976576462766338” to the screen.

You can see that the pixel scale is associated with the calexp.wcs object. There are other image planes associated with a calexp (and coadd images have the same structure).

As another example, to see other metadata for this image, you can use the getMetadata method:

calexp.getMetadata()

You may also want to explore the skyMap datasetType, which gives information about how the skymap is defined, along with some methods to do things like finding tracts/patches overlapping a given coordinate.

I know it’s probably not the most satisfying answer, but the simplest answer to your overall question is that there is no single place to find the types of info you are seeking.

2 Likes

I believe one should give the calexp,wcs,getPixelScale() a Point2D to get the right pixel scale for a location in the desired CCD. I’ve used:

detector = camera[idet]
x0,y0 = detector.getBBox().getCenter()
pixscale = wcs.getPixelScale(Point2D(x0,y0))
1 Like

Thank you Jeff and Aaron for the clear pointers! It’s not a big deal and it seems to me that the image metadata provides what I am looking for. I will also explore skyMap further. :pray: