StreamingDistributedFFT
- class ska_sdp_exec_swiftly.fourier_transform.algorithm_parameters.StreamingDistributedFFT(**fundamental_constants)[source]
Bases:
BaseParameters
Streaming Distributed Fourier Transform class
It takes the fundamental_constants dict as input (see BaseParameters class). It encompasses all building blocks of the algorithm for both subgrid -> facet and facet -> subgrid directions.
The algorithm was developed for 2D input arrays (images).
Methods Summary
add_facet_contribution
(facet_contrib, ...)Further transforms facet contributions, which then will be summed up.
add_subgrid_contribution
(NjSi, ...)Further transform subgrid contributions, which are then summed up.
extract_facet_contrib_to_subgrid
(BF, ...)Extract the facet contribution to a subgrid.
extract_subgrid_contrib_to_facet
(FSi, ...)Extract contribution of subgrid to a facet.
finish_facet
(MiNjSi_sum, facet_B_mask_elem, ...)Obtain finished facet.
finish_subgrid
(summed_facets[, subgrid_masks])Obtain finished subgrid.
prepare_facet
(facet, Fb, axis, **kwargs)Calculate the inverse FFT of a padded facet element multiplied by Fb (Fb: Fourier transform of grid correction function)
prepare_subgrid
(subgrid, **kwargs)Calculate the FFT of a padded subgrid element.
Methods Documentation
- add_facet_contribution(facet_contrib, facet_off_elem, axis, **kwargs)[source]
Further transforms facet contributions, which then will be summed up.
- Parameters:
facet_contrib – array-chunk of individual facet contributions
facet_off_elem – facet offset for the facet_contrib array chunk
axis – axis along which the operations are performed (0 or 1)
kwargs – needs to contain the following if dask is used: use_dask: True nout: <number of function outputs> –> 1
- Returns:
TODO??
- add_subgrid_contribution(NjSi, subgrid_off_elem, facet_m0_trunc, axis, **kwargs)[source]
Further transform subgrid contributions, which are then summed up.
- Parameters:
dims – length of tuple to be produced by create_slice (i.e. number of dimensions); int
NjSi – TODO
subgrid_off_elem – single subgrid offset element
facet_m0_trunc – mask truncated to a facet (image space)
axis – axis along which operations are performed (0 or 1)
kwargs – needs to contain the following if dask is used: use_dask: True nout: <number of function outputs> –> 1
:return summed subgrid contributions
- extract_facet_contrib_to_subgrid(BF, subgrid_off_elem, facet_m0_trunc, Fn, axis, **kwargs)[source]
Extract the facet contribution to a subgrid.
- Parameters:
BF – TODO: ? prepared facet
subgrid_off_elem – single subgrid offset element
facet_m0_trunc – mask truncated to a facet (image space)
Fn – Fourier transform of gridding function
axis – axis along which the operations are performed (0 or 1)
kwargs – needs to contain the following if dask is used: use_dask: True nout: <number of function outputs> –> 1
- Returns:
contribution of facet to subgrid
- extract_subgrid_contrib_to_facet(FSi, facet_off_elem, Fn, axis, **kwargs)[source]
Extract contribution of subgrid to a facet.
- Parameters:
Fsi – Padded subgrid in image space
facet_off_elem – single facet offset element
Fn – Fourier transform of gridding function
axis – axis along which the operations are performed (0 or 1)
kwargs – needs to contain the following if dask is used: use_dask: True nout: <number of function outputs> –> 1
- Returns:
Contribution of subgrid to facet
- finish_facet(MiNjSi_sum, facet_B_mask_elem, Fb, axis, **kwargs)[source]
Obtain finished facet.
It extracts from the padded facet (obtained from subgrid via FFT) the true-sized facet and multiplies with masked Fb. (Fb: Fourier transform of grid correction function)
- Parameters:
MiNjSi_sum – sum of subgrid contributions to a facet
facet_B_mask_elem – a facet mask element
Fb – Fourier transform of grid correction function
axis – axis along which operations are performed (0 or 1)
kwargs – needs to contain the following if dask is used: use_dask: True nout: <number of function outputs> –> 1
- Returns:
finished (approximate) facet element
- finish_subgrid(summed_facets, subgrid_masks=None, **kwargs)[source]
Obtain finished subgrid. Operation performed for all axes.
- Parameters:
summed_facets – summed facets contributing to thins subgrid
subgrid_masks – subgrid mask per axis (optional)
kwargs – needs to contain the following if dask is used: use_dask: True nout: <number of function outputs> –> 1
- Returns:
approximate subgrid element
- prepare_facet(facet, Fb, axis, **kwargs)[source]
Calculate the inverse FFT of a padded facet element multiplied by Fb (Fb: Fourier transform of grid correction function)
- Parameters:
facet – single facet element
Fb – Fourier transform of grid correction function
axis – axis along which operations are performed (0 or 1)
chunk – using chunk mode or not
kwargs – needs to contain the following if dask is used: use_dask: True nout: <number of function outputs> –> 1
- Returns:
TODO: BF? prepared facet
- prepare_subgrid(subgrid, **kwargs)[source]
Calculate the FFT of a padded subgrid element. No reason to do this per-axis, so always do it for all axes.
- Parameters:
subgrid – single subgrid array element
kwargs – needs to contain the following if dask is used: use_dask: True nout: <number of function outputs> –> 1
- Returns:
Padded subgrid in image space