API
ska_sdp_exec_swiftly.api Module
Application Programming Interface for Distributed Fourier Transform
Functions
|
make facet config list |
|
make subgrid config list |
Classes
|
Facet Configuration Class |
|
Subgrid Configuration Class |
|
Swiftly configuration |
|
Swiftly Forward class |
|
Swiftly Backward class |
ska_sdp_exec_swiftly.api_helper Module
Some helper function for Distributed Fourier Transform API
Functions
|
update NAF_MNAF |
|
update MNAF_BMNAF |
|
check facet using sources |
|
check residual image |
|
check subgrid using sources |
|
extract column task |
|
wrapper of finish_facet |
|
make facet |
|
Generates a facet from a source list |
|
Generate a fully covered config list |
|
make mask from sparse_mask result |
|
make subgrid |
|
Generates a subgrid from a source list |
|
prepare NAF_NAF |
|
sum faect contribution and finsh subgrid |
ska_sdp_exec_swiftly.fourier_transform.algorithm_parameters Module
The main data classes are listed in this module.
Note: An alternative way of calculating nfacet is:
if sizes.fov is not None:
nfacet = int(numpy.ceil(sizes.N * sizes.fov / sizes.yB_size))
log.info(
f"{nfacet}x{nfacet} facets for FoV of {sizes.fov} "
f"({sizes.N * sizes.fov / nfacet / sizes.yB_size * 100}% efficiency)"
)
This makes sure that if we have a specific FoV we care about, then we don’t create facets outside that.
Classes
|
Class that calculates and holds fundamental constant arrays. |
|
**fundamental_constants contains the following keys: |
|
Streaming Distributed Fourier Transform class |
ska_sdp_exec_swiftly.fourier_transform.fourier_algorithm Module
Distributed Fourier Transform Module. Included are a list of base functions that are used across the code.
Functions
|
Stretch input array to shape determined by the dims and axis values. |
|
Generate a 1D array with length n, which spans [-0.5,0.5] with 0 at position n/2. |
|
Create a tuple of length = dims. |
|
The Dask wrapper function |
|
Extract a section from middle of a map (array) along a given axis. |
|
Fourier transformation from image to grid space, along a given axis. |
|
Fourier transformation from grid to image space, along a given axis. |
|
Calculate a single facet or subgrid element. |
|
Generates a facet from a source list |
|
Calculate the actual subgrids and facets. |
|
Calculate the actual subgrids and facets. |
|
Calculate the actual subgrids and facets from a list of specific sources. |
|
Generates a subgrid from a source list |
|
Pad an array to a desired size with zeros at a given axis. |
|
Calculate the slice of the roll + extract mid method |
|
Calculate the slice of the roll + extract mid along |
ska_sdp_exec_swiftly.dask_wrapper Module
The dask wrapper.
We wrap the Dask delayed implementation in a dask wrapper where if use_dask is set to True, the dask wrapper function will call the dask.delayed option for the computation.
Functions
|
The Dask wrapper function |
|
Set up the Dask Client |
|
Close the Dask Client |
ska_sdp_exec_swiftly.utils Module
Utility Functions
We provide functions that help plotting and basic validation of the algorithm.
Functions
|
Functions for iterative operations to accelerate the construction of graphs |
|
Generate a 1D array with length n, which spans [-0.5,0.5] with 0 at position n/2. |
|
The Dask wrapper function |
|
Display plots using pylab |
|
Calculate the error terms for a single facet to subgrid algorithm. |
|
Calculate the error terms for a single 2D subgrid to facet algorithm. |
|
Calculate the error terms for the 2D facet to subgrid algorithm. |
Functions for calculating the error of approx subgrid |
|
|
Calculate the error terms for the 2D subgrid to facet algorithm. |
Functions for calculating the error of approx facets |
|
|
Extract a section from middle of a map (array) along a given axis. |
|
Fourier transformation from image to grid space, along a given axis. |
|
Functions for calculating the error common to facet or subgrid |
|
Generate standard data G and FG |
|
Fourier transformation from grid to image space, along a given axis. |
|
Helper for marking ranges in a graph. |
|
the mean of err_mean, err_mean_img |
|
Pad an array to a desired size with zeros at a given axis. |
|
Plot to check that PSWF indeed satisfies intended bounds. |
|
Calculate actual work terms to use and plot to check them. |
|
Calculate the slice of the roll + extract mid method |
|
Single subgrid or facet write hdf5 file task |
|
Summing over error array :param err_list: err_mean, err_mean_img list from subgrid or facets :returns: sum of err_mean and err_mean_img # TODO: need reduce sum |
|
Fetch the first element of a list |
|
Write approx subgrid and facet to hdf5 |
ska_sdp_exec_swiftly.fourier_transform_dask Module
Main algorithm routine. The functions that conduct the main Dask-implemented algorithm include the subgrid to facet, and facet to subgrid transformations. The main function calls all the functions.
Functions
|
Functions for iterative operations to accelerate the construction of graphs |
Parse command line arguments |
|
|
Calculate the error terms for the 2D facet to subgrid algorithm. |
|
Functions for calculating the error of approx subgrid |
|
Calculate the error terms for the 2D subgrid to facet algorithm. |
|
Functions for calculating the error of approx facets |
|
Generate subgrid from facet 2D. |
|
Approach 2: First, do prepare_facet on the horizontal axis |
|
Generate subgrid from facet 2D. |
|
Finish generating subgrids from facets. |
|
Generate standard data G and FG |
|
Main function to run the Distributed FFT |
|
Calculate the actual subgrids and facets. |
|
Calculate the actual subgrids and facets. |
|
Calculate the actual subgrids and facets from a list of specific sources. |
|
Plot to check that PSWF indeed satisfies intended bounds. |
|
Calculate actual work terms to use and plot to check them. |
|
Main execution function that reads in the configuration, generates the source data, and runs the algorithm. |
|
Set up the Dask Client |
|
Generate facets from subgrids. |
|
Close the Dask Client |
|
Write approx subgrid and facet to hdf5 |
ska_sdp_exec_swiftly.generate_hdf5 Module
Small script for generating hdf5 test files, including FG, G
Functions
Parse command line arguments |
|
|
The Dask wrapper function |
|
Calculate the value of a chunk of direct fourier transform and |
|
Generate standard data G and FG with hdf5 |
|
Main function to generate G and FG hdf5 file |
|
Generates a subgrid from a source list |
|
Set up the Dask Client |
|
Close the Dask Client |