masking_and_transpose
This module, masking_and_transpose, is used for preprocessing and analyzing astronomical data. It includes functions for data loading, masking, and cube processing to prepare the data for further analysis.
- Functions:
load_data: Loads and sums data from a file along a specified axis.
create_masking_plot: Generates a masking plot based on signal-to-noise ratio.
write_to_file: Writes numerical data to a file in binary format.
transpose_cube_data: transposes and writes spectra for each pixel for analysis.
- Dependencies:
mpdaf: For handling astronomical data cubes.
numpy: For numerical calculations.
os, sys, struct: For file and system operations.
- preprocessing.masking_and_transpose.create_masking_plot() None[source]
Create a masking plot and write it to a file.
The function takes no parameters. It uses the filename from the command line arguments, loads the data and statistic from the file, creates a signal-to-noise image, and writes it to ‘image00.fits’.
- Returns:
None
- preprocessing.masking_and_transpose.load_data(file: str, ext: int) Cube[source]
Load data from a file.
- Parameters:
file (str) – The file path.
ext (int) – The extension number.
- Returns:
The sum of the cube data along the specified axis.
- Return type:
mpdaf.obj.Cube
- preprocessing.masking_and_transpose.transpose_cube_data(cube_data: ndarray, dy: int, dx: int, file_path: str) None[source]
Function to transpose cube data and write it to a file.
- Parameters:
cube_data (np.ndarray) – The cube data to be processed
dy (int) – The y dimension of the cube data
dx (int) – The x dimension of the cube data
file_path (str) – Path to the file where the processed data will be written
- Returns:
None