Skip to content

Add n_threads keyword to deblend_sources and SourceFinder - #2409

Merged
larrybradley merged 4 commits into
astropy:mainfrom
larrybradley:segm/deblend-n-threads
Sep 3, 2026
Merged

Add n_threads keyword to deblend_sources and SourceFinder#2409
larrybradley merged 4 commits into
astropy:mainfrom
larrybradley:segm/deblend-n-threads

Conversation

@larrybradley

Copy link
Copy Markdown
Member

This PR adds an n_threads keyword to deblend_sources and SourceFinder to deblend the sources using multiple threads. The sources are divided into chunks and processed concurrently, producing results identical to the single-threaded computation. The marker-building kernels release the GIL, as do the watershed and most of the array operations, so multithreading can significantly speed up deblending, especially for large sources.

@larrybradley
larrybradley force-pushed the segm/deblend-n-threads branch from b7e8913 to 9cafee8 Compare September 3, 2026 17:34
@larrybradley
larrybradley merged commit bf66ac6 into astropy:main Sep 3, 2026
26 checks passed
@larrybradley
larrybradley deleted the segm/deblend-n-threads branch September 3, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant