aces.beamset.mapset

Defines the MapSet subclass of BeamSet Copyright (C) CSIRO 2017

Module Contents

Classes

MapSet

MapSet is based on BeamSet. See comments in that class, which describes the structure of data

class aces.beamset.mapset.MapSet(metadata=None, data=None, flags=None, filename=None)[source]

Bases: aces.beamset.beamset.BeamSet

MapSet is based on BeamSet. See comments in that class, which describes the structure of data and flag arrays.

MapSet holds sets of beam maps (the payloads), assumed to be held as 2D ndarrays of complex values. Axis length and grid interval can be different, but gird intervals are equal in the two directions after interpolation.

Metadata items additional to those defined for BeamSet: * ‘xAxis’ - list of grid positions in x-direction * ‘yAxis’ - list of grid positions in y-direction

metadataDefaults[source]
allowedMapTypes = ['complex', 'amplitude', 'phase', 'power', 'real', 'imag'][source]
payloadtype = 'complex'[source]
print_summary()[source]

Prints to standard output a summary

set_phase_to_zero()[source]
set_interp(interp_step=None)[source]

Sets the grid interval for map interpolation to be the smaller of the current interval and the given value. :param interp_step: New grid interval for interpolation, in degrees.

get_beam_positions()[source]

Return beam positions in array index space. :return:

put_map_array(selection, data)[source]
Parameters:
  • selection – slice destination array

  • data – 2D ndarray of values

get_map(selection, maptype='amplitude', normalise=False, average=None, flag=None)[source]

Retrieves a single map from the set as a BeamMap object.

Parameters:
  • selection – a slice into the data and flag arrays

  • maptype – must be one of [‘complex’,’amplitude’,’phase’,’power’,’real’,’imag’]

  • normalise – If True, the map data will be divided by its absolute maximum value before return

  • average – str, can be [‘antennas’, ‘channels’, ‘both’]. Takes the average along the ‘antennas’ or ‘channels’ axis, or ‘both’. If specified, the corresponding value in ‘section’ will be ignored.

  • flag – str, can be [‘antennas’, ‘channels’, ‘both’]. If taking an average, removes the ‘bad_ants’ or ‘bad_chans’ values from the mean.

Returns:

An instance of BeamMap

get_map_stokes_i(selection, normalise=True)[source]

Retrieves a single map from the set as a BeamMap object, constructed as Stokes I. The polarization portion of the selection is ignored. (In future this could be generalized as any linear combination of individual polarized images.) :param selection: a slice into the data and flag arrays :param normalise: If True, the map data will be divided by its absolute maximum value before return

Returns:

An instance of BeamMap as a “pseudo” Stokes I map: the mean of XX and YY power maps

get_map_stokes(selection, stokes='I', normalise=False, average=None, flag=None)[source]

Retrieves a single map from the set as a BeamMap object, constructed as a Stokes parameter.

WARNING: Normalisation seems to break things at the moment

Note the difference between ASKAP Stokes definitions and ‘standard’:
# ‘Standard’ Stokes convention

# I = new_XX + new_YY # Q = new_XX - new_YY # U = new_XY + new_YX # V = -1j * (new_XY - new_YX)

# ASKAP Stokes convention

# I_A = new_XX + new_YY # Q_A = new_XX - new_YY # U_A = new_XY + new_YX # V_A = 1j * (new_XY - new_YX)

This will be in the antenna frame, and will need to be rotated to the sky frame.

The polarization portion of the selection is ignored.

Parameters:
  • selection – A slice into the data and flag arrays

  • normalise – If True, the map data will be divided by its absolute maximum value before return

  • average – str, can be [‘antennas’, ‘channels’, ‘both’]. Takes the average along the ‘antennas’ or ‘channels’ axis, or ‘both’. If specified, the corresponding value in ‘section’ will be ignored.

  • flag – str, can be [‘antennas’, ‘channels’, ‘both’]. If taking an average, removes the ‘bad_ants’ or ‘bad_chans’ values from the mean.

Returns:

An instance of BeamMap as a Stokes map.

_get_map(selection, maptype, normalise, average=None, flag=None)[source]
Parameters:
  • selection

  • maptype – in [‘complex’, ‘amplitude’, ‘phase’, ‘power’, ‘real’, ‘imag’]

  • normalise

  • average

  • flag

Returns:

_get_map4(selection, maptype, normalise, average=None, flag=None)[source]

Return a set of 4 maps, one for each native polarisation. :param selection: :param maptype: in [‘complex’, ‘amplitude’, ‘phase’, ‘power’, ‘real’, ‘imag’] :param normalise: :param average: :param flag: :return:

_interpolate(selection, average=None, flag=None)[source]
get_badvals(which='both', show_plots=True, sigma_chan=3, maxiter_chan=3, sigma_ant=3, maxiter_ant=1)[source]

Get the indices of bad data. Uses the sigma clipping of the RMS across beams along either the antenna or channel axis. Uses the XX polarisation.

Parameters:
  • which – str, can be ‘channels’, ‘antennas’, or ‘both’

  • show_plots – if True show plots of the variation in each beam.

  • sigma_chan – passed on to astropy.stats.sigma_clip

  • maxiter_chan – passed on to astropy.stats.sigma_clip

  • sigma_ant – passed on to astropy.stats.sigma_clip

  • maxiter_ant – passed on to astropy.stats.sigma_clip

static _do_axis(axis, step)[source]
Parameters:
  • axis

  • step

Returns:

static _interp2D_cmplx(z, outs)[source]

:param z Complex 2D function :param ins X,Y grid ins[N,2] square NxN grid :param outs X,Y grid for evaluation outs[M,2] M ≥ 1

static _sky_transform(data)[source]
static sky_transform_hyper(data)[source]