Imager

ehtim.imaging.imager_utils.imager_func(Obsdata, InitIm, Prior, flux, d1='vis', d2=False, d3=False, alpha_d1=100, alpha_d2=100, alpha_d3=100, s1='simple', s2=False, s3=False, alpha_s1=1, alpha_s2=1, alpha_s3=1, alpha_flux=500, alpha_cm=500, **kwargs)[source]

Run a general interferometric imager. Only works directly on the image’s primary polarization.

Parameters
  • Obsdata (Obsdata) – The Obsdata object with VLBI data

  • InitIm (Image) – The Image object with the initial image for the minimization

  • Prior (Image) – The Image object with the prior image

  • flux (float) – The total flux of the output image in Jy

  • d1 (str) – The first data term; options are ‘vis’, ‘bs’, ‘amp’, ‘cphase’, ‘cphase_diag’ ‘camp’, ‘logcamp’, ‘logcamp_diag’

  • d2 (str) – The second data term; options are ‘vis’, ‘bs’, ‘amp’, ‘cphase’, ‘cphase_diag’ ‘camp’, ‘logcamp’, ‘logcamp_diag’

  • d3 (str) – The third data term; options are ‘vis’, ‘bs’, ‘amp’, ‘cphase’, ‘cphase_diag’ ‘camp’, ‘logcamp’, ‘logcamp_diag’

  • s1 (str) – The first regularizer; options are ‘simple’, ‘gs’, ‘tv’, ‘tv2’, ‘l1’, ‘patch’,’compact’,’compact2’,’rgauss’

  • s2 (str) – The second regularizer; options are ‘simple’, ‘gs’, ‘tv’, ‘tv2’,’l1’, ‘patch’,’compact’,’compact2’,’rgauss’

  • s3 (str) – The third regularizer; options are ‘simple’, ‘gs’, ‘tv’, ‘tv2’,’l1’, ‘patch’,’compact’,’compact2’,’rgauss’

  • alpha_d1 (float) – The first data term weighting

  • alpha_d2 (float) – The second data term weighting

  • alpha_d2 – The third data term weighting

  • alpha_s1 (float) – The first regularizer term weighting

  • alpha_s2 (float) – The second regularizer term weighting

  • alpha_s3 (float) – The third regularizer term weighting

  • alpha_flux (float) – The weighting for the total flux constraint

  • alpha_cm (float) – The weighting for the center of mass constraint

  • maxit (int) – Maximum number of minimizer iterations

  • stop (float) – The convergence criterion

  • clipfloor (float) – The Jy/pixel level above which prior image pixels are varied

  • grads (bool) – If True, analytic gradients are used

  • logim (bool) – If True, uses I = exp(I’) change of variables

  • norm_reg (bool) – If True, normalizes regularizer terms

  • norm_init (bool) – If True, normalizes initial image to given total flux

  • show_updates (bool) – If True, displays the progress of the minimizer

  • weighting (str) – ‘natural’ or ‘uniform’

  • debias (bool) – if True then apply debiasing to amplitudes/closure amplitudes

  • systematic_noise (float) – a fractional systematic noise tolerance to add to thermal sigmas

  • snrcut (float) – a snr cutoff for including data in the chi^2 sum

  • beam_size (float) – beam size in radians for normalizing the regularizers

  • maxset (bool) – if True, use maximal set instead of minimal for closure quantities

  • systematic_cphase_noise (float) – a value in degrees to add to the closure phase sigmas

  • cp_uv_min (float) – flag baselines shorter than this before forming closure quantities

  • ttype (str) – The Fourier transform type; options are ‘fast’, ‘direct’, ‘nfft’

  • fft_pad_factor (float) – The FFT will pre-pad the image by this factor x the original size

  • order (int) – Interpolation order for sampling the FFT

  • conv_func (str) – The convolving function for gridding; options are ‘gaussian’, ‘pill’, and ‘cubic’

  • p_rad (int) – The pixel radius for the convolving function in gridding for FFTs

Returns

Image object with result

Return type

Image

