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