• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python pylab.log10函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pylab.log10函数的典型用法代码示例。如果您正苦于以下问题:Python log10函数的具体用法?Python log10怎么用?Python log10使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了log10函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: value

    def value(self, data, image=None):        
        cam = data['name']
        if type(cam) == N.recarray:
            cam = cam[0]
        pix_size = {"sky": N.sqrt(202000/4), "sbc": 11.3}[cam]        
        ex = data['exposure']
        sky = data['sky'].clip(0.0001, data['sky'].max())
        mean = data['mean'] 
        pix_mag = 2.5*log10(pix_size**2) 


        temp = data['temp'].copy()
        if type(cam) == N.recarray:
            temp[temp < -35] = -40
            temp[temp >= -35] = -30
            
            offset = ex.copy()
            offset[temp == -30] = 2.25*ex[temp == -30]
            offset[temp == -40] = 0.59*ex[temp == -40]
        else:
            offset = 0
        if cam == "sbc":
            offset = 68
        else:
            offset += 77.1
        return -2.5*log10(sky - offset) + data['zmag']  + pix_mag
开发者ID:california43,项目名称:gattini,代码行数:26,代码来源:fields.py


示例2: main

def main():
    Z = 17.4
    pix_size = 11.3
    pix_mag = 2.5*log10(pix_size**2) 
    sky = 148
    offset = 68        
    print -2.5*log10(sky - offset) + Z  + pix_mag
开发者ID:california43,项目名称:gattini,代码行数:7,代码来源:foo.py


示例3: restore_logaxes_labels

def restore_logaxes_labels(subplot, xaxis=True, yaxis=True):
	'''
	This script reformats the default labeling scheme
	for logarithmic axis labels to the "regular" format.
	e.g. axis labels of "10**-1" and "10**3" will be
	changed to "0.1" and "1000" respectively.
	'''
	xticks = subplot.get_xticks() 
	yticks = subplot.get_yticks() 

	if xaxis:
		xticks_new = []
		for xi in xticks:
			base = pylab.log10(xi)
			if base >= 0:
				xi_new = '%i' % xi
			else:
				formatter = '%.' + str(int(abs(base))) + 'f'
				xi_new = formatter % xi
			xticks_new.append(xi_new)
		subplot.xaxis.set_ticklabels(xticks_new)

	if yaxis:
		yticks_new = []
		for yi in yticks:
			base = pylab.log10(yi)
			if base >= 0:
				yi_new = '%i' % yi
			else:
				formatter = '%.' + str(int(abs(base))) + 'f'
				yi_new = formatter % yi
			yticks_new.append(yi_new)
		subplot.yaxis.set_ticklabels(yticks_new)

	return subplot
开发者ID:tomczak724,项目名称:mypy,代码行数:35,代码来源:galaxy_bios.py


示例4: get_Rplusmag_true

def get_Rplusmag_true(rflux_instr, iflux_instr):
	a = 1.
	b = 0.03185165
	c = 27.45145076
	if rflux_instr < 0 or iflux_instr < 0:
		return -99.
	else:
		rmag_instr = -2.5 * pylab.log10(rflux_instr)
		imag_instr = -2.5 * pylab.log10(iflux_instr)
		return a * rmag_instr + b * (rmag_instr - imag_instr) + c
开发者ID:tomczak724,项目名称:mypy,代码行数:10,代码来源:py_mk-flux-mag-cats.py


示例5: get_Kmag_true

def get_Kmag_true(jflux_instr, kflux_instr):
	a = 1.
	b = -0.0257698323
	c = 29.4494709
	if jflux_instr < 0 or kflux_instr < 0:
		return -99.
	else:
		jmag_instr = -2.5 * pylab.log10(jflux_instr)
		kmag_instr = -2.5 * pylab.log10(kflux_instr)
		return a * kmag_instr + b * (jmag_instr - kmag_instr) + c
开发者ID:tomczak724,项目名称:mypy,代码行数:10,代码来源:py_mk-flux-mag-cats.py


示例6: get_rmag_true

def get_rmag_true(rflux_instr, iflux_instr):
	a = 1.
	b = 0.05033836
	c = 26.52083003
	if rflux_instr < 0 or iflux_instr < 0:
		return -99.
	else:
		rmag_instr = -2.5 * pylab.log10(rflux_instr)
		imag_instr = -2.5 * pylab.log10(iflux_instr)
		return a * rmag_instr + b * (rmag_instr - imag_instr) + c
开发者ID:tomczak724,项目名称:mypy,代码行数:10,代码来源:py_mk-flux-mag-cats.py


示例7: create_figure

def create_figure():
    psd = test_eigenfre_music()
    f = linspace(-0.5, 0.5, len(psd))
    plot(f, 10 * log10(psd/max(psd)), '--',label='MUSIC 15')
    savefig('psd_eigenfre_music.png')

    psd = test_eigenfre_ev()
    f = linspace(-0.5, 0.5, len(psd))
    plot(f, 10 * log10(psd/max(psd)), '--',label='EV 15')
    savefig('psd_eigenfre_ev.png')
