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

Last change on this file since 977 was 977, checked in by aslmd, 12 years ago

UTIL PYTHON planetoplot_v2. Added rainbow spahetti plot based on an idea by Alizee. Simply set a colormap for a 1D plot and you get it. Also added in pp_reload (simple rainbow function in ppplot). Added also xmin and xmax capabilitiy. Fixed various bugs related to dummy axis, logarithmic axes. Removed time_counter from set_ppclass.txt it is useless in most cases.

  • 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.colorb = "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.label = 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.