Index: trunk/UTIL/PYTHON/mcd/proto/cgi-bin/diapo.py
===================================================================
--- trunk/UTIL/PYTHON/mcd/proto/cgi-bin/diapo.py	(revision 859)
+++ trunk/UTIL/PYTHON/mcd/proto/cgi-bin/diapo.py	(revision 859)
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+
+from os import listdir
+from random import choice
+
+ext2conttype = {"jpg": "image/jpeg",
+                "jpeg": "image/jpeg",
+                "png": "image/png",
+                "gif": "image/gif"}
+
+def content_type(filename):
+    return ext2conttype[filename[filename.rfind(".")+1:].lower()]
+
+def isimage(filename):
+    """true if the filename's extension is in the content-type lookup"""
+    filename = filename.lower()
+    return filename[filename.rfind(".")+1:] in ext2conttype
+
+def random_file(dir):
+    """returns the filename of a randomly chosen image in dir"""
+    images = [f for f in listdir(dir) if isimage(f)]
+    return choice(images)
+
+if __name__ == "__main__":
+    dir = "../img/"
+    r = random_file(dir)
+    #print "Content-type: %s\n" % (content_type(r))
+
+    print "Content-type:text/html\n"
+    print "  "  #Apache needs a space after content-type
+    header="""<html><head><title>Mars Climate Database: The Web Interface</title></head><body>"""
+    print header
+
+    print "<form name='diapo' action='./diapo.py' method='post'>"
+    print "<center>"
+    print "<b style='font-size: 125%;'>Mars Climate Database: The Web Interface.</b><br />"
+    print "<b style='font-size: 125%;'>Demo mode!</b>"
+    print "<input type='submit' value='Click here for another random example' style='font-weight:bold'/><br />"
+    print "<a href='../index.html'>back to the main interface.</a><br />"
+    print "</center>"
+    print "<hr />"
+
+    #dafile = file(dir+r, "rb").read()
+    dafile = dir+r
+    print "<img src='"+dafile+"'><br />"
+
+    bottom = "</body></html>"
+    print bottom
Index: trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py
===================================================================
--- trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py	(revision 827)
+++ trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py	(revision 859)
@@ -73,4 +73,8 @@
 query=mcd.mcd() 
 
+# set MCD version changes if needed
+betatest = form.getvalue("betatest")
+if betatest == "on": query.toversion5()
+
 # Get the kind of vertical coordinates and choose default behavior for "all"
 try: query.zkey = int(form.getvalue("zkey"))
@@ -93,5 +97,5 @@
 if query.datekey == 1:
     try: query.xdate = float(form.getvalue("ls"))
-    except: query.xdate = float(1) ; badlschar = True
+    except: query.xdate = float(1) ; badlschar = True # comment the second part if in debug command line mode
 else:
     try: query.xdate = float(form.getvalue("julian"))
@@ -161,7 +165,8 @@
 except: query.max2d = None
 
-try: query.dpi = float(form.getvalue("dpi"))
+try: query.dpi = form.getvalue("dpi")
 except: query.dpi = 80.
-
+if query.dpi == "eps":  yeaheps = True  ; query.dpi = 300.
+else:                   yeaheps = False ; query.dpi = float(query.dpi)
 
 # Get variables to plot
@@ -194,6 +199,8 @@
 
  # reference name (to test which figures are already in the database)
- reference = query.getnameset()+str(var1)+str(var2)+str(var3)+str(var4)+str(iswind)+str(isfixedlt)+str(iszonmean)+query.colorm+str(query.min2d)+str(query.max2d)+str(query.dpi)
- figname = '../img/'+reference+'.png'
+ try: reference = query.getnameset()+str(var1)+str(var2)+str(var3)+str(var4)+str(iswind)+str(isfixedlt)+str(iszonmean)+query.colorm+str(query.min2d)+str(query.max2d)+str(query.dpi)
+ except: reference = "test"
+ if yeaheps:  figname = '../img/'+reference+'.eps'
+ else:        figname = '../img/'+reference+'.png'
  txtname = '../txt/'+reference+'.txt'
  testexist = daos.path.isfile(figname)
@@ -234,4 +241,7 @@
 
 header="""<html><head><title>Mars Climate Database: The Web Interface</title></head><body>"""
+if betatest == "on": 
+    print "<b>!!! THIS IS A BETA VERSION. RESULTS ARE NOT VALIDATED !!!</b>"
+    if sumfree == 2:     print "<br>"
 
 print header
@@ -248,9 +258,12 @@
 else:
   if sumfree == 0: 	query.update() ; query.htmlprinttabextvar(vartoplot)
-  elif sumfree == 2: 	print "<img src='"+figname+"'><br />"
+  elif sumfree == 2: 	
+                        if yeaheps:  print "<hr><a href='"+figname+"'>!!!! Click here to download the EPS figure file !!!!</a><br /><hr>"
+                        else:        print "<img src='"+figname+"'><br />"
   elif sumfree == 1:      
                         print "<a href='"+txtname+"'>Click here to download an ASCII file containing data</a><br />"
                         print "<hr>"
-                        print "<img src='"+figname+"'><br />"
+                        if yeaheps:  print "<hr><a href='"+figname+"'>!!!! Click here to download the EPS figure file !!!!</a><br /><hr>"
+                        else:        print "<img src='"+figname+"'><br />"
 
 ## This is quite common
Index: trunk/UTIL/PYTHON/mcd/proto/diapo.html
===================================================================
--- trunk/UTIL/PYTHON/mcd/proto/diapo.html	(revision 859)
+++ trunk/UTIL/PYTHON/mcd/proto/diapo.html	(revision 859)
@@ -0,0 +1,21 @@
+<!-- Author Aymeric Spiga LMD -->
+<!DOCTYPE html>
+<html>
+
+<head>
+<meta charset="utf-8" />
+<title>Mars Climate Database: The Web Interface</title>
+</head>
+
+<body onload="submit">
+<form name="diapo" action="./cgi-bin/diapo.py" method="post"> 
+<center>
+<b style="font-size: 125%;">Mars Climate Database: The Web Interface. </b><br>
+<b style="font-size: 125%;">Demo mode!</b> 
+<input type='submit' value='Click here for a random example' style='font-weight:bold'/><br />
+<a href='index.html'>back to the main interface.</a><br />
+</center>
+<hr />
+</body>
+
+</html>
Index: trunk/UTIL/PYTHON/mcd/proto/index.html
===================================================================
--- trunk/UTIL/PYTHON/mcd/proto/index.html	(revision 827)
+++ trunk/UTIL/PYTHON/mcd/proto/index.html	(revision 859)
@@ -108,14 +108,19 @@
 <ul>
 <li>Dust scenario <select name="dust">
-<option value="1"         >MY24 min solar</option>
-<option value="2" selected>MY24 ave solar</option>
-<option value="3"         >MY24 max solar</option>
-<option value="4"         >dust storm tau=4 min solar</option>
-<option value="5"         >dust storm tau=4 ave solar</option>
-<option value="6"         >dust storm tau=4 max solar</option>
-<option value="7"         >warm scenario (dusty, max solar)</option>
-<option value="8"         >cold scenario (low dust, min solar)</option>
+<option value="1"         >climatology min solar</option>
+<option value="2" selected>climatology ave solar</option>
+<option value="3"         >climatology max solar</option>
+<option value="4"         >dust storm min solar</option>
+<option value="5"         >dust storm ave solar</option>
+<option value="6"         >dust storm max solar</option>
+<option value="7"         >warm (dusty, max solar)</option>
+<option value="8"         >cold (low dust, min solar)</option>
 </select></li>
 <li>Interpolate using MOLA topography <input type="radio" name="hrkey" value="1" checked /> on <input type="radio" name="hrkey" value="0" /> off </li>
+<li> <span style="font-size: 80%;"> Beta-testing (only for developers)
+<input type="radio" name="betatest" value="off" checked /> off
+<input type="radio" name="betatest" value="on"          /> on
+</span>
+</li>
 </ul>
 </td>
@@ -163,4 +168,11 @@
 <option value="co"            >[CO] vol. mixing ratio (mol/mol)</option>
 <option value="visc"          >Air viscosity estimation (N s m-2)</option>
+<option value="pbl"           >(beta) Convective PBL height (m)</option>
+<option value="stress"        >(beta) Surf. wind stress (Kg/m/s2)</option>
+<option value="ar"            >(beta) Ar vol.mix.rat. (mol/mol)</option>
+<option value="updraft"       >(beta) Max PBL updraft wind (m/s)</option>
+<option value="downdraft"     >(beta) Max PBL downdraft wind (m/s)</option>
+<option value="pblwvar"       >(beta) PBL vert wind variance (m2/s2)</option>
+<option value="pblhvar"       >(beta) PBL eddy vert heat flux (m/s/K)</option>
 </select>
 <br />
@@ -192,4 +204,11 @@
 <option value="co"            >[CO] vol. mixing ratio (mol/mol)</option>
 <option value="visc"          >Air viscosity estimation (N s m-2)</option>
+<option value="pbl"           >(beta) Convective PBL height (m)</option>
+<option value="stress"        >(beta) Surf. wind stress (Kg/m/s2)</option>
+<option value="ar"            >(beta) Ar vol.mix.rat. (mol/mol)</option>
+<option value="updraft"       >(beta) Max PBL updraft wind (m/s)</option>
+<option value="downdraft"     >(beta) Max PBL downdraft wind (m/s)</option>
+<option value="pblwvar"       >(beta) PBL vert wind variance (m2/s2)</option>
+<option value="pblhvar"       >(beta) PBL eddy vert heat flux (m/s/K)</option>
 </select>
 <br />
@@ -221,4 +240,11 @@
 <option value="co"            >[CO] vol. mixing ratio (mol/mol)</option>
 <option value="visc"          >Air viscosity estimation (N s m-2)</option>
+<option value="pbl"           >(beta) Convective PBL height (m)</option>
+<option value="stress"        >(beta) Surf. wind stress (Kg/m/s2)</option>
+<option value="ar"            >(beta) Ar vol.mix.rat. (mol/mol)</option>
+<option value="updraft"       >(beta) Max PBL updraft wind (m/s)</option>
+<option value="downdraft"     >(beta) Max PBL downdraft wind (m/s)</option>
+<option value="pblwvar"       >(beta) PBL vert wind variance (m2/s2)</option>
+<option value="pblhvar"       >(beta) PBL eddy vert heat flux (m/s/K)</option>
 </select>
 <br />
@@ -250,4 +276,11 @@
 <option value="co"            >[CO] vol. mixing ratio (mol/mol)</option>
 <option value="visc"          >Air viscosity estimation (N s m-2)</option>
+<option value="pbl"           >(beta) Convective PBL height (m)</option>
+<option value="stress"        >(beta) Surf. wind stress (Kg/m/s2)</option>
+<option value="ar"            >(beta) Ar vol.mix.rat. (mol/mol)</option>
+<option value="updraft"       >(beta) Max PBL updraft wind (m/s)</option>
+<option value="downdraft"     >(beta) Max PBL downdraft wind (m/s)</option>
+<option value="pblwvar"       >(beta) PBL vert wind variance (m2/s2)</option>
+<option value="pblhvar"       >(beta) PBL eddy vert heat flux (m/s/K)</option>
 </select>
 </td>
@@ -257,4 +290,5 @@
 <input type="radio" name="dpi" value="80" checked> medium
 <input type="radio" name="dpi" value="160"> high
+<input type="radio" name="dpi" value="eps"> eps
 </li>
 <li> Set colormap
Index: trunk/UTIL/PYTHON/mcd/proto/martian_time.js
===================================================================
--- trunk/UTIL/PYTHON/mcd/proto/martian_time.js	(revision 827)
+++ trunk/UTIL/PYTHON/mcd/proto/martian_time.js	(revision 859)
@@ -462,5 +462,5 @@
 Convert2Ls();
 PlaceValues(0.,0.);
-DefaultSpaceTime()
+DefaultSpaceTime();
 }
 
@@ -469,2 +469,3 @@
 document.calendar.submit();
 }
+
