utils
Helper functions for constructing the pipeline
- ska_sdp_distributed_self_cal_prototype.workflow.utils.calculate_observation_info(pipeline_config: PipelineConfig, processing_set_manager: ProcessingSetManager, swiftly_manager: Swiftly, gridding_manager: Gridder) PipelineConfig[source]
Calculates observation metadata.
- Parameters:
pipeline_config – Configuration for the pipeline.
processing_set_manager – Manager for visibility data.
swiftly_manager – Swiftly manager for the pipeline.
gridding_manager – Gridding manager for the pipeline.
- Returns:
Updated pipeline_config.
- ska_sdp_distributed_self_cal_prototype.workflow.utils.save_image(image_info: ImageInfo, image_data: numpy.ndarray, output_dir: Path, filename: str = 'dirty_image', save_fits: bool = True, save_png: bool = True) None[source]
Save 2D array of image data as FITS and/or PNG images.
- Parameters:
image_info – Information on phase centre, pixel size and frequency required to construct the WCS.
image_data – Data to save as FITS/PNG.
output_dir – The directory where the image will be saved.
filename – The filename the image will be saved into.
save_fits – Controls whether a FITS file is output.
save_png – Controls whether a PNG file is output.
- Returns:
None
Notes
image_info is only required if saving to FITS
Image is rotated by 90 degrees for correct display
PNG image is displayed with RA/DEC axis and colour bar
- ska_sdp_distributed_self_cal_prototype.workflow.utils.split_square_array(array: numpy.ndarray, n_subarray: int) list[numpy.ndarray][source]
Split a 2D square array into n_subarray square subarrays, where n_subarray is a square number.
- Parameters:
array – The input 2D square array to split.
n_subarray – The number of square subarrays (must be a square number).
- Returns:
A list containing the square subarrays.
- Return type:
subarrays