Utility

ska_sdp_func_python.util.array_functions Module

Useful array functions.

Functions

average_chunks(arr, wts, chunksize)

Average the array arr with weights by chunks.

average_chunks2(arr, wts, chunksize)

Average the two-dimensional array arr with weights by chunks.

tukey_filter(x, r)

Calculate the Tukey (tapered cosine) filter.

insert_array(im, x, y, flux[, bandwidth, ...])

Insert point into Image using specified function.

insert_function_L(x[, a])

Insertion with Lanczos function.

insert_function_pswf(x[, a])

Insertion with PSWF.

insert_function_sinc(x)

Insertion with Sinc function.

ska_sdp_func_python.util.coordinate_support Module

Functions for coordinate support

We follow the casa definition of coordinate systems http://casa.nrao.edu/Memos/CoordConvention.pdf:

UVW is a right-handed coordinate system, with W pointing towards the source, and a baseline convention of \(ant2 - ant1\) where \(index(ant1) < index(ant2)\). Consider an XYZ Celestial coordinate system centered at the location of the interferometer, with \(X\) towards the East, \(Z\) towards the NCP and \(Y\) to complete a right-handed system. The UVW coordinate system is then defined by the hour-angle and declination of the phase-reference direction such that

  1. when the direction of observation is the NCP (ha=0,dec=90), the UVW coordinates are aligned with XYZ

  2. V, W and the NCP are always on a Great circle

  3. when W is on the local meridian, U points East

  4. when the direction of observation is at zero declination, an hour-angle of -6 hours makes W point due East

The \((l,m,n)\) coordinates are parallel to \((u,v,w)\) such that \(l\) increases with Right-Ascension (or increasing longitude coordinate), \(m\) increases with Declination, and \(n\) is towards the source. With this convention, images will have Right Ascension increasing from Right to Left, and Declination increasing from Bottom to Top.

Functions

azel_to_hadec(az, el, latitude)

Converting Az El to HA Dec.

baselines(ants_uvw)

Compute baselines in uvw co-ordinate system from uvw co-ordinate system station positions.

ecef_to_enu(location, xyz)

Convert ECEF coordinates to ENU coordinates relative to reference location.

ecef_to_lla(x, y, z)

Convert earth-centered, earth-fixed coordinates to (rad), longitude (rad), elevation (m) using Bowring's method.

eci_to_enu(eci, lat)

Converts a baseline in earth-centered inertial coordinates [x, y, z] to [east, north, elevation] for that baseline.

eci_to_uvw(xyz, ha, dec)

Rotate \((x,y,z)\) positions in earth coordinates to \((u,v,w)\) coordinates relative to astronomical source position \((ha, dec)\).

enu_to_ecef(location, enu)

Convert ENU coordinates relative to reference location to ECEF coordinates.

enu_to_eci(enu, lat)

Converts a baseline in [east, north, elevation] to earth-centered inertial coordinates for that baseline [x, y, z].

enu_to_xyz(e, n, u, lat)

Convert ENU to XYZ coordinates.

hadec_to_azel(ha, dec, latitude)

Convert HA Dec to Az El.

lla_to_ecef(lat, lon, alt)

Convert WGS84 spherical coordinates to ECEF cartesian coordinates.

lmn_to_skycoord(lmn, phasecentre)

Convert l,m,n coordinate system + phascentre to astropy sky coordinate relative to a phase centre.

pa_z(ha, dec, lat)

Calculate parallactic angle and zenith angle of source at ha, dec observed from site at latitude dec.

parallactic_angle(ha, dec, lat)

Calculate parallactic angle of source at ha, dec observed from site at latitude dec.

skycoord_to_lmn(pos, phasecentre)

Convert astropy sky coordinates into the l,m,n coordinate system relative to a phase centre.

simulate_point(dist_uvw, l, m)

Simulate visibilities for unit amplitude point source at direction cosines (l,m) relative to the phase centre.

uvw_to_eci(uvw, ha, dec)

Rotate (x,y,z) positions relative to a sky position at (ha, dec) to earth coordinates.

uvw_to_xyz(uvw, ha, dec)

Rotate \((x,y,z)\) positions relative to a sky position at \((ha, dec)\) to earth coordinates.

uvw_transform(uvw, transform_matrix)

Transforms UVW baseline coordinates such that the image is transformed with the given matrix.

visibility_shift(uvw, vis, dl, dm)

Shift visibilities by the given image-space distance.

xyz_to_baselines(ants_xyz, ha_range, dec)

Calculate baselines in \((u,v,w)\) co-ordinate system for a range of hour angles (i.e. non-snapshot observation) to create a uvw sampling distribution.

xyz_at_latitude(local_xyz, lat)

Rotate local XYZ coordinates into celestial XYZ coordinates.

xyz_to_uvw(xyz, ha, dec)

Rotate \((x,y,z)\) positions in earth coordinates to \((u,v,w)\) coordinates relative to astronomical source position \((ha, dec)\).

ska_sdp_func_python.util.geometry Module

Useful geometry functions

Functions

calculate_transit_time(location, utc_time, ...)

Find the UTC time of the nearest transit.

calculate_hourangles(location, utc_time, ...)

Return hour angles for location, utc_time, and direction.

calculate_parallactic_angles(location, ...)

Return hour angles for location, utc_time, and direction.

calculate_azel(location, utc_time, direction)

Return az el for a location, utc_time, and direction.

utc_to_ms_epoch(ts)

Convert an timestamp to seconds (epoch values) epoch suitable for using in a Measurement Set.