RadioImagerGPU 1.0
|
To run the CPU implementation, execute the imaging_cpu.py
script from the python
directory:
The imaging_cpu.py
script computes UVW coordinates from XYZ coordinates, performs imaging using CPU processing, and saves the resulting images and coordinates.
The following options can be provided to the imaging_cpu.py
script:
--input
: Path to the input CSV file with XYZ coordinates. Default: data/xyz_coordinates.csv
--directions
: Path to the directions CSV file with Hour Angles (HAs) and Declinations (Decs). Default: data/directions.csv
--use_predefined_params
: Use predefined UVW parameters. Default: true
--image_dir
: Directory to save images. Default: data/images
--uvw_dir
: Directory to save UVW coordinates. Default: data/uvw_coordinates
--optimized
: Use optimized implementation. Default: true
--save_uvw
: Save UVW coordinates to CSV. Default: true
--generate_images
: Generate and save images. Default: true
--save_im
: Save images (default: true)--save_as_csv
: Additionally save images as CSV files apart from PNG. Default: true
The optimized implementation leverages NumPy's broadcasting and vectorized operations to efficiently compute the UVW coordinates and map visibilities to a grid. This approach minimizes the use of explicit loops and takes advantage of NumPy's internal optimizations for array operations, resulting in significant performance improvements, especially for large datasets.
np.add.at
to accumulate visibilities on the grid efficiently.The non-optimized implementation uses explicit loops to compute UVW coordinates and map visibilities to a grid. While this approach is straightforward and easier to understand, it is significantly slower for large datasets due to the overhead of Python loops and the lack of vectorized operations.
This command will use custom input files, disable predefined UVW parameters, output UVW coordinates to the specified directory, and save images to the specified directory together with saving them as CSV files.
Got it. Here is the text to be added to your README without the code:
The generate_synthetic_data.py
script can be used to generate synthetic XYZ coordinates and directions for testing purposes. This script can be executed with the following command:
This generates synthetic data which can be used for testing with different configurations, such as:
The convert_gpu_csv_to_png.py
script converts CSV files containing image data to PNG format for easier visualization. This script can be executed with the following command:
These scripts can be modified to test different numbers of elements and configurations as needed. The data
directory in the root of the repository contains examples of the output CSV and PNG files.