The Target

Lightweight python module for generating visibilities and closure quantities without noise. You might also be interested in the VLBI Dataset Website.

Class Methods

class scatterbrane.Target(wavelength=0.0013, position='sgra', obspos='eht', zenith_cuts=[75.0, 0.0])

Class for constructing visibility samples.

Parameters:
  • wavelength – (optional) Scalar wavelength in meters.
  • position – (optional) (2, ) A tuple with right ascension and declination of the source in (hours, degrees) or the preset string “sgra”.
  • obspos – (optional) A dictionary of observatories and their geocentric positions.
  • elevation_cuts – (optional) (2, ) The upper and lower bound on the observing zenith angle.

Note

The zenith angle cut corresponds to whether the site can observe the source. As a result, for functions such as generateTracks(), the number of uv samples returned will be less than or equal to the number of samples set by the times argument. To disable the zenith angle cut you can initialize Target with zenith_cuts = [180.,0.].

FTElementFast(img, dx, baseline)

Return complex visibility.

Parameters:
  • img – Image array.
  • dx – pixel size in microarcseconds.
  • baseline – (u,v) point in wavelengths.
Returns:

complex visibility

calculateBS(img, dx, uvTriangle)

Calculate bispectrum for numpy arrays of 3 baselines that should form a closed triangle:

\[B_{abc} = V_{ab}V_{bc}V_{ca}\]
Parameters:
  • img(n, n) Image array.
  • dx – scalar Pixel size of image in microarcseconds.
  • uvTriangle(num_measurements, 3, 2) uv samples for which to calculate the bispectra. The baseline order along axis=1 should be (ab,bc,ca).
Returns:

(num_measurements, ) Complex bispectra.

calculateCA(img, dx, uvQuadrangle)

Calculate closure amplitudes for numpy arrays of 4 baselines:

\[A_{abcd} = \frac{|V_{ab}||V_{cd}|}{|V_{ac}||V_{bd}|}\]
Parameters:
  • img(n, n) Numpy image array.
  • dx – scalar Pixel size of image in microarcseconds.
  • uvQuadrangle(num_measurements, 4, 2) The uv samples for which to calculate the closure amplitude. The baseline order along axis=1 should be (ab,cd,ac,bd).
Returns:

(num_measurements, ) Closure amplitudes.

calculateCP(img, dx, uvTriangle)

Calculate closure phases for numpy arrays of 3 baselines that should form a closed triangle:

\[\phi_{abc} = \mathrm{arg}(V_{ab}V_{bc}V_{ca})\]
Parameters:
  • img(n, n) Numpy image array.
  • dx – scalar Pixel size of image in microarcseconds.
  • uvTriangle(num_measurements, 3, 2) The uv samples for which to calculate the closure phase. The baseline order along axis=1 should be (ab,bc,ca).
Returns:

(num_measurements, ) Closure phases in radians.

calculateVisibilities(img, dx, uv)

Calculate complex visibilities.

Parameters:
  • img – Image array.
  • dx – Pixel size in microarcseconds.
  • uv(num_measurements, 2) An array of uv samples with dimension.
Returns:

(num_measurements, ) Scalar complex visibilities.

generateQuadrilateralTracks(sites, times=(0.0, 24.0, 144), return_hour=False)

Generates a quadruplet of uv points for a quadrilateral (a,b,c,d) ensuring that all sites can see the source. See the docstring for generateTracks() for notes about the sampling rate.

Suggested usage: Feed the generated uv samples to calculateCA() which will return the closure amplitude quantity.

Parameters:
  • sites(4, 3) Array of geocentric positions for 4 sites (a,b,c,d).
  • times – (optional) (start, stop, num_samples) Tuple setting the spacing of the uv-samples in time. The start and stop times should be in hours and in the range [0,24]. stop is non-inclusive.
  • return_hour – (optional) Return hour of uv samples as second item to unpack.
Returns:

(num_measurements, 4, 2) Array where the order of the baselines along the first dimension (axis=1) is (ab, cd, ac, bd).

generateTracks(sites, times=(0.0, 24.0, 144), return_hour=False)

Generates uv-samples where the sample rate is to be equally spaced in time. For instance, if you want samples spaced by 5 minutes ranging from 1 UT to 4 UT (non-inclusive) you would set times = (1, 4, int((4.-1.)*60./5.)). As another example, you would generate 128 samples separated by 10 seconds if times = (0., 128*10./3600, 128).

Parameters:
  • sites(num_sites, 3) Numpy array of sites’ geocentric positions.
  • times – (optional) (start, stop, num_samples) Tuple setting the spacing of the uv-samples in time. The start and stop times should be in hours and in the range [0,24]. stop is non-inclusive.
  • return_hour – (optional) bool Return hour of uv samples as second item to unpack.
Returns:

(num_measurements, 2) Numpy array with uv samples where num_measurements \(\leq\) num_samples.

generateTriangleTracks(sites, times=(0.0, 24.0, 144), return_hour=False)

Generates a triplet of uv points for a closed triangle of sites (a,b,c) ensuring that all sites can see the source. See the docstring for generateTracks() for notes about the sampling rate.

Suggested usage: Feed the generated UV samples to calculateBS() or calculateCP() to calculate closure phase or bispectrum quanities.

Parameters:
  • sites(3, 3) Array of geocentric positions for 3 sites (a,b,c).
  • times – (optional) (start, stop, num_samples) Tuple setting the spacing of the uv-samples in time. The start and stop times should be in hours and in the range [0,24]. stop is non-inclusive.
  • return_hour – (optional) Return hour of uv samples as second item to unpack.
Returns:

(num_measurements, 3, 2) Array of uv points where the order of the baselines along the first dimension (axis=1) is (ab,bc,ca).

generateUV(site_pair, theta)

Generate uv baseline.

Parameters:
  • site_pair(2, 3) Geocentric (x,y,z) positions of two sites.
  • theta – scalar Angle in radians.
Returns:

(2, ) A uv point.

hour(theta)

Convert to UT time.

Parameters:theta(n, ) vector of angles in radians.
Returns:(n, ) vector of times in hours.
sites(s)

Look up geocentric positions of sites by their string keyword.

Parameters:s – List of site keys.
Returns:Array of site geocentric positions.
theta(hour)

Convert from UT to angle.

Parameters:hour(n, ) Vector of times in hours.
Returns:(n, ) Vector of angles in radians.