Helper methods for Fourier processing (sarpy.processing.sicd.fft_base)¶
Helper classes and methods for Fourier processing schemes.
- class sarpy.processing.sicd.fft_base.FFTCalculator(reader: str | SICDTypeReader, dimension: int = 0, index: int = 0, block_size: None | int | float = 50)¶
Bases:
FullResolutionFetcher
Base Fourier processing calculator class.
This is intended for processing schemes where full resolution is required along the processing dimension, so sub-sampling along the processing dimension does not decrease the amount of data which must be fetched.
- property dimension: int¶
The dimension along which to perform the color subaperture split.
- Type:
int
- property index: int¶
The index of the reader.
- Type:
int
- property fill: float¶
The fill factor for the fourier processing.
- Type:
float
- property block_size: float | None¶
The approximate processing block size in MB, where None represents processing in a single block.
- Type:
None|float
- property block_size_in_bytes: int | None¶
The approximate processing block size in bytes.
- Type:
None|int
- property data_size: Tuple[int, ...]¶
The data size for the reader at the given index.
- Type:
Tuple[int, …]
- static extract_blocks(the_range: slice | Tuple[int, int, int], index_block_size: None | int | float) Tuple[List[Tuple[int, int, int]], List[Tuple[int, int]]] ¶
Convert the single range definition into a series of range definitions in keeping with fetching of the appropriate block sizes.
- Parameters:
the_range (slice|Tuple[int, int, int]) – The input (off processing axis) range.
index_block_size (None|int|float) – The size of blocks (number of indices).
- Returns:
range_definitions (List[Tuple[int, int, int]]) – The sequence of range definitions (start index, stop index, step) relative to the overall image.
limit_indices (List[Tuple[int, int]]) – The sequence of start/stop indices for positioning of the given range relative to the original range.
- get_fetch_block_size(start_element: int, stop_element: int) int ¶
Gets the fetch block size for the given full resolution section. This assumes that the fetched data will be 8 bytes per pixel, in accordance with single band complex64 data.
- Parameters:
start_element (int) –
stop_element (int) –
- Return type:
int
- property reader: SICDTypeReader¶
The reader instance.
- Type:
- sarpy.processing.sicd.fft_base.fft_sicd(array: ndarray, dimension: int, sicd: SICDType) ndarray ¶
Apply the forward one-dimensional forward fft to data associated with the given sicd along the given dimension/axis, in accordance with the sign populated in the SICD structure (default is -1).
- Parameters:
array (numpy.ndarray) – The data array, which must be two-dimensional and complex.
dimension (int) – Must be one of 0, 1.
sicd (SICDType) – The associated SICD structure.
- Return type:
numpy.ndarray
- sarpy.processing.sicd.fft_base.ifft_sicd(array: ndarray, dimension: int, sicd: SICDType) ndarray ¶
Apply the inverse one-dimensional fft to data associated with the given sicd along the given dimension/axis.
- Parameters:
array (numpy.ndarray) – The data array, which must be two-dimensional and complex.
dimension (int) – Must be one of 0, 1.
sicd (SICDType) – The associated SICD structure.
- Return type:
numpy.ndarray
- sarpy.processing.sicd.fft_base.fft2_sicd(array: ndarray, sicd: SICDType) ndarray ¶
Apply the forward two-dimensional fft (i.e. both axes) to data associated with the given sicd.
- Parameters:
array (numpy.ndarray) – The data array, which must be two-dimensional and complex.
sicd (SICDType) – The associated SICD structure.
- Return type:
numpy.ndarray
- sarpy.processing.sicd.fft_base.ifft2_sicd(array: ndarray, sicd: SICDType) ndarray ¶
Apply the inverse two-dimensional fft (i.e. both axes) to data associated with the given sicd.
- Parameters:
array (numpy.ndarray) – The data array, which must be two-dimensional and complex.
sicd (SICDType) – The associated SICD structure.
- Return type:
numpy.ndarray