本文整理汇总了Python中MA.maximum方法的典型用法代码示例。如果您正苦于以下问题:Python MA.maximum方法的具体用法?Python MA.maximum怎么用?Python MA.maximum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MA
的用法示例。
在下文中一共展示了MA.maximum方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: derive_format_str
# 需要导入模块: import MA [as 别名]
# 或者: from MA import maximum [as 别名]
def derive_format_str(self, data):
if len(data) == 0:
return self.default_format_str
width = 10
max = MA.maximum(MA.absolute(data))
if max > 0:
decimals = width - math.log(max, 10) - 2
if decimals < 0:
decimals = 0
elif max >= 0.00001:
decimals = 8
else:
return '%10.10g'
return '%%%d.%df' % (width, decimals)
示例2: int
# 需要导入模块: import MA [as 别名]
# 或者: from MA import maximum [as 别名]
if dim != 'x' and dim != 'X':
dim = 'y'
else:
dim = 'x'
if ipos == 0:
if dim == 'x':
ipos = int(round(shape(pvar)[1]/2))
else:
ipos = int(round(shape(pvar)[2]/2))
pos = repr(ipos)
if minval == maxval:
if dim == 'x':
minval = int(floor(MA.minimum(pvar[:,:,ipos])))
maxval = int(ceil(MA.maximum(pvar[:,:,ipos])))
else:
minval = int(floor(MA.minimum(pvar[:,ipos,:])))
maxval = int(ceil(MA.maximum(pvar[:,ipos,:])))
minval = minval - abs(minval)*0.05
maxval = maxval + abs(maxval)*0.05
sys.stdout.write("Plotting "+var+" (sliced at "+dim+" position "+pos+")\nPlotting time step ")
for t in range(maxt):
sys.stdout.write(repr(t)+'...')
sys.stdout.flush()
if dim == 'x':
示例3: writeGbin
# 需要导入模块: import MA [as 别名]
# 或者: from MA import maximum [as 别名]
Latitude,Longitude = writeGbin(file,Trajectory,(NumTimesteps,NumLEs),HeaderData)#,flags
mxLat = N.ones((NumTimesteps),N.Float)
meanLat = N.ones((NumTimesteps),N.Float)
mnLat = N.ones((NumTimesteps),N.Float)
leTimes = []
# Assumming a Timestep is an hour (3600 seconds)!
count = 0
for cn in range(NumTimesteps):
dtime = datetime.timedelta(seconds=cn*3600)
time = modelStartTime + dtime
tLat = N.take(Latitude,(cn,), 1)
# print tLat
mxL = MA.maximum(tLat,)
mnL = MA.minimum(tLat,)
meanL=MLab.mean(tLat,0)
N.put(mxLat,cn,mxL)
N.put(mnLat,cn,mnL)
N.put(meanLat,cn,meanL)
leTimes.append(time)
nboth = 0
if time in ocTime:
write_matches = 1
while write_matches == 1:
# print nboth, cn
if count == 0:
nboth = ocTime.index(time)
count +=1
示例4: int
# 需要导入模块: import MA [as 别名]
# 或者: from MA import maximum [as 别名]
if opt == '--minval':
minval = int(arg)
elif opt == '--maxval':
maxval = int(arg)
elif opt in ('-t','--transpose'):
tp = 1
elif opt in ('--prefix','-p'):
prefix = arg + '-'
if tp:
print 'Value matrix will be transposed.'
# colourbar range not set on cmdline
if (minval == maxval):
minval = int(floor(1.01*MA.minimum(pvar)))
maxval = int(ceil(1.01*MA.maximum(pvar)))
print 'Boundaries for values are %0.2f and %0.2f' % (minval,maxval)
step = int(ceil((maxval-minval)/1024.0))
if tp:
p.imshow(pvar[:,:].transpose(),origin='lower',interpolation='nearest',vmin=minval,vmax=maxval)
p.colorbar(orientation='horizontal')
else:
p.imshow(pvar[:,:],origin='lower',interpolation='nearest',vmin=minval,vmax=maxval)
p.colorbar(orientation='horizontal')
filename = prefix + "phioro.png"
p.title('Orography')
p.savefig(filename)