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