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


Python MA.minimum方法代码示例

本文整理汇总了Python中MA.minimum方法的典型用法代码示例。如果您正苦于以下问题:Python MA.minimum方法的具体用法?Python MA.minimum怎么用?Python MA.minimum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MA的用法示例。


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

示例1: writeGbin

# 需要导入模块: import MA [as 别名]
# 或者: from MA import minimum [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                        
#                         fs.write('%i, %s, %i %i %i %i %i, %f %f %f, %f %f %f\n'%(cn, file, int(time.year), int(time.month), int(time.day), int(time.hour), int(time.minute), mxL, meanL, mnL, ocLat[nboth,0], ocLat[nboth,1],ocLat[nboth,2]))
开发者ID:ChrisBarker-NOAA,项目名称:wave_utils,代码行数:33,代码来源:plotTraj.py

示例2: int

# 需要导入模块: import MA [as 别名]
# 或者: from MA import minimum [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()
	
开发者ID:jsfan,项目名称:swim,代码行数:31,代码来源:swimplot-slice.py

示例3: int

# 需要导入模块: import MA [as 别名]
# 或者: from MA import minimum [as 别名]
for opt, arg in opts:
        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')
开发者ID:jsfan,项目名称:swim,代码行数:33,代码来源:oroplot.py


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