source: trunk/src/draw_map_mod_gc.py @ 54

Last change on this file since 54 was 11, checked in by lahlod, 10 years ago

ajout d'un fichier test Laura

  • Property svn:executable set to *
File size: 1.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
7import ffgrid2
8from pylab import *
9from mpl_toolkits.basemap import Basemap
10from mpl_toolkits.basemap import shiftgrid, cm
11#import netCDF4
12
13#x=monthly_lon
14#y=monthly_lat
15#z=monthly_outz
16
17zz1=zzpgrid
18zz2=sigma_grid
19zz3=nngrid
20
21t1='amsua_ch2_tb.png'
22tt1='amsua_ch2 tb'
23t2='amsua_ch2_ecart_type.png'
24tt2='amsua_ch2 ecart type'
25t3='amsua_ch2_nom_donnes_tb.png'
26tt3='amsua ch2 nom donnes tb'
27
28#t1='amsua_ch2_pos2_tb.png'
29#tt1='amsua_ch2 pos2 tb'
30#t2='amsua_ch2_pos2_ecart_type.png'
31#tt2='amsua_ch2 pos2 ecart type'
32#t3='amsua_ch2_pos2_nom_donnes_tb.png'
33#tt3='amsua ch2 pos2 nom donnes tb'
34
35
36# on recupere les coordonnes xy de la projection orth standard
37m1 = Basemap(projection='ortho', lat_0 = -90, lon_0 = 0,
38resolution = 'l')
39
40xii, yii = m1(*np.meshgrid(xvec,yvec))
41width = m1.urcrnrx - m1.llcrnrx
42height = m1.urcrnry - m1.llcrnry
43
44# en jouant sur la valeurt du coef, on peut zoomer sur l'Antarctique
45
46coef = 0.6
47width = width*coef
48height = height*coef
49
50# on fait une nouvelle projection en zoomant sur l'antarctique
51
52map = Basemap(projection='ortho',lon_0=0,lat_0=-90,resolution='l',\
53
54llcrnrx=-0.5*width,llcrnry=-0.5*height,urcrnrx=0.5*width,urcrnry=0.5*height)
55xii, yii = map(*np.meshgrid(xvec,yvec))
56cs=map.pcolormesh(xii,yii,zz1,cmap=cm.s3pcpn_l_r)
57#cmap=cm.s3pcpn_l_r)
58#sstanom)
59#s3pcpn_l_r)
60cbar =colorbar(cs)
61plt.title(tt1)
62
63# draw coastlines, country boundaries, fill continents.
64map.drawcoastlines(linewidth=1)
65# draw the edge of the map projection region (the projection limb)
66map.drawmapboundary()
67# draw lat/lon grid lines every 30 degrees.
68map.drawmeridians(np.arange(0, 360, 10))
69map.drawparallels(np.arange(-90, 90, 10))
70plt.show()
71
72plt.savefig(t1)
73close()
Note: See TracBrowser for help on using the repository browser.