source: trunk/src/carte.py @ 56

Last change on this file since 56 was 9, checked in by pinsard, 10 years ago

fix thanks to coding rules

File size: 1.7 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3import string
4import numpy as np
5import matplotlib.pyplot as plt
6import ffgrid2
7from pylab import *
8from mpl_toolkits.basemap import Basemap
9from mpl_toolkits.basemap import shiftgrid, cm
10#import netCDF4
11
12def draw(z, x, y, outfile, txt, cax1,cax2,cax3, my_cmap):
13
14        m = Basemap(llcrnrlon=-180,urcrnrlon=180,llcrnrlat=-90,urcrnrlat=90,projection='cyl',resolution='c',fix_aspect=True)
15        #m = Basemap(projection='ortho',lon_0=0,lat_0=-90,resolution='c')
16        #m = Basemap(resolution='c',projection='sinu',lon_0=60)
17        #m = Basemap(llcrnrlon=-180,urcrnrlon=180,llcrnrlat=-90,urcrnrlat=90,projection='cyl',resolution='i',fix_aspect=True)
18        #m = Basemap(llcrnrlon=-180,urcrnrlon=180,llcrnrlat=-60,urcrnrlat=60,projection='cyl',resolution='c',fix_aspect=True)
19
20        #ax = plt.gca()
21        xii, yii = m(*np.meshgrid(x,y))
22        #ax = plt.gca()
23        #clevs=arange(0,0.8,0.005)
24        clevs=arange(cax1,cax2,cax3)
25        #boxColors = ['darkkhaki','royalblue']
26
27        m.drawcoastlines(linewidth=1)
28        #m.drawlsmask(land_color='white',ocean_color='#F4EAF1', lakes=False)
29        cs=m.contourf(xii,yii,z, clevs, cmap=my_cmap) # emissivity
30        cbar =colorbar(cs)
31        cbar.set_label(txt)
32        #cbar.set_clim(0.65,1)
33        #m.drawmapboundary(fill_color='aqua')
34        #m.drawparallels(np.arange(-90.,90.,10.), labels=[1,0,0,0])
35        #m.drawmeridians(np.arange(-180.,180.,30.), labels=[0,0,0,1])
36        m.drawparallels(np.arange(-90.,90.,45.), color='#909090', linewidth=1.0, zorder=None, dashes=[1, 1])
37        #m.drawmeridians(np.arange(-180.,180.,50.))
38        # stations: Thulé, Resolute, Longyearbyen, lqaluit, murmonsk, arkangelek
39
40        plt.savefig(outfile)
41        #close()
Note: See TracBrowser for help on using the repository browser.