Plotting

ehtim.plotting.summary_plots.imgsum(im_or_mov, obs, obs_uncal, outname, outdir='.', title='imgsum', commentstr='', fontsize=22, cfun='afmhot', snrcut=0.0, maxset=False, ttype='nfft', gainplots=True, ampplots=True, cphaseplots=True, campplots=True, ebar=True, debias=True, cp_uv_min=False, force_extrapolate=True, processes=4, sysnoise=0, syscnoise=0)[source]

Produce an image summary plot for an image and uvfits file.

Parameters
  • im_or_mov (Image or Movie) – an Image object or Movie

  • obs (Obsdata) – the self-calibrated Obsdata object

  • obs_uncal (Obsdata) – the original Obsdata object

  • outname (str) – output pdf file name

  • outdir (str) – directory for output file

  • title (str) – the pdf file title

  • commentstr (str) – a comment for the top line of the pdf

  • fontsize (float) – the font size for text in the sheet

  • cfun (float) – matplotlib color function

  • maxset (bool) – True to use a maximal set of closure quantities

  • gainplots (bool) – include gain plots or not

  • ampplots (bool) – include amplitude consistency plots or not

  • cphaseplots (bool) – include closure phase consistency plots or not

  • campplots (bool) – include closure amplitude consistency plots or not

  • ebar (bool) – include error bars or not

  • debias (bool) – debias visibility amplitudes before computing chisq or not

  • cp_uv_min (bool) – minimum uv-distance cutoff for including a baseline in closure phase

  • sysnoise (float) – percent systematic noise added in quadrature

  • syscnoise (float) – closure phase systematic noise in degrees added in quadrature

  • snrcut (dict) – a dictionary of snrcut values for each quantity

  • ttype (str) – “fast” or “nfft” or “direct”

  • force_extrapolate (bool) – if True, always extrapolate movie start/stop frames

  • processes (int) – number of cores to use in multiprocessing

Returns:

ehtim.plotting.summary_plots.imgsum_pol(im, obs, obs_uncal, outname, leakage_arr=False, nvec=False, outdir='.', title='imgsum_pol', commentstr='', fontsize=22, cfun='afmhot', snrcut=0.0, dtermplots=True, pplots=True, mplots=True, qplots=True, uplots=True, ebar=True, sysnoise=0)[source]

Produce a polarimetric image summary plot for an image and uvfits file.

Parameters
  • im (Image) – an Image object

  • obs (Obsdata) – the calibrated Obsdata object

  • obs_uncal (Obsdata) – the original Obsdata object

  • outname (str) – output pdf file name

  • leakage_arr (bool) – array with calibrated d-terms

  • nvec (int) – number of polarimetric vectors to plot in each direction

  • outdir (str) – directory for output file

  • title (str) – the pdf file title

  • commentstr (str) – a comment for the top line of the pdf

  • fontsize (float) – the font size for text in the sheet

  • cfun (float) – matplotlib color function

  • snrcut (dict) – a dictionary of snrcut values for each quantity

  • dtermplots (bool) – plot the d-terms or not

  • mplots (bool) – plot the fractional polarizations or not

  • pplots (bool) – plot the P=RL polarization or not

  • mplots – plot the Q data or not

  • pplots – plot the U data or not

  • ebar (bool) – include error bars or not

  • sysnoise (float) – percent systematic noise added in quadrature

Returns:

ehtim.plotting.comp_plots.plot_bl_compare(obslist, imlist, site1, site2, field, debias=False, sgrscat=False, ang_unit='deg', timetype='UTC', ttype='nfft', axis=False, rangex=False, rangey=False, snrcut=0.0, clist=[0.11764705882352941, 0.5647058823529412, 1.0, 1.0, 0.38823529411764707, 0.2784313725490196, 0.5411764705882353, 0.16862745098039217, 0.8862745098039215, 0.4196078431372549, 0.5568627450980392, 0.13725490196078433, 1.0, 0.6470588235294118, 0.0, 0.5450980392156862, 0.27058823529411763, 0.07450980392156863, 0.0, 0.0, 0.803921568627451, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.39215686274509803, 0.0, 0.8235294117647058, 0.7058823529411765, 0.5490196078431373, 0.0, 0.0, 0.0], legendlabels=None, markersize=3, export_pdf='', grid=False, ebar=True, axislabels=True, legend=True, show=True)[source]

Plot data from multiple observations vs time on a single baseline on the same axes.

Parameters
  • obslist (list) – list of observations to plot

  • imlist (list) – list of ground truth images to compare to

  • site1 (str) – station 1 name

  • site2 (str) – station 2 name

  • field (str) – y-axis field (from FIELDS)

  • debias (bool) – If True, debias amplitudes.

  • sgrscat (bool) – if True, the visibilites will be blurred by the Sgr A* scattering kernel

  • ang_unit (str) – phase unit ‘deg’ or ‘rad’

  • timetype (str) – ‘GMST’ or ‘UTC’

  • ttype (str) – if “fast” or “nfft” use FFT to produce visibilities. Else “direct” for DTFT

  • snrcut (float) – a snr cutoff

  • axis (matplotlib.axes.Axes) – add plot to this axis

  • rangex (list) – [xmin, xmax] x-axis limits

  • rangey (list) – [ymin, ymax] y-axis limits

  • clist (list) – list of colors scatterplot points

  • legendlabels (list) – list of labels of the same length of obslist or imlist

  • markersize (int) – size of plot markers

  • export_pdf (str) – path to pdf file to save figure

  • grid (bool) – Plot gridlines if True

  • ebar (bool) – Plot error bars if True

  • axislabels (bool) – Show axis labels if True

  • legend (bool) – Show legend if True

  • show (bool) – Display the plot if true

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.plot_bl_obs_compare(obslist, site1, site2, field, **kwargs)[source]

Plot data from multiple observations vs time on a single baseline on the same axes.

Parameters
  • obslist (list) – list of observations to plot

  • site1 (str) – station 1 name

  • site2 (str) – station 2 name

  • field (str) – y-axis field (from FIELDS)

  • debias (bool) – If True and plotting vis amplitudes, debias them

  • axislabels (bool) – Show axis labels if True

  • legendlabels (str) – should be a list of labels of the same length of obslist or imlist

  • ang_unit (str) – phase unit ‘deg’ or ‘rad’

  • timetype (str) – ‘GMST’ or ‘UTC’

  • sgrscat (bool) – if True, the visibilites will be blurred by the Sgr A* scattering kernel

  • snrcut (float) – a snr cutoff

  • rangex (list) – [xmin, xmax] x-axis (time) limits

  • rangey (list) – [ymin, ymax] y-axis limits

  • legend (bool) – Show legend if True

  • grid (bool) – Plot gridlines if True

  • ebar (bool) – Plot error bars if True

  • show (bool) – Display the plot if true

  • axis (matplotlib.axes.Axes) – add plot to this axis

  • clist (list) – list of color strings of scatterplot points

  • export_pdf (str) – path to pdf file to save figure

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.plot_bl_obs_im_compare(obslist, imlist, site1, site2, field, **kwargs)[source]

Plot data from multiple observations vs time on a single baseline on the same axes.

Parameters
  • obslist (list) – list of observations to plot

  • imlist (list) – list of ground truth images to compare to

  • site1 (str) – station 1 name

  • site2 (str) – station 2 name

  • field (str) – y-axis field (from FIELDS)

  • debias (bool) – If True and plotting vis amplitudes, debias them

  • axislabels (bool) – Show axis labels if True

  • legendlabels (str) – should be a list of labels of the same length of obslist or imlist

  • ang_unit (str) – phase unit ‘deg’ or ‘rad’

  • timetype (str) – ‘GMST’ or ‘UTC’

  • sgrscat (bool) – if True, the visibilites will be blurred by the Sgr A* scattering kernel

  • snrcut (float) – a snr cutoff

  • rangex (list) – [xmin, xmax] x-axis (time) limits

  • rangey (list) – [ymin, ymax] y-axis limits

  • legend (bool) – Show legend if True

  • grid (bool) – Plot gridlines if True

  • ebar (bool) – Plot error bars if True

  • show (bool) – Display the plot if true

  • axis (matplotlib.axes.Axes) – add plot to this axis

  • clist (list) – list of color strings of scatterplot points

  • export_pdf (str) – path to pdf file to save figure

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.plot_camp_compare(obslist, imlist, site1, site2, site3, site4, vtype='vis', ctype='camp', camps=[], force_recompute=False, debias=False, sgrscat=False, timetype='UTC', ttype='nfft', axis=False, rangex=False, rangey=False, snrcut=0.0, clist=[0.11764705882352941, 0.5647058823529412, 1.0, 1.0, 0.38823529411764707, 0.2784313725490196, 0.5411764705882353, 0.16862745098039217, 0.8862745098039215, 0.4196078431372549, 0.5568627450980392, 0.13725490196078433, 1.0, 0.6470588235294118, 0.0, 0.5450980392156862, 0.27058823529411763, 0.07450980392156863, 0.0, 0.0, 0.803921568627451, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.39215686274509803, 0.0, 0.8235294117647058, 0.7058823529411765, 0.5490196078431373, 0.0, 0.0, 0.0], legendlabels=None, markersize=3, export_pdf='', grid=False, ebar=True, axislabels=True, legend=True, show=True)[source]

Plot closure amplitude on a triangle vs time from multiple observations on the same axes.

Parameters
  • obslist (list) – list of observations to plot

  • imlist (list) – list of ground truth images to compare to

  • site1 (str) – station 1 name

  • site2 (str) – station 2 name

  • site3 (str) – station 3 name

  • site4 (str) – station 4 name

  • vtype (str) – The visibilty type (‘vis’,’qvis’,’uvis’,’vvis’,’pvis’)

  • ctype (str) – The closure amplitude type (‘camp’ or ‘logcamp’)

  • camps (list) – optionally pass in a list of camp so they don’t have to be recomputed

  • force_recompute (bool) – if True, recompute closure phases instead of using stored data

  • debias (bool) – If True, debias amplitudes.

  • sgrscat (bool) – if True, the visibilites will be blurred by the Sgr A* scattering kernel

  • timetype (str) – ‘GMST’ or ‘UTC’

  • ttype (str) – if “fast” or “nfft” use FFT to produce visibilities. Else “direct” for DTFT

  • snrcut (float) – a snr cutoff

  • axis (matplotlib.axes.Axes) – add plot to this axis

  • rangex (list) – [xmin, xmax] x-axis limits

  • rangey (list) – [ymin, ymax] y-axis limits

  • clist (list) – list of colors scatterplot points

  • legendlabels (list) – list of labels of the same length of obslist or imlist

  • markersize (int) – size of plot markers

  • export_pdf (str) – path to pdf file to save figure

  • grid (bool) – Plot gridlines if True

  • ebar (bool) – Plot error bars if True

  • axislabels (bool) – Show axis labels if True

  • legend (bool) – Show legend if True

  • show (bool) – Display the plot if true

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.plot_camp_obs_compare(obslist, site1, site2, site3, site4, **kwargs)[source]

Plot closure amplitude on a triangle vs time from multiple observations on the same axes.

Parameters
  • obslist (list) – list of observations to plot

  • site1 (str) – station 1 name

  • site2 (str) – station 2 name

  • site3 (str) – station 3 name

  • site4 (str) – station 4 name

  • vtype (str) – The visibilty type (‘vis’,’qvis’,’uvis’,’vvis’,’pvis’)

  • ctype (str) – The closure amplitude type (‘camp’ or ‘logcamp’)

  • camps (list) – optionally pass in a list of camps so they don’t have to be recomputed

  • force_recompute (bool) – if True, recompute closure phases instead of using stored data

  • debias (bool) – If True, debias amplitudes.

  • sgrscat (bool) – if True, the visibilites will be blurred by the Sgr A* scattering kernel

  • timetype (str) – ‘GMST’ or ‘UTC’

  • ttype (str) – if “fast” or “nfft” use FFT to produce visibilities. Else “direct” for DTFT

  • snrcut (float) – a snr cutoff

  • axis (matplotlib.axes.Axes) – add plot to this axis

  • rangex (list) – [xmin, xmax] x-axis limits

  • rangey (list) – [ymin, ymax] y-axis limits

  • clist (list) – list of colors scatterplot points

  • legendlabels (list) – list of labels of the same length of obslist or imlist

  • markersize (int) – size of plot markers

  • export_pdf (str) – path to pdf file to save figure

  • grid (bool) – Plot gridlines if True

  • ebar (bool) – Plot error bars if True

  • axislabels (bool) – Show axis labels if True

  • legend (bool) – Show legend if True

  • show (bool) – Display the plot if true

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.plot_camp_obs_im_compare(obslist, imlist, site1, site2, site3, site4, **kwargs)[source]

Plot closure amplitude on a triangle vs time from multiple observations on the same axes.

Parameters
  • obslist (list) – list of observations to plot

  • image (Image) – ground truth image to compare to

  • site1 (str) – station 1 name

  • site2 (str) – station 2 name

  • site3 (str) – station 3 name

  • site4 (str) – station 4 name

  • vtype (str) – The visibilty type (‘vis’,’qvis’,’uvis’,’vvis’,’pvis’)

  • ctype (str) – The closure amplitude type (‘camp’ or ‘logcamp’)

  • camps (list) – optionally pass in a list of camps so they don’t have to be recomputed

  • force_recompute (bool) – if True, recompute closure phases instead of using stored data

  • debias (bool) – If True, debias amplitudes.

  • sgrscat (bool) – if True, the visibilites will be blurred by the Sgr A* scattering kernel

  • timetype (str) – ‘GMST’ or ‘UTC’

  • ttype (str) – if “fast” or “nfft” use FFT to produce visibilities. Else “direct” for DTFT

  • snrcut (float) – a snr cutoff

  • axis (matplotlib.axes.Axes) – add plot to this axis

  • rangex (list) – [xmin, xmax] x-axis limits

  • rangey (list) – [ymin, ymax] y-axis limits

  • clist (list) – list of colors scatterplot points

  • legendlabels (list) – list of labels of the same length of obslist or imlist

  • markersize (int) – size of plot markers

  • export_pdf (str) – path to pdf file to save figure

  • grid (bool) – Plot gridlines if True

  • ebar (bool) – Plot error bars if True

  • axislabels (bool) – Show axis labels if True

  • legend (bool) – Show legend if True

  • show (bool) – Display the plot if true

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.plot_cphase_compare(obslist, imlist, site1, site2, site3, vtype='vis', cphases=[], force_recompute=False, ang_unit='deg', timetype='UTC', ttype='nfft', axis=False, rangex=False, rangey=False, snrcut=0.0, clist=[0.11764705882352941, 0.5647058823529412, 1.0, 1.0, 0.38823529411764707, 0.2784313725490196, 0.5411764705882353, 0.16862745098039217, 0.8862745098039215, 0.4196078431372549, 0.5568627450980392, 0.13725490196078433, 1.0, 0.6470588235294118, 0.0, 0.5450980392156862, 0.27058823529411763, 0.07450980392156863, 0.0, 0.0, 0.803921568627451, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.39215686274509803, 0.0, 0.8235294117647058, 0.7058823529411765, 0.5490196078431373, 0.0, 0.0, 0.0], legendlabels=None, markersize=3, export_pdf='', grid=False, ebar=True, axislabels=True, legend=True, show=True)[source]

Plot closure phase on a triangle compared to ground truth from an image on the same axes.

Parameters
  • obslist (list) – list of observations to plot

  • imlist (list) – list of ground truth images to compare to

  • site1 (str) – station 1 name

  • site2 (str) – station 2 name

  • site3 (str) – station 3 name

  • vtype (str) – The visibilty type (‘vis’,’qvis’,’uvis’,’vvis’,’pvis’)

  • cphases (list) – optionally pass in a list of cphases so they don’t have to be recomputed

  • force_recompute (bool) – if True, recompute closure phases instead of using stored data

  • ang_unit (str) – phase unit ‘deg’ or ‘rad’

  • timetype (str) – ‘GMST’ or ‘UTC’

  • ttype (str) – if “fast” or “nfft” use FFT to produce visibilities. Else “direct” for DTFT

  • snrcut (float) – a snr cutoff

  • axis (matplotlib.axes.Axes) – add plot to this axis

  • rangex (list) – [xmin, xmax] x-axis limits

  • rangey (list) – [ymin, ymax] y-axis limits

  • clist (list) – list of colors scatterplot points

  • legendlabels (list) – list of labels of the same length of obslist or imlist

  • markersize (int) – size of plot markers

  • export_pdf (str) – path to pdf file to save figure

  • grid (bool) – Plot gridlines if True

  • ebar (bool) – Plot error bars if True

  • axislabels (bool) – Show axis labels if True

  • legend (bool) – Show legend if True

  • show (bool) – Display the plot if true

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.plot_cphase_obs_compare(obslist, site1, site2, site3, **kwargs)[source]

Plot closure phase on a triangle vs time from multiple observations on the same axes.

Parameters
  • obslist (list) – list of observations to plot

  • site1 (str) – station 1 name

  • site2 (str) – station 2 name

  • site3 (str) – station 3 name

  • vtype (str) – The visibilty type (‘vis’,’qvis’,’uvis’,’vvis’,’pvis’)

  • cphases (list) – optionally pass in a list of cphases so they don’t have to be recomputed

  • force_recompute (bool) – if True, recompute closure phases instead of using stored data

  • ang_unit (str) – phase unit ‘deg’ or ‘rad’

  • timetype (str) – ‘GMST’ or ‘UTC’

  • ttype (str) – if “fast” or “nfft” use FFT to produce visibilities. Else “direct” for DTFT

  • snrcut (float) – a snr cutoff

  • axis (matplotlib.axes.Axes) – add plot to this axis

  • rangex (list) – [xmin, xmax] x-axis limits

  • rangey (list) – [ymin, ymax] y-axis limits

  • clist (list) – list of colors scatterplot points

  • legendlabels (list) – list of labels of the same length of obslist or imlist

  • markersize (int) – size of plot markers

  • export_pdf (str) – path to pdf file to save figure

  • grid (bool) – Plot gridlines if True

  • ebar (bool) – Plot error bars if True

  • axislabels (bool) – Show axis labels if True

  • legend (bool) – Show legend if True

  • show (bool) – Display the plot if true

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.plot_cphase_obs_im_compare(obslist, imlist, site1, site2, site3, **kwargs)[source]

Plot closure phase on a triangle vs time from multiple observations on the same axes.

Parameters
  • obslist (list) – list of observations to plot

  • imlist (list) – list of ground truth images to compare to

  • site1 (str) – station 1 name

  • site2 (str) – station 2 name

  • site3 (str) – station 3 name

  • vtype (str) – The visibilty type (‘vis’,’qvis’,’uvis’,’vvis’,’pvis’)

  • cphases (list) – optionally pass in a list of cphases so they don’t have to be recomputed

  • force_recompute (bool) – if True, recompute closure phases instead of using stored data

  • ang_unit (str) – phase unit ‘deg’ or ‘rad’

  • timetype (str) – ‘GMST’ or ‘UTC’

  • ttype (str) – if “fast” or “nfft” use FFT to produce visibilities. Else “direct” for DTFT

  • snrcut (float) – a snr cutoff

  • axis (matplotlib.axes.Axes) – add plot to this axis

  • rangex (list) – [xmin, xmax] x-axis limits

  • rangey (list) – [ymin, ymax] y-axis limits

  • clist (list) – list of colors scatterplot points

  • legendlabels (list) – list of labels of the same length of obslist or imlist

  • markersize (int) – size of plot markers

  • export_pdf (str) – path to pdf file to save figure

  • grid (bool) – Plot gridlines if True

  • ebar (bool) – Plot error bars if True

  • axislabels (bool) – Show axis labels if True

  • legend (bool) – Show legend if True

  • show (bool) – Display the plot if true

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.plotall_compare(obslist, imlist, field1, field2, conj=False, debias=False, sgrscat=False, ang_unit='deg', timetype='UTC', ttype='nfft', axis=False, rangex=False, rangey=False, snrcut=0.0, clist=[0.11764705882352941, 0.5647058823529412, 1.0, 1.0, 0.38823529411764707, 0.2784313725490196, 0.5411764705882353, 0.16862745098039217, 0.8862745098039215, 0.4196078431372549, 0.5568627450980392, 0.13725490196078433, 1.0, 0.6470588235294118, 0.0, 0.5450980392156862, 0.27058823529411763, 0.07450980392156863, 0.0, 0.0, 0.803921568627451, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.39215686274509803, 0.0, 0.8235294117647058, 0.7058823529411765, 0.5490196078431373, 0.0, 0.0, 0.0], legendlabels=None, markersize=3, export_pdf='', grid=False, ebar=True, axislabels=True, legend=True, show=True)[source]

Plot data from observations compared to ground truth from an image on the same axes.

Parameters
  • obslist (list) – list of observations to plot

  • imlist (list) – list of ground truth images to compare to

  • field1 (str) – x-axis field (from FIELDS)

  • field2 (str) – y-axis field (from FIELDS)

  • conj (bool) – Plot conjuage baseline data points if True

  • debias (bool) – If True, debias amplitudes.

  • sgrscat (bool) – if True, the visibilites will be blurred by the Sgr A* scattering kernel

  • ang_unit (str) – phase unit ‘deg’ or ‘rad’

  • timetype (str) – ‘GMST’ or ‘UTC’

  • ttype (str) – if “fast” or “nfft” use FFT to produce visibilities. Else “direct” for DTFT

  • axis (matplotlib.axes.Axes) – add plot to this axis

  • rangex (list) – [xmin, xmax] x-axis limits

  • rangey (list) – [ymin, ymax] y-axis limits

  • clist (list) – list of colors scatterplot points

  • legendlabels (list) – list of labels of the same length of obslist or imlist

  • markersize (int) – size of plot markers

  • export_pdf (str) – path to pdf file to save figure

  • grid (bool) – Plot gridlines if True

  • ebar (bool) – Plot error bars if True

  • axislabels (bool) – Show axis labels if True

  • legend (bool) – Show legend if True

  • show (bool) – Display the plot if true

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.plotall_obs_compare(obslist, field1, field2, **kwargs)[source]

Plot data from observations compared to ground truth from an image on the same axes.

Parameters
  • obslist (list) – list of observations to plot

  • field1 (str) – x-axis field (from FIELDS)

  • field2 (str) – y-axis field (from FIELDS)

  • conj (bool) – Plot conjuage baseline data points if True

  • debias (bool) – If True, debias amplitudes.

  • ang_unit (str) – phase unit ‘deg’ or ‘rad’

  • sgrscat (bool) – if True, the visibilites will be blurred by the Sgr A* scattering kernel

  • ttype (str) – if “fast” or “nfft” use FFT to produce visibilities. Else “direct” for DTFT

  • rangex (list) – [xmin, xmax] x-axis limits

  • rangey (list) – [ymin, ymax] y-axis limits

  • legendlabels (str) – should be a list of labels of the same length of obslist or imlist

  • snrcut (float) – a snr cutoff

  • grid (bool) – Plot gridlines if True

  • ebar (bool) – Plot error bars if True

  • axislabels (bool) – Show axis labels if True

  • legend (bool) – Show legend if True

  • show (bool) – Display the plot if true

  • axis (matplotlib.axes.Axes) – add plot to this axis

  • clist (list) – list of colors scatterplot points

  • markersize (int) – size of plot markers

  • export_pdf (str) – path to pdf file to save figure

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.plotall_obs_im_compare(obslist, imlist, field1, field2, **kwargs)[source]

Plot data from observations compared to ground truth from an image on the same axes.

Parameters
  • obslist (list) – list of observations to plot

  • imlist (list) – list of images to plot

  • field1 (str) – x-axis field (from FIELDS)

  • field2 (str) – y-axis field (from FIELDS)

  • conj (bool) – Plot conjuage baseline data points if True

  • debias (bool) – If True, debias amplitudes.

  • ang_unit (str) – phase unit ‘deg’ or ‘rad’

  • sgrscat (bool) – if True, the visibilites will be blurred by the Sgr A* scattering kernel

  • ttype (str) – if “fast” or “nfft” use FFT to produce visibilities. Else “direct” for DTFT

  • rangex (list) – [xmin, xmax] x-axis limits

  • rangey (list) – [ymin, ymax] y-axis limits

  • legendlabels (str) – should be a list of labels of the same length of obslist

  • snrcut (float) – a snr cutoff

  • grid (bool) – Plot gridlines if True

  • ebar (bool) – Plot error bars if True

  • axislabels (bool) – Show axis labels if True

  • legend (bool) – Show legend if True

  • show (bool) – Display the plot if true

  • axis (matplotlib.axes.Axes) – add plot to this axis

  • clist (list) – list of colors scatterplot points

  • markersize (int) – size of plot markers

  • export_pdf (str) – path to pdf file to save figure

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.plotall_obs_im_cphases(obs, imlist, vtype='vis', ang_unit='deg', timetype='UTC', ttype='nfft', sgrscat=False, rangex=False, rangey=[- 180, 180], legend=False, legendlabels=None, show=True, ebar=True, axislabels=False, print_chisqs=True, display_mode='all')[source]

Plot all observation closure phases on top of image ground truth values. Works with ONE obs and MULTIPLE images.

Parameters
  • obs (Obsdata) – observation to plot

  • imlist (list) – list of ground truth images to compare to

  • vtype (str) – The visibilty type (‘vis’,’qvis’,’uvis’,’vvis’,’pvis’)

  • ang_unit (str) – phase unit ‘deg’ or ‘rad’

  • timetype (str) – ‘GMST’ or ‘UTC’

  • ttype (str) – if “fast” or “nfft” use FFT to produce visibilities. Else “direct” for DTFT

  • sgrscat (bool) – if True, the visibilites will be blurred by the Sgr A* scattering kernel

  • rangex (list) – [xmin, xmax] x-axis (time) limits

  • rangey (list) – [ymin, ymax] y-axis (phase) limits

  • show (bool) – Display the plot if True

  • ebar (bool) – Plot error bars if True

  • axislabels (bool) – Show axis labels if True

  • print_chisqs (bool) – print individual chisqs if True

  • display_mode (str) – ‘all’ or ‘individual’

Returns

Axes object with data plot

Return type

(matplotlib.axes.Axes)

ehtim.plotting.comp_plots.prep_plot_lists(obslist, imlist, clist=[0.11764705882352941, 0.5647058823529412, 1.0, 1.0, 0.38823529411764707, 0.2784313725490196, 0.5411764705882353, 0.16862745098039217, 0.8862745098039215, 0.4196078431372549, 0.5568627450980392, 0.13725490196078433, 1.0, 0.6470588235294118, 0.0, 0.5450980392156862, 0.27058823529411763, 0.07450980392156863, 0.0, 0.0, 0.803921568627451, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.39215686274509803, 0.0, 0.8235294117647058, 0.7058823529411765, 0.5490196078431373, 0.0, 0.0, 0.0], legendlabels=None, sgrscat=False, ttype='nfft')[source]

Return observation, color, marker, legend lists for comp plots

ehtim.plotting.comparisons.get_psize_fov(imarr)[source]

Look over an array of images and determine the min pixel size and max fov that can be used consistently across them