You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The saturation step is much slower than it needs to be. This is of limited importance for jwst, but this step can take a significant fraction of the Stage 1 pipeline for Roman and I believe it is worth some effort at optimizing.
There are a number of small changes that improve speed, but three stand out. First, when a pixel saturates, that saturation is propagated into all subsequent reads. This is done every group for a cost ~ngroup^2, but it could be handled with a running boolean tally of pixels that have saturated. Second, ndimage.binary_dilation is very slow, an order of magnitude slower than writing the operations out explicitly. Finally, if there is no averaging in groups, there is no point in the diluted saturation check; we can skip this check if the dilution factor is 1.
Making the three changes noted above, together with a number of other, very minor changes, improves runtime of the saturation step for jw01283001001_03101_00001_mirimage_uncal.fits (10 integrations, 100 groups) from 42s to 4.5s (a factor of nearly 10). If forcing it to keep the diluted saturation step, the speed improvement is from 42s to 9s (a factor of 4.5). The resulting 4D gdq array is identical in all cases.
The text was updated successfully, but these errors were encountered:
Issue JP-3820 was created on JIRA by Timothy Brandt:
The saturation step is much slower than it needs to be. This is of limited importance for jwst, but this step can take a significant fraction of the Stage 1 pipeline for Roman and I believe it is worth some effort at optimizing.
There are a number of small changes that improve speed, but three stand out. First, when a pixel saturates, that saturation is propagated into all subsequent reads. This is done every group for a cost ~ngroup^2, but it could be handled with a running boolean tally of pixels that have saturated. Second, ndimage.binary_dilation is very slow, an order of magnitude slower than writing the operations out explicitly. Finally, if there is no averaging in groups, there is no point in the diluted saturation check; we can skip this check if the dilution factor is 1.
Making the three changes noted above, together with a number of other, very minor changes, improves runtime of the saturation step for jw01283001001_03101_00001_mirimage_uncal.fits (10 integrations, 100 groups) from 42s to 4.5s (a factor of nearly 10). If forcing it to keep the diluted saturation step, the speed improvement is from 42s to 9s (a factor of 4.5). The resulting 4D gdq array is identical in all cases.
The text was updated successfully, but these errors were encountered: