source: trunk/UTIL/PYTHON/planetoplot_v2/examples/ppclass_additional/vertpress1d.py @ 1170

Last change on this file since 1170 was 1050, checked in by aslmd, 11 years ago

UTIL PYTHON planetoplot_v2

RENAMED VARIABLES TO BE SIMPLER or COMPLIANT WITH MATPLOTLIB

colorb >> colorbar
lstyle >> linestyle
label >> legend

stridevecx >> svx
stridevecy >> svy
stridex >> sx
stridey >> sy
stridez >> sz
stridet >> st

(in ppplot only)
field >> f
absc >> x
ordi >> y
addvecx >> vx
addvecy >> vy
addontour >> c

ALSO added (same reason of compatibility)

  • the possibility to call ppplot.show() as in matplotlib
  • a shortcut method for a ppplot object: the so-called .makeshow()
  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#! /usr/bin/env python
2from ppclass import pp
3
4##################################################################
5##################################################################
6
7files = ["diagfi_start150.nc","diagfi_start175.nc","diagfi_start200.nc"]
8labs = ['$T_{ini}=150$ K','$T_{ini}=175$ K','$T_{ini}=200$ K']
9name = "profile_tini"
10
11#files = ["diagfi_start200.nc","diagfi_start200_Rayleigh.nc","diagfi_start200_A034.nc"]
12#labs = ['ref ($T_{ini}=200$ K)','ref + Rayleigh scatt.','ref + $A_{surf} = 0.34$']
13#name = "profile_tests"
14
15##################################################################
16##################################################################
17
18# OK retrieve pressure and temperatures
19press = pp(file=files,var="p",x=0,y=0,t=1.e15).get()
20temp = pp(file=files,var="temp",x=0,y=0,t=1.e15).get()
21
22# this must be done before the next step
23# ... because the next step is doing defineplot
24temp.superpose = True
25#temp.out = "png"
26temp.filename = name
27temp.includedate = False
28temp.colorbar = "hot"
29
30# this is doing defineplot amongst other things
31temp.func(press)
32
33# customize plots
34count=0
35for yeah in temp.p:
36    yeah.logy = True
37    yeah.invert = True
38    yeah.swaplab = False
39    yeah.ylabel = "Pressure (Pa)"
40    yeah.xlabel = "Temperature (K)"
41    yeah.ymin = 1.
42    yeah.xmax = 230.
43    yeah.xmin = 70.
44    yeah.div = 32
45    yeah.legend = labs[count]
46    yeah.title = "Equilibrium profile with a 1D globally-averaged model after 50 Saturn years"
47    count = count+1
48
49# finally make the plot
50temp.makeplot()
Note: See TracBrowser for help on using the repository browser.