开发者ID:anielsen001,项目名称:spectrum,代码行数:10,代码来源:test_eigenfre.py


示例8: get_Iplusmag_true

def get_Iplusmag_true(rflux_instr, iflux_instr):
	a = 1.
	b = 0.00013198858
	c = 27.3378864
	if rflux_instr < 0 or iflux_instr < 0:
		return -99.
	else:
		rmag_instr = -2.5 * pylab.log10(rflux_instr)
		imag_instr = -2.5 * pylab.log10(iflux_instr)
		return a * imag_instr + b * (rmag_instr - imag_instr) + c
开发者ID:tomczak724,项目名称:mypy,代码行数:10,代码来源:py_mk-flux-mag-cats.py


示例9: get_imag_true

def get_imag_true(rflux_instr, iflux_instr):
	a = 1.
	b = 0.021948947
	c = 26.2291181
	if rflux_instr < 0 or iflux_instr < 0:
		return -99.
	else:
		rmag_instr = -2.5 * pylab.log10(rflux_instr)
		imag_instr = -2.5 * pylab.log10(iflux_instr)
		return a * imag_instr + b * (rmag_instr - imag_instr) + c
开发者ID:tomczak724,项目名称:mypy,代码行数:10,代码来源:py_mk-flux-mag-cats.py


示例10: get_zmag_true

def get_zmag_true(iflux_instr, zflux_instr):
	a = 1.
	b = -0.03321189
	c = 25.02113495
	if iflux_instr < 0 or zflux_instr < 0:
		return -99.
	else:
		imag_instr = -2.5 * pylab.log10(iflux_instr)
		zmag_instr = -2.5 * pylab.log10(zflux_instr)
		return a * zmag_instr + b * (imag_instr - zmag_instr) + c
开发者ID:tomczak724,项目名称:mypy,代码行数:10,代码来源:py_mk-flux-mag-cats.py


示例11: get_Jmag_true

def get_Jmag_true(jflux_instr, kflux_instr):
	a = 1.
	b = -0.04157139
	c = 29.07118567
	if jflux_instr < 0 or kflux_instr < 0:
		return -99.
	else:
		jmag_instr = -2.5 * pylab.log10(jflux_instr)
		kmag_instr = -2.5 * pylab.log10(kflux_instr)
		return a * jmag_instr + b * (jmag_instr - kmag_instr) + c
开发者ID:tomczak724,项目名称:mypy,代码行数:10,代码来源:py_mk-flux-mag-cats.py


示例12: getDR

 def getDR(self):
     #this function should return the dynamic range
     #this should be the noiselevel of the fft
     noiselevel=py.sqrt(py.mean(abs(py.fft(self._tdData.getAllPrecNoise()[0]))**2))
     #apply a moving average filter on log
     window_size=5
     window=py.ones(int(window_size))/float(window_size)
     hlog=py.convolve(20*py.log10(self.getFAbs()), window, 'valid')
     one=py.ones((2,))
     hlog=py.concatenate((hlog[0]*one,hlog,hlog[-1]*one))
     return hlog-20*py.log10(noiselevel)         
开发者ID:DavidJahn86,项目名称:terapy,代码行数:11,代码来源:TeraData.py


示例13: on_release

  def on_release(self, event):
    """When we release the mouse, if we were dragging the line, recompute the filter and draw it."""
    if self.being_dragged is None: return

    self.being_dragged = None
    xy = self.design_line.get_data()
    self.wp = [xy[0][2], xy[0][3]]
    self.ws = [xy[0][1], xy[0][4]]
    self.gpass = -20*pylab.log10(xy[1][2])
    self.gstop = -20*pylab.log10(xy[1][1])
    self.update_design()
开发者ID:kghose,项目名称:neurapy,代码行数:11,代码来源:filterexplore.py


示例14: _fetch_normalisation

    def _fetch_normalisation(self):
        # x is training
        # y is gold
        filename = self._pj([self._path2data, 'data', 'common_training.csv'])
        training = pd.read_csv(filename)

        filename = self._pj([self._path2data, 'data', 'common_gold.csv'])
        goldfile = pd.read_csv(filename)

        #"""function [m b rho] = fetch_normalization(jj)
        #%% jj is the index of the molecule (1-7)

        colnames = self.species

        self.norm_training = pylab.log10(training[colnames] + 1)
        self.norm_gold = pylab.log10(goldfile[colnames] + 1)
开发者ID:Sage-Bionetworks,项目名称:dreamtools,代码行数:16,代码来源:scoring.py


示例15: create_figure

def create_figure():
    psd = test_correlog()
    f = linspace(-0.5, 0.5, len(psd))

    psd = cshift(psd, len(psd)/2)
    plot(f, 10*log10(psd/max(psd)))
    savefig('psd_corr.png')
开发者ID:anielsen001,项目名称:spectrum,代码行数:7,代码来源:test_correlog.py


