当前位置: 首页>>代码示例>>Python>>正文


Python MA.maximum方法代码示例

本文整理汇总了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)
开发者ID:timchurches,项目名称:NetEpi-Analysis,代码行数:16,代码来源:DataTypes.py

示例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':
开发者ID:jsfan,项目名称:swim,代码行数:33,代码来源:swimplot-slice.py

示例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                        
开发者ID:ChrisBarker-NOAA,项目名称:wave_utils,代码行数:32,代码来源:plotTraj.py

示例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)
开发者ID:jsfan,项目名称:swim,代码行数:33,代码来源:oroplot.py


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