Utilities¶
Your might find these functions useful.
Functions¶
-
scatterbrane.utilities.FTElementFast(img, dx, baseline)¶ Return complex visibility.
Parameters: - img –
(n, n)numpy image array - dx – scalar Pixel size in microarcseconds
- baseline –
(2, )(u,v) point in wavelengths
Note
To shift center try multipliny by \(\mathrm{exp}(\pi i u n_x\Delta_x)\) and watch out for the axis orientation.
- img –
-
scatterbrane.utilities.ensembleSmooth(img, dx, brane, return_kernel=False)¶ Generates ensemble averaged image given scattering kernel parameters.
Parameters: - img –
(n, n)numpy array - dx – scalar Pixel scale in microarcseconds
- brane – Brane object.
- return_kernel – (optional) bool
Return tuple with uv kernel (
nump.fft.rfft2()format). SeegetUVKernel()for an alternate method.
- img –
-
scatterbrane.utilities.getUVKernel(u, v, brane)¶ Get ensemble kernel in visibility plane for specified uv points. See func:ensembleSmooth for an althernate method.
Parameters: - u –
(n, )Samples of u in units of wavelengths. - v –
(n, )Samples of v in units of wavelengths. - brane – Brane object
Returns: (n, )Ensemble kernel complex visibility- u –
-
scatterbrane.utilities.loadSettings(filename)¶ - Loads simulation settings from a file generated by
Brane.save_settings().Parameters: filename – string File name that contains simulation settings. Returns: A dictionary with simulation settings.
-
scatterbrane.utilities.regrid(a, inx, idx, onx, odx)¶ Regrids array with a new resolution and pixel number.
Parameters: - a –
(n, n)Input numpy image - inx – int Number of input pixels on a side
- idx – scalar Input resolution element
- onx – int Number of output pixels on a side
- odx – scalar Output resolution element
Returns: Array regridded to the new resolution and field of view.
- a –
-
scatterbrane.utilities.smoothImage(img, dx, fwhm)¶ Returns Image smoothed by a gaussian kernel.
Parameters: - img –
(n, n)numpy array - dx – scalar Pixel scale in microarcseconds
- fwhm – scalar Gaussian full width at half maximum in microarcseconds
- img –
-
scatterbrane.utilities.writefits(m, dx, dest='image.fits', obsra=266.4168370833333, obsdec=-29.00781055555555, freq=230000000000.0)¶ Write fits file with header. Defaults are set for Sgr A* at 1.3mm.
Parameters: - m –
(n, n)numpy image array - dx – scalar Pixel size in microarcseconds
- dest – (optional) string Output fits file name
- obsra – (optional) scalar Source right ascension
- obsdec – (optional) scalar Source declination
- m –