Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/aire.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/aire.py	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/aire.py	(revision 923)
@@ -11,4 +11,5 @@
 tpond.compute = "meanarea"
 tpond.superpose = True
+tpond.label = "mean with ponderation by mesh area"
 tpond.getplot(extraplot=1)
 
@@ -17,4 +18,6 @@
 tnormal.compute = "mean"
 tnormal.plotin = tpond
+tnormal.label = "simple mean (kind of wrong)"
+tnormal.filename = "aire"
 tnormal.getplot()
 
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/anomaly.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/anomaly.py	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/anomaly.py	(revision 923)
@@ -17,4 +17,5 @@
 ## COMPUTE AND PLOT RELATIVE ANOMALY in %
 anomaly = ((simple-mean)/mean)*100.
+anomaly.filename = "anomaly"
 anomaly.defineplot()
 anomaly.p[0].title = "surface temperature anomaly in %"
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/chain_pp.sh
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/chain_pp.sh	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/chain_pp.sh	(revision 923)
@@ -1,43 +1,43 @@
 #! /bin/bash
 
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -v v -t 0.5 -z 10.
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -y 2
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -y 2 -m 1000 -L --
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -C spectral
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P ortho
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P moll
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P npstere
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P spstere
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P cyl -A Tharsis
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P lcc -A Tharsis
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P laea -A Tharsis
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -A Tropics -P merc
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -c phisinit -t 0.5 -z 10. -T Yeah -P laea -A Tharsis
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P merc -A Whole_No_High
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P robin
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -v v -t 0.5 -z 10.
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -y 2
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -y 2 -m 1000 -L --
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -C spectral
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P ortho
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P moll
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P npstere
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P spstere
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P cyl -A Tharsis
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P lcc -A Tharsis
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P laea -A Tharsis
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -A Tropics -P merc
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -c phisinit -t 0.5 -z 10. -T Yeah -P laea -A Tharsis
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P merc -A Whole_No_High
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P robin
 
-./pp.py -f /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 
-./pp.py -f /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 -v HGT -B vishires
-./pp.py -f /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 -v HGT -t 1. -B vishires -H 0.5
-./pp.py -f /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 -v HGT -t 1. -P ortho -B vishires
+./pp.py  /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 
+./pp.py  /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 -v HGT -B vishires
+./pp.py  /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 -v HGT -t 1. -B vishires -H 0.5
+./pp.py  /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 -v HGT -t 1. -P ortho -B vishires
 
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P robin
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -x 10 -C jet -P robin
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P robin -H 0.5 -B vishires
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P robin
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -x 10 -C jet -P robin
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P robin -H 0.5 -B vishires
 
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -P robin
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v phisinit -P ortho -I -120.
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v phisinit -P ortho -I -120. -v phisinit -I 120
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v phisinit -P ortho -I -120. -v phisinit
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P robin -I -120. -v icetot -I 120.
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -P robin
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v phisinit -P ortho -I -120.
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v phisinit -P ortho -I -120. -v phisinit -I 120
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v phisinit -P ortho -I -120. -v phisinit
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P robin -I -120. -v icetot -I 120.
 
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll -i u -j v
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll -i u -j v -z 10.
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll -i u -j v -z 10000.
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P cyl -i u -j v -z 10000. --verbose
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P cyl -i u -j v -z 10000. -c phisinit
-./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P cyl -z 10000. -c temp
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll -i u -j v
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll -i u -j v -z 10.
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll -i u -j v -z 10000.
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P cyl -i u -j v -z 10000. --verbose
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P cyl -i u -j v -z 10000. -c phisinit
+./pp.py  /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P cyl -z 10000. -c temp
 
-./pp.py -f wrfout_d03_2024-06-09_00\:00\:00_z -v tk -c HGT -t 1 -z 0 -P lcc -i Um -j Vm --verbose
+./pp.py  wrfout_d03_2024-06-09_00\:00\:00_z -v tk -c HGT -t 1 -z 0 -P lcc -i Um -j Vm --verbose
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/function.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/function.py	(revision 923)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/function.py	(revision 923)
@@ -0,0 +1,29 @@
+#! /usr/bin/env python
+from ppclass import pp
+
+var1 = pp(\
+file="/home/aymeric/Big_Data/DATAPLOT/diagfired.nc",\
+var="ps",\
+x=None,\
+y=10.,\
+t=2.)
+var1.get()
+
+var2 = pp(\
+file="/home/aymeric/Big_Data/DATAPLOT/diagfired.nc",\
+var="phisinit",\
+x=None,\
+y=10.,\
+t=2.)
+var2.get()
+var2 = var2 / 3.72
+
+S = var2.f(var1)
+
+S.p[0].marker = 'o'
+S.p[0].lstyle = ''
+S.p[0].ylabel = "Surface geopotential height (km)"
+S.p[0].ycoeff = 1./1000.
+S.filename = "function"
+S.makeplot()
+
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/gw_v2.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/gw_v2.py	(revision 923)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/gw_v2.py	(revision 923)
@@ -0,0 +1,37 @@
+#! /usr/bin/env python
+from ppclass import pp
+
+gw = pp()
+gw.file = "/home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00:00:00_z"
+gw.var = ["W","tk"]
+gw.vargoal = ["main","contour"]
+gw.x = None
+gw.y = -5.
+gw.z = None
+gw.t = 5.
+gw.verbose = True
+gw.filename = "gw"
+
+# we define global settings for plot
+# (must be done before defineplot)
+gw.colorb = "RdBu_r"
+gw.vmin = -1. ; gw.vmax = 1.
+gw.div = 30
+gw.xlabel = "East longitude (deg)"
+gw.ycoeff = 1./1000.
+gw.ylabel = "Altitude above MOLA reference (km)"
+
+# we define, get field and define, get plot
+gw.getplot()
+
+# we keep the same object for another plot of a different kind
+gw.vargoal = ["main","main"]
+gw.out = "png"
+gw.getdefineplot()
+
+# NB: global plot settings are defined in gw !!
+# ... so we redefine plot settings for the plot on the right
+gw.p[1].define_from_var() # we define colors, etc... from variable
+gw.p[1].vmin = None # we reinitialize to default for min bounds
+gw.p[1].vmax = None # we reinitialize to default for max bounds
+gw.makeplot()
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/hodograph.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/hodograph.py	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/hodograph.py	(revision 923)
@@ -17,4 +17,5 @@
 # u as a function of v
 hodo = u.f(v)
+hodo.filename = "hodograph"
 hodo.makeplot()
 
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/les_psfc.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/les_psfc.py	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/les_psfc.py	(revision 923)
@@ -14,5 +14,6 @@
 les.y = None
 les.t = ["10"]
-#les.stridex = 3
-#les.stridey = 3
+les.stridex = 3
+les.stridey = 3
+les.filename = "les_psfc"
 les.getplot()
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/meso_profile.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/meso_profile.py	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/meso_profile.py	(revision 923)
@@ -47,4 +47,5 @@
 S.p[0].ylabel="Geopotential height (km)"
 S.p[0].xlabel="Potential temperature (K)"
+S.filename = "meso_profile"
 
 # make the plot
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/scatter.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/scatter.py	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/scatter.py	(revision 923)
@@ -50,4 +50,5 @@
 S3.p[0].color="k"
 S3.p[0].ylabel="wind speed $\sqrt{u^{2}+v^{2}}$ (m s$^{-1}$)"
+S3.filename="scatter"
 S3.makeplot()
 
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/simple.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/simple.py	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/simple.py	(revision 923)
@@ -21,4 +21,5 @@
 u.p[0].title = "This is what we name $u$ (m s$^{-1}$)"
 u.p[0].proj = "robin"
+u.filename = "simple"
 
 # we plot
@@ -28,4 +29,5 @@
 # ... no need to reload data
 u.p[0].colorb = "RdBu"
+u.filename = "myplot"
 u.makeplot()
 
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/tide.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/tide.py	(revision 923)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/tide.py	(revision 923)
@@ -0,0 +1,40 @@
+#! /usr/bin/env python
+from ppclass import pp
+
+fi = "/home/aymeric/Big_Data/DATAPLOT/diagfired.nc"
+v = ["ps","phisinit"]
+vg = ["main","contour"]
+
+meanps = pp(file=fi,var=v,vargoal=vg,t="0,1").get()
+waveref = pp(file=fi,var=v,vargoal=vg,t=0.5).get() - meanps
+waveref.smooth(5)
+waveref.title = "$p_s$ diurnal anomaly"
+waveref.proj = "moll"
+waveref.vmin = -10
+waveref.vmax = 10
+waveref.div = 10
+waveref.filename = "tide"
+waveref.plot(extraplot=3)
+
+eqmeanps = pp(file=fi,var="ps",t="0,1",y=0.).get() 
+addplot = pp(file=fi,var="ps",t=0.5,y=0.).get() - eqmeanps
+addplot.plotin = waveref
+addplot.title = "Tide signal at the equator"
+addplot.ylabel = "$p_s$ diurnal anomaly (Pa)"
+addplot.lstyle = ""
+addplot.marker = "."
+addplot.plot()
+
+for choice_t in [0.6,0.7]:
+    wave = pp(file=fi,var=v,vargoal=vg,t=choice_t).get() - meanps
+    wave << waveref
+    wave.smooth(5)
+    wave.plotin = waveref
+    wave.plot()
+
+
+
+
+
+
+
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/vector.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/vector.py	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/vector.py	(revision 923)
@@ -8,4 +8,5 @@
 u.t = "0.5,0.8"
 u.z = "50000"
+u.filename = "vector"
 u.get()
 u.defineplot()
@@ -16,4 +17,5 @@
 
 u.z = "50"
+u.filename = "myplot"
 u.getplot()
 
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/vertpress.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/vertpress.py	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/vertpress.py	(revision 923)
@@ -9,4 +9,5 @@
 prof.x = 30
 prof.y = 30
+prof.filename = "vertpress"
 
 prof.get()
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/windspeed.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/windspeed.py	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/windspeed.py	(revision 923)
@@ -25,4 +25,5 @@
 wind = wind**0.5
 wind.plotin = v
+wind.filename = "windspeed"
 wind.defineplot()
 wind.p[2].title = "$\sqrt{u^2+v^2}$ (m s$^{-1}$)"
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/zonalcontour.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/zonalcontour.py	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/zonalcontour.py	(revision 923)
@@ -8,4 +8,5 @@
 u.x = "0"
 u.t = "0.5"
+u.filename = "zonalcontour"
 u.get()
 u.defineplot()
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/zonalmean.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/zonalmean.py	(revision 921)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/zonalmean.py	(revision 923)
@@ -21,4 +21,5 @@
 u.y = None
 u.t = "0.5"
+u.filename = "zonalmean"
 u.get()
 u.defineplot()
@@ -30,4 +31,5 @@
 ## ZONAL MINIMUM
 u.compute = "min"
+u.filename = "zonalmin"
 u.get()
 u.defineplot()
@@ -39,4 +41,5 @@
 ## ZONAL MAXIMUM
 u.compute = "max"
+u.filename = "myplot"
 u.get()
 u.defineplot()
