original_docstring: Plots autocorrelations from UVData object.
  
      Parameters
      ----------
      UV : UVData object
          The UVData object for which to plot autocorrelations.
      
docstring: Plots autocorrelations from UVData object.
  Parameters
  
  UV : UVData object
  The UVData object for which to plot autocorrelations.
docstring_tokens: Plots autocorrelations from UVData object . Parameters UV : UVData object The UVData object for which to plot autocorrelations .
code: def plot_autocorr(UV):
      """Plots autocorrelations from UVData object.
  
      Parameters
      ----------
      UV : UVData object
          The UVData object for which to plot autocorrelations.
      """
      freq = UV.freq_array.squeeze()
      ant1 = UV.ant_1_array.reshape(UV.Ntimes, -1)[0, :]
      ant2 = UV.ant_2_array.reshape(UV.Ntimes, -1)[0, :]
      time = UV.time_array.reshape(UV.Ntimes, -1)[:, 0]
      vis = UV.data_array.reshape(UV.Ntimes, -1, UV.Nfreqs, UV.Npols)
      autocorrs = np.where(ant1 == ant2)[0]
      ccyc = plt.rcParams['axes.prop_cycle'].by_key()['color']
      _, ax = plt.subplots(
          len(autocorrs)//len(ccyc)+1,
          1,
          figsize=(8, 4*len(autocorrs)//len(ccyc)+1),
          sharex=True,
          sharey=True
      )
      for j in range(len(autocorrs)//len(ccyc)+1):
          for i, ac in enumerate(autocorrs[len(ccyc)*j:len(ccyc)*(j+1)]):
              ax[j].plot(
                  freq.squeeze()/1e9,
                  np.abs(np.nanmean(vis[:, ac, ..., 0], axis=0)),
                  alpha=0.5,
                  color=ccyc[i%len(ccyc)],
                  ls='-',
                  label=ant1[ac]+1
              )
              ax[j].plot(
                  freq.squeeze()/1e9,
                  np.abs(np.nanmean(vis[:, ac, ..., 1], axis=0)),
                  alpha=0.5,
                  color=ccyc[i%len(ccyc)],
                  ls=':'
              )
          ax[j].legend()
      ax[-1].set_xlabel('freq (GHz)')
      ax[0].set_yscale('log')
      plt.subplots_adjust(hspace=0)
  
      _, ax = plt.subplots(
          len(autocorrs)//len(ccyc)+1,
          1,
          figsize=(8, 4*len(autocorrs)//len(ccyc)+1),
          sharex=True,
          sharey=True
      )
      for j in range(len(autocorrs)//len(ccyc)+1):
          for i, ac in enumerate(autocorrs[len(ccyc)*j:len(ccyc)*(j+1)]):
              ax[j].plot(
                  (time-time[0])*24*60,
                  np.abs(vis[:, ac, ..., 0].mean(axis=1)),
                  alpha=0.5,
                  color=ccyc[i%len(ccyc)],
                  ls='-',
                  label=ant1[ac]+1
              )
              ax[j].plot(
                  (time-time[0])*24*60,
                  np.abs(vis[:, ac, ..., 1].mean(axis=1)),
                  alpha=0.5,
                  color=ccyc[i%len(ccyc)],
                  ls=':'
              )
          ax[j].legend()
      ax[-1].set_xlabel('time (min)')
      ax[0].set_yscale('log')
      plt.subplots_adjust(hspace=0)
code_tokens: def plot_autocorr ( UV ) : freq = UV . freq_array . squeeze ( ) ant1 = UV . ant_1_array . reshape ( UV . Ntimes , - 1 ) [ 0 , : ] ant2 = UV . ant_2_array . reshape ( UV . Ntimes , - 1 ) [ 0 , : ] time = UV . time_array . reshape ( UV . Ntimes , - 1 ) [ : , 0 ] vis = UV . data_array . reshape ( UV . Ntimes , - 1 , UV . Nfreqs , UV . Npols ) autocorrs = np . where ( ant1 == ant2 ) [ 0 ] ccyc = plt . rcParams [ 'axes.prop_cycle' ] . by_key ( ) [ 'color' ] _ , ax = plt . subplots ( len ( autocorrs ) // len ( ccyc ) + 1 , 1 , figsize = ( 8 , 4 * len ( autocorrs ) // len ( ccyc ) + 1 ) , sharex = True , sharey = True ) for j in range ( len ( autocorrs ) // len ( ccyc ) + 1 ) : for i , ac in enumerate ( autocorrs [ len ( ccyc ) * j : len ( ccyc ) * ( j + 1 ) ] ) : ax [ j ] . plot ( freq . squeeze ( ) / 1e9 , np . abs ( np . nanmean ( vis [ : , ac , ... , 0 ] , axis = 0 ) ) , alpha = 0.5 , color = ccyc [ i % len ( ccyc ) ] , ls = '-' , label = ant1 [ ac ] + 1 ) ax [ j ] . plot ( freq . squeeze ( ) / 1e9 , np . abs ( np . nanmean ( vis [ : , ac , ... , 1 ] , axis = 0 ) ) , alpha = 0.5 , color = ccyc [ i % len ( ccyc ) ] , ls = ':' ) ax [ j ] . legend ( ) ax [ - 1 ] . set_xlabel ( 'freq (GHz)' ) ax [ 0 ] . set_yscale ( 'log' ) plt . subplots_adjust ( hspace = 0 ) _ , ax = plt . subplots ( len ( autocorrs ) // len ( ccyc ) + 1 , 1 , figsize = ( 8 , 4 * len ( autocorrs ) // len ( ccyc ) + 1 ) , sharex = True , sharey = True ) for j in range ( len ( autocorrs ) // len ( ccyc ) + 1 ) : for i , ac in enumerate ( autocorrs [ len ( ccyc ) * j : len ( ccyc ) * ( j + 1 ) ] ) : ax [ j ] . plot ( ( time - time [ 0 ] ) * 24 * 60 , np . abs ( vis [ : , ac , ... , 0 ] . mean ( axis = 1 ) ) , alpha = 0.5 , color = ccyc [ i % len ( ccyc ) ] , ls = '-' , label = ant1 [ ac ] + 1 ) ax [ j ] . plot ( ( time - time [ 0 ] ) * 24 * 60 , np . abs ( vis [ : , ac , ... , 1 ] . mean ( axis = 1 ) ) , alpha = 0.5 , color = ccyc [ i % len ( ccyc ) ] , ls = ':' ) ax [ j ] . legend ( ) ax [ - 1 ] . set_xlabel ( 'time (min)' ) ax [ 0 ] . set_yscale ( 'log' ) plt . subplots_adjust ( hspace = 0 )
short_docstring: Plots autocorrelations from UVData object.
short_docstring_tokens: Plots autocorrelations from UVData object .
comment: """Plots autocorrelations from UVData object.
  
      Parameters
      ----------
      UV : UVData object
          The UVData object for which to plot autocorrelations.
      """