示例16: hz2mel

def hz2mel(hz):
    """Convert a value in Hertz to Mels

    :param hz: a value in Hz. This can also be a numpy array, conversion proceeds element-wise.
    :returns: a value in Mels. If an array was passed in, an identical sized array is returned.
    """
    return 2595 * pylab.log10(1+hz/700.0)
开发者ID:AllanRamsay,项目名称:COMP34411,代码行数:7,代码来源:base.py


示例17: compute_response

    def compute_response(self, **kargs):
        """Compute the window data frequency response

        :param norm: True by default. normalised the frequency data.
        :param int NFFT:       total length of the final data sets( 2048 by default. if less than data length, then
            NFFT is set to the data length*2).

        The response is stored in :attr:`response`.

        .. note:: Units are dB (20 log10) since we plot the frequency response)


        """
        from pylab import fft, fftshift, log10

        norm = kargs.get('norm', self.norm)

        # do some padding. Default is max(2048, data.len*2)
        NFFT = kargs.get('NFFT', 2048)
        if NFFT < len(self.data):
            NFFT = self.data.size * 2

        # compute the fft modulus
        A = fft(self.data, NFFT)
        mag = abs(fftshift(A))

        # do we want to normalise the data
        if norm is True:
            mag = mag / max(mag)
        response = 20. * log10(mag) # factor 20 we are looking at the response
                                    # not the powe
        #response = clip(response,mindB,100)
        self.__response = response
开发者ID:carlkl,项目名称:spectrum,代码行数:33,代码来源:window.py


示例18: update_design

  def update_design(self):
    ax = self.ax
    ax.cla()
    ax2 = self.ax2
    ax2.cla()

    wp = self.wp
    ws = self.ws
    gpass = self.gpass
    gstop = self.gstop
    b, a = ss.iirdesign(wp, ws, gpass, gstop, ftype=self.ftype, output='ba')
    self.a = a
    self.b = b
    #b = [1,2]; a = [1,2]
    #Print this on command line so we can use it in our programs
    print 'b = ', pylab.array_repr(b)
    print 'a = ', pylab.array_repr(a)

    my_w = pylab.logspace(pylab.log10(.1*self.ws[0]), 0.0, num=512)
    #import pdb;pdb.set_trace()
    w, h = freqz(b, a, worN=my_w*pylab.pi)
    gp = 10**(-gpass/20.)#Go from db to regular
    gs = 10**(-gstop/20.)
    self.design_line, = ax.plot([.1*self.ws[0], self.ws[0], wp[0], wp[1], ws[1], 1.0], [gs, gs, gp, gp, gs, gs], 'ko:', lw=2, picker=5)
    ax.semilogx(w/pylab.pi, pylab.absolute(h),lw=2)
    ax.text(.5,1.0, '{:d}/{:d}'.format(len(b), len(a)))
    pylab.setp(ax, 'xlim', [.1*self.ws[0], 1.2], 'ylim', [-.1, max(1.1,1.1*pylab.absolute(h).max())], 'xticklabels', [])

    ax2.semilogx(w/pylab.pi, pylab.unwrap(pylab.angle(h)),lw=2)
    pylab.setp(ax2, 'xlim', [.1*self.ws[0], 1.2])
    ax2.set_xlabel('Normalized frequency')

    pylab.draw()
开发者ID:kghose,项目名称:neurapy,代码行数:33,代码来源:filterexplore.py


示例19: toggle_logscale

 def toggle_logscale(self,label):
     self.log_flag = not self.log_flag
     if self.log_flag:
         self.data = log10(self.data+1e-9)
     else:
         self.data = self.raw_data
     self.update_img()
开发者ID:pawel-kw,项目名称:pyxsvs,代码行数:7,代码来源:makemask.py


示例20: pcolor

    def pcolor(self, mode="mean", vmin=None, vmax=None):
        """

        If you loaded the pickle data sets with only mean and sigma, the D and
        pvalue mode cannot be used.

        """
        from pylab import clf, xticks, yticks, pcolor, colorbar, flipud, log10
        if mode == "mean":
            data = self.get_mean()
        elif mode == "sigma":
            data = self.get_sigma()
        elif mode == "D":
            data = self.get_ks()[0]
        elif mode == "pvalue":
            data = self.get_ks()[1]
        clf();

        if mode == "pvalue":
            pcolor(log10(flipud(data)), vmin=vmin, vmax=vmax);
        else:
            pcolor(flipud(data), vmin=vmin,vmax=vmax);

        colorbar()
        xticks([x+0.5 for x in range(0,8)], self.ligands, rotation=90)
        cellLines = self.cellLines[:]
        cellLines.reverse()
        yticks([x+0.5 for x in range(0,4)], cellLines, rotation=0)
开发者ID:nagyistoce,项目名称:dreamtools,代码行数:28,代码来源:sc1a_tools.py



注:本文中的pylab.log10函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pylab.loglog函数代码示例发布时间:2022-05-25
下一篇:
Python pylab.log函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap