Imager

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.

cp_uv_min_last()[source]

Return last choice of minimal uvdistance for closure phases

dat_terms_last()[source]

Return last used data terms.

debias_last()[source]

Return last debias value.

flux_last()[source]

Return last total flux constraint.

format_outim(outarr, pol_prim='I')[source]

format the final image data into an Image object

init_imager()[source]

Set up Stokes I imager.

init_last()[source]

Return last initial image.

make_chisq_dict(imcur)[source]

Make a dictionary of current chi^2 term values input is image array transformed to bounded values

make_chisqgrad_dict(imcur)[source]

Make a dictionary of current chi^2 term gradient values input is image array transformed to bounded values

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

  • show_updates (bool) – whether or not to show imager progress

  • update_interval (int) – step interval for plotting if show_updates=True

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

  • mf_order (int) – order for multifrequency spectral index imaging

  • mf_order_pol (int) – order for multifrequency polarization fraction imaging

  • mf_rm (int) – order for rotation measure imaging

  • mf_cm (int) – order for conversion measure imaging

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_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 input is image array transformed to bounded values

make_reggrad_dict(imcur)[source]

Make a dictionary of current regularizer gradient values input is image array transformed to bounded values

maxit_last()[source]

Return last max_iterations value.

maxset_last()[source]

Return last choice of closure phase maximal/minimal set

mf_cm_last()[source]

Return last choice for CM imaging

mf_last()[source]

Return last choice for multifrequency imaging

mf_order_last()[source]

Return last choice of order for multifrequency imaging

mf_order_pol_last()[source]

Return last choice of order for multifrequency polarimetric imaging

mf_rm_last()[source]

Return last choice for RM imaging

objfunc(imvec)[source]

Current objective function.

objgrad(imvec)[source]

Current 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_last()[source]

Return last result.

pflux_last()[source]

Return last total linear polarimetric flux constraint.

plotcur(imvec, **kwargs)[source]

Plot current image.

pol_last()[source]

Return last polarization imaged.

prior_last()[source]

Return last used prior image.

reffreq_last()[source]

Return last choice of order for multifrequency imaging

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.

ehtim.imager.embed_imarr(imarr, mask, clipfloor=0.0, randomfloor=False)[source]

Embeds a multidimensional image array into the size of boolean embed mask

ehtim.imager.make_initarr(image, mask, norm_init=False, flux=1, mf=False, pol=False, randompol_lin=False, randompol_circ=False, meanpol=0.2, sigmapol=0.01)[source]

Make initial image array from image object, or initialize with default values

ehtim.imager.pack_imarr(imarr, which_solve)[source]

pack image array imarr into 1D array vec for minimizaiton ignore quantities not solved for

ehtim.imager.transform_gradients(gradarr, imarr, transforms, which_solve)[source]

Apply chain rule gradients for solver values for all polarizations gradarr is objective func gradients w/r/t physical variables imarr is the current image in solver variables

ehtim.imager.transform_imarr(imarr, transforms, which_solve)[source]

Apply transformation from solver to physical values for all polarizations

ehtim.imager.transform_imarr_inverse(imarr, transforms, which_solve)[source]

Apply inverse transformation from physical to solver values for all polarizations

ehtim.imager.unpack_imarr(vec, priorarr, which_solve)[source]

unpack minimized vector vec into array, replace quantities not solved for with their initial values