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=iterrei |
---|
15 | tt1='terre amusa ch2' |
---|
16 | t1='terre_amsua_ch2.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(0,1,0.001)#star, stop, step |
---|
38 | cs=map.pcolor(xii,yii,zz1) |
---|
39 | cbar =colorbar(cs) |
---|
40 | plt.title(tt1) |
---|
41 | |
---|
42 | # draw coastlines, country boundaries, fill continents. |
---|
43 | map.drawcoastlines(linewidth=1) |
---|
44 | # draw the edge of the map projection region (the projection limb) |
---|
45 | map.drawmapboundary() |
---|
46 | # draw lat/lon grid lines every 30 degrees. |
---|
47 | map.drawmeridians(np.arange(0, 360, 10)) |
---|
48 | map.drawparallels(np.arange(-90, 90, 10)) |
---|
49 | plt.show() |
---|
50 | |
---|
51 | plt.savefig(t1) |
---|
52 | close() |
---|