nenupy.io.xst


XST file

Inheritance diagram of nenupy.io.xst.XST, nenupy.io.xst.NenufarTV

XST(file_name)

Crosslet STatistics reading class.

NenufarTV(file_name)

Crosslet abstract class (both for XST and NenuFAR TV dat files).

TV_Image(tv_image, analog_pointing, fov_radius)

TV_Nearfield(nearfield, source_imprints, ...)

class nenupy.io.xst.Crosslet[source]

Bases: ABC

Crosslet abstract class (both for XST and NenuFAR TV dat files).

Methods Summary

get([polarization, miniarray_selection, ...])

get_stokes([stokes, miniarray_selection, ...])

frequency_selection and time_selection

get_beamform(pointing[, ...])

Example:

Attributes and Methods Documentation

get(polarization='XX', miniarray_selection=None, frequency_selection=None, time_selection=None)[source]
get_beamform(pointing, frequency_selection=None, time_selection=None, mini_arrays=array([0, 1]), polarization='NW', calibration='default')[source]
Example:

from nenupy.io.bst import BST, XST 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”

)

get_stokes(stokes='I', miniarray_selection=None, frequency_selection=None, time_selection=None)[source]

frequency_selection and time_selection

arguments accept str values formatted as, e.g., '>={value}' or '>={value_1} & <{value_2}' or '=={value}'.

Parameters:
  • frequency_selection (str) – Frequency selection. The expected '{value}' format is frequency units, e.g. '>=50MHz' or '< 1 GHz'. Default is None (i.e., no selection upon frequency).

  • time_selection (str) – Time selection. The expected '{value}' format is ISOT, e.g. '>=2022-01-01T12:00:00'. Default is None (i.e., no selection upon time).

  • stokes (str) – Stokes parameters to return

\[\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}\]
class nenupy.io.xst.NenufarTV(file_name)[source]

Bases: StatisticsData, Crosslet

Crosslet abstract class (both for XST and NenuFAR TV dat files).

Attributes Summary

frequencies

Returns the mid frequency of the recorded subbands.

Methods Summary

get([polarization, miniarray_selection, ...])

get_stokes([stokes, miniarray_selection, ...])

frequency_selection and time_selection

get_beamform(pointing[, ...])

Example:

compute_nenufar_tv([analog_pointing_file])

kwargs fov_radius resolution stokes

compute_nearfield_tv([sources])

kwargs

Attributes and Methods Documentation

compute_nearfield_tv(sources=[], **kwargs)[source]
kwargs

stokes radius npix

Example:

from nenupy.io.xst import NenufarTV tv = NenufarTV(“20191204_132113_nenufarTV.dat”) nf_object = tv.compute_nearfield_tv(

sources=[“Cyg A”, “Cas A”, “Vir A”, “Tau A”, “Sun”], npix=64

)

compute_nenufar_tv(analog_pointing_file=None, **kwargs)[source]

kwargs fov_radius resolution stokes

load_tv_data()[source]
class nenupy.io.xst.TV_Image(tv_image, analog_pointing, fov_radius)[source]

Bases: object

classmethod from_fits(file_name)[source]
save_fits(file_name, partial=True)[source]
save_png(figname='', beam_contours=True, show_sources=True, **kwargs)[source]
class nenupy.io.xst.TV_Nearfield(nearfield, source_imprints, npix, time, frequency, radius, mini_arrays, stokes)[source]

Bases: object

classmethod from_fits(file_name)[source]

Loads a nearfield previously stored in a FITS file.

Parameters:

file_name (str) – Path to the FITS file containing a near-field image (whose format is such as created by the save_fits() method).

Returns:

Instance of TV_Nearfield.

Return type:

TV_Nearfield

Example:

from nenupy.io.xst import TV_Nearfield nf = TV_Nearfield.from_fits(“/path/to/nearfield.fits”)

save_fits(file_name)[source]

Saves a nearfield made from NenuFAR TV data as a FITS file.

Parameters:

file_name (str) – Name of the file to save.

Example:

from nenupy.io.xst import NenufarTV tv = NenufarTV(“20191204_132113_nenufarTV.dat”) nf_object = tv.compute_nearfield_tv(sources=[“Cyg A”, “Cas A”, “Sun”]) nf_object.save_fits(file_name=”/path/to/nearfield.fits”)

save_png(figname='', **kwargs)[source]
class nenupy.io.xst.XST(file_name)[source]

Bases: StatisticsData, Crosslet

Crosslet STatistics reading class.

Attributes Summary

mini_arrays

Retrieves the list of Mini-Arrays used to get the cross-correlations.

Methods Summary

get([polarization, miniarray_selection, ...])

get_stokes([stokes, miniarray_selection, ...])

frequency_selection and time_selection

get_beamform(pointing[, ...])

Example:

Attributes and Methods Documentation

property mini_arrays

Retrieves the list of Mini-Arrays used to get the cross-correlations.

Getter:

Mini-Arrays list.

Type:

ndarray

