Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#First evaluate the dust map
ds= numpy.linspace(range[0],range[1],nds)
if distmod:
adust= self(l,b,10.**(ds/5.-2.))
else:
adust= self(l,b,ds)
#Add labels
if distmod:
kwargs['xlabel']= r'$\mathrm{Distance\ modulus}$'
else:
kwargs['xlabel']= r'$D\,(\mathrm{kpc})$'
if not self._filter is None:
kwargs['ylabel']= r'$A_{%s}\,(\mathrm{mag})$' % (self._filter.split(' ')[-1])
else:
kwargs['ylabel']= r'$E(B-V)\,(\mathrm{mag})$'
return bovy_plot.bovy_plot(ds,adust,*args,**kwargs)
elif type == 'tgas' or type == '2mass':
vmin= 1.
vmax= 10**6.
ylabel= r'$\log_{10}\mathrm{number\ counts}$'
semilogy= True
if type == 'tgas':
if splitcolors:
pt= nstartgas[:,ii]
else:
pt= numpy.nansum(nstartgas,-1)
elif type == '2mass':
if splitcolors:
pt= nstar2mass[:,ii]
else:
pt= numpy.nansum(nstar2mass,-1)
bovy_plot.bovy_plot(exs,pt,ls='steps-mid',
xrange=[2.,14.],
yrange=[vmin,vmax],
semilogy=semilogy,
xlabel=r'$J+\Delta J$',
ylabel=ylabel,
overplot=(ii>0)+overplot)
if not splitcolors: break
return None
plot to output device
HISTORY:
2013-12-15 - Written - Bovy (IAS)
"""
if not _BOVY_PLOT_LOADED:
raise NotImplementedError("galpy.util.bovy_plot could not be loaded, so there is no plotting; might have to install galpy (http://github.com/jobovy/galpy) for plotting")
#First get the data
tdata= self.lbData(l,b)
#Filter
if self._filter is None:
filterFac= 1./aebv('2MASS Ks',sf10=self._sf10)
else:
filterFac= 1./aebv('2MASS Ks',sf10=self._sf10)\
*aebv(self._filter,sf10=self._sf10)
#Plot
out= bovy_plot.bovy_plot(tdata['dist'],tdata['aks']*filterFac,
*args,**kwargs)
#uncertainties
pyplot.errorbar(tdata['dist'],tdata['aks']*filterFac,
xerr=tdata['e_dist'],
yerr=tdata['e_aks']*filterFac,
ls='none',marker=None,color='k')
return out