Index: trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py
===================================================================
--- trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py	(revision 760)
+++ trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py	(revision 761)
@@ -4,7 +4,7 @@
 ##################################################
 ### A Python CGI for the Mars Climate Database ###
-### -------------------------------------------###
-### Aymeric SPIGA 18-19/04/2012                ###
-### -------------------------------------------###
+### ------------------------------------------ ###
+### Aymeric SPIGA 18-19/04/2012 ~ 11/08/2012   ###
+### ------------------------------------------ ###
 ### (see mcdtest.py for examples of use)       ###
 ##################################################
@@ -27,10 +27,20 @@
 query = mcd()
 
-# Get data from user-defined fields
-query.lat = float(form.getvalue("latitude"))
-query.lon = float(form.getvalue("longitude"))
-query.loct = float(form.getvalue("localtime"))
+# Get data from user-defined fields and define free dimensions
+getlat = form.getvalue("latitude")
+if getlat == "all":  islatfree = 1 ; query.lat = -9999.
+else:                islatfree = 0 ; query.lat = float(getlat)
+getlon = form.getvalue("longitude")
+if getlon == "all":  islonfree = 1 ; query.lon = -9999.
+else:                islonfree = 0 ; query.lon = float(getlon)
+getloct = form.getvalue("localtime")
+if getloct == "all": isloctfree = 1 ; query.loct = -9999.
+else:                isloctfree = 0 ; query.loct = float(getloct)
+getalt = form.getvalue("altitude")
+if getalt == "all":  isaltfree = 1 ; query.xz = -9999.
+else:                isaltfree = 0 ; query.xz = float(getalt)
+sumfree = islatfree + islonfree + isloctfree + isaltfree 
+if sumfree > 2: exit() ## only 1D or 2D plots for the moment
 query.xdate = float(form.getvalue("ls"))
-query.xz = float(form.getvalue("altitude"))
 query.hrkey = int(form.getvalue("hrkey"))
 query.dust = int(form.getvalue("dust"))
@@ -40,14 +50,22 @@
 #        self.gwlength  = 0. #gravity Wave wavelength (unused if perturkey=0)
 
-# Get free dimensions
-islatfree  = float(form.getvalue("islatfree"))
-islonfree  = float(form.getvalue("islonfree"))
-isloctfree = float(form.getvalue("isloctfree"))
-isaltfree  = float(form.getvalue("isaltfree"))
-sumfree = islatfree + islonfree + isloctfree + isaltfree 
-if sumfree > 2: exit() ## only 1D or 2D plots for the moment
+# Get variables to plot
+var1 = form.getvalue("var1")
+var2 = form.getvalue("var2")
+var3 = form.getvalue("var3")
+var4 = form.getvalue("var4")
+vartoplot = [var1]
+if var2 != "none": vartoplot = np.append(vartoplot,var2)
+if var3 != "none": vartoplot = np.append(vartoplot,var3)
+if var4 != "none": vartoplot = np.append(vartoplot,var4)
+iswind = form.getvalue("iswind")
+if iswind == "on": iswindlog = True
+else:              iswindlog = False
+isfixedlt = form.getvalue("isfixedlt")
+if isfixedlt == "on": input_fixedlt=True
+else:                 input_fixedlt=False  
 
 # reference name (to test which figures are already in the database)
-reference = str(islatfree)+str(islonfree)+str(isloctfree)+str(isaltfree)+query.getnameset()
+reference = str(islatfree)+str(islonfree)+str(isloctfree)+str(isaltfree)+query.getnameset()+str(var1)+str(var2)+str(var3)+str(var4)+str(iswind)+str(isfixedlt)
 figname = 'img/'+reference+'.jpg'
 testexist = daos.path.isfile(figname)
@@ -67,5 +85,6 @@
 
     ### generic building of figure
-    query.plot1d(["t","p","u","v"],vertplot=isaltfree)    
+    #query.plot1d(["t","p","u","v"],vertplot=isaltfree)
+    query.plot1d(vartoplot,vertplot=isaltfree)
     mpl.savefig("img/temp.png",dpi=85,bbox_inches='tight',pad_inches=0.25)
     Image.open("img/temp.png").save(figname,'JPEG')
@@ -77,6 +96,7 @@
     if islatfree == 1 and islonfree == 1:  	query.latlon()   
     else:					exit()  
-    
-    query.map2d(["t","u"]) 
+
+    ### figure    
+    query.map2d(vartoplot,incwind=iswindlog,fixedlt=input_fixedlt) 
     mpl.savefig("img/temp.png",dpi=110,bbox_inches='tight',pad_inches=0.4)
     Image.open("img/temp.png").save(figname,'JPEG') ##lighter images   
@@ -92,12 +112,14 @@
 
 ## Now the part which differs
-if sumfree == 0: 	query.update() ; query.printmeanvar()  
+if sumfree == 0: 	query.update() ; query.htmlprinttabextvar(vartoplot)  #query.printmeanvar()
 elif sumfree >= 1: 	print "<img src='../"+figname+"'><br />"
 else:			exit()
 
 ## This is quite common
-print "Based on the <a href='http://www-mars.lmd.jussieu.fr'>Mars Climate Database</a> (c) LMD/OU/IAA/ESA/CNES.<br />"
+#print "Based on the <a href='http://www-mars.lmd.jussieu.fr'>Mars Climate Database</a> (c) LMD/OU/IAA/ESA/CNES.<br />"
 print "<hr>"
-query.printset()
+print "<a href='../index.html'>Click here to start a new query</a>."
+#query.printset()
+print "<hr>"
 print "</body>"
 print "</html>"
Index: trunk/UTIL/PYTHON/mcd/proto/index.html
===================================================================
--- trunk/UTIL/PYTHON/mcd/proto/index.html	(revision 760)
+++ trunk/UTIL/PYTHON/mcd/proto/index.html	(revision 761)
@@ -11,15 +11,43 @@
 </head>
 
-<body onload="DefaultDateValues();DefaultTimeValues();Convert2Ls();PlaceValues(0.,0.)">
+<body onload="DefaultDateValues();DefaultTimeValues();Convert2Ls();PlaceValues(0.,0.);DefaultSpaceTime()">
 
 <!-- aussi possible: get a la place de post. pour avoir un beau lien -->
 
-<form name="calendar" action="./cgi-bin/mcdcgi.py" method="post">
+<form name="calendar" action="./cgi-bin/mcdcgi.py" method="post"> <!--target="_new">-->
+
+<center>
+<img src="PIA03610_red.jpg" height=80 width=1200>
+</center>
 
 <table align="center" border="1" width="1200" bgcolor="#F5DEB3">
-<tr>
-<td align="center">
-<b>Step 1 : CHOOSE EARTH TIME</b><br />
-Year / Month / Day @ hh:mm:ss [UTC time]<br />
+
+<tr>
+<td align="center">
+<i>Beginners' column (1-click presets)</i>
+</td>
+<td align="center">
+<i>Regular users' column</i>
+</td>
+<td align="center">
+<i>Advanced settings and information</i>
+</td>
+</tr>
+<tr><td align="center"></td><td align="center"></td><td align="center"></td></tr>
+<tr>
+<td align="center">
+<b>1) LANDING DATE</b>
+<input type="radio" name="lander" value="Now!" onClick="DefaultDateValues();DefaultTimeValues();Convert2Ls();PlaceValues(0.0,0.0)" checked>Land now!<br />
+<input type="radio" name="lander" value="Curiosity" onClick="DateAndTimeValues(2012,8,6,05,17,57);Convert2Ls();PlaceValues(137.4,-4.6)">Curiosity
+<input type="radio" name="lander" value="Phoenix" onClick="DateAndTimeValues(2008,5,25,23,38,23);Convert2Ls();PlaceValues(234.25,68.22)">Phoenix<br />
+<input type="radio" name="lander" value="Opportunity" onClick="DateAndTimeValues(2004,1,25,4,55,0);Convert2Ls();PlaceValues(354.47,-1.95)">Opportunity
+<input type="radio" name="lander" value="Spirit" onClick="DateAndTimeValues(2004,1,4,4,26,0);Convert2Ls();PlaceValues(175.48,-14.57)">Spirit
+<input type="radio" name="lander" value="Pathfinder" onClick="DateAndTimeValues(1997,7,4,16,56,55);Convert2Ls();PlaceValues(-33.22,19.13)">Pathfinder <br />
+<input type="radio" name="lander" value="Viking Lander 2" onClick="DateAndTimeValues(1976,9,3,22,58,20);Convert2Ls();PlaceValues(-225.74,47.97)">Viking Lander 2
+<input type="radio" name="lander" value="Viking Lander 1" onClick="DateAndTimeValues(1976,7,20,11,53,6);Convert2Ls();PlaceValues(-49.97,22.48)">Viking Lander 1<br />
+</td>
+<td align="center">
+<b>CUSTOMIZE EARTH TIME</b><br />
+Year / Month / Day @ hh:mm:ss [UTC]<br />
 <input type="text" size="3" name="year"> / <input type="text" size="1" name="month"> / <input type="text" size="1" name="day"> @
 <input type="text" size="1" name="hours">:<input type="text" size="1" name="minutes">:<input type="text" size="1" name="seconds"><br />
@@ -35,11 +63,46 @@
 <tr>
 <td align="center">
-<b>Step 2 : CHOOSE COORDINATES ON MARS</b><br />
+<hr>
+<b>2) TIME</b>
+<input type="radio" name="tata" value="Morning" onClick="PlaceValues2(9.)" checked>Morning
+<input type="radio" name="tata" value="Afternoon" onClick="PlaceValues2(15.)">Afternoon<br />
+<input type="radio" name="tata" value="Evening" onClick="PlaceValues2(21.)">Evening
+<input type="radio" name="tata" value="Night" onClick="PlaceValues2(3.)">Night<br />
+<!--<input type="radio" name="tata" value="Whole day!" onClick="PlaceValues2('all')"><i>Whole day!</i><br />-->
+<hr>
+<b>3) ALTITUDE</b>
+<input type="radio" name="toto" value="Near surface" onClick="PlaceValues3(2.)" checked>Near-surface<br />
+<input type="radio" name="toto" value="Boundary layer" onClick="PlaceValues3(1000.)">Boundary layer
+<input type="radio" name="toto" value="Troposphere" onClick="PlaceValues3(10000.)">Troposphere<br/>
+<input type="radio" name="toto" value="Mesophere" onClick="PlaceValues3(80000.)">Mesosphere<br />
+<!--<input type="radio" name="toto" value="Whole profile!" onClick="PlaceValues3('all')"><i>Whole profile!</i><br />-->
+<hr>
+<!--
+<b>4) COORDINATES</b> Automatic! <br />
+<input type="button" value="... or click here for global map!" onClick="PlaceValues('all','all')"><br />
+-->
+<!--
+<b>4)</b>
+<input type="button" value="Click here for a global map!" onClick="PlaceValues('all','all')"><br />
+-->
+<!--
+<input type="radio" name="titi" value="Global map" onClick="PlaceValues('all','all')">Global map<br />
+<input type="radio" name="toto" value="Vertical profile" onClick="PlaceValues3('all')">Vertical profile
+<input type="radio" name="tata" value="Diurnal cycle" onClick="PlaceValues2('all')">Diurnal cycle<br />
+-->
+</td>
+<td align="center">
+<b>CUSTOMIZE COORDINATES ON MARS</b><br />
 <ul>
+<li>Latitude <input type="text" size="3" name="latitude" value="0."> (write a value or 'all')
+<li>Longitude <input type="text" size="3" name="longitude" value="0."> (write a value or 'all')
+<li>Local Time <input type="text" size="2" name="localtime" value="0."> (write a value or 'all')
+<li>Altitude (m) <input type="text" size="3" name="altitude" value="10."> (write a value or 'all')
+<!--
 <li>Latitude   
 <input type="radio" name="islatfree" value="0" checked> Value: <input type="text" size="2" name="latitude" value="0.">
 <input type="radio" name="islatfree" value="1"> All [-90 ; 90]
 </li>
-<li>Longitude  
+<li>Longitude 
 <input type="radio" name="islonfree" value="0" checked> Value: <input type="text" size="2" name="longitude" value="0.">
 <input type="radio" name="islonfree" value="1"> All [-180 ; 180]
@@ -53,10 +116,11 @@
 <input type="radio" name="isaltfree" value="1"> All [0 ; 100000] m
 </li>
+-->
 </ul>
 </td>
 <td align="center">
-[Advanced settings for well-informed Martians]<br />
+<!--[Advanced settings for well-informed Martians]<br />-->
 <ul>
-<li>Force Martian solar longitude to be <input type="text" size="3" name="ls"> degrees</li> 
+<li>Force Mars solar longitude to be <input type="text" size="3" name="ls"> degrees</li> 
 <li>High resolution topography? <input type="radio" name="hrkey" value="1" checked /> Yes <input type="radio" name="hrkey" value="0" /> No </li>
 <li>Dust scenario? <select name="dust">
@@ -70,14 +134,14 @@
 <option value="8"         >cold scenario (low dust, min solar)</option>
 </select></li>
-<li>Presets
-<!--<input type="button" value="Now!" onClick="DefaultDateValues();DefaultTimeValues();Convert2Ls();">-->
+<!--<li>Presets
+<input type="button" value="Now!" onClick="DefaultDateValues();DefaultTimeValues();Convert2Ls();">
 <input type="button" value="Curiosity" onClick="DateAndTimeValues(2012,8,6,05,30,00);Convert2Ls();PlaceValues(137.4,-4.6)">
 <input type="button" value="Phoenix" onClick="DateAndTimeValues(2008,5,25,23,38,23);Convert2Ls();PlaceValues(234.25,68.22)">
 <input type="button" value="Opportunity" onClick="DateAndTimeValues(2004,1,25,4,55,0);Convert2Ls();PlaceValues(354.47,-1.95)">
-<input type="button" value="Spirit" onClick="DateAndTimeValues(2004,1,4,4,26,0);Convert2Ls();PlaceValues(175.48,-14.57)"><br />
+<input type="button" value="Spirit" onClick="DateAndTimeValues(2004,1,4,4,26,0);Convert2Ls();PlaceValues(175.48,-14.57)">
 <input type="button" value="Pathfinder" onClick="DateAndTimeValues(1997,7,4,16,56,55);Convert2Ls();PlaceValues(-33.22,19.13)">
 <input type="button" value="Viking Lander 2" onClick="DateAndTimeValues(1976,9,3,22,58,20);Convert2Ls();PlaceValues(-225.74,47.97)">
 <input type="button" value="Viking Lander 1" onClick="DateAndTimeValues(1976,7,20,11,53,6);Convert2Ls();PlaceValues(-49.97,22.48)">
-</li>
+</li>-->
 </ul>
 </td>
@@ -85,8 +149,173 @@
 <tr>
 <td align="center">
-<b>Step 3 : </b> <input type="submit" value="SUBMIT" style="font-weight:bold"/>
-</td>
-<td align="center">
-Based on the <a href="http://www-mars.lmd.jussieu.fr">Mars Climate Database</a> (c) LMD/OU/IAA/ESA/CNES.
+<b>4) INTEREST</b>
+<input type="radio" name="yeah" value="Atmosphere" onClick="PlaceVar('t','p','none','none')" checked>Atmosphere<br />
+<input type="radio" name="yeah" value="Winds" onClick="PlaceVar('u','v','none','none')">Winds
+<input type="radio" name="yeah" value="Weather" onClick="PlaceVar('ps_ddv','t','none','none')">Weather<br />
+<input type="radio" name="yeah" value="Water clouds" onClick="PlaceVar('h2ovap','mtot','h2oice','icetot')">Water clouds
+<input type="radio" name="yeah" value="Chemistry" onClick="PlaceVar('o3','h2ovap','o','co')">Chemistry<br />
+<input type="radio" name="yeah" value="Landing engineering" onClick="PlaceVar('rho','rho_ddv','cp','visc')">Landing engineering<br />
+<input type="radio" name="yeah" value="Glaciology" onClick="PlaceVar('tsurfmn','tsurfmx','co2ice','icetot')">Glaciology
+<input type="radio" name="yeah" value="Surface meteorology" onClick="PlaceVar('ps','tsurf','none','none')">Surface meteorology<br />
+<input type="radio" name="yeah" value="Radiative balance" onClick="PlaceVar('lwdown','swdown','lwup','swup')">Radiative balance<br />
+<!--<input type="button" value="Surface data" onClick="PlaceVar('ps','tsurf','none','none')">-->
+</td>
+<td align="center">
+<b>CUSTOMIZE VARIABLE(S) TO BE DISPLAYED</b><br />
+<br />
+Variable 1 <select name="var1">
+<option value="t"     selected>Temperature (K)</option>
+<option value="p"             >Pressure (Pa)</option>
+<option value="rho"           >Density (kg/m3)</option>
+<option value="u"             >W-E wind component (m/s)</option>
+<option value="v"             >S-N wind component (m/s)</option>
+<option value="tsurf"         >Surface temperature (K)</option>
+<option value="ps"            >Surface pressure (Pa)</option>
+<option value="mtot"          >Water vapor column (kg/m2)</option>
+<option value="icetot"        >Water ice column (kg/m2)</option>
+<option value="h2ovap"        >Water vapor vol. mixing ratio (mol/mol)</option>
+<option value="h2oice"        >Water ice mixing ratio (mol/mol)</option>
+<option value="ps_ddv"        >Surface pressure DTD RMS (Pa)</option>
+<option value="co2ice"        >surface CO2 ice layer (kg/m2)</option>
+<option value="cp"            >Air heat capacity Cp (J kg-1 K-1)</option>
+<option value="rho_ddv"       >density DTD RMS (kg/m^3)</option>
+<option value="tsurfmx"       >daily max mean surf temperature (K)</option>
+<option value="tsurfmn"       >daily min mean surf temperature (K)</option>
+<option value="lwdown"        >thermal IR flux to surface (W/m2)</option>
+<option value="swdown"        >solar flux to surface (W/m2)</option>
+<option value="lwup"          >thermal IR flux to space (W/m2)</option>
+<option value="swup"          >solar flux reflected to space (W/m2)</option>
+<option value="o3"            >O3 ozone vol. mixing ratio (mol/mol)</option>
+<option value="o"             >[O] vol. mixing ratio (mol/mol)</option>
+<option value="co"            >[CO] vol. mixing ratio (mol/mol)</option>
+<option value="visc"          >Air viscosity estimation (N s m-2)</option>
+</select>
+<br />
+Variable 2 <select name="var2">
+<option value="none"          >(None)</option>
+<option value="t"             >Temperature (K)</option>
+<option value="p"     selected>Pressure (Pa)</option>
+<option value="rho"           >Density (kg/m3)</option>
+<option value="u"             >W-E wind component (m/s)</option>
+<option value="v"             >S-N wind component (m/s)</option>
+<option value="tsurf"         >Surface temperature (K)</option>
+<option value="ps"            >Surface pressure (Pa)</option>
+<option value="mtot"          >Water vapor column (kg/m2)</option>
+<option value="icetot"        >Water ice column (kg/m2)</option>
+<option value="h2ovap"        >Water vapor vol. mixing ratio (mol/mol)</option>
+<option value="h2oice"        >Water ice mixing ratio (mol/mol)</option>
+<option value="ps_ddv"        >Surface pressure DTD RMS (Pa)</option>
+<option value="co2ice"        >surface CO2 ice layer (kg/m2)</option>
+<option value="cp"            >Air heat capacity Cp (J kg-1 K-1)</option>
+<option value="rho_ddv"       >density DTD RMS (kg/m^3)</option>
+<option value="tsurfmx"       >daily max mean surf temperature (K)</option>
+<option value="tsurfmn"       >daily min mean surf temperature (K)</option>
+<option value="lwdown"        >thermal IR flux to surface (W/m2)</option>
+<option value="swdown"        >solar flux to surface (W/m2)</option>
+<option value="lwup"          >thermal IR flux to space (W/m2)</option>
+<option value="swup"          >solar flux reflected to space (W/m2)</option>
+<option value="o3"            >O3 ozone vol. mixing ratio (mol/mol)</option>
+<option value="o"             >[O] vol. mixing ratio (mol/mol)</option>
+<option value="co"            >[CO] vol. mixing ratio (mol/mol)</option>
+<option value="visc"          >Air viscosity estimation (N s m-2)</option>
+</select>
+<br />
+Variable 3 <select name="var3">
+<option value="none"  selected>(None)</option>
+<option value="t"             >Temperature (K)</option>
+<option value="p"             >Pressure (Pa)</option>
+<option value="rho"           >Density (kg/m3)</option>
+<option value="u"             >W-E wind component (m/s)</option>
+<option value="v"             >S-N wind component (m/s)</option>
+<option value="tsurf"         >Surface temperature (K)</option>
+<option value="ps"            >Surface pressure (Pa)</option>
+<option value="mtot"          >Water vapor column (kg/m2)</option>
+<option value="icetot"        >Water ice column (kg/m2)</option>
+<option value="h2ovap"        >Water vapor vol. mixing ratio (mol/mol)</option>
+<option value="h2oice"        >Water ice mixing ratio (mol/mol)</option>
+<option value="ps_ddv"        >Surface pressure DTD RMS (Pa)</option>
+<option value="co2ice"        >surface CO2 ice layer (kg/m2)</option>
+<option value="cp"            >Air heat capacity Cp (J kg-1 K-1)</option>
+<option value="rho_ddv"       >density DTD RMS (kg/m^3)</option>
+<option value="tsurfmx"       >daily max mean surf temperature (K)</option>
+<option value="tsurfmn"       >daily min mean surf temperature (K)</option>
+<option value="lwdown"        >thermal IR flux to surface (W/m2)</option>
+<option value="swdown"        >solar flux to surface (W/m2)</option>
+<option value="lwup"          >thermal IR flux to space (W/m2)</option>
+<option value="swup"          >solar flux reflected to space (W/m2)</option>
+<option value="o3"            >O3 ozone vol. mixing ratio (mol/mol)</option>
+<option value="o"             >[O] vol. mixing ratio (mol/mol)</option>
+<option value="co"            >[CO] vol. mixing ratio (mol/mol)</option>
+<option value="visc"          >Air viscosity estimation (N s m-2)</option>
+</select>
+<br />
+Variable 4 <select name="var4">
+<option value="none"  selected>(None)</option>
+<option value="t"             >Temperature (K)</option>
+<option value="p"             >Pressure (Pa)</option>
+<option value="rho"           >Density (kg/m3)</option>
+<option value="u"             >W-E wind component (m/s)</option>
+<option value="v"             >S-N wind component (m/s)</option>
+<option value="tsurf"         >Surface temperature (K)</option>
+<option value="ps"            >Surface pressure (Pa)</option>
+<option value="mtot"          >Water vapor column (kg/m2)</option>
+<option value="icetot"        >Water ice column (kg/m2)</option>
+<option value="h2ovap"        >Water vapor vol. mixing ratio (mol/mol)</option>
+<option value="h2oice"        >Water ice mixing ratio (mol/mol)</option>
+<option value="ps_ddv"        >Surface pressure DTD RMS (Pa)</option>
+<option value="co2ice"        >surface CO2 ice layer (kg/m2)</option>
+<option value="cp"            >Air heat capacity Cp (J kg-1 K-1)</option>
+<option value="rho_ddv"       >density DTD RMS (kg/m^3)</option>
+<option value="tsurfmx"       >daily max mean surf temperature (K)</option>
+<option value="tsurfmn"       >daily min mean surf temperature (K)</option>
+<option value="lwdown"        >thermal IR flux to surface (W/m2)</option>
+<option value="swdown"        >solar flux to surface (W/m2)</option>
+<option value="lwup"          >thermal IR flux to space (W/m2)</option>
+<option value="swup"          >solar flux reflected to space (W/m2)</option>
+<option value="o3"            >O3 ozone vol. mixing ratio (mol/mol)</option>
+<option value="o"             >[O] vol. mixing ratio (mol/mol)</option>
+<option value="co"            >[CO] vol. mixing ratio (mol/mol)</option>
+<option value="visc"          >Air viscosity estimation (N s m-2)</option>
+</select>
+</td>
+<td align="center">
+<!--[Additional settings]<br />-->
+<ul>
+<li> Add wind vectors
+<input type="radio" name="iswind" value="off" checked /> No
+<input type="radio" name="iswind" value="on"          /> Yes</li>  
+<li> Set same LT on whole planet
+<input type="radio" name="isfixedlt" value="off" checked /> No
+<input type="radio" name="isfixedlt" value="on"          /> Yes</li>
+<!--
+<li> Add another variable 
+<input type="radio" name="superimposed" value="0" checked /> side-by-side
+<input type="radio" name="superimposed" value="1"         /> superimposed</li> 
+-->
+<!--
+<li>
+Presets
+<input type="button" value="Usual meteorology" onClick="PlaceVar('p','t','u','v')">
+<input type="button" value="Surface data" onClick="PlaceVar('ps','tsurf','none','none')">
+<input type="button" value="Water cycle" onClick="PlaceVar('mtot','icetot','none','none')">
+</select>
+-->
+</li>
+</ul>
+</td>
+</tr>
+<tr>
+<td align="center">
+<input type="submit" value="Values" style="font-weight:bold" />
+<input type="submit" value="Daily cycle" style="font-weight:bold" onClick="PlaceValues2('all')"/><br />
+<input type="submit" value="Vertical profile" style="font-weight:bold" onClick="PlaceValues3('all')"/>
+<input type="submit" value="Global map" style="font-weight:bold" onClick="PlaceValues('all','all')"/><br />
+</td>
+<td align="center">
+<input type="submit" value="SUBMIT" style="font-weight:bold"/>
+</td>
+<td align="center">
+<a href="http://www-mars.lmd.jussieu.fr">Mars Climate Database</a> (c) LMD/OU/IAA/ESA/CNES.<br />
+Interface by Aymeric Spiga (LMD).<br />
 </td>
 </tr>
Index: trunk/UTIL/PYTHON/mcd/proto/martian_time.js
===================================================================
--- trunk/UTIL/PYTHON/mcd/proto/martian_time.js	(revision 760)
+++ trunk/UTIL/PYTHON/mcd/proto/martian_time.js	(revision 761)
@@ -367,5 +367,85 @@
 var lon;
 var lat;
+var savlon;
+var savlat;
+var yeah;
+savlon=document.calendar.longitude.value;
+savlat=document.calendar.latitude.value;
 document.calendar.longitude.value=lon;
 document.calendar.latitude.value=lat;
-}
+yeah=document.calendar.toto.value;
+// to be improved. lon and lat should be separated. but for the moment
+// only mapping capabilities exist as 2D plots which means if lon is all
+// lat is all and vice versa.
+if ( document.calendar.longitude.value == "all") {
+ if ( document.calendar.altitude.value == "all") {
+    alert("Not allowed! Altitude and time must be fixed in mapping mode.");
+    document.calendar.longitude.value=savlon;
+    document.calendar.latitude.value=savlat;
+    document.calendar.toto.value=yeah;
+ }
+ if ( document.calendar.localtime.value == "all") {
+    alert("Not allowed! Altitude and time must be fixed in mapping mode.");
+    document.calendar.longitude.value=savlon;
+    document.calendar.latitude.value=savlat;
+    document.calendar.toto.value=yeah;
+ }
+}
+}
+
+function PlaceVar(var1,var2,var3,var4){
+var var1;
+var var2;
+var var3;
+var var4;
+document.calendar.var1.value=var1;
+document.calendar.var2.value=var2;
+document.calendar.var3.value=var3;
+document.calendar.var4.value=var4;
+}
+
+function DefaultSpaceTime(){
+document.calendar.localtime.value = 9
+document.calendar.altitude.value = 2
+}
+
+// this is separated from PlaceValues because
+// allows easier determination through earth time
+// if needed (e.g. example case with rovers)
+function PlaceValues2(localtime){
+var localtime;
+var savlocaltime;
+savlocaltime=document.calendar.localtime.value
+document.calendar.localtime.value=localtime;
+if ( document.calendar.localtime.value == "all" ) {
+ if ( document.calendar.altitude.value == "all" ) {
+    alert("Not allowed! Now choose either a fixed altitude or a fixed time.");
+    //document.calendar.localtime.value=savlocaltime;
+ }
+}
+if ( document.calendar.localtime.value == "all" ) {
+ if ( document.calendar.longitude.value == "all" ) {
+    alert("Not allowed! Now choose either a lander or a fixed time.");
+    //document.calendar.localtime.value=savlocaltime;
+ }
+}
+}
+function PlaceValues3(altitude){
+var altitude;
+var savaltitude;
+savaltitude=document.calendar.altitude.value
+document.calendar.altitude.value=altitude;
+if ( document.calendar.altitude.value == "all" ) {
+ if ( document.calendar.localtime.value == "all") {
+    alert("Not allowed! Now choose either a fixed time or a fixed altitude.");
+    //document.calendar.altitude.value=savaltitude;
+ }
+}
+if ( document.calendar.altitude.value == "all" ) {
+ if ( document.calendar.longitude.value == "all") {
+    alert("Not allowed! Now choose either a lander or a fixed altitude.");
+    //document.calendar.altitude.value=savaltitude;
+ }
+}
+}
+
