Repository navigation
Avoid unnecessary copies in aligned single-component mosaics - #488
Conversation
|
Some more details on the work we save here: AWS banzai currently takes around 2 minutes to run this stage, and reductions on site deployments take about 8 minutes. The following is work that we are able to skip for single images:
This is a total of 4.13 GB of writes into mapped arrays for full frame images. It's hard to tell how much of this is written to disk, but timing measurements imply at least some is being flushed. With this change, the site reduction mosaic stage is reduced from over 8 seconds to near 0. I have not tested the AWS reduction timing. |
Description
MosaicCreator rebuilds the science, mask, and uncertainty arrays even when a single component already matches the output geometry. For large QHY frames, this adds unnecessary memory copying and temporary-file allocation.
This PR adds a shortcut for single-component images that already match the output geometry. It reuses existing arrays while keeping the same header updates, uncertainty precision, and memory-map behavior in later stages.
The shortcut is used for inputs with native float64 science data, uint8 masks, and writable, contiguous arrays. All other inputs use the existing mosaic code.
Validation