Skip to content

ENH: Multiprocessing for THUMBNAIL#72

Merged
pllim merged 3 commits intospacetelescope:masterfrom
pllim:multiproc-scale-img
Oct 6, 2020
Merged

ENH: Multiprocessing for THUMBNAIL#72
pllim merged 3 commits intospacetelescope:masterfrom
pllim:multiproc-scale-img

Conversation

@pllim
Copy link
Collaborator

@pllim pllim commented Oct 6, 2020

Enable multiprocessing for downsampling images in THUMBNAIL mode. I checked that output images did not change at all (which is good) using fitsdiff. Also changed the default output dimension from 100 to 500 as @Skyhawk172 suggested.

Some timing:

In [1]: import glob

In [2]: images = glob.glob('*.fits')

In [3]: len(images)
Out[3]: 10

In [4]: from wss_tools.quip.main import  shrink_input_images

In [5]: %time out = shrink_input_images(images, ext=('SCI', 1), new_width=500, outpath='ztmp1', n_cores=1)  # No multiprocessing
CPU times: user 1.38 s, sys: 173 ms, total: 1.55 s
Wall time: 1.58 s

In [6]: %time out = shrink_input_images(images, ext=('SCI', 1), new_width=500, outpath='ztmp2', n_cores=10)
CPU times: user 3.55 ms, sys: 23.4 ms, total: 26.9 ms
Wall time: 297 ms

@pllim pllim added this to the 1.2 milestone Oct 6, 2020
@pllim
Copy link
Collaborator Author

pllim commented Oct 6, 2020

Need this for #70 , so merging.

@pllim pllim merged commit d3ef131 into spacetelescope:master Oct 6, 2020
@pllim pllim deleted the multiproc-scale-img branch October 6, 2020 20:15
pllim added a commit to pllim/wss_tools that referenced this pull request Oct 6, 2020
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