Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
nstar2mass= numpy.nansum(nstar2mass,axis=-1)
nstartgas= numpy.nansum(nstartgas,axis=-1)
if type == 'sf':
pt= nstartgas/nstar2mass
vmin= 0.
vmax= 1.
zlabel=r'$\mathrm{completeness}$'
elif type == 'tgas' or type == '2mass':
vmin= 0.
vmax= 6.
zlabel= r'$\log_{10}\mathrm{number\ counts}$'
if type == 'tgas':
pt= numpy.log10(nstartgas)
elif type == '2mass':
pt= numpy.log10(nstar2mass)
return bovy_plot.bovy_dens2d(pt,origin='lower',
cmap='viridis',interpolation='nearest',
colorbar=True,shrink=0.78,
vmin=vmin,vmax=vmax,zlabel=zlabel,
yrange=[edges[0][0],edges[0][-1]],
xrange=[edges[1][0],edges[1][-1]],
xlabel=r'$J-K_s$',
ylabel=r'$J+\Delta J$')
def plot_magdist(self,type='sf',cut=True,splitcolors=False,overplot=False):