|
Last change
on this file since 1247 was
1054,
checked in by aslmd, 12 years ago
|
|
planetoplot. added possibility to retrieve attribute from netCDF file. added an option to set value formatting through ppclass or pp.py. added a nice example used in a press release.
|
-
Property svn:executable set to
*
|
|
File size:
962 bytes
|
| Line | |
|---|
| 1 | #! /usr/bin/env python |
|---|
| 2 | import ppclass |
|---|
| 3 | import numpy as np |
|---|
| 4 | |
|---|
| 5 | asr = ppclass.pp() |
|---|
| 6 | asr.file = "diagfi115.nc" |
|---|
| 7 | asr.var = "ASR" |
|---|
| 8 | asr.t = 360 |
|---|
| 9 | asr.get() |
|---|
| 10 | |
|---|
| 11 | isr = ppclass.pp() |
|---|
| 12 | isr << asr |
|---|
| 13 | isr.var = "ISR" |
|---|
| 14 | isr.get() |
|---|
| 15 | |
|---|
| 16 | tau = ppclass.pp() |
|---|
| 17 | tau << asr |
|---|
| 18 | tau.var = "tau_col" |
|---|
| 19 | tau.get() |
|---|
| 20 | |
|---|
| 21 | alb = ppclass.pp() |
|---|
| 22 | alb << asr |
|---|
| 23 | alb.var = "ALB" |
|---|
| 24 | alb.get() |
|---|
| 25 | |
|---|
| 26 | tsurf = ppclass.pp() |
|---|
| 27 | tsurf << asr |
|---|
| 28 | tsurf.var = "tsurf" |
|---|
| 29 | add = tsurf.getf() |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | ##alb.smooth(20) |
|---|
| 34 | #tau.smooth(2) |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | #albedo = asr/isr |
|---|
| 38 | ##albedo = 1.-albedo |
|---|
| 39 | #albedo = albedo + taucol |
|---|
| 40 | |
|---|
| 41 | albedo = alb + tau/100. |
|---|
| 42 | |
|---|
| 43 | albedo.colorb = "Blues_r" |
|---|
| 44 | albedo.div = 20 #10 |
|---|
| 45 | #albedo.vmin = 0.3 |
|---|
| 46 | #albedo.vmax = 0.7 |
|---|
| 47 | albedo.proj = "ortho" |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | albedo.defineplot() |
|---|
| 51 | albedo.p[0].blat = 15. |
|---|
| 52 | albedo.p[0].showcb = False |
|---|
| 53 | albedo.p[0].title = "" |
|---|
| 54 | |
|---|
| 55 | albedo.p[0].addcontour = add - 273.15 |
|---|
| 56 | |
|---|
| 57 | #dafield = albedo.p[0].field |
|---|
| 58 | #dafield[np.where(dafield < 0.4)] = 0.0 |
|---|
| 59 | #dafield[np.where(dafield > 0.6)] = 1.0 |
|---|
| 60 | albedo.p[0].vmin = 0.1 |
|---|
| 61 | albedo.p[0].vmax = 0.6 |
|---|
| 62 | |
|---|
| 63 | #albedo.p[0].back = "coast" |
|---|
| 64 | |
|---|
| 65 | albedo.makeplot() |
|---|
Note: See
TracBrowser
for help on using the repository browser.