source: trunk/UTIL/PYTHON/README.PP @ 439

Last change on this file since 439 was 436, checked in by aslmd, 14 years ago

GRAPHICS: make movies work with mapmode=1. very nice animated movies are now possible with cool map projections.

File size: 6.9 KB
Line 
1**************************************
2**************************************
3**************************************
4    PLANETOPLOT TUTORIAL EXAMPLES
5**************************************
6         Authors : AC + AS
7**************************************
8  DON'T FORGET YOUR BEST FRIEND IS
9     pp.py -h [or] pp.py --help
10**************************************
11**************************************
12**************************************
13
14
15*************************************
16MAPMODE 1
17MAPPING MODE
18SIMPLE EXAMPLES on a SAMPLE GCM FILE
19*************************************
20
21Goal: The simplest, most minimal example. Mapping topography.
22pp.py -f diagfired.nc
23
24Goal: I would like finer contours.
25pp.py -f diagfired.nc --div 30
26
27Goal: I would like wind vectors.
28pp.py -f diagfired.nc -W
29
30Goal: I would like more vectors [i.e. lower the stride].
31pp.py -f diagfired.nc -W -s 1
32
33Goal: I want to map a given field (surface temperature).
34pp.py -f diagfired.nc -v tsurf
35
36Goal: I want to map two fields next to one another (topography and tauice).
37pp.py -f diagfired.nc -v phisinit,tauice
38
39Goal: I want to map two fields, tauice shaded, topography contoured, same plot.
40pp.py -f diagfired.nc -v tauice -w phisinit
41
42Goal: I want to map a field but projected on the sphere.
43pp.py -f diagfired.nc -v tauice -p ortho
44
45Goal: I want to redefine the minimum and maximum values shown.
46pp.py -f diagfired.nc -v tauice -m 0.2 -M 0.9
47
48Goal: I want to insert holes wherever values are lower than 0.2 and higher than 0.9
49pp.py -f diagfired.nc -v tauice -m 0.2 -M 0.9 -H
50
51Goal: I want to fill holes with an background image of Mars [you have to be connected to Internet]
52pp.py -f diagfired.nc -v tauice -m 0.2 -M 0.9 -H -b vishires
53
54Goal: I want the same map, but projected on the sphere
55pp.py -f diagfired.nc -v tauice -m 0.2 -M 0.9 -H -b vishires -p ortho
56
57Goal: I want the same map, but projected with north polar stereographic view
58pp.py -f diagfired.nc -v tauice -m 0.2 -M 0.9 -H -b vishires -p npstere
59
60Goal: I want to save this in PNG format
61pp.py -f diagfired.nc -v tauice -m 0.2 -M 0.9 -H -b vishires -p ortho -S png
62
63Goal: I want to animate this along time axis with fps=12
64pp.py -f diagfired.nc -v tauice -m 0.2 -M 0.9 -H -b vishires -p ortho --rate 12
65
66Goal: I want to plot results from two simulation files next to one another
67pp.py -f diagfired.nc,diagfired.nc -v tsurf
68
69Goal: I want to plot results for two different times in the file next to one another
70pp.py -f diagfi.nc -v tsurf --time 4 -- time 7
71
72Goal: I want to plot averaged results in the file from one time to another time
73pp.py -f diagfi.nc -v tsurf --time 4,7
74
75--- mesoscale stuff
76Goal: I want to plot results for two different LOCAL times in the file next to one another
77pp.py -f wrfout**** -v TSURF --time -4 -- time -7
78
79Goal: The classic mountain GW plot
80pp.py -f wrfout_d01_9999-09-09_09:00:00 -v W,tpot --lat 60 --time 15 -i 4 -l 30,130,100 --div 50
81
82***********************************************************************************
83Simple 2D plot: Zonal mean.
84**********************************************************************************
85
86Goal:
87
88Plot the zonal mean temperature from a netcdf fiel representing one month.
89
90Command:
91
92gcm.py -f POLAR_NIGHT_RUN/diagfi16.nc --var temp --lon 180,-180 --time 0,65
93
94Note:
95
96The --time, --lat, --lon and --vert command takes in input values corresponding to the unit stored in the netcdf file, and not indices ! For example, if the "Time" unit is in sol (which is common for a gcm output), --time 2 means sol 2.0 and not index 2 along the time direction. Consequently, one can ask --time 2.5 for temperatures at 12:00 on sol 2.
97
98Means are easy to perform by specifying a range. Here: --time 0,65 and --lat -180,180.
99
100***********************************************************************************
101Vertical interpolation of the field.
102***********************************************************************************
103
104Goal:
105
106Calls to zrecast and api are built-in the python functions. One can call them using -i with the appropriate argument (see meso.py -h or gcm.py -h). Here is an example that re-interpolates data using zrecast before plotting it in a 2D contour.
107
108Command:
109
110gcm.py -f POLAR_NIGHT_RUN/diagfi16.nc --var temp --lon -180,180 --time 0,65 -i 4
111
112Note:
113
114All interpolation modes available in zrecast and api (pressure, AGL, distance from planet center, etc...) are theoretically possible, but may not be coded yet in the routine. See gcm.py -h or meso.py -h.
115
116For this example, the default behavior of zrecast for -i 4 is to interpolate in (m) from the local surface, between 0 and 150 km. The command will generate a reinterpolated netcdf file "POLAR_NIGHT_RUN/diagfi16_S.nc" with only the requested field, which is not deleted afterward.
117
118
119***********************************************************************************
1202D plot of the difference between two files.
121***********************************************************************************
122
123Goal:
124
125Comparing two .nc files with similar dimension axis can be done in a single command, by specifying which files to compare and the comparison operator (i.e. is it a difference, an addition, etc...). When comparing data along a vertical axis, it can be wise to also ask for an interpolation of the fields to make sure the comparison is correct.
126
127Command:
128
129gcm.py -f POLAR_NIGHT_RUN/stats16.nc --var temp --lon -180,180 --time 1 -i 4 --fref POLAR_NIGHT_REF/stats16.nc --operation - --mope -2 --Mope 2 --title "Polar temperatures with new parametrizations" --titleref "Reference run"
130
131Note:
132
133The command will output 3 plots: the field from file 1, the field from file 2, and the comparison between the two. One can specify specific names for the title of these plots by using --title and --titleref for the titles of file 1 and file 2, and can specify different plotting range for the normal field (-m -M) and the compared field (--mope --Mope).
134
135One can combine this command with projections and means, so that for example, to compare co2 depletion at the south pole:
136
137gcm.py -f POLAR_NIGHT_RUN/start16.nc --var co2 --vert 0,150 --proj spstere --time 1 -i 4 --fref POLAR_NIGHT_REF/start16.nc --operation - --mope -0.5 --Mope 0.5 --title "Polar co2 with new parametrizations" --titleref "Reference run"
138
139***********************************************************************************
1402D plot of data with missing values, along a pressure axis (decreasing with height).
141***********************************************************************************
142
143Goal:
144
145By default, python will force the y-axis of a 2D plot to be ordered by increasing values. Here is how to force it otherwise.
146
147Command:
148
149gcm.py -f TES.MappedClimatology.nadir.MY25.nc --var T_nadir_day --lat -76. --time 90 --ymin 500 --ymax 1 -m 128 -M 148 -H
150
151Note:
152
153The axis reversal is done by specifying ymin and ymax in the right order. One can also simply use --inverty and not specify (ymin,ymax). Missing values (out of range values) are replaced by holes by the option "-H".
Note: See TracBrowser for help on using the repository browser.