class nenupy.io.xst.XST_Slice(mini_arrays, time, frequency, value)[source]

Bases: object

Class to handle the result of selection upon XST-like data.

Methods Summary

plot_correlaton_matrix([mask_autocorrelations])

Plots the cross-correlation matrix.

rephase_visibilities(phase_center, uvw)

make_image([resolution, fov_radius, ...])

Example:

make_nearfield([radius, npix, sources])

Computes the Near-field image from the cross-correlation statistics data \(\mathcal{V}\).

Attributes and Methods Documentation

make_image(resolution=<Quantity 1. deg>, fov_radius=<Quantity 25. deg>, phase_center=None, stokes='I')[source]
Example:

xst = XST(“XST.fits”) data = xst.get_stokes(“I”) sky = data.make_image(

resolution=0.5*u.deg, fov_radius=27*u.deg, phase_center=SkyCoord(277.382, 48.746, unit=”deg”)

) sky[0, 0, 0].plot(

center=SkyCoord(277.382, 48.746, unit=”deg”), radius=24.5*u.deg

)

make_nearfield(radius=<Quantity 400. m>, npix=64, sources=[])[source]

Computes the Near-field image from the cross-correlation statistics data \(\mathcal{V}\).

The distances between each Mini-Array \({\rm MA}_i\) and the ground positions \(\Delta\) is:

\[d_{\rm{MA}_i} (x, y) = \sqrt{ ({\rm MA}_{i, x} - \Delta_x)^2 + ({\rm MA}_{i, y} - \Delta_y)^2 + \left( {\rm MA}_{i, z} - \sum_j \frac{{\rm MA}_{j, z}}{n_{\rm MA}} - 1 \right)^2 }\]

Then, the near-field image \(n_f\) can be retrieved as follows (\(k\) and \(l\) being two distinct Mini-Arrays):

\[n_f (x, y) = \sum_{k, l} \left| \sum_{\nu} \langle \mathcal{V}_{\nu, k, l}(t) \rangle_t e^{2 \pi i \left( d_{{\rm MA}_k} - d_{{\rm MA}_l} \right) (x, y) \frac{\nu}{c}} \right|\]

Note

To simulate astrophysical source of brightness \(\mathcal{B}\) footprint on the near-field, its visibility per baseline of Mini-Arrays \(k\) and \(l\) are computed as:

\[\mathcal{V}_{{\rm simu}, k, l} = \mathcal{B} e^{2 \pi i \left( \mathbf{r}_k - \mathbf{r}_l \right) \cdot \mathbf{u} \frac{\nu}{c}}\]

with \(\mathbf{r}\) the ENU position of the Mini-Arrays, \(\mathbf{u} = \left( \cos(\theta) \sin(\phi), \cos(\theta) \cos(\phi), sin(\theta) \right)\) the ground projection vector (in East-North-Up coordinates), (\(\phi\) and \(\theta\) are the source horizontal coordinates azimuth and elevation respectively).

Parameters:
  • radius (Quantity) – Radius of the ground image. Default is 400m.

  • npix (int) – Number of pixels of the image size. Default is 64.

  • sources (list) – List of source names for which their near-field footprint may be computed. Only sources above 10 deg elevation will be considered.

Returns:

Tuple of near-field image and a dictionnary containing all source footprints.

Return type:

(ndarray, dict)

Example:
from nenupy.io.xst import XST

xst = XST("xst_file.fits")
nearfield, src_dict = xst.make_nearfield(sources=["Cas A", "Sun"])

Added in version 1.1.0.

plot_correlaton_matrix(mask_autocorrelations=False, **kwargs)[source]

Plots the cross-correlation matrix.

param mask_autocorrelations:

If set to True, the auto-correlation diagnoal is hidden. Default is False.

type mask_autocorrelations:

bool

Several parameters, listed below, can be tuned to adapt the plot to the user requirements:

Data display keywords

param decibel:

If set to True, the data will be displayed in a decibel scale (i.e., :math:`{

m dB} = 10 log_{10}({ m data})`).

Default is True.

type decibel:

bool

param vmin:

Dynamic spectrum plot only. Minimal data value to display.

type vmin:

float

param vmax:

Dynamic spectrum plot only. Maximal data value to display.

type vmax:

float

Plotting layout keywords

param figname:

Name of the file (absolute or relative path) to save the figure. Default is '' (i.e., only show the figure).

type figname:

str

param figsize:

Set the figure size. Default is (10, 10).

type figsize:

tuple

param title:

Set the figure title. Default is ''.

type title:

str

param colorbar_label:

Dynamic spectrum plot only. Label of the color bar. Default is 'Amp' if decibel=False and 'dB' otherwise.

type colorbar_label:

str

param cmap:

Dynamic spectrum plot only. Color map used to represent the data. Default is 'YlGnBu_r'.

type cmap:

str

Example:
from nenupy.io.xst import XST

xst = XST("/path/to/XST.fits")
data = xst.get....
rephase_visibilities(phase_center, uvw)[source]