nenupy.io.xst.XST
- class nenupy.io.xst.XST(file_name)[source]
Bases:
StatisticsData,CrossletCrosslet STatistics reading class.
See also
Methods
__init__(file_name)get([polarization, miniarray_selection, ...])Main data selection method.
get_beamform(pointing[, ...])Perform beamforming operation on XST-like NenuFAR visibilities.
get_stokes([stokes, miniarray_selection, ...])Converts cross-correlation visibilities to Stokes parameter.
info()Print the basic file information.
rephase(phase_center)_summary_
Attributes
Returns the mid frequency of the recorded subbands.
Retrieves the list of Mini-Arrays used to get the cross-correlations.
_summary_
- property frequencies
Returns the mid frequency of the recorded subbands.
- get(polarization='XX', miniarray_selection=None, frequency_selection=None, time_selection=None)
Main data selection method.
- Parameters:
polarization (
str, optional) – Cross-correlation polarization selection (can either be “XX”, “XY”, “YX”, “YY”), for Stokes parameters seeget_stokes(), by default “XX”miniarray_selection (
ndarray, optional) – Mini-Arrays selection, the visibilities will be filter to only take into account cross-correlations involving Mini-Arrays from the list provided, by defaultNone(i.e., all available Mini-Arrays)frequency_selection (
str, optional) – Frequency selection code (e.g., “>=40MHz & <51.1MHz”), by defaultNone(i.e., all available frequencies)time_selection (
str, optional) – Time selection code (e.g., “<2024-06-21T12:32:40”), by defaultNone(i.e., all available time samples)
- Returns:
Data selection.
- Return type:
Example
>>> from nenupy.io.xst import XST >>> import numpy as np >>> xst = XST(".../nenupy/tests/test_data/XST.fits") >>> xx_data = xst.get( polarization="XX", miniarray_selection=np.array([0, 2, 3]), frequency_selection=">73MHz & <75MHz", time_selection="<2020-02-19T19:00:00" ) >>> xx_data.value.shape, xx_data.time.shape, xx_data.frequency.shape ((1, 7, 6), (1,), (7,))
- get_beamform(pointing, frequency_selection=None, time_selection=None, mini_arrays=array([0, 1]), polarization='NW', calibration='default')
Perform beamforming operation on XST-like NenuFAR visibilities. In a nutsheel, this method transforms XST into BST.
- Parameters:
pointing (
Pointing) – Pointing instance, describing where the beamforming must be applied across timefrequency_selection (
str, optional) – Frequency selection (seeget()), by defaultNonetime_selection (
str, optional) – Time selection (seeget()), by defaultNonemini_arrays (
ndarray, optional) – Mini-Array selection (seeget()), by defaultnp.array([0, 1])polarization (
str, optional) – Polarization selection of the output data (can either be “NW” or “NE”), by default “NW”calibration (
str, optional) – Residual delay calibration file to be used during beamforming, “none” does not apply any calibration, by default “default”
- Returns:
Beamformed data from XST-like visibilities.
- Return type:
- Raises:
IndexError – Raised if the Mini Array selection is not valid.
Example
>>> from nenupy.io.bst import BST, XST >>> from nenupy.astro.pointing import Pointing >>> bst = BST("20191129_141900_BST.fits") >>> xst = XST("20191129_141900_XST.fits") >>> bf_cal = xst.get_beamform( pointing = Pointing.from_bst(bst, beam=0, analog=False), mini_arrays=bst.mini_arrays, calibration="default" )
See also
- get_stokes(stokes='I', miniarray_selection=None, frequency_selection=None, time_selection=None)
Converts cross-correlation visibilities to Stokes parameter. Available Stokes parameters “I”, “Q”, “U”, “V”, “FL” or “FV” are respectively computed as follows:
\[\begin{split}\begin{cases} \rm{I} = \frac{1}{2}(\rm{XX} + \rm{YY})\\ \rm{Q} = \frac{1}{2}(\rm{XX} - \rm{YY})\\ \rm{U} = \frac{1}{2}(\rm{XY} + \rm{YX})\\ \rm{V} = \frac{-i}{2}(\rm{XY} - \rm{YX})\\ \frac{\rm{L}}{\rm{I}} = \frac{\sqrt{\rm{Q}^2 + \rm{U}^2}}{\rm{I}}\\ \frac{\rm{V}}{\rm{I}} = \frac{\rm{V}}{\rm{I}}\\ \end{cases}\end{split}\]- Parameters:
stokes (
str, optional) – Stokes parameter to synthetize (can either be “I”, “Q”, “U”, “V”, “FL” or “FV”), by default “I”miniarray_selection (
ndarray, optional) – Mini-Arrays selection, the visibilities will be filter to only take into account cross-correlations involving Mini-Arrays from the list provided, by defaultNone(i.e., all available Mini-Arrays)frequency_selection (
str, optional) – Frequency selection code (e.g., “>=40MHz & <51.1MHz”), by defaultNone(i.e., all available frequencies)time_selection (
str, optional) – Time selection code (e.g., “<2024-06-21T12:32:40”), by defaultNone(i.e., all available time samples)
- Returns:
Data selection converted to desired Stokes parameter.
- Return type:
Example
>>> from nenupy.io.xst import XST >>> import numpy as np >>> xst = XST(".../nenupy/tests/test_data/XST.fits") >>> u_data = xst.get_stokes( polarization="U", miniarray_selection=np.array([0, 2, 3]), frequency_selection=">73MHz & <75MHz", time_selection="<2020-02-19T19:00:00" ) >>> u_data.value.shape, u_data.time.shape, u_data.frequency.shape ((1, 7, 6), (1,), (7,))
- info()
Print the basic file information.
Example
>>> from nenupy.io.bst import BST >>> bst = BST("/path/to/20231201_021200_BST.fits") >>> bst.info() file: '/path/to/20231201_021200_BST.fits' frequency (384,): 11.9140625 MHz -- 86.71875 MHz time (13600,): 2023-12-01T02:13:10.000 -- 2023-12-01T05:59:49.000 data: (13600, 2, 768)
- property mini_arrays
Retrieves the list of Mini-Arrays used to get the cross-correlations.
- Getter:
Mini-Arrays list.
- Type:
- property phase_center
_summary_
- Returns:
_description_
- Return type:
SkyCoord
- rephase(phase_center)
_summary_
- Parameters:
phase_center (SkyCoord) – _description_
- Returns:
_description_
- Return type:
- Raises:
ValueError – _description_