Cross-Correlation STatistics (XST)

XST

XST selection

get()

from nenupy.io.xst import XST

xst = XST("20191129_141900_XST.fits")

xst_data = xst.get(
    polarization="XX",
    miniarray_selection=None,
    frequency_selection=">=20MHz",
    time_selection=">=2019-11-19T15:15:00"
)

XST_Slice, plot_correlaton_matrix()

xst_data.plot_correlaton_matrix()
../_images/correlation_matrix.png

Cross-correlation matrix.

Beamforming from cross-correlations

from nenupy.io.bst import BST
from nenupy.io.xst import XST

bst = BST("20191129_141900_BST.fits")
xst = XST("20191129_141900_XST.fits")

bst_data = bst.get(frequency_selection="==40.234375MHz")

get_beamform()

from nenupy.astro.pointing import Pointing

bf_cal = xst.get_beamform(
    pointing=Pointing.from_bst(bst, beam=0, analog=False),
    frequency_selection="==40.234375MHz",
    mini_arrays=bst.mini_arrays,
    calibration="default"
)
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(7, 4))
plt.plot(bst_data.time.datetime, bst_data.value, label="BST data", linewidth=3)
plt.plot(bf_uncal.time.datetime, bf_uncal.value, label="XST data uncalibrated", linewidth=1)
plt.plot(bf_cal.time.datetime, bf_cal.value, label="XST data", linewidth=0.5, color="tab:red")
plt.legend()
plt.xlabel(f"Time (UTC from {bst_data.time[0].isot})")
plt.ylabel("Amp")
../_images/beamforming_from_xst.png

BST data versus time, against re-constructed beamformed data from XST (uncalibrated or calibrated with the default table used to obtain the BST). The blue (BST) and orange (calibrated XST) curves are perfectly aligned as expected.

Image from XST

get_stokes(), make_image()

plot()

import astropy.units as u
from astropy.coordinates import SkyCoord

xst_data = xst.get_stokes(
    stokes="I",
    miniarray_selection=None,
    frequency_selection=">=20MHz",
    time_selection=">=2019-11-19T15:15:00"
)

cyg_a = SkyCoord.from_name("Cyg A")

im = xst_data.make_image(
    resolution=1*u.deg,
    fov_radius=20*u.deg,
    phase_center=cyg_a,
    stokes="I"
)

im[0, 0, 0].plot(
    center=cyg_a,
    radius=17*u.deg,
    colorbar_label="Stokes I (arb. units)",
    figsize=(8, 8),
)
../_images/xst_image.png

Cygnus A image obtained from XST data.

Near-field imprint from XST

get_stokes(), make_nearfield()

TV_Nearfield, save_png()

from nenupy.io.xst import TV_Nearfield

xst_data = xst.get_stokes(
    stokes="I",
    miniarray_selection=None,
    frequency_selection=">=20MHz",
    time_selection="==2019-11-29T16:16:46.000"
)

radius = 400*u.m
npix = 64
nf, source_imprint = xst_data.make_nearfield(
    radius=radius,
    npix=npix,
    sources=["Cyg A", "Cas A", "Sun"]
)

nearfield = TV_Nearfield(
    nearfield=nf,
    source_imprints=source_imprint,
    npix=npix,
    time=xst_data.time[0],
    frequency=np.mean(xst_data.frequency),
    radius=radius,
    mini_arrays=xst_data.mini_arrays,
    stokes="I"
)

nearfield.save_png(
    figsize=(8, 8)
)
../_images/xst_nearfield.png

XST near-field.

NenuFAR TV

NenufarTV

from nenupy.io.xst import NenufarTV

tv = NenufarTV("/path/to/nenufarTV.dat")

TV Image

compute_nenufar_tv()

tv_image = tv.compute_nenufar_tv(
    sources=["Cyg A", "Cas A"],
    stokes="I"
)
tv_image.save_png()
../_images/nenufartv_im.png

NenuFAR-TV image.

TV Near-field

compute_nearfield_tv()

tv_nearfield = tv.compute_nearfield_tv(
    sources=["Cyg A", "Cas A"],
    stokes="I"
)
tv_nearfield.save_png()

TV_Nearfield, save_png()

../_images/nenufartv_nf.png

NenuFAR-TV near-field.