source: trunk/src/python_script/draw_map_ssmisch15.py @ 6

Last change on this file since 6 was 6, checked in by gaclod, 12 years ago

add GC python scripts

  • Property svn:executable set to *
File size: 4.8 KB
Line 
1#mod gabi para graficar AMSUA CH2
2#!/usr/bin/env python
3# -*- coding: utf-8 -*-
4import string
5import numpy as np
6import matplotlib.pyplot as plt
7from pylab import *
8from mpl_toolkits.basemap import Basemap
9from mpl_toolkits.basemap import shiftgrid, cm
10
11#trans t
12
13
14zz1=tbpgrid_t
15tt1='tb moy ssmis ch15'
16t1='tb_ssmis_ch15.png'
17
18# on recupere les coordonnes xy de la projection orth standard
19m1 = Basemap(projection='ortho', lat_0 = -90, lon_0 = 0,
20resolution = 'l')
21
22xii, yii = m1(*np.meshgrid(xvec,yvec))
23width = m1.urcrnrx - m1.llcrnrx
24height = m1.urcrnry - m1.llcrnry
25
26coef = 0.6
27width = width*coef
28height = height*coef
29
30# on fait une nouvelle projection en zoomant sur l'antarctique
31
32map = Basemap(projection='ortho',lon_0=0,lat_0=-90,resolution='l',\
33
34llcrnrx=-0.5*width,llcrnry=-0.5*height,urcrnrx=0.5*width,urcrnry=0.5*height)
35xii, yii = map(*np.meshgrid(xvec,yvec))
36#, clevs, cmap=my_cmap)
37clevs=arange(100,300,1)#star, stop, step
38cs=map.contourf(xii,yii,zz1, clevs, cmap=cm.s3pcpn_l_r)
39#cmap=cm.s3pcpn_l_r)
40#sstanom)
41#s3pcpn_l_r)
42cbar =colorbar(cs)
43plt.title(tt1)
44
45# draw coastlines, country boundaries, fill continents.
46map.drawcoastlines(linewidth=1)
47# draw the edge of the map projection region (the projection limb)
48map.drawmapboundary()
49# draw lat/lon grid lines every 30 degrees.
50map.drawmeridians(np.arange(0, 360, 10))
51map.drawparallels(np.arange(-90, 90, 10))
52#plt.show()
53
54plt.savefig(t1)
55close()
56
57################################
58#carte ecart type
59
60zz1=tbsigma_grid_t
61tt1='ecart type tb moy ssmis ch15'
62t1='ecart_type_tb_ssmis_ch15.png'
63
64# on recupere les coordonnes xy de la projection orth standard
65m1 = Basemap(projection='ortho', lat_0 = -90, lon_0 = 0,
66resolution = 'l')
67
68xii, yii = m1(*np.meshgrid(xvec,yvec))
69width = m1.urcrnrx - m1.llcrnrx
70height = m1.urcrnry - m1.llcrnry
71
72coef = 0.6
73width = width*coef
74height = height*coef
75
76# on fait une nouvelle projection en zoomant sur l'antarctique
77
78map = Basemap(projection='ortho',lon_0=0,lat_0=-90,resolution='l',\
79
80llcrnrx=-0.5*width,llcrnry=-0.5*height,urcrnrx=0.5*width,urcrnry=0.5*height)
81xii, yii = map(*np.meshgrid(xvec,yvec))
82#, clevs, cmap=my_cmap)
83clevs=arange(0,40,0.1)#star, stop, step
84cs=map.contourf(xii,yii,zz1, clevs, cmap=cm.s3pcpn_l_r)
85#cmap=cm.s3pcpn_l_r)
86#sstanom)
87#s3pcpn_l_r)
88cbar =colorbar(cs)
89plt.title(tt1)
90
91# draw coastlines, country boundaries, fill continents.
92map.drawcoastlines(linewidth=1)
93# draw the edge of the map projection region (the projection limb)
94map.drawmapboundary()
95# draw lat/lon grid lines every 30 degrees.
96map.drawmeridians(np.arange(0, 360, 10))
97map.drawparallels(np.arange(-90, 90, 10))
98#plt.show()
99plt.savefig(t1)
100close()
101
102################################
103#nom données
104
105zz1=tbnngrid_t
106tt1='nom donnees tb moy ssmis ch15'
107t1='nom_donnees_tb_ssmis_ch15.png'
108
109# on recupere les coordonnes xy de la projection orth standard
110m1 = Basemap(projection='ortho', lat_0 = -90, lon_0 = 0,
111resolution = 'l')
112
113xii, yii = m1(*np.meshgrid(xvec,yvec))
114width = m1.urcrnrx - m1.llcrnrx
115height = m1.urcrnry - m1.llcrnry
116
117coef = 0.6
118width = width*coef
119height = height*coef
120
121# on fait une nouvelle projection en zoomant sur l'antarctique
122
123map = Basemap(projection='ortho',lon_0=0,lat_0=-90,resolution='l',\
124
125llcrnrx=-0.5*width,llcrnry=-0.5*height,urcrnrx=0.5*width,urcrnry=0.5*height)
126xii, yii = map(*np.meshgrid(xvec,yvec))
127#, clevs, cmap=my_cmap)
128clevs=arange(0,300,1)#star, stop, step
129cs=map.contourf(xii,yii,zz1, clevs, cmap=cm.s3pcpn_l_r)
130#cmap=cm.s3pcpn_l_r)
131#sstanom)
132#s3pcpn_l_r)
133cbar =colorbar(cs)
134plt.title(tt1)
135
136# draw coastlines, country boundaries, fill continents.
137map.drawcoastlines(linewidth=1)
138# draw the edge of the map projection region (the projection limb)
139map.drawmapboundary()
140# draw lat/lon grid lines every 30 degrees.
141map.drawmeridians(np.arange(0, 360, 10))
142map.drawparallels(np.arange(-90, 90, 10))
143#plt.show()
144plt.savefig(t1)
145close()
146
147################################
148#mask
149
150zz1=mzzpgrid_t
151# on recupere les coordonnes xy de la projection orth standard
152m1 = Basemap(projection='ortho', lat_0 = -90, lon_0 = 0,
153resolution = 'l')
154
155xii, yii = m1(*np.meshgrid(xvec,yvec))
156width = m1.urcrnrx - m1.llcrnrx
157height = m1.urcrnry - m1.llcrnry
158
159coef = 0.6
160width = width*coef
161height = height*coef
162
163# on fait une nouvelle projection en zoomant sur l'antarctique
164
165map = Basemap(projection='ortho',lon_0=0,lat_0=-90,resolution='l',\
166
167llcrnrx=-0.5*width,llcrnry=-0.5*height,urcrnrx=0.5*width,urcrnry=0.5*height)
168xii, yii = map(*np.meshgrid(xvec,yvec))
169#, clevs, cmap=my_cmap)
170clevs=arange(0,300,1)#star, stop, step
171cs=map.contourf(xii,yii,zz1, clevs, cmap=cm.s3pcpn_l_r)
172#cmap=cm.s3pcpn_l_r)
173#sstanom)
174#s3pcpn_l_r)
175cbar =colorbar(cs)
176
177# draw coastlines, country boundaries, fill continents.
178map.drawcoastlines(linewidth=1)
179# draw the edge of the map projection region (the projection limb)
180map.drawmapboundary()
181# draw lat/lon grid lines every 30 degrees.
182map.drawmeridians(np.arange(0, 360, 10))
183map.drawparallels(np.arange(-90, 90, 10))
184plt.show()
185
Note: See TracBrowser for help on using the repository browser.