# Calexp postage stamp service in DP0?

**URL:** <https://www.rubin.community/t/calexp-postage-stamp-service-in-dp0/7910>\
**Category:** Support\
**Tags:** dp0\
**Created:** [September 7, 2023, 7:23pm UTC](https://www.rubin.community/t/calexp-postage-stamp-service-in-dp0/7910 "2023-09-07T19:23:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![agagliano](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/agagliano/32/2214_2.png) [@agagliano](https://www.rubin.community/u/agagliano)\
**Post date:** [September 7, 2023, 7:23pm UTC](https://www.rubin.community/t/calexp-postage-stamp-service-in-dp0/7910/1 "2023-09-07T19:23:14Z")

</div>

Hi all! Is there a way to rapidly generate calexp color postage stamps for DC2 galaxies in DP0? I’ve been looking at the tutorial at [https://github.com/rubin-dp0/cst-dev/blob/main/MLG\_sandbox/DP02/draft\_cutout\_calexps.ipynb](https://github.com/rubin-dp0/cst-dev/blob/main/MLG_sandbox/DP02/draft_cutout_calexps.ipynb) but am separately querying for the detector and visit IDs, and I was hoping there was a more efficient solution. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![MelissaGraham](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/melissagraham/32/2549_2.png) [@MelissaGraham](https://www.rubin.community/u/MelissaGraham)\
**Post date:** [September 7, 2023, 7:43pm UTC](https://www.rubin.community/t/calexp-postage-stamp-service-in-dp0/7910/2 "2023-09-07T19:43:04Z")

</div>

Thank you for posting this! An image cutout service does exist, and new tutorials demonstrating how to use it with DP0.2 are nearly done. We are coordinating a response here and will be able to provide a timeline (or perhaps point you to a draft version so you can get started).

---

<div class="post-metadata">

**Author:** ![parejkoj](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/parejkoj/32/138_2.png) [@parejkoj](https://www.rubin.community/u/parejkoj)\
**Post date:** [September 11, 2023, 5:17pm UTC](https://www.rubin.community/t/calexp-postage-stamp-service-in-dp0/7910/3 "2023-09-11T17:17:56Z")

</div>

I had implemented a large part of this functionality in the image\_cutout\_backend repo, on the `tickets/DM-33699` branch (which I’ve just updated to main). I wasn’t able to get full EXIF information (e.g. WCS, calibration) into the PNG, but it generated color PNGs using the normal ImageCutoutBackend. There is no VO service definition for generating color images, so there is no good definition for what our API should be for this.

---

<div class="post-metadata">

**Author:** ![MelissaGraham](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/melissagraham/32/2549_2.png) [@MelissaGraham](https://www.rubin.community/u/MelissaGraham)\
**Post date:** [September 11, 2023, 5:42pm UTC](https://www.rubin.community/t/calexp-postage-stamp-service-in-dp0/7910/4 "2023-09-11T17:42:38Z")

</div>

Thanks John.

If the support for color PNGs was just merged into main branch, which weekly release would it be available in? We’re about to update the recommended image for the RSP at data.lsst.cloud to Weekly\_35, but of course users can choose a more recent release.

Could you clarify “There is no VO service definition for generating color images, so there is good definition for what our API should be for this”? (Or should there be a “no” in front of “good”?)

---

<div class="post-metadata">

**Author:** ![parejkoj](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/parejkoj/32/138_2.png) [@parejkoj](https://www.rubin.community/u/parejkoj)\
**Post date:** [September 12, 2023, 8:18pm UTC](https://www.rubin.community/t/calexp-postage-stamp-service-in-dp0/7910/5 "2023-09-12T20:18:33Z")

</div>

I did not merge that branch into main, I updated it to be on top of main. The image cutout service is not included in lsst\_distrib: it’s the service running at the backend of the cutout website. I offered it as a suggestion for how someone could go about making such cutouts themselves, and/or to see about whether we could get such functionality in the cutout server in the future (that’s a higher level decision).

And yes, I forgot a “no” there. Sorry; I’ll fix the sentence.

---

<div class="post-metadata">

**Author:** ![ChristinaWilliams](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/christinawilliams/32/2227_2.png) [@ChristinaWilliams](https://www.rubin.community/u/ChristinaWilliams)\
**Post date:** [September 12, 2023, 10:29pm UTC](https://www.rubin.community/t/calexp-postage-stamp-service-in-dp0/7910/6 "2023-09-12T22:29:33Z")

</div>

Hi all,

In case it is useful, here is a little demo notebook that demonstrates how to create single-band cutouts of calexp files which should be quick without having to load images from the Butler. Hopefully this is a good starting point. You can access the notebook here:

[https://github.com/rubin-dp0/little-demos/blob/main/cutout\_example.ipynb](https://github.com/rubin-dp0/little-demos/blob/main/cutout_example.ipynb)

As a side note, with Rubin LSST data, because calexps in different filters for a given sky coordinate would be taken hours to days apart (and with different rotations), making color images from calexps is not straightforward. So this demo just makes single-band cutouts. However, color cutouts from pre-made color deepCoadds might be possible in the future. A demonstration of how to make color images from deepCoadds can be found in Section 6 of DP0.2 tutorial notebook 03a “Image Display and Manipulation”.

Please let us know if you have any questions!
