Question about Bricks, Inverse Variance Maps, and cutout shapes

The Legacy Cutout service allows one to retrieve cutouts for individual galaxies. The general cutouts are always square, so they must involve some combination of adjacent bricks if a galaxy is near the edge. When one instead requests a subimage, such that the invar / weight map can be retrieved along with the image, this seems to only happen on a brick by brick level, meaning that galaxies near the edge of a brick often get cut in half or otherwise return non-square cutouts.

Is there any straightforward way to retrieve square cutouts for a given coordinate along with the weight map even in cases where things are near the edge of a brick? It is conceivable (given what I can tell of the data structure) to download both full brick images and their weight maps and then do a custom combination of some kind after, but that would involve a significant number of much larger downloads than strictly necessary.

Going along with that vein, I’ve read somewhere that cutouts (possibly the ones that you get when not specififying subimage?) are not good enough for precision work — would you consider general profile fitting (e.g. with GALFIT) precision work? If so, are the cutouts retrieved when using subimage (i.e., at the 0.262" pixel scale and 22.5 ZP) ok for that purpose, and if not, is there a recommended way to perform a sersic fit to an image cutout from Legacy? (e.g., in cases where the Tractor may have fit a simpler model but you want a uniform sample of sersic fits)?

Thanks in advance, and apologies if this is is somewhere in the documentation for the surveys and I haven’t been able to find it.

Hi,

About using coadds for model fitting… the issue is the PSF. You’re going to have to tell GalFit what the PSF of the coadd is, and in general that is a complicated thing – a different number of images may overlap different parts of the galaxy, for example!

(But, there is a link for retrieving the PSF of a given RA,Dec position in the coadds, eg:)
https://www.legacysurvey.org/viewer/coadd-psf/?ra=44.0260&dec=-14.1866&layer=ls-dr9-south

We did store the fitting results for all galaxy models that we actually ran – these are in the “metrics/BBB/all-models-BRICK.fits” files. We did not fit Sersic models for every galaxy – if the PSF model was better than DeV or Exp, then we didn’t fit Sersic.

The cutouts retrieved with “subimage” are the individual exposures, so yes, those are fine for fitting.

cheers,
dustin

Thanks Dustin! This is helpful.

As a clarification:
I have been grabbing PSF images using the psf cutout service as you link to above. But now that you mention the potential differences between the coadds and individual exposures, am I understanding correctly that if I am using subimage, i should not use the coadd-psf api and instead just query the psf-size file for the brick that subimage is pulling from?

And a second clarification, if hypothetically one used a coadd with a coadd psf for fitting (in the non sub-image case), is it the case that there are no weight maps available for coadd locations?

At the moment my plan would be to use the subimage retrieval service to grab cutouts for systems which are not near the edge of a brick (with whichever psf is the right one to use, probably the brick psf file it seems?) and then for systems near the edge of a brick, i was going to download the overlapping bricks at the galaxy location and use swarp to stitch them together in order to make a square cutout around the galaxy of interest and the relevant inverse variance maps, and use the coadd psf…

If that seems like a bad idea, I’m open to any suggestions for how to deal with galaxies at the edges of bricks from a fitting perspective!

Hi,

For the cutout route:

  • if you add “&invvar” to the FITS cutout URL, AND if you are requesting cutouts at the native pixel scale (0.262"/pixel), then the FITS cutout it will include an INVVAR (inverse-variance map) as well as the image.

About the “subimage” option – you probably don’t want to use these, because they’re still sub-images from our coadded brick images.

There’s one other route, which is that you can get a full tarball of the individual exposures, including PSFEx models, invvars and data-quality maps – the link is on the “Single Exposures” page and looks like
https://www.legacysurvey.org/viewer/exposures-tgz/?ra=20.8781&dec=11.2894&size=100&layer=ls-dr9

cheers,
dustin