Index: trunk/UTIL/PYTHON/planetoplot_v2/README.TXT
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/README.TXT	(revision 922)
+++ trunk/UTIL/PYTHON/planetoplot_v2/README.TXT	(revision 923)
@@ -30,5 +30,6 @@
 data
 ----
-- demo_data/* --> plot objects for a demonstration tour and customizing tests
+plot objects for a demonstration tour and customizing tests
+https://dl.dropbox.com/u/11078310/demo_data.tar.gz
 
 Requirements
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/aire.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/aire.py	(revision 922)
+++ 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 922)
+++ 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 922)
+++ 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 922)
+++ 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 922)
+++ 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 922)
+++ 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 922)
+++ 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 922)
+++ 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 922)
+++ 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 922)
+++ 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 922)
+++ 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 922)
+++ 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 922)
+++ 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()
Index: trunk/UTIL/PYTHON/planetoplot_v2/pp.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/pp.py	(revision 922)
+++ trunk/UTIL/PYTHON/planetoplot_v2/pp.py	(revision 923)
@@ -16,17 +16,31 @@
 #     ... see sample scripts
 
-#####################################
-# get arguments from the command line
-#####################################
+######################################
+# define parser with version and usage 
+######################################
 parser = OptionParser()
+parser.version = \
+'''************************************************************************
+PLANETOPLOT (for help: pp.py -h)
+--> command line tool to make nice & quick plots from netCDF files
+--> based on python + numpy + scipy + matplotlib + basemap + netCDF4
+--> Author: A. Spiga (LMD/UPMC) aymeric.spiga@upmc.fr
+************************************************************************'''
+parser.usage = \
+'''pp.py [options] netCDF file(s)
+(NB: no options --> simple inspection of variables and dimensions in netCDF files'''
+parser.print_version()
+
+########################################
+# set options for the pp.py command line
+########################################
 parser.add_option('--verbose',action='store_true',dest='verbose',default=False,help='make the program verbose')
 # field --> lower case
-parser.add_option('-f','--file',action='append',dest='file',type="string",default=None,help="[NEEDED] 'file' or ['file1','file2',etc]")
 parser.add_option('-v','--var',action='append',dest='var',type="string",default=None,help="'variable' or ['var1','var2',etc]")
-parser.add_option('-x','--lon',action='append',dest='x',type="string",default=None,help="x axis value. either one value; or val1,val2 (computations)")
-parser.add_option('-y','--lat',action='append',dest='y',type="string",default=None,help="y axis value. either one value; or val1,val2 (computations)")
-parser.add_option('-z','--vert',action='append',dest='z',type="string",default=None,help="z axis value. either one value; or val1,val2 (computations)")
-parser.add_option('-t','--time',action='append',dest='t',type="string",default=None,help="t axis value. either one value; or val1,val2 (computations)")
-parser.add_option('-u','--compute',action='store',dest='compute',type="string",default="mean",help="computation: mean, min, max")
+parser.add_option('-x','--lon',action='append',dest='x',type="string",default=None,help="x axis value. one value; or val1,val2 (computations)")
+parser.add_option('-y','--lat',action='append',dest='y',type="string",default=None,help="y axis value. one value; or val1,val2 (computations)")
+parser.add_option('-z','--vert',action='append',dest='z',type="string",default=None,help="z axis value. one value; or val1,val2 (computations)")
+parser.add_option('-t','--time',action='append',dest='t',type="string",default=None,help="t axis value. one value; or val1,val2 (computations)")
+parser.add_option('-u','--compute',action='store',dest='compute',type="string",default="mean",help="computation: mean, min, max, meanarea")
 parser.add_option('-c','--contour',action='store',dest='contour',type="string",default=None,help="one 'variable' for contour")
 parser.add_option('-i','--vecx',action='store',dest='vecx',type="string",default=None,help="one 'variable' for wind vector x component")
@@ -36,5 +50,4 @@
 parser.add_option('-o','--output',action='store',dest='filename',type="string",default="myplot",help="name of output files")
 parser.add_option('-d','--directory',action='store',dest='folder',type="string",default="./",help="directory of output files")
-parser.add_option('-u','--compute',action='store',dest='compute',type="string",default="mean",help='')
 # plot --> upper case
 # -- generic
@@ -51,4 +64,5 @@
 parser.add_option('-K','--marker',action='append',dest='marker',type="string",default=None,help="[1D] marker: '' 'x' 'o' etc")
 parser.add_option('-S','--superpose',action='store_true',dest='superpose',default=False,help="[1D] use same axis for all plots")
+parser.add_option('-E','--label',action='append',dest='label',type="string",default=None,help="[1D] label for line")
 # -- 2D plot
 parser.add_option('-C','--colorb',action='append',dest='colorb',type="string",default=None,help="[2D] colormap: http://micropore.files.wordpress.com/2010/06/colormaps.png")
@@ -62,11 +76,17 @@
 (opt,args) = parser.parse_args()
 
-##########################################
-# a possibility to simply inspect the file
-##########################################
-if opt.file is None:
-    print "Stop here. I need at least a file: -f FILE" ; exit()
+######################################
+# get arguments (one or several files)
+######################################
+if args is None:
+    print "Stop here! I need file(s) as argument(s)!" ; exit()
+else:
+    files = args
+
+#############################################
+# a possibility to simply inspect the file(s)
+#############################################
 if opt.var is None:
-    for filename in opt.file: inspect(filename)
+    for filename in files: inspect(filename)
     exit()
 
@@ -83,11 +103,8 @@
 # set pp object
 user = pp()
-user.file = opt.file
-user.var = var
-user.vargoal = vargoal
-user.x = opt.x
-user.y = opt.y
-user.z = opt.z
-user.t = opt.t
+user.file = files
+user.var = var ; user.vargoal = vargoal
+user.x = opt.x ; user.y = opt.y 
+user.z = opt.z ; user.t = opt.t
 user.verbose = opt.verbose
 user.compute = opt.compute
@@ -118,5 +135,5 @@
 try:
     f = open(opt.folder+'/'+opt.filename+'.sh', 'w')
-    f.write(command)
+    f.write(command)	
 except IOError:
     print "!! WARNING !! pp.py command not saved. Probably do not have permission to write here."
Index: trunk/UTIL/PYTHON/planetoplot_v2/pp_reload.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/pp_reload.py	(revision 922)
+++ trunk/UTIL/PYTHON/planetoplot_v2/pp_reload.py	(revision 923)
@@ -10,5 +10,7 @@
 parser = OptionParser()
 parser.add_option('-O','--out',action='store',dest='out',type="string",default="gui",help='Specify a new output format')
-parser.add_option('-P','--proj',action='store',dest='proj',type="string",default=None,help='Define a new map projection')
+parser.add_option('-K','--marker',action='store',dest='marker',type="string",default=None,help="[1D] Define a new marker")
+parser.add_option('-P','--proj',action='store',dest='proj',type="string",default=None,help='[2D] Define a new map projection')
+parser.add_option('-C','--colorb',action='store',dest='colorb',type="string",default=None,help="[2D] Define a new colormap")
 (opt,args) = parser.parse_args()
 # -----------------------------------------------------------------------
@@ -20,4 +22,10 @@
       for plot in yeah.p:
         plot.proj = opt.proj
+    if opt.colorb is not None:
+      for plot in yeah.p:
+        plot.colorb = opt.colorb
+    if opt.marker is not None:
+      for plot in yeah.p:
+        plot.marker = opt.marker
     yeah.makeplot()
 
Index: trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py	(revision 922)
+++ trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py	(revision 923)
@@ -24,7 +24,4 @@
 #### ... executed when imported  ##
 ###################################
-print "************************************"
-print "**** WELCOME TO PLANETOPLOT 2.0 ****"
-print "************************************"
 # where settings files are located...
 whereset = None
@@ -143,5 +140,16 @@
                       out="gui",\
                       filename="myplot",\
-                      folder="./"):
+                      folder="./",\
+                      xlabel=None,ylabel=None,\
+                      xcoeff=None,ycoeff=None,\
+                      proj=None,\
+                      vmin=None,vmax=None,\
+                      div=None,\
+                      colorb=None,\
+                      lstyle=None,\
+                      marker=None,\
+                      color=None,\
+                      label=None,\
+                      title=None):
         self.request = None
         self.nfin = 0 ; self.nvin = 0
@@ -172,4 +180,17 @@
         self.filename = filename
         self.folder = folder
+        ## here are user-defined plot settings 
+        ## -- if not None, valid on all plots in the pp() objects
+        self.xlabel = xlabel ; self.xcoeff = xcoeff
+        self.ylabel = ylabel ; self.ycoeff = ycoeff
+        self.proj = proj
+        self.vmin = vmin ; self.vmax = vmax
+        self.div = div
+        self.colorb = colorb
+        self.lstyle = lstyle
+        self.marker = marker
+        self.color = color
+        self.label = label
+        self.title = title
 
     # print status
@@ -178,9 +199,45 @@
             pass
         else:
-            print "**** Done step: " + self.status
+            print "**** PPCLASS. Done step: " + self.status
 
     #####################################################
     # EMULATE OPERATORS + - * / ** << FOR PP() OBJECTS  #
     #####################################################
+
+    # define the operation <<
+    # ... e.g. obj2 << obj1
+    # ... means: get init for pp object obj2 from another pp object obj1
+    # ... (this should solve the affectation trap obj2 = obj1)
+    def __lshift__(self,other):
+        if other.__class__.__name__ == "pp":
+            self.file = other.file
+            self.var = other.var
+            self.filegoal = other.filegoal
+            self.vargoal = other.vargoal
+            self.x = other.x ; self.y = other.y   ## if None, free dimension
+            self.z = other.z ; self.t = other.t   ## if None, free dimension
+            self.stridex = other.stridex ; self.stridey = other.stridey
+            self.stridez = other.stridez ; self.stridet = other.stridet
+            self.verbose = other.verbose
+            self.noproj = other.noproj
+            self.plotin = other.plotin
+            self.superpose = other.superpose
+            self.forcedimplot = other.forcedimplot
+            self.out = other.out
+            self.filename = other.filename
+            self.folder = other.folder
+            self.xlabel = other.xlabel ; self.xcoeff = other.xcoeff
+            self.ylabel = other.ylabel ; self.ycoeff = other.ycoeff
+            self.proj = other.proj
+            self.vmin = other.vmin ; self.vmax = other.vmax
+            self.div = other.div
+            self.colorb = other.colorb
+            self.lstyle = other.lstyle
+            self.marker = other.marker
+            self.color = other.color
+            self.label = other.label
+            self.title = other.title
+        else:
+            print "!! ERROR !! argument must be a pp object." ; exit()
 
     # check the compatibility of two objects for operations
@@ -236,4 +293,5 @@
                 setattr(obj,k,v)
         the_clone.status = "retrieved"
+        the_clone.filename = self.filename
         return the_clone
 
@@ -258,7 +316,8 @@
               else:           
                   ope = other
-              if "vector" in self.vargoal[j] + self.filegoal[i]:
-                  print "!! ERROR !! we do not operate on vectors yet."
-                  exit()
+              goal = self.vargoal[j] + self.filegoal[i]
+              if ("vector" in goal) or ("contour" in goal):
+                  if self.verbose: print "!! WARNING !! No operation was made on contours and vectors. This can be debatted actually."
+                  obj.field = obj_ref.field
               else:
                   obj.field = obj_ref.field + ope
@@ -285,7 +344,8 @@
               else:
                   ope = other
-              if "vector" in self.vargoal[j] + self.filegoal[i]:
-                  print "!! ERROR !! we do not operate on vectors yet."
-                  exit()
+              goal = self.vargoal[j] + self.filegoal[i]
+              if ("vector" in goal) or ("contour" in goal):
+                  if self.verbose: print "!! WARNING !! No operation was made on contours and vectors. This can be debatted actually."
+                  obj.field = obj_ref.field
               else:
                   obj.field = obj_ref.field - ope
@@ -312,7 +372,8 @@
               else:
                   ope = other
-              if "vector" in self.vargoal[j] + self.filegoal[i]:
-                  print "!! ERROR !! we do not operate on vectors yet."
-                  exit()
+              goal = self.vargoal[j] + self.filegoal[i]
+              if ("vector" in goal) or ("contour" in goal):
+                  if self.verbose: print "!! WARNING !! No operation was made on contours and vectors. This can be debatted actually."
+                  obj.field = obj_ref.field
               else:
                   obj.field = obj_ref.field * ope
@@ -339,7 +400,8 @@
               else:
                   ope = other
-              if "vector" in self.vargoal[j] + self.filegoal[i]:
-                  print "!! ERROR !! we do not operate on vectors yet."
-                  exit()
+              goal = self.vargoal[j] + self.filegoal[i]
+              if ("vector" in goal) or ("contour" in goal):
+                  if self.verbose: print "!! WARNING !! No operation was made on contours and vectors. This can be debatted actually."
+                  obj.field = obj_ref.field
               else:
                   obj.field = obj_ref.field / ope
@@ -383,7 +445,8 @@
                   obj  = the_clone.request[i][j][t][z][y][x]
                   obj_ref = self.request[i][j][t][z][y][x]
-                  if "vector" in self.vargoal[j] + self.filegoal[i]:
-                      print "!! ERROR !! we do not operate on vectors yet."
-                      exit()
+                  goal = self.vargoal[j] + self.filegoal[i]
+                  if ("vector" in goal) or ("contour" in goal):
+                      if self.verbose: print "!! WARNING !! No operation was made on contours and vectors. This can be debatted actually."
+                      obj.field = obj_ref.field
                   else:
                       obj.field = obj_ref.field ** num
@@ -392,28 +455,5 @@
         return the_clone
 
-    # define the operation <<
-    # ... e.g. obj2 << obj1
-    # ... means: get init for pp object obj2 from another pp object obj1
-    # ... (this should solve the affectation trap obj2 = obj1)
-    def __lshift__(self,other):
-        if other.__class__.__name__ == "pp":
-            self.file = other.file
-            self.var = other.var
-            self.filegoal = other.filegoal
-            self.vargoal = other.vargoal
-            self.x = other.x ; self.y = other.y   ## if None, free dimension
-            self.z = other.z ; self.t = other.t   ## if None, free dimension
-            self.stridex = other.stridex ; self.stridey = other.stridey
-            self.stridez = other.stridez ; self.stridet = other.stridet
-            self.verbose = other.verbose
-            self.noproj = other.noproj
-            self.plotin = other.plotin
-            self.superpose = other.superpose
-            self.forcedimplot = other.forcedimplot
-            self.out = other.out
-            self.filename = other.filename
-            self.folder = other.folder
-        else:
-            print "!! ERROR !! argument must be a pp object." ; exit()
+    ### TBD: reverse power? for exponentials?
 
     ##############################################################################################
@@ -505,4 +545,5 @@
         # change status
         self.status = "defined"
+        return self
 
     ##############################################################################################
@@ -533,4 +574,5 @@
         # change status
         self.status = "retrieved"
+        return self
 
     ##########################################################
@@ -540,4 +582,5 @@
         self.define()
         self.retrieve()
+        return self  
 
     ########################################
@@ -643,6 +686,16 @@
                     plobj.ordi = obj.ordi      # ordinate (or latitude)
                                                # -- useless in 1D but not used anyway
+                    # specific 1D plot stuff
+                    if dp == 1:
+                        # -- a default label
+                        plobj.label = ""
+                        if self.nfin > 1: plobj.label = plobj.label + " file #"+str(i+1)
+                        if self.nvin > 1: plobj.label = plobj.label + " var #"+str(j+1)
+                        if self.nplott > 1: plobj.label = plobj.label + " t #"+str(t+1)
+                        if self.nplotz > 1: plobj.label = plobj.label + " z #"+str(z+1)
+                        if self.nploty > 1: plobj.label = plobj.label + " y #"+str(y+1)
+                        if self.nplotx > 1: plobj.label = plobj.label + " x #"+str(x+1)
+                    # specific 2d plot stuff
                     if dp == 2:
-                    # specific 2d plot stuff
                         # -- light grey background for missing values
                         if type(plobj.field).__name__ in 'MaskedArray': plobj.axisbg = '0.75'
@@ -651,5 +704,24 @@
                                        and "grid points" not in obj.name_x \
                                        and not self.noproj )
-                    # finally append
+                    # possible user-defined plot settings shared by all plots
+                    if self.div is not None: plobj.div = self.div
+                    if self.xlabel is not None: plobj.xlabel = self.xlabel
+                    if self.xcoeff is not None: plobj.xcoeff = self.xcoeff
+                    if self.ylabel is not None: plobj.ylabel = self.ylabel
+                    if self.ycoeff is not None: plobj.ycoeff = self.ycoeff
+                    if self.title is not None: plobj.title = self.title
+                    # -- 1D specific
+                    if dp == 1:
+                        if self.lstyle is not None: plobj.lstyle = self.lstyle
+                        if self.marker is not None: plobj.marker = self.marker
+                        if self.color is not None: plobj.color = self.color
+                        if self.label is not None: plobj.label = self.label
+                    # -- 2D specific
+                    elif dp == 2:
+                        if self.proj is not None and not self.noproj: plobj.proj = self.proj
+                        if self.vmin is not None: plobj.vmin = self.vmin
+                        if self.vmax is not None: plobj.vmax = self.vmax
+                        if self.colorb is not None: plobj.colorb = self.colorb
+                    # finally append plot object
                     self.p.append(plobj)
                     count = count + 1
@@ -711,4 +783,5 @@
         # final status
         self.status = "definedplot"
+        return self
 
     ##############################################################################################
@@ -780,9 +853,11 @@
             # finally make the plot
             pl.make()
-            self.n = self.n+1 
+            # increment plot count (and propagate this in plotin)
+            self.n = self.n+1
+            if self.plotin is not None: self.plotin.n = self.n
         # once completed show the plot (cannot show intermediate plotin)
         # ... added a fix (customplot=True) for the label problem in basemap
-        print "**** Done step: makeplot"
-        if (self.n == self.howmanyplots): 
+        print "**** PPCLASS. Done step: makeplot"
+        if (self.n == self.howmanyplots):
             ppplot.save(mode=self.out,filename=self.filename,folder=self.folder,custom=self.customplot)
             mpl.close()
@@ -795,4 +870,5 @@
         except IOError: 
             print "!! WARNING !! Saved object file not written. Probably do not have permission to write here."
+        return self
 
     ###########################################################
@@ -802,4 +878,5 @@
         self.defineplot(extraplot=extraplot)
         self.makeplot()
+        return self
 
     #######################################################
@@ -809,4 +886,5 @@
         self.get()
         self.plot(extraplot=extraplot)
+        return self
 
     ###################################################################
@@ -816,4 +894,5 @@
         self.get()
         self.defineplot(extraplot=extraplot)
+        return self
 
     ##############################################################
@@ -907,4 +986,9 @@
             except:  
                 try: self.p[iii].marker = opt.marker[0]
+                except: pass
+            ###
+            try: self.p[iii].label = opt.label[iii]
+            except:
+                try: self.p[iii].label = opt.label[0]
                 except: pass
             ###
@@ -1045,5 +1129,5 @@
           if "grid points" not in self.name_x:
             if self.field_x.all() == self.field_x[0,0]:
-               print "!! WARNING !! xy axis look undefined. creating a non-dummy ones."
+               print "!! WARNING !! xy axis look undefined. creating non-dummy ones."
                self.field_x = np.array(range(self.dim_x)) ; self.name_x = "x grid points"
                self.field_y = np.array(range(self.dim_y)) ; self.name_y = "y grid points"
@@ -1330,5 +1414,9 @@
         # ... this is done in the .area() method. 
         # after that self.field contains field*area/totarea
-        if "area" in self.compute: self.area()
+        if "area" in self.compute: 
+            if "comp" in self.method_x+self.method_y: 
+                self.area()
+            else:
+                if self.verbose: print "!! WARNING !! No area accounted for (computing on t and/or z axis)."
         # now ready to compute [TBD: we would like to have e.g. mean over x,y and min over t ??]
         if self.method_t == "comp":
@@ -1371,6 +1459,6 @@
             print "**** OK. Final shape for "+self.var+" after averaging and squeezing",self.field.shape
     
-    # get areas for computations and ponderate field by those areas
-    # -------------------------------------------------------------
+    # get areas for computations and ponderate self.field by area/totarea
+    # -------------------------------------------------------------------
     def area(self):
         if self.verbose: print "**** OK. Get area array for computations."
@@ -1398,12 +1486,26 @@
         # read the 2D area array in netCDF file
         aire.getfield()
-        # normalize by total area
         aire.field = np.squeeze(aire.field)
-        totarea = ppcompute.sum(ppcompute.sum(aire.field,axis=1),axis=0)
-        if self.verbose: print "**** OK. Total area is: ",totarea
-        aire.field = aire.field / totarea
         # reduce with self horizontal indexes
         if "fixed" in self.method_x+self.method_y:
             aire.field = aire.field[self.index_y,self.index_x]
+        # calculate total area
+        # ... 2D comp is easy. 1D comp is a bit less easy but simple array manipulation.
+        if "free" in self.method_x+self.method_y:
+            if self.method_x == "free":
+                totarea = ppcompute.sum(aire.field,axis=0)
+                totarea = np.reshape(totarea,(1,totarea.size))
+                totarea = np.tile(totarea,(1,self.index_x))
+            elif self.method_y == "free":
+                totarea = ppcompute.sum(aire.field,axis=1)
+                totarea = np.reshape(totarea,(totarea.size,1))
+                totarea = np.tile(totarea,(1,self.index_x.size))
+        elif self.method_x == "comp" and self.method_y == "comp":
+            totarea = ppcompute.sum(ppcompute.sum(aire.field,axis=1),axis=0)
+        else:
+            if self.verbose: print "!! WARNING !! Not account for areas. Only averaging over z and/or t axis."
+        # normalize by total area
+        print "**** OK. I can now normalize field by areas."
+        aire.field = aire.field / totarea
         # tile area array over self t and z axis so that area field could be multiplied with self.field
         aire.field = np.tile(aire.field,(self.index_t.size,self.index_z.size,1,1))
Index: trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py	(revision 922)
+++ trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py	(revision 923)
@@ -349,5 +349,6 @@
                  lstyle='-',\
                  color='b',\
-                 marker='x'):
+                 marker='x',\
+                 label=None):
         ## get initialization from parent class
         plot.__init__(self)
@@ -356,4 +357,5 @@
         self.color = color
         self.marker = marker
+        self.label = label
 
     # define_from_var
@@ -389,7 +391,7 @@
         # either request linestyle or let matplotlib decide
         if self.lstyle is not None and self.color is not None:
-            mpl.plot(x,y,self.color+self.lstyle,marker=self.marker)
+            mpl.plot(x,y,self.color+self.lstyle,marker=self.marker,label=self.label)
         else:
-            mpl.plot(x,y,marker=self.marker)
+            mpl.plot(x,y,marker=self.marker,label=self.label)
         # make log axes and/or invert ordinate
         # ... this must be after plot so that axis bounds are well-defined
@@ -398,4 +400,8 @@
         if self.logy: mpl.semilogy()
         if self.invert: ax = mpl.gca() ; ax.set_ylim(ax.get_ylim()[::-1])
+        # add a label for line(s)
+        if self.label is not None:
+            if self.label != "":
+                mpl.legend(loc="best",fancybox=True)
         ## TBD: set with .div the number of ticks
         ## TBD: be able to control plot limits
@@ -556,5 +562,5 @@
                 wlat[0] = None ; wlat[1] = None ; wlon[0] = None ; wlon[1] = None
                 steplon = 30. ; steplat = 30.
-                if self.proj == "robin": steplon = 60.
+                if self.proj in ["robin","moll"]: steplon = 60.
                 mertab = np.r_[-360.:360.:steplon]
                 partab = np.r_[-90.:90.:steplat]
@@ -642,6 +648,7 @@
                               scale=zescale*reducevec,width=widthvec )
                 # make vector key. default is on upper left corner.
-                p = mpl.quiverkey(q,-0.03,1.08,\
+                keyh = 1.025 ; keyv = 1.05
+                #keyh = -0.03 ; keyv = 1.08
+                p = mpl.quiverkey(q,keyh,keyv,\
                                   zescale,str(int(zescale)),\
                                   color='black',labelpos='S',labelsep = 0.07)
-        #### streamplot!!! avec basemap
Index: trunk/UTIL/PYTHON/planetoplot_v2/set_multiplot.txt
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/set_multiplot.txt	(revision 922)
+++ trunk/UTIL/PYTHON/planetoplot_v2/set_multiplot.txt	(revision 923)
@@ -4,8 +4,8 @@
 ############################################
 1 ; 1 ; 1 ; 0.0 ; 0.0 ; 22
-2 ; 1 ; 2 ; 0.35 ; 0.0 ; 20
+2 ; 1 ; 2 ; 0.5 ; 0.0 ; 20
 #3 ; 3 ; 1 ; 0.0 ; 1.0 ; 18
 3 ; 1 ; 3 ; 0.35 ; 0.0 ; 18
-4 ; 2 ; 2 ; 0.8 ; 0.6 ; 18
+4 ; 2 ; 2 ; 0.35 ; 0.6 ; 18
 6 ; 3 ; 2 ; 0.6 ; 1.0 ; 18
 8 ; 2 ; 4 ; 0.6 ; 0.6 ; 18
