aces.utilities.emsim.readmat

Module Contents

Functions

grid_from_file(regions_fname[, n_regions])

Load cartesian grid and differential solid angle from .mat files made by Stuart's simulations of ASKAP patterns

field_from_file(field_fname[, n_regions, debug])

Load far-field electric field (far-field pattern) from Stuart's simulations of ASKAP patterns

interpolate_sub_slow(e_field, xyz, xyz_target)

Interpolate function at finite list of coordinates that are not necessarily on a grid

interp_weights(xy, uv[, d])

Setup function for reimplementation of scipy.interpolate.griddata to avoid repeating setup for repeated

interpolate(values, vtx, wts)

Reimplementation of scipy.interpolate.griddata to avoid repeating setup for repeated interpolation for common input

interpolate_sub(e_field, xyz, xyz_target)

Interpolate function at finite list of coordinates that are not necessarily on a grid

Attributes

N_REGIONS

POINTS_PER_REGION

N_PORTS

portmapx

portmapy

portmap

portmap

aces.utilities.emsim.readmat.N_REGIONS = 54[source]
aces.utilities.emsim.readmat.POINTS_PER_REGION = 961[source]
aces.utilities.emsim.readmat.N_PORTS = 188[source]
aces.utilities.emsim.readmat.portmapx[source]
aces.utilities.emsim.readmat.portmapy[source]
aces.utilities.emsim.readmat.portmap[source]
aces.utilities.emsim.readmat.portmap[source]
aces.utilities.emsim.readmat.grid_from_file(regions_fname, n_regions=N_REGIONS)[source]

Load cartesian grid and differential solid angle from .mat files made by Stuart’s simulations of ASKAP patterns

Args:

regions_fname (str): n_regions (int):

Returns:
xyz (numpy.ndarray): with (x,y,z) cartesian coordinates defining unit vector describing angle

one row per coordinate with each coordinate in a separate column, real valued.

domega (numpy.ndarray): vector of differential solid angle for each pattern point, real valued.

aces.utilities.emsim.readmat.field_from_file(field_fname, n_regions=N_REGIONS, debug=False)[source]

Load far-field electric field (far-field pattern) from Stuart’s simulations of ASKAP patterns

Args:

field_fname (str): template name of field file n_regions (int): number of regions (each in individual .mat file) debug (bool): print debug info if True

Returns:

e_field (numpy.ndarray): Ex,Ey,Ez field components in columns and one row per simulation point (direction) complex valued

aces.utilities.emsim.readmat.interpolate_sub_slow(e_field, xyz, xyz_target)[source]

Interpolate function at finite list of coordinates that are not necessarily on a grid

Interpolation is performed in the Sin projection, with tangent at the positive x direction that is the forward hemisphere of the antenna pattern. This is probably okay near the boresight.

Args:

e_field (numpy.ndarray): Complex valued function of direction in 3-space xyz (numpy.ndarray): Grid points representing directions in 3-space at which e_field is evaluated xyz_target (numpy.ndarray): List of specific directions in 3-space to interpolate at

Returns:

e_interp (numpy.ndarray): Values of e_field at directions xyz_target

aces.utilities.emsim.readmat.interp_weights(xy, uv, d=2)[source]

Setup function for reimplementation of scipy.interpolate.griddata to avoid repeating setup for repeated interpolation for common input and output grids.

  1. Call sp.spatial.qhull.Dealunay is made to triangulate the irregular grid coordinates.

2. For each point in the new grid, the triangulation is searched to find in which triangle (actually, in which simplex, which in your 3D case will be in which tetrahedron) does it lay. 3. The barycentric coordinates of each new grid point with respect to the vertices of the enclosing simplex are computed.

From http://stackoverflow.com/questions/20915502

Args:

xy: existing coordinates for available data uv: points to interpolate to d: dimension

Returns:

vertices: weights:

aces.utilities.emsim.readmat.interpolate(values, vtx, wts)[source]

Reimplementation of scipy.interpolate.griddata to avoid repeating setup for repeated interpolation for common input and output grids.

4. An interpolated values is computed for that grid point, using the barycentric coordinates, and the values of the function at the vertices of the enclosing simplex.

http://stackoverflow.com/questions/20915502

Args:

values: available data vtx: vertices from interp_weights() wts: weights from interp_weights()

Returns:

values interpolated to points determined by setup function interp_weights()

aces.utilities.emsim.readmat.interpolate_sub(e_field, xyz, xyz_target)[source]

Interpolate function at finite list of coordinates that are not necessarily on a grid

Interpolation is performed in the Sin projection, with tangent at the positive x direction that is the forward hemisphere of the antenna pattern. This is probably okay near the boresight.

Args:

e_field (numpy.ndarray): Complex valued function of direction in 3-space xyz (numpy.ndarray): Grid points representing directions in 3-space at which e_field is evaluated xyz_target (numpy.ndarray): List of specific directions in 3-space to interpolate at

Returns:

e_interp (numpy.ndarray): Values of e_field at directions xyz_target