source: trunk/src/scripts_Laura/ARCTIC/Travail_CEN/map_ffgrid.py @ 55

Last change on this file since 55 was 40, checked in by lahlod, 10 years ago

scripts ajoutes apres CEN

File size: 947 bytes
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3import string
4import numpy as np
5import matplotlib.pyplot as plt
6from pylab import *
7from mpl_toolkits.basemap import Basemap
8from mpl_toolkits.basemap import shiftgrid, cm
9
10
11
12
13
14
15def draw_map_l (xcoord, ycoord, c0, c1, dc, zvar, colormap, text):
16
17    figure()
18    m = Basemap(projection = 'nplaea', boundinglat = 65., lon_0 = 0., resolution = 'l', fix_aspect = True)
19    m.drawcoastlines(linewidth = 0.5)
20    m.drawlsmask(ocean_color='#F4EAF1', lakes=False)
21    m.drawparallels(np.arange(60.,90.,10.), labels=[1,0,0,0])
22    m.drawmeridians(np.arange(-180.,180.,20.), labels=[0,0,0,1])
23    xii, yii = m(*np.meshgrid(xcoord,ycoord))
24    clevs = np.arange(c0, c1, dc)
25    #cmap = cm.s3pcpn_l_r
26    cs = m.contourf(xii, yii, zvar, clevs, cmap = colormap) 
27    cbar = colorbar(cs)
28    cbar.set_label(text)
29    #plt.savefig('/mma/hermozol/Documents/figure_output/tb_lamb_AMSUB_1sept2009.png')
30
31
32    return 
Note: See TracBrowser for help on using the repository browser.