class ehtim.imager.Imager(obs_in, init_im, prior_im=None, flux=None, data_term={'vis': 100}, reg_term={'simple': 1}, **kwargs)[source]

A general interferometric imager.

check_limits()[source]

Check image parameter consistency with observation.

check_params()[source]

Check parameter consistency.

clipfloor_last()[source]

Return last clip floor.

dat_terms_last()[source]

Return last used data terms.

debias_last()[source]

Return last debias value.

flux_last()[source]

Return last total flux constraint.

init_imager()[source]

Set up Stokes I imager.

init_imager_scattering()[source]

Set up scattering imager.

init_last()[source]

Return last initial image.

make_chisq_dict(imcur)[source]

Make a dictionary of current chi^2 term values i indexes the observation number in self.obslist_next

make_chisqgrad_dict(imcur, i=0)[source]

Make a dictionary of current chi^2 term gradient values i indexes the observation number in self.obslist_next

make_image(pol=None, grads=True, mf=False, **kwargs)[source]

Make an image using current imager settings.

Parameters
  • pol (str) – which polarization to image

  • grads (bool) – whether or not to use image gradients

  • mf (bool) – whether or not to do multifrequency (spectral index only for now)

Returns

output image

Return type

(Image)

make_image_I(grads=True, niter=1, blur_frac=1, **kwargs)[source]

Make Stokes I image using current imager settings.

make_image_IP(grads=True, niter=1, blur_frac=1, **kwargs)[source]

Make Stokes I and P polarimetric image simultaneously using current imager settings.

make_image_IV(grads=True, niter=1, blur_frac=1, **kwargs)[source]

Make Stokes I image using current imager settings.

make_image_I_stochastic_optics(grads=True, **kwargs)[source]

Reconstructs an image of total flux density using the stochastic optics scattering mitigation technique.

Uses the scattering model in Imager.scattering_model. If none has been specified, defaults to standard model for Sgr A*. Returns the estimated unscattered image.

Parameters
  • grads (bool) – Flag for whether or not to use analytic gradients.

  • show_updates (bool) – Flag for whether or not to show updates

Returns

The estimated unscattered image.

Return type

out (Image)

make_image_P(grads=True, niter=1, blur_frac=1, **kwargs)[source]

Make Stokes P polarimetric image using current imager settings.

make_image_V(grads=True, niter=1, blur_frac=1, **kwargs)[source]

Make Stokes I image using current imager settings.

make_reg_dict(imcur)[source]

Make a dictionary of current regularizer values

make_reggrad_dict(imcur)[source]

Make a dictionary of current regularizer gradient values

maxit_last()[source]

Return last max_iterations value.

objfunc(imvec)[source]

Current objective function.

objfunc_scattering(minvec)[source]

Current stochastic optics objective function.

objgrad(imvec)[source]

Current objective function gradient.

objgrad_scattering(minvec)[source]

Current stochastic optics objective function gradient

obs_last()[source]

Return last used observation.

property obs_next

the next Obsdata to be used in imaging

obslist_last()[source]

Return last used observation.

out_epsilon_last()[source]

Return last result with scattering.

out_last()[source]

Return last result.

out_scattered_last()[source]

Return last result with scattering.

pflux_last()[source]

Return last total linear polarimetric flux constraint.

plotcur(imvec, **kwargs)[source]

Plot current image.

plotcur_scattering(minvec)[source]

Plot current stochastic optics image/screen

pol_last()[source]

Return last polarization imaged.

prior_last()[source]

Return last used prior image.

reg_terms_last()[source]

Return last used regularizer terms.

set_embed()[source]

Set embedding matrix.

snrcut_last()[source]

Return last snrcut value.

stop_last()[source]

Return last convergence value.

systematic_cphase_noise_last()[source]

Return last closure phase systematic noise value (in degree).

systematic_noise_last()[source]

Return last systematic_noise value.

transform_last()[source]

Return last image transform used.

vflux_last()[source]

Return last total circular polarimetric flux constraint.

weighting_last()[source]

Return last weighting value.