本文整理汇总了Python中pylab.log10函数的典型用法代码示例。如果您正苦于以下问题:Python log10函数的具体用法?Python log10怎么用?Python log10使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log10函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
示例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
示例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
示例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
示例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
示例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
示例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')
示例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
示例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
示例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
示例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
示例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)
示例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()
示例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)
示例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')