:orphan: :mod:`astrohack.io.image_mds` ============================= .. py:module:: astrohack.io.image_mds Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: astrohack.io.image_mds.AstrohackImageFile .. class:: AstrohackImageFile(file: str) Data class for image data. Data within an object of this class can be selected for further inspection, plotted or produce a report .. method:: 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 Export contents of an AstrohackImageFile object to several FITS files in the destination folder :param destination: Name of the destination folder to contain plots :type destination: str :param complex_split: How to split complex data, cartesian (real + imag, default) or polar (amplitude + phase) :type complex_split: str, optional :param ant: List of antennas/antenna to be plotted, defaults to "all" when None, ex. ea25 :type ant: list or str, optional :param ddi: List of ddi to be plotted, defaults to "all" when None, ex. 0 :type ddi: list or int, optional :param parallel: If True will use an existing astrohack client to export FITS in parallel, default is False :type parallel: bool, optional .. _Description: 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. .. rubric:: 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 .. method:: 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 Aperture amplitude and phase plots from the data in an AstrohackImageFIle object. :param destination: Name of the destination folder to contain plots :type destination: str :param ant: List of antennas/antenna to be plotted, defaults to "all" when None, ex. ea25 :type ant: list or str, optional :param ddi: List of ddis/ddi to be plotted, defaults to "all" when None, ex. 0 :type ddi: list or int, optional :param polarization_state: List of polarization states/ polarization state to be plotted, defaults to "I" :type polarization_state: list or str, optional :param plot_screws: Add screw positions to plot, default is False :type plot_screws: bool, optional :param amplitude_limits: Lower than Upper limit for amplitude in volts default is None (Guess from data) :type amplitude_limits: numpy.ndarray, list, tuple, optional :param phase_unit: Unit for phase plots, defaults is 'deg' :type phase_unit: str, optional :param phase_limits: Lower than Upper limit for phase, value in phase_unit, default is None (Guess from data) :type phase_limits: numpy.ndarray, list, tuple, optional :param deviation_unit: Unit for deviation plots, defaults is 'mm' :type deviation_unit: str, optional :param deviation_limits: Lower than Upper limit for deviation, value in deviation_unit, default is None (Guess from data) :type deviation_limits: numpy.ndarray, list, tuple, optional :param panel_labels: Add panel labels to antenna surface plots, default is False :type panel_labels: bool, optional :param display: Display plots inline or suppress, defaults to True :type display: bool, optional :param colormap: Colormap for plots, default is viridis :type colormap: str, optional :param figure_size: 2 element array/list/tuple with the plot sizes in inches :type figure_size: numpy.ndarray, list, tuple, optional :param dpi: dots per inch to be used in plots, default is 300 :type dpi: int, optional :param parallel: If True will use an existing astrohack client to produce plots in parallel, default is False :type parallel: bool, optional .. _Description: Produce plots from ``astrohack.holog`` results for analysis .. method:: 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 Beam plots from the data in an AstrohackImageFIle object. :param destination: Name of the destination folder to contain plots :type destination: str :param ant: List of antennas/antenna to be plotted, defaults to "all" when None, ex. ea25 :type ant: list or str, optional :param ddi: List of ddis/ddi to be plotted, defaults to "all" when None, ex. 0 :type ddi: list or int, optional :param angle_unit: Unit for L and M axes in plots, default is 'deg'. :type angle_unit: str, optional :param complex_split: How to split complex beam data, cartesian (real + imag) or polar (amplitude + phase, default) :type complex_split: str, optional :param phase_unit: Unit for phase in 'polar' plots, default is 'deg'. :type phase_unit: str :param display: Display plots inline or suppress, defaults to True :type display: bool, optional :param colormap: Colormap for plots, default is viridis :type colormap: str, optional :param figure_size: 2 element array/list/tuple with the plot sizes in inches :type figure_size: numpy.ndarray, list, tuple, optional :param dpi: dots per inch to be used in plots, default is 300 :type dpi: int, optional :param parallel: If True will use an existing astrohack client to produce plots in parallel, default is False :type parallel: bool, optional .. _Description: Produce plots from ``astrohack.holog`` results for analysis .. method:: 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 Export perturbations phase fit results from the data in an AstrohackImageFIle object to ASCII files. :param destination: Name of the destination folder to contain ASCII files :type destination: str :param ant: List of antennas/antenna to be exported, defaults to "all" when None, ex. ea25 :type ant: list or str, optional :param ddi: List of ddis/ddi to be exported, defaults to "all" when None, ex. 0 :type ddi: list or int, optional :param angle_unit: Unit for results that are angles. :type angle_unit: str, optional :param length_unit: Unit for results that are displacements. :type length_unit: str, optional :param parallel: If True will use an existing astrohack client to produce ASCII files in parallel, default is False :type parallel: bool, optional .. _Description: Export the results of the phase fitting process in ``astrohack.holog`` for analysis .. method:: export_zernike_fit_results(self, destination: str, ant: Union[str, List[str]] = 'all', ddi: Union[str, int, List[int]] = 'all', parallel: bool = False) -> None Export Zernike coefficients from the data in an AstrohackImageFIle object to ASCII files. :param destination: Name of the destination folder to contain ASCII files :type destination: str :param ant: List of antennas/antenna to be exported, defaults to "all" when None, ex. ea25 :type ant: list or str, optional :param ddi: List of ddis/ddi to be exported, defaults to "all" when None, ex. 0 :type ddi: list or int, optional :param parallel: If True will use an existing astrohack client to produce ASCII files in parallel, default is False :type parallel: bool, optional .. _Description: Export Zernike coefficients from the AstrohackImageFile object obtained during processing in ``astrohack.holog`` for analysis. .. method:: 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 Plot Zernike models from the data in an AstrohackImageFile object. :param destination: Name of the destination folder to contain the model plots :type destination: str :param ant: List of antennas/antenna to be exported, defaults to "all" when None, ex. ea25 :type ant: list or str, optional :param ddi: List of ddis/ddi to be exported, defaults to "all" when None, ex. 0 :type ddi: list or int, optional :param display: Display plots inline or suppress, defaults to True :type display: bool, optional :param colormap: Colormap for plots, default is viridis :type colormap: str, optional :param figure_size: 2 element array/list/tuple with the plot sizes in inches :type figure_size: numpy.ndarray, list, tuple, optional :param dpi: dots per inch to be used in plots, default is 300 :type dpi: int, optional :param parallel: If True will use an existing astrohack client to produce plots in parallel, default is False :type parallel: bool, optional .. _Description: Export Zernike coefficients from the AstrohackImageFile object obtained during processing in ``astrohack.holog`` for analysis. .. method:: 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 Create a Summary of observation information :param summary_file: Text file to put the observation summary :type summary_file: str :param ant: antenna ID to use in subselection, defaults to "all" when None, ex. ea25 :type ant: list or str, optional :param ddi: data description ID to use in subselection, defaults to "all" when None, ex. 0 :type ddi: list or int, optional :param az_el_key: What type of Azimuth & Elevation information to print, 'mean', 'median' or 'center', default is 'center' :type az_el_key: str, optional :param phase_center_unit: What unit to display phase center coordinates, 'radec' and angle units supported, default is 'radec' :type phase_center_unit: str, optional :param az_el_unit: Angle unit used to display Azimuth & Elevation information, default is 'deg' :type az_el_unit: str, optional :param time_format: datetime time format for the start and end dates of observation, default is "%d %h %Y, %H:%M:%S" :type time_format: str, optional :param tab_size: Number of spaces in the tab levels, default is 3 :type tab_size: int, optional :param print_summary: Print the summary at the end of execution, default is True :type print_summary: bool, optional :param parallel: Run in parallel, defaults to False :type parallel: bool, optional **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.