original_docstring: Plots the calibrated and uncalibrated visibilities for comparison.
  
      Parameters
      ----------
      vis : ndarray
          The complex, uncalibrated visibilities, with dimensions
          (baseline, time, freq, pol).
      vis_cal : ndarray
          The complex calibrated visibilities, with dimensions
          (baseline, time, freq, pol).
      mjd : ndarray
          The midpoint time of each subintegration in MJD.
      fobs : ndarray
          The center frequency of each channel in GHz.
      bidx : int
          The index along the baseline dimension to plot.
      pol : int
          The index along the polarization dimension to plot.
      outname : str
          The base to use for the name of the png file the plot is saved to.  The
          plot will be saved to `outname`_cal_vis.png if `outname` is provided,
          otherwise no plot will be saved.  Defaults ``None``.
      show : boolean
          If `show` is passed ``False``, the plot will be closed after being
          generated.  Otherwise, it is left open.  Defaults ``True``.
      
docstring: Plots the calibrated and uncalibrated visibilities for comparison.
  Parameters
  
  vis : ndarray
  The complex, uncalibrated visibilities, with dimensions
  (baseline, time, freq, pol).
  vis_cal : ndarray
  The complex calibrated visibilities, with dimensions
  (baseline, time, freq, pol).
  mjd : ndarray
  The midpoint time of each subintegration in MJD.
  fobs : ndarray
  The center frequency of each channel in GHz.
  bidx : int
  The index along the baseline dimension to plot.
  pol : int
  The index along the polarization dimension to plot.
  outname : str
  The base to use for the name of the png file the plot is saved to.  The
  plot will be saved to `outname`_cal_vis.png if `outname` is provided,
  otherwise no plot will be saved.  Defaults ``None``.
docstring_tokens: Plots the calibrated and uncalibrated visibilities for comparison . Parameters vis : ndarray The complex uncalibrated visibilities with dimensions ( baseline time freq pol ) . vis_cal : ndarray The complex calibrated visibilities with dimensions ( baseline time freq pol ) . mjd : ndarray The midpoint time of each subintegration in MJD . fobs : ndarray The center frequency of each channel in GHz . bidx : int The index along the baseline dimension to plot . pol : int The index along the polarization dimension to plot . outname : str The base to use for the name of the png file the plot is saved to . The plot will be saved to ` outname ` _cal_vis . png if ` outname ` is provided otherwise no plot will be saved . Defaults ` ` None ` ` .
code: def plot_calibrated_vis(vis, vis_cal, mjd, fobs, bidx, pol,
                          outname=None, show=True):
      """Plots the calibrated and uncalibrated visibilities for comparison.
  
      Parameters
      ----------
      vis : ndarray
          The complex, uncalibrated visibilities, with dimensions
          (baseline, time, freq, pol).
      vis_cal : ndarray
          The complex calibrated visibilities, with dimensions
          (baseline, time, freq, pol).
      mjd : ndarray
          The midpoint time of each subintegration in MJD.
      fobs : ndarray
          The center frequency of each channel in GHz.
      bidx : int
          The index along the baseline dimension to plot.
      pol : int
          The index along the polarization dimension to plot.
      outname : str
          The base to use for the name of the png file the plot is saved to.  The
          plot will be saved to `outname`_cal_vis.png if `outname` is provided,
          otherwise no plot will be saved.  Defaults ``None``.
      show : boolean
          If `show` is passed ``False``, the plot will be closed after being
          generated.  Otherwise, it is left open.  Defaults ``True``.
      """
      x = mjd[:mjd.shape[0]//128*128].reshape(-1, 128).mean(-1)
      x = ((x-x[0])*u.d).to_value(u.min)
      y = fobs[:fobs.shape[0]//5*5].reshape(-1, 5).mean(-1)
  
      _, ax = plt.subplots(2, 2, figsize=(16, 16), sharex=True, sharey=True)
  
      vplot = rebin_vis(vis[bidx, ..., pol], 128, 5).T
      ax[0, 0].imshow(vplot.real, interpolation='none', origin='lower',
                      aspect='auto', vmin=-1, vmax=1,
                      extent=[x[0], x[-1], y[0], y[-1]])
      ax[0, 0].text(0.1, 0.9, 'Before cal, real', transform=ax[0, 0].transAxes,
                    size=22, color='white')
      ax[1, 0].imshow(vplot.imag, interpolation='none', origin='lower',
                      aspect='auto', vmin=-1, vmax=1,
                      extent=[x[0], x[-1], y[0], y[-1]])
      ax[1, 0].text(0.1, 0.9, 'Before cal, imag', transform=ax[1, 0].transAxes,
                    size=22, color='white')
  
      vplot = rebin_vis(vis_cal[bidx, ..., pol], 128, 5).T
      ax[0, 1].imshow(vplot.real, interpolation='none', origin='lower',
                      aspect='auto', vmin=-1, vmax=1,
                      extent=[x[0], x[-1], y[0], y[-1]])
      ax[0, 1].text(0.1, 0.9, 'After cal, real', transform=ax[0, 1].transAxes,
                    size=22, color='white')
      ax[1, 1].imshow(vplot.imag, interpolation='none', origin='lower',
                      aspect='auto', vmin=-1, vmax=1,
                      extent=[x[0], x[-1], y[0], y[-1]])
      ax[1, 1].text(0.1, 0.9, 'After cal, imag', transform=ax[1, 1].transAxes,
                    size=22, color='white')
      for i in range(2):
          ax[1, i].set_xlabel('time (min)')
          ax[i, 0].set_ylabel('freq (GHz)')
      plt.subplots_adjust(hspace=0, wspace=0)
      if outname is not None:
          plt.savefig('{0}_{1}_cal_vis.png'.format(outname, 'A' if pol == 0 else
                                                   'B'))
      if not show:
          plt.close()
code_tokens: def plot_calibrated_vis ( vis , vis_cal , mjd , fobs , bidx , pol , outname = None , show = True ) : x = mjd [ : mjd . shape [ 0 ] // 128 * 128 ] . reshape ( - 1 , 128 ) . mean ( - 1 ) x = ( ( x - x [ 0 ] ) * u . d ) . to_value ( u . min ) y = fobs [ : fobs . shape [ 0 ] // 5 * 5 ] . reshape ( - 1 , 5 ) . mean ( - 1 ) _ , ax = plt . subplots ( 2 , 2 , figsize = ( 16 , 16 ) , sharex = True , sharey = True ) vplot = rebin_vis ( vis [ bidx , ... , pol ] , 128 , 5 ) . T ax [ 0 , 0 ] . imshow ( vplot . real , interpolation = 'none' , origin = 'lower' , aspect = 'auto' , vmin = - 1 , vmax = 1 , extent = [ x [ 0 ] , x [ - 1 ] , y [ 0 ] , y [ - 1 ] ] ) ax [ 0 , 0 ] . text ( 0.1 , 0.9 , 'Before cal, real' , transform = ax [ 0 , 0 ] . transAxes , size = 22 , color = 'white' ) ax [ 1 , 0 ] . imshow ( vplot . imag , interpolation = 'none' , origin = 'lower' , aspect = 'auto' , vmin = - 1 , vmax = 1 , extent = [ x [ 0 ] , x [ - 1 ] , y [ 0 ] , y [ - 1 ] ] ) ax [ 1 , 0 ] . text ( 0.1 , 0.9 , 'Before cal, imag' , transform = ax [ 1 , 0 ] . transAxes , size = 22 , color = 'white' ) vplot = rebin_vis ( vis_cal [ bidx , ... , pol ] , 128 , 5 ) . T ax [ 0 , 1 ] . imshow ( vplot . real , interpolation = 'none' , origin = 'lower' , aspect = 'auto' , vmin = - 1 , vmax = 1 , extent = [ x [ 0 ] , x [ - 1 ] , y [ 0 ] , y [ - 1 ] ] ) ax [ 0 , 1 ] . text ( 0.1 , 0.9 , 'After cal, real' , transform = ax [ 0 , 1 ] . transAxes , size = 22 , color = 'white' ) ax [ 1 , 1 ] . imshow ( vplot . imag , interpolation = 'none' , origin = 'lower' , aspect = 'auto' , vmin = - 1 , vmax = 1 , extent = [ x [ 0 ] , x [ - 1 ] , y [ 0 ] , y [ - 1 ] ] ) ax [ 1 , 1 ] . text ( 0.1 , 0.9 , 'After cal, imag' , transform = ax [ 1 , 1 ] . transAxes , size = 22 , color = 'white' ) for i in range ( 2 ) : ax [ 1 , i ] . set_xlabel ( 'time (min)' ) ax [ i , 0 ] . set_ylabel ( 'freq (GHz)' ) plt . subplots_adjust ( hspace = 0 , wspace = 0 ) if outname is not None : plt . savefig ( '{0}_{1}_cal_vis.png' . format ( outname , 'A' if pol == 0 else 'B' ) ) if not show : plt . close ( )
short_docstring: Plots the calibrated and uncalibrated visibilities for comparison.
short_docstring_tokens: Plots the calibrated and uncalibrated visibilities for comparison .
comment: """Plots the calibrated and uncalibrated visibilities for comparison.
  
      Parameters
      ----------
      vis : ndarray
          The complex, uncalibrated visibilities, with dimensions
          (baseline, time, freq, pol).
      vis_cal : ndarray
          The complex calibrated visibilities, with dimensions
          (baseline, time, freq, pol).
      mjd : ndarray
          The midpoint time of each subintegration in MJD.
      fobs : ndarray
          The center frequency of each channel in GHz.
      bidx : int
          The index along the baseline dimension to plot.
      pol : int
          The index along the polarization dimension to plot.
      outname : str
          The base to use for the name of the png file the plot is saved to.  The
          plot will be saved to `outname`_cal_vis.png if `outname` is provided,
          otherwise no plot will be saved.  Defaults ``None``.
      show : boolean
          If `show` is passed ``False``, the plot will be closed after being
          generated.  Otherwise, it is left open.  Defaults ``True``.
      """