Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: afw
-
Labels:None
-
Team:External
Description
Profiling measureCoaddSources.py reveals that about 1/3 of the time is going to AST transforms, which is much larger than desirable. For example, 15% of the time is spent in malloc, which is used by GetMapping, which is called by the ast::Mapping::apply* family of functions; and ast::Mapping::_tran (32.9%) calls through to something called ValidateMapping.part.59 which uses a whopping 12.8%. The result is that when getting the PSF, we are spending more time in lsst::afw::geom::linearizeTransform than we are in warping the pixels to the coadd frame.
We need to determine whether our use of AST is inefficient or AST is inherently inefficient. Either way, we need to devise a strategy to deal with this.
Attachments
Issue Links
- blocks
-
DM-13665 Finalize the stack version, step, and config for the S18 PDR1 reprocessing
- Done
A few notes: it is more efficient to transform many points at once, in one call to pixelToSky/skyToPixel (SkyWcs), applyForward (Transform and astshim) or astTran (AST), than callling that function once for each point. I believe the measurement framework has a few plugins that apply a WCS, which would be one call to pixelToSky per point. It is worth spending some time trying to eliminate that. I suspect it will be difficult to make such a change for forced photometry.
Given your results, it is also possible that we can save some time by caching a copy of the pixel-to-sky mapping inside SkyWcs, instead of using the contained FrameSet to perform the transformation. This would be practical because SkyWcs is immutable, but it does add some memory overhead and construction overhead (assuming we want to do the thread-safe-and-simple thing of filling the cache at construction time, instead of for the first call to pixelToSky or skyToPixel).