Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/easy_get_field.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/easy_get_field.py	(revision 947)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/easy_get_field.py	(revision 960)
@@ -1,38 +1,63 @@
 #! /usr/bin/env python
 from ppclass import pp
-import numpy as np
-import matplotlib.pyplot as mpl
 
+########
+## ppclass allows for getting fields very easily from a netcdf file
+## ... this is contained in the "f" attributes of the pp object
+## ... and the "l" attributes of the pp object contains useful information
+## ... two methods getf() and getfl() are helpful shortcuts
+###########################################
+
+## 1 --> an unique and straightforward request
+##   --> very easy ! see also minimal_field.py
+##############################################
+icetot = pp(file="/home/aymeric/Big_Data/DATAPLOT/diagfired.nc",var="icetot",t=0.5).getf()
+print "icetot", icetot[10,10]
+
+## 2 --> simple multiple request, no labelling
+##############################################
+test = pp(file="/home/aymeric/Big_Data/DATAPLOT/diagfired.nc",t=0.5)
+test.var = ["mtot","icetot"]
+allf = test.getf() # or allf = test.get().f
+##
+mtot = allf[0]
+icetot = allf[1]
+print "mtot", mtot[10,10]
+print "icetot", icetot[10,10]
+
+## 3 --> complex multiple requests and labelling
+################################################
+test = pp(file="/home/aymeric/Big_Data/DATAPLOT/diagfired.nc")
+test.var = ["mtot","icetot"]
+test.t = [0.4,0.5]
+allf,lab = test.getfl()
+##
+icetot04 = allf[lab.index("_v=icetot_t=0.4_")]
+mtot04 = allf[lab.index("_v=mtot_t=0.4_")]
+icetot05 = allf[lab.index("_v=icetot_t=0.5_")]
+mtot05 = allf[lab.index("_v=mtot_t=0.5_")]
+print "mtot04", mtot04[10,10]
+print "icetot04", icetot04[10,10]
+print "mtot05", mtot05[10,10]
+print "icetot05", icetot05[10,10]
+
+## 4 --> an example of complete labelling
+## .... a rather unlikely example ....
+## .... but shows label ordering ....
+#########################################
 test = pp()
-test.file = [ \
-  "/planeto/jllmd/Earth/Nmix/F1525/output/diagfi4.nc", \
-  "/planeto/jllmd/Earth/Nmix/F1550/output/diagfi4.nc", \
-  "/planeto/jllmd/Earth/Nmix/F1500/output/diagfi4.nc" ]
-test.var = ["tsurf","ASR"]
-test.x = "-180.,175."
-test.y = "-90.,90."
-test.t = "0,1000"
-#test.verbose = True
-test.compute = "meanarea"
-test.get()
-
-# -----------------------------
-# self.allfield contains data !
-# -----------------------------
-# index ordering: 
-# - file
-# - var
-# - request t
-# - request z
-# - request y
-# - request x
-# - field dimensions
-# -----------------------------
-
-
-for ii in range(test.nfin):
-    print "tsurf",test.allfield[ii][0][0][0][0][0]
-    print "asr",test.allfield[ii][1][0][0][0][0]
-
-#mpl.plot(tsurf,asr)
-#mpl.show()
+test.file = ["/home/aymeric/Big_Data/DATAPLOT/diagfired.nc","/home/aymeric/Big_Data/DATAPLOT/diagfired.nc"]
+test.var = ["u","v"]
+test.x = [10.,20.]
+test.y = [10.,20.]
+test.z = [10.,20.]
+test.t = [0.4,0.5]
+print "... please wait. this one is a bit stupid..."
+allf,lab = test.getfl()
+## note label ordering: file -- var -- x -- y -- z -- t
+l1 = "_f=#2_v=u_x=10.0_y=10.0_z=20.0_t=0.4_"
+l2 = "_f=#2_v=v_x=10.0_y=10.0_z=20.0_t=0.4_"
+u_example = allf[lab.index(l1)]
+v_example = allf[lab.index(l2)]
+print l1, u_example
+print l2, v_example
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/function.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/function.py	(revision 947)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/function.py	(revision 960)
@@ -19,5 +19,5 @@
 var2 = var2 / 3.72
 
-S = var2.f(var1)
+S = var2.func(var1)
 
 S.p[0].marker = 'o'
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/hodograph.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/hodograph.py	(revision 947)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/hodograph.py	(revision 960)
@@ -16,9 +16,9 @@
 
 # u as a function of v
-hodo = u.f(v)
+hodo = u.func(v)
 hodo.filename = "hodograph"
 hodo.makeplot()
 
 # v as a function of u
-hodo2 = v.f(u)
+hodo2 = v.func(u)
 hodo2.makeplot()
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/meso_profile.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/meso_profile.py	(revision 947)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/meso_profile.py	(revision 960)
@@ -38,5 +38,5 @@
 
 # define potential temperature as a function of height
-S = tpot.f(z)
+S = tpot.func(z)
 
 # change a few plot settings
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/minimal_field.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/minimal_field.py	(revision 960)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/minimal_field.py	(revision 960)
@@ -0,0 +1,6 @@
+#! /usr/bin/env python
+from ppclass import pp
+import matplotlib.pyplot as mpl
+icetot = pp(file="/home/aymeric/Big_Data/DATAPLOT/diagfired.nc",var="icetot",t=0.5).getf()
+mpl.pcolor(icetot)
+mpl.show()
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/scatter.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/scatter.py	(revision 947)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/scatter.py	(revision 960)
@@ -15,5 +15,5 @@
 ps.getdefineplot()
 
-S = ps.f(tsurf)
+S = ps.func(tsurf)
 S.p[0].lstyle=""
 S.p[0].marker="h"
@@ -26,5 +26,5 @@
 icetot.getdefineplot()
 
-S2 = icetot.f(tsurf)
+S2 = icetot.func(tsurf)
 S2.p[0].lstyle=""
 S2.p[0].marker="D"
@@ -45,5 +45,5 @@
 wind = u**2 + v**2
 wind = wind**0.5
-S3 = wind.f(ps)
+S3 = wind.func(ps)
 S3.p[0].lstyle=""
 S3.p[0].marker="o"
@@ -70,5 +70,5 @@
 ps.getdefineplot()
 
-S = ps.f(tsurf)
+S = ps.func(tsurf)
 S.p[0].lstyle=""
 S.p[0].marker="h"
Index: trunk/UTIL/PYTHON/planetoplot_v2/pp_reload.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/pp_reload.py	(revision 947)
+++ trunk/UTIL/PYTHON/planetoplot_v2/pp_reload.py	(revision 960)
@@ -26,4 +26,5 @@
 
     yeah = pp()
+    yeah.quiet = True
     yeah.defineplot(loadfile=files)
     yeah.out = opt.out
Index: trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py	(revision 947)
+++ trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py	(revision 960)
@@ -25,4 +25,5 @@
 ###################################
 # where settings files are located...
+# ... this can be hardcoded here
 whereset = None
 whereset = ppcompute.findset(whereset)
@@ -39,5 +40,5 @@
     for stuff in lines[17].strip().split(';'): glob_listarea.append(stuff)
 except IOError: 
-    print "warning: "+zefile+" not in "+whereset+" ; no presets."
+    print "PPCLASS warning: "+zefile+" not in "+whereset+" ; no presets."
 
 ##################################
@@ -135,5 +136,7 @@
                       stridez=1,stridet=1,\
                       compute="mean",\
-                      verbose=False,noproj=False,\
+                      verbose=False,\
+                      quiet=False,\
+                      noproj=False,\
                       superpose=False,\
                       plotin=None,\
@@ -154,6 +157,8 @@
                       label=None,\
                       changetime=None,\
+                      units=None,\
                       title=None):
         self.request = None
+        self.nrequest = 0
         self.nfin = 0 ; self.nvin = 0
         self.nplotx = None ; self.nploty = None
@@ -165,5 +170,6 @@
         self.p = None
         self.customplot = False
-        self.allfield = None
+        self.f = None
+        self.l = None
         ## what could be defined by the user
         self.file = file
@@ -177,4 +183,5 @@
         self.compute = compute
         self.verbose = verbose
+        self.quiet = quiet
         self.noproj = noproj
         self.plotin = plotin
@@ -198,8 +205,10 @@
         self.color = color
         self.label = label
+        self.units = units
         self.title = title
 
     # print status
     def printstatus(self):
+      if not self.quiet:
         if self.filename == "THIS_IS_A_CLONE":
             pass
@@ -243,4 +252,5 @@
             self.color = other.color
             self.label = other.label
+            self.units = other.units
             self.title = other.title
             self.includedate = other.includedate
@@ -319,6 +329,8 @@
               if not isnum:   
                   ope = other.request[i][j][t][z][y][x].field
-                  if obj_ref.field.shape != ope.shape:
-                    print "!! ERROR !! The two fields for operation do not have the same shape.",self.field.shape,other.field.shape
+                  if ope.ndim == 0: 
+                    ope = float(ope) # if no dimension then this means that ope is a single value (not to be kept as an array)
+                  elif obj_ref.field.shape != ope.shape:
+                    print "!! ERROR !! The two fields for operation do not have the same shape.",obj_ref.field.shape,ope.shape
                     exit()
               else:           
@@ -347,6 +359,8 @@
               if not isnum:
                   ope = other.request[i][j][t][z][y][x].field
-                  if obj_ref.field.shape != ope.shape:
-                    print "!! ERROR !! The two fields for operation do not have the same shape.",self.field.shape,other.field.shape
+                  if ope.ndim == 0: 
+                    ope = float(ope) # if no dimension then this means that ope is a single value (not to be kept as an array)
+                  elif obj_ref.field.shape != ope.shape:
+                    print "!! ERROR !! The two fields for operation do not have the same shape.",obj_ref.field.shape,ope.shape
                     exit()
               else:
@@ -375,6 +389,8 @@
               if not isnum:
                   ope = other.request[i][j][t][z][y][x].field
-                  if obj_ref.field.shape != ope.shape:
-                    print "!! ERROR !! The two fields for operation do not have the same shape.",self.field.shape,other.field.shape
+                  if ope.ndim == 0: 
+                    ope = float(ope) # if no dimension then this means that ope is a single value (not to be kept as an array)
+                  elif obj_ref.field.shape != ope.shape:
+                    print "!! ERROR !! The two fields for operation do not have the same shape.",obj_ref.field.shape,ope.shape
                     exit()
               else:
@@ -403,6 +419,8 @@
               if not isnum:
                   ope = other.request[i][j][t][z][y][x].field
-                  if obj_ref.field.shape != ope.shape:
-                    print "!! ERROR !! The two fields for operation do not have the same shape.",self.field.shape,other.field.shape
+                  if ope.ndim == 0: 
+                    ope = float(ope) # if no dimension then this means that ope is a single value (not to be kept as an array)
+                  elif obj_ref.field.shape != ope.shape:
+                    print "!! ERROR !! The two fields for operation do not have the same shape.",obj_ref.field.shape,ope.shape
                     exit()
               else:
@@ -526,4 +544,6 @@
                        for z in range(self.nplotz)] for t in range(self.nplott)] \
                        for j in range(self.nvin)]   for i in range(self.nfin)] 
+        # store how many onerequest() objects are in self.request
+        self.nrequest = self.nfin*self.nvin*self.nplotx*self.nploty*self.nplotz*self.nplott
         # loop on onerequest() objects
         for i in range(self.nfin):
@@ -571,11 +591,10 @@
         # check if things were done OK before
         if self.status != "defined": print "!! ERROR !! Please use .define() to define your pp object." ; exit()
-        # create the list of allfield() objects
-        # --> so that the user can easily access values
-        self.allfield = [[[[[[ \
-                        [] \
-                        for x in range(self.nplotx)] for y in range(self.nploty)] \
-                        for z in range(self.nplotz)] for t in range(self.nplott)] \
-                        for j in range(self.nvin)]   for i in range(self.nfin)]
+        ## create the list of f() and l() objects
+        ## --> so that the user can easily access values (and labels for easy exploration)
+        ## --> see example easy_get_field
+        self.f = [ [] for iii in range(self.nrequest) ]
+        self.l = [ [] for iii in range(self.nrequest) ]
+        count = 0
         ## first get fields
         ## ... only what is needed is extracted from the files
@@ -590,5 +609,17 @@
               obj.getfield()
               obj.computations()
-              self.allfield[i][j][t][z][y][x] = obj.field
+              # save fields in self.f for the user
+              self.f[count] = obj.field
+              # save a label in self.l for the user
+              self.l[count] = "_"
+              if self.nfin > 1:   self.l[count] = self.l[count] + "f=#"+str(int(i+1))+'_'
+              if self.nvin > 1:   self.l[count] = self.l[count] + "v="+obj.var+'_'
+              if self.nplotx > 1: self.l[count] = self.l[count] + "x="+str(self.x[x])+'_'
+              if self.nploty > 1: self.l[count] = self.l[count] + "y="+str(self.y[y])+'_'
+              if self.nplotz > 1: self.l[count] = self.l[count] + "z="+str(self.z[z])+'_'
+              if self.nplott > 1: self.l[count] = self.l[count] + "t="+str(self.t[t])+'_'
+              count = count + 1
+        ## make it simple: self.f is simply the data array if self.nrequest=1
+        if self.nrequest == 1: self.f = self.f[0]
         # change status
         self.status = "retrieved"
@@ -602,4 +633,24 @@
         self.retrieve()
         return self  
+
+    ###########################################################
+    # getf: a shortcut method for the define + retrieve chain #
+    #       ... in which the output is self.f                 #
+    #       ... and the ppclass is kept quiet                 #
+    ###########################################################
+    def getf(self):
+        self.quiet = True
+        self.get()
+        return self.f
+
+    ############################################################
+    # getfl: a shortcut method for the define + retrieve chain #
+    #       ... in which the output is self.f, self.l          #
+    #       ... and the ppclass is kept quiet                 #
+    ############################################################
+    def getfl(self):
+        self.quiet = True
+        self.get()
+        return self.f,self.l
 
     ########################################
@@ -730,4 +781,5 @@
                     if self.ycoeff is not None: plobj.ycoeff = self.ycoeff
                     if self.title is not None: plobj.title = self.title
+                    if self.units is not None: plobj.units = self.units
                     # -- 1D specific
                     if dp == 1:
@@ -799,5 +851,5 @@
             if self.verbose: print "**** OK. expect %i plots" % (self.howmanyplots)
         else:
-            exit() # because this means that we only had 0D values !
+            pass # because this means that we only had 0D values !
         # final status
         self.status = "definedplot"
@@ -813,4 +865,5 @@
     ##############################################################################################
     def makeplot(self):
+      if self.howmanyplots > 0:
         self.printstatus()
         # a few initial operations
@@ -888,5 +941,5 @@
             pickle.dump(self.p, filehandler)
         except IOError: 
-            print "!! WARNING !! Saved object file not written. Probably do not have permission to write here."
+            if self.verbose: print "!! WARNING !! Saved object file not written. Probably do not have permission to write here."
         return self
 
@@ -915,11 +968,11 @@
         return self
 
-    ##############################################################
-    # f: operation on two pp objects being on status 'definedplot'
+    #################################################################
+    # func: operation on two pp objects being on status 'definedplot'
     # this allows for one field being function of another one
-    # e.g. u.f(v) means u will be displayed as a function of v
-    # ... no need to do defineplot after u.f(v), makeplot directly
-    ##############################################################
-    def f(self,other):
+    # e.g. u.func(v) means u will be displayed as a function of v
+    # ... no need to do defineplot after u.func(v), makeplot directly
+    #################################################################
+    def func(self,other):
         # preamble: for this operation to work, defineplot() must have been done
         if self.status != "definedplot":
@@ -1149,5 +1202,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 non-dummy ones."
+               if self.verbose: 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"
@@ -1242,5 +1295,5 @@
                             self.field_t = self.field_t % 24 # so that the user is not mistaken!
             else:
-                print "!! WARNING !! This time change is not implemented. Nothing is done."
+                if self.verbose: print "!! WARNING !! This time change is not implemented. Nothing is done."
             if self.verbose: print "**** OK. new t axis values [%5.1f,%5.1f]" % (self.field_t.min(),self.field_t.max())
 
@@ -1396,8 +1449,9 @@
     def getfield(self):
         ## first tell what is to be done
-        if self.dimplot > 2:                       print "**** !! ERROR !! "+str(self.dimplot)+"D plots not supported!" ; exit()
-        elif self.dimplot == 0 and self.verbose:   print "**** OK. 0D value requested."
-        elif self.dimplot == 1 and self.verbose:   print "**** OK. 1D plot requested."
-        elif self.verbose:                         print "**** OK. 2D section requested."
+        if self.verbose:
+          if self.dimplot > 2:                       print "**** !! WARNING !! "+str(self.dimplot)+"D plots will not be supported!"
+          elif self.dimplot == 0 and self.verbose:   print "**** OK. 0D value requested."
+          elif self.dimplot == 1 and self.verbose:   print "**** OK. 1D plot requested."
+          elif self.verbose:                         print "**** OK. 2D section requested."
         # well, now get field from netcdf file
         # part below is necessary otherwise there is an index error below
Index: trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py	(revision 947)
+++ trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py	(revision 960)
@@ -534,4 +534,13 @@
             print "!! WARNING !! Transposing axes"
             self.field = np.transpose(self.field)
+        # set dummy xy axis if not defined
+        if self.absc is None: 
+            self.absc = np.array(range(self.field.shape[0]))
+            self.mapmode = False
+            print "!! WARNING !! dummy coordinates on x axis"
+        if self.ordi is None: 
+            self.ordi = np.array(range(self.field.shape[1]))
+            self.mapmode = False
+            print "!! WARNING !! dummy coordinates on y axis"
         # bound field
         zevmin, zevmax = calculate_bounds(self.field,vmin=self.vmin,vmax=self.vmax)
