开发者

How to estimate the number of pixels in a satellite image using python matplotlib

I'm working with satellite images. I have a program (Python) to contrast satellite images by temperature of the cloud's top, the program is below:

from pylab import *
#import pylab imread,imshow


sat=imread('1101092045G13I04.tif')
imshow(sat)
map=imread('map.tif')
map=mean(map,2,)/3
#contour(map,cmap=cm.gray)

imshow((sat+map)**2,cmap=cm.gray,origin=1)

frio=where(logical_and((418.-sat)-273.15>=-110,(418.-sat)-273.15<=-31),(418.-sat)-273.15,0)
quente=where(logical_and((660.-sat)/2-273.15>-31,(660.-sat)/2-273.15<=40),(660.-sat)/2-273.15,0)
imshow=((frio+quente))

temperatura=[-80,-70,-60,-50,-40,-30]

#cores -> 'r','b','k','c','g','m','y'

amar='#ffff00'
verm='#ff3333'
verd='#00ff00'
lara='#ff9900'
aaaa='#ff00ff'

contourf((frio+quente),temperatura,transparent='true',colors=[aaaa,verm,lara,amar,verd])
color开发者_Go百科bar(cmap=cm.hot,shrink=0.6,orientation='horizontal',ticks=[-80, -70, -60, -50, -40, -30])


show()
#savefig('testeII.png') 

Now i need to estimate the number of pixels for each scale of temperatures. How can i do it? Please help me.


Now i need to estimate the number of pixels for each scale of temperatures.

I suppose histogram function is what you need.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