astrohack.io.image_mds¶
Module Contents¶
Classes¶
Data class for image data. |
-
class
AstrohackImageFile(file: str)[source]¶ Data class for image data.
Data within an object of this class can be selected for further inspection, plotted or produce a report
-
export_to_fits(self, destination: str, complex_split: str = 'cartesian', ant: Union[str, List[str]] = 'all', ddi: Union[str, int, List[int]] = 'all', parallel: bool = False) → None[source]¶ Export contents of an AstrohackImageFile object to several FITS files in the destination folder
- Parameters
destination (str) – Name of the destination folder to contain plots
complex_split (str, optional) – How to split complex data, cartesian (real + imag, default) or polar (amplitude + phase)
ant (list or str, optional) – List of antennas/antenna to be plotted, defaults to “all” when None, ex. ea25
ddi (list or int, optional) – List of ddi to be plotted, defaults to “all” when None, ex. 0
parallel (bool, optional) – If True will use an existing astrohack client to export FITS in parallel, default is False
Export the products from the holog mds onto FITS files to be read by other software packages
Additional Information The image products of holog are complex images due to the nature of interferometric measurements and Fourier transforms, currently complex128 FITS files are not supported by astropy, hence the need to split complex images onto two real image products, we present the user with two options to carry out this split.
Available complex splitting possibilities:
cartesian: Split is done to a real part and an imaginary part FITS files
polar: Split is done to an amplitude and a phase FITS files
The FITS files produced by this function have been tested and are known to work with CARTA and DS9
-
plot_apertures(self, destination: str, ant: Union[str, List[str]] = 'all', ddi: Union[str, int, List[int]] = 'all', polarization_state: Union[str, List[str]] = 'I', plot_screws: bool = False, amplitude_limits: Union[List[float], Tuple, numpy.array] = None, phase_unit: str = 'deg', phase_limits: Union[List[float], Tuple, numpy.array] = None, deviation_unit: str = 'mm', deviation_limits: Union[List[float], Tuple, numpy.array] = None, panel_labels: bool = False, display: bool = False, colormap: str = 'viridis', figure_size: Union[Tuple, List[float], numpy.array] = None, dpi: int = 300, parallel: bool = False) → None[source]¶ Aperture amplitude and phase plots from the data in an AstrohackImageFIle object.
- Parameters
destination (str) – Name of the destination folder to contain plots
ant (list or str, optional) – List of antennas/antenna to be plotted, defaults to “all” when None, ex. ea25
ddi (list or int, optional) – List of ddis/ddi to be plotted, defaults to “all” when None, ex. 0
polarization_state (list or str, optional) – List of polarization states/ polarization state to be plotted, defaults to “I”
plot_screws (bool, optional) – Add screw positions to plot, default is False
amplitude_limits (numpy.ndarray, list, tuple, optional) – Lower than Upper limit for amplitude in volts default is None (Guess from data)
phase_unit (str, optional) – Unit for phase plots, defaults is ‘deg’
phase_limits (numpy.ndarray, list, tuple, optional) – Lower than Upper limit for phase, value in phase_unit, default is None (Guess from data)
deviation_unit (str, optional) – Unit for deviation plots, defaults is ‘mm’
deviation_limits (numpy.ndarray, list, tuple, optional) – Lower than Upper limit for deviation, value in deviation_unit, default is None (Guess from data)
panel_labels (bool, optional) – Add panel labels to antenna surface plots, default is False
display (bool, optional) – Display plots inline or suppress, defaults to True
colormap (str, optional) – Colormap for plots, default is viridis
figure_size (numpy.ndarray, list, tuple, optional) – 2 element array/list/tuple with the plot sizes in inches
dpi (int, optional) – dots per inch to be used in plots, default is 300
parallel (bool, optional) – If True will use an existing astrohack client to produce plots in parallel, default is False
Produce plots from
astrohack.hologresults for analysis
-
plot_beams(self, destination: str, ant: Union[str, List[str]] = 'all', ddi: Union[str, int, List[int]] = 'all', complex_split: str = 'polar', angle_unit: str = 'deg', phase_unit: str = 'deg', display: bool = False, colormap: str = 'viridis', figure_size: Union[Tuple, List[float], numpy.array] = (8, 4.5), dpi: int = 300, parallel: bool = False) → None[source]¶ Beam plots from the data in an AstrohackImageFIle object.
- Parameters
destination (str) – Name of the destination folder to contain plots
ant (list or str, optional) – List of antennas/antenna to be plotted, defaults to “all” when None, ex. ea25
ddi (list or int, optional) – List of ddis/ddi to be plotted, defaults to “all” when None, ex. 0
angle_unit (str, optional) – Unit for L and M axes in plots, default is ‘deg’.
complex_split (str, optional) – How to split complex beam data, cartesian (real + imag) or polar (amplitude + phase, default)
phase_unit (str) – Unit for phase in ‘polar’ plots, default is ‘deg’.
display (bool, optional) – Display plots inline or suppress, defaults to True
colormap (str, optional) – Colormap for plots, default is viridis
figure_size (numpy.ndarray, list, tuple, optional) – 2 element array/list/tuple with the plot sizes in inches
dpi (int, optional) – dots per inch to be used in plots, default is 300
parallel (bool, optional) – If True will use an existing astrohack client to produce plots in parallel, default is False
Produce plots from
astrohack.hologresults for analysis
-
export_phase_fit_results(self, destination: str, ant: Union[str, List[str]] = 'all', ddi: Union[str, int, List[int]] = 'all', angle_unit: str = 'deg', length_unit: str = 'mm', parallel: bool = False) → None[source]¶ Export perturbations phase fit results from the data in an AstrohackImageFIle object to ASCII files.
- Parameters
destination (str) – Name of the destination folder to contain ASCII files
ant (list or str, optional) – List of antennas/antenna to be exported, defaults to “all” when None, ex. ea25
ddi (list or int, optional) – List of ddis/ddi to be exported, defaults to “all” when None, ex. 0
angle_unit (str, optional) – Unit for results that are angles.
length_unit (str, optional) – Unit for results that are displacements.
parallel (bool, optional) – If True will use an existing astrohack client to produce ASCII files in parallel, default is False
Export the results of the phase fitting process in
astrohack.hologfor analysis
-
export_zernike_fit_results(self, destination: str, ant: Union[str, List[str]] = 'all', ddi: Union[str, int, List[int]] = 'all', parallel: bool = False) → None[source]¶ Export Zernike coefficients from the data in an AstrohackImageFIle object to ASCII files.
- Parameters
destination (str) – Name of the destination folder to contain ASCII files
ant (list or str, optional) – List of antennas/antenna to be exported, defaults to “all” when None, ex. ea25
ddi (list or int, optional) – List of ddis/ddi to be exported, defaults to “all” when None, ex. 0
parallel (bool, optional) – If True will use an existing astrohack client to produce ASCII files in parallel, default is False
Export Zernike coefficients from the AstrohackImageFile object obtained during processing in
astrohack.hologfor analysis.
-
plot_zernike_model(self, destination: str, ant: Union[str, List[str]] = 'all', ddi: Union[str, int, List[int]] = 'all', display: bool = False, colormap: str = 'viridis', figure_size: Union[Tuple, List[float], numpy.array] = (16, 9), dpi: int = 300, parallel: bool = False) → None[source]¶ Plot Zernike models from the data in an AstrohackImageFile object.
- Parameters
destination (str) – Name of the destination folder to contain the model plots
ant (list or str, optional) – List of antennas/antenna to be exported, defaults to “all” when None, ex. ea25
ddi (list or int, optional) – List of ddis/ddi to be exported, defaults to “all” when None, ex. 0
display (bool, optional) – Display plots inline or suppress, defaults to True
colormap (str, optional) – Colormap for plots, default is viridis
figure_size (numpy.ndarray, list, tuple, optional) – 2 element array/list/tuple with the plot sizes in inches
dpi (int, optional) – dots per inch to be used in plots, default is 300
parallel (bool, optional) – If True will use an existing astrohack client to produce plots in parallel, default is False
Export Zernike coefficients from the AstrohackImageFile object obtained during processing in
astrohack.hologfor analysis.
-
observation_summary(self, summary_file: str, ant: Union[str, List[str]] = 'all', ddi: Union[str, int, List[int]] = 'all', az_el_key: str = 'center', phase_center_unit: str = 'radec', az_el_unit: str = 'deg', time_format: str = '%d %h %Y, %H:%M:%S', tab_size: int = 3, print_summary: bool = True, parallel: bool = False) → None[source]¶ Create a Summary of observation information
- Parameters
summary_file (str) – Text file to put the observation summary
ant (list or str, optional) – antenna ID to use in subselection, defaults to “all” when None, ex. ea25
ddi (list or int, optional) – data description ID to use in subselection, defaults to “all” when None, ex. 0
az_el_key (str, optional) – What type of Azimuth & Elevation information to print, ‘mean’, ‘median’ or ‘center’, default is ‘center’
phase_center_unit (str, optional) – What unit to display phase center coordinates, ‘radec’ and angle units supported, default is ‘radec’
az_el_unit (str, optional) – Angle unit used to display Azimuth & Elevation information, default is ‘deg’
time_format (str, optional) – datetime time format for the start and end dates of observation, default is “%d %h %Y, %H:%M:%S”
tab_size (int, optional) – Number of spaces in the tab levels, default is 3
print_summary (bool, optional) – Print the summary at the end of execution, default is True
parallel (bool, optional) – Run in parallel, defaults to False
Additional Information
This method produces a summary of the data in the AstrohackImageFile displaying general information, spectral information, beam image characteristics and aperture image characteristics.
-