How do I coadd specifically selected calexps in a Jupyter notebook

I’d like to write a notebook that explores loading and combining different calexps into a coadd to explore template behavior. The motivation is working on building templates for DIA; doing this in a Notebook helps building easy visualization and quick iteration. Where should I start?

The specific motivating case here is that the method expects data refs instead of exposures because it’s written assuming not everything will fit in memory. But I’d also like to directly specify the list of calexps, without separately running them through a selectFilter.

Here’s a notebook that shows my thinking and struggles.

GenerateTemplates.ipynb (1.8 MB)

The more general version of my question is how to run pipetasks from a notebook, but I understand that is not a generally available functionality yet.

How do I make a patchRef? was a small part of my trying to understand this.

There’s a notebook being developed to create custom coadds. It’s not ready for production yet, but I’ll send you a direct message with a link.

1 Like

What you want is to use a lsst.pipe.base.InMemoryDatasetHandle. You create one of those with your python Exposure object and it can be used as a direct drop-in replacement in your run methods that need a DeferredDatasetHandle. You will need a very recent weekly since we only added this a couple of weeks back.