Exemplo n.º 1
0
def maglim_ax(Llls, cgg, ax, band = 'g', decband='i'):
  from  pz2nbar  import  nbar_convert

  ms, Ns      = get_shot(type=band, mlim=None)
  Ns          = nbar_convert(Ns, unit='str')

  iNs_interp  = interp1d(ms, 1. / Ns, kind='linear', bounds_error=True, assume_sorted=False)

  ##  Add second mag_axis.                                                                                                                        
  ax2         = ax.twinx()
  ymin, ymax  = ax.get_ylim()

  ax2.loglog(Llls, cgg, alpha=0.0)
    
  tms         =  np.arange(23.0, 26.0, 0.25)

  strings     = ['%.1lf' % x   for x in tms]
  tms         = [iNs_interp(x) for x in tms]

  ax2.set_yticks(tms)
  ax2.set_yticklabels(strings)
  
  ax2.set_ylabel(r'$%s_{{\rm{AB}}}$' % decband)
  ax2.tick_params(axis='y', which='minor', color='w')
  
  ax2.set_ylim([ymin, ymax])

  return  ax2
Exemplo n.º 2
0
                   'u': {'colors': ['darkblue',  'deepskyblue', 'b'], 'maglim': 24.6, 'decband': 'R'},\
                   'g': {'colors': ['darkgreen', 'limegreen',   'g'], 'maglim': 25.8, 'decband': 'i'},\
                   'r': {'colors': ['darkred',   'indianred',   'r'], 'maglim': 25.8, 'decband': 'z'}}

    mlim = setup[band]['maglim']

    ##  pz     =  get_pz(band)

    ##  Interloper GP rewrite.
    _, _, _, _, ngp = gp_pz(band, 'Full', 5.5)
    pz = np.vectorize(ngp)

    ##
    bz = lambda z: bz_callmodel(z, mlim)

    nbar = get_shot(band, mlim)
    nbar /= (4. * np.pi / 41253.)  ##  Sq. deg. to steradian.

    ##
    int_frac = 0.06
    nbar_wint = (1.0 + int_frac) * nbar

    decband = setup[band]['decband']
    colors = setup[band]['colors']

    peakz = _peakz(pz)

    ##  Hard p(z) limits.
    zmin = 0.01
    zmax = 10.00