source: trunk/UTIL/PYTHON/ti.py @ 531

Last change on this file since 531 was 294, checked in by aslmd, 13 years ago

MESOSCALE: python graphics, housekeeping.

  • Property svn:executable set to *
File size: 758 bytes
Line 
1#! /usr/bin/env python
2
3from netCDF4 import Dataset
4import matplotlib.pyplot as mpl
5import numpy as np
6
7nc = Dataset("geo_em.d01.nc")
8#ti = np.ravel(nc.variables["THERMAL_INERTIA"][:,:])
9#alb = np.ravel(nc.variables["ALBEDO_GCM"][:,:])
10
11#lat = np.ravel(nc.variables["XLAT_M"][:,:])
12
13#alb = alb[ lat < 80.]
14#ti = ti[ lat < 80. ]
15
16#alb = np.log(alb)
17#ti = np.log(ti)
18
19#mpl.plot(ti,alb,'b.')
20#mpl.plot(ti,lat,'b.')
21
22
23limalb = 0.28
24limti = 800.
25icealb = 0.45
26
27ti = nc.variables["THERMAL_INERTIA"][0,:,:]
28alb = nc.variables["ALBEDO_GCM"][0,:,:]
29ti [ alb > limalb ] = limti
30ti [ ti > limti ] = limti
31alb [ alb > limalb ] = icealb
32
33mpl.figure()
34mpl.subplot(121)
35mpl.contourf(ti,100)
36mpl.colorbar()
37mpl.subplot(122)
38mpl.contourf(alb,100)
39mpl.colorbar()
40
41mpl.show()
Note: See TracBrowser for help on using the repository browser.