nenupy.io.xst.NenufarTV
- class nenupy.io.xst.NenufarTV(file_name)[source]
Bases:
StatisticsData,CrossletClass to load and process NenuFAR TV data. Results of such operations can be seen live on NenuFAR-TV where the current view of the Sky observed by NenuFAR is displayed.
- __init__(file_name)[source]
Generate an instance of
NenufarTV- Parameters:
file_name (
str) – NenuFAR-TV data file (must end with .dat)- Raises:
AssertionError – Raised if the data file is not correctly formated
Methods
__init__(file_name)Generate an instance of
NenufarTVcompute_nearfield_tv([sources, stokes, ...])Compute the near-field from NenuFAR-TV data.
compute_nenufar_tv([analog_pointing_file, ...])Compute the NenuFAR-TV image.
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.
_summary_
- compute_nearfield_tv(sources=[], stokes='I', radius=<Quantity 400. m>, npix=64)[source]
Compute the near-field from NenuFAR-TV data.
- Parameters:
sources (
list, optional) – List of celestial sources for which a near-field imprint will be computed (passed tomake_nearfield()), by default []stokes (
str, optional) – Stokes parameter to display (passed toget_stokes()), by default “I”radius (
Quantity, optional) – Ground radius on which the near-field projection is computed (passed tomake_nearfield()), by default 400 metersnpix (
int, optional) – Number of pixels of the image size (passed tomake_nearfield()), by default 64.
- Returns:
The near-field
- Return type:
Example
>>> from nenupy.io.xst import NenufarTV >>> tv = NenufarTV("20191204_132113_nenufarTV.dat") >>> nf_obj = tv.compute_nearfield_tv( sources=["Cyg A", "Cas A", "Vir A", "Tau A", "Sun"], npix=64 )
- compute_nenufar_tv(analog_pointing_file=None, fov_radius=<Quantity 27. deg>, resolution=<Quantity 0.5 deg>, stokes='I')[source]
Compute the NenuFAR-TV image.
- Parameters:
analog_pointing_file (
str, optional) – NenuFAR analog pointing file (as read byfrom_file()), by defaultNone(i.e., a zenithal pointing is assumed)fov_radius (
Quantity, optional) – Radius of the image field of view (passed tomake_image()), by default 27 degreesresolution (
Quantity, optional) – Resolution of the image (passed tomake_image()), by default 0.5 degreestokes (
str, optional) – Stokes parameter to display (passed toget_stokes()), by default “I”
- Returns:
The NenuFAR-TV image
- Return type:
Example
>>> from nenupy.io.xst import NenufarTV >>> tv = NenufarTV("20191204_132113_nenufarTV.dat") >>> tv_obj = tv.compute_nenufar_tv()
- 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)
- abstract 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_