Changeset 761 for trunk/UTIL
- Timestamp:
- Aug 19, 2012, 12:19:59 AM (12 years ago)
- Location:
- trunk/UTIL/PYTHON/mcd
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/mcd/mcd.py
r723 r761 60 60 def getextvarlab(self,num): 61 61 whichfield = { \ 62 91: "Pressure (Pa)", \ 63 92: "Density (kg/m3)", \ 64 93: "Temperature (K)", \ 65 94: "W-E wind component (m/s)", \ 66 95: "S-N wind component (m/s)", \ 62 67 1: "Radial distance from planet center (m)",\ 63 68 2: "Altitude above areoid (Mars geoid) (m)",\ … … 111 116 50: "Air viscosity estimation (N s m-2)" 112 117 } 113 if num not in whichfield: errormess("Incorrect subscript in extvar.")118 if num not in whichfield: myplot.errormess("Incorrect subscript in extvar.") 114 119 return whichfield[num] 120 121 def convertlab(self,num): 122 ## a conversion from text inquiries to extvar numbers. to be completed. 123 if num == "p": num = 91 124 elif num == "rho": num = 92 125 elif num == "t": num = 93 126 elif num == "u": num = 94 127 elif num == "v": num = 95 128 elif num == "tsurf": num = 15 129 elif num == "topo": num = 4 130 elif num == "h": num = 13 131 elif num == "ps": num = 19 132 elif num == "tau": num = 36 133 elif num == "mtot": num = 40 134 elif num == "icetot": num = 42 135 elif num == "ps_ddv": num = 22 136 elif num == "h2ovap": num = 41 137 elif num == "h2oice": num = 43 138 elif num == "cp": num = 8 139 elif num == "rho_ddv": num = 10 140 elif num == "tsurfmx": num = 16 141 elif num == "tsurfmn": num = 17 142 elif num == "lwdown": num = 31 143 elif num == "swdown": num = 32 144 elif num == "lwup": num = 33 145 elif num == "swup": num = 34 146 elif num == "o3": num = 44 147 elif num == "o": num = 46 148 elif num == "co": num = 48 149 elif num == "visc": num = 50 150 elif num == "co2ice": num = 35 151 elif not isinstance(num, np.int): myplot.errormess("field reference not found.") 152 return num 115 153 116 154 ################### … … 126 164 self.datekey,self.xdate,self.loct,self.dset,self.dust, \ 127 165 self.perturkey,self.seedin,self.gwlength,self.extvarkey ) 166 ## we use the end of extvar (unused) to store meanvar. this is convenient for getextvar(lab) 167 self.extvar[90] = self.pres ; self.extvar[91] = self.dens 168 self.extvar[92] = self.temp ; self.extvar[93] = self.zonwind ; self.extvar[94] = self.merwind 128 169 129 170 def printset(self): … … 139 180 def printcoord(self): 140 181 # print requested space-time coordinates 141 print "----------------------------------------------------------------"142 182 print "LAT",self.lat,"LON",self.lon,"LOCT",self.loct,"XDATE",self.xdate 143 print "----------------------------------------------------------------"144 183 145 184 def printmeanvar(self): … … 153 192 def printextvar(self,num): 154 193 # print extra MCD variables 155 print self.getextvarlab(num) + " ---> " + str(self.extvar[num-1]) 194 num = self.convertlab(num) 195 print self.getextvarlab(num) + " ..... " + str(self.extvar[num-1]) 156 196 157 197 def printallextvar(self): 158 198 # print all extra MCD variables 159 199 for i in range(50): self.printextvar(i+1) 200 201 def htmlprinttabextvar(self,tabtodo): 202 print "Results from the Mars Climate Database" 203 print "<ul>" 204 for i in range(len(tabtodo)): print "<li>" ; self.printextvar(tabtodo[i]) ; print "</li>" 205 print "</ul>" 206 print "<hr>" 207 print "SETTINGS<br />" 208 self.printcoord() 209 self.printset() 160 210 161 211 def printmcd(self): … … 163 213 self.update() 164 214 self.printcoord() 215 print "-------------------------------------------" 165 216 self.printmeanvar() 166 217 … … 187 238 def definefield(self,choice): 188 239 ### for analysis or plot purposes, set field and field label from user-defined choice 189 ### --- choice can be a MCD number for extvar 190 if isinstance(choice, np.int): field = self.getextvar(choice); fieldlab = self.getextvarlab(choice) 191 else: 192 if choice == "t": field = self.temptab ; fieldlab="Temperature (K)" 193 elif choice == "p": field = self.prestab ; fieldlab="Pressure (Pa)" 194 elif choice == "rho": field = self.denstab ; fieldlab="Density (kg/m3)" 195 elif choice == "u": field = self.zonwindtab ; fieldlab="W-E wind component (m/s)" 196 elif choice == "v": field = self.merwindtab ; fieldlab="S-N wind component (m/s)" 197 elif choice == "tsurf": field = self.getextvar(15); fieldlab="Surface temperature (K)" 198 elif choice == "topo": field = self.getextvar(4) ; fieldlab="Topography (m)" 199 elif choice == "h": field = self.getextvar(13); fieldlab = "Scale height (m)" 200 elif choice == "ps": field = self.getextvar(19); fieldlab = "Surface pressure (Pa)" 201 elif choice == "olr": field = self.getextvar(33); fieldlab = "Outgoing longwave radiation (W/m2)" 202 elif choice == "tau": field = self.getextvar(36); fieldlab = "Dust optical depth" 203 elif choice == "mtot": field = self.getextvar(40); fieldlab = "Water vapor column (kg/m2)" 204 elif choice == "icetot": field = self.getextvar(42); fieldlab = "Water ice column (kg/m2)" 205 elif choice == "ps_ddv": field = self.getextvar(22); fieldlab = "Surface pressure RMS day to day variations (Pa)" 206 else: errormess("field reference not found.") 240 choice = self.convertlab(choice) 241 field = self.getextvar(choice); fieldlab = self.getextvarlab(choice) 207 242 return field,fieldlab 208 243 … … 214 249 ## fill in subscript i in output arrays 215 250 ## (arrays must have been correctly defined through prepare) 216 if self.prestab is None: errormess("arrays must be prepared first through self.prepare")251 if self.prestab is None: myplot.errormess("arrays must be prepared first through self.prepare") 217 252 self.prestab[i] = self.pres ; self.denstab[i] = self.dens ; self.temptab[i] = self.temp 218 253 self.zonwindtab[i] = self.zonwind ; self.merwindtab[i] = self.merwind … … 238 273 for i in range(nd): self.lat = self.xcoord[i] ; self.update() ; self.put1d(i) 239 274 240 def profile(self,nd=20,start=0.,end=1 00000.,tabperso=None):275 def profile(self,nd=20,start=0.,end=120000.,tabperso=None): 241 276 ### retrieve an altitude slice (profile) 242 277 self.xlabel = "Altitude (m)" … … 253 288 for i in range(nd): self.xdate = self.xcoord[i] ; self.update() ; self.put1d(i) 254 289 255 def latlon(self,ndx=37,startx=-180.,endx=180.,ndy=19,starty=-90.,endy=90.):256 ### retrieve a latitude/longitude slice257 self.xlabel = "East longitude (degrees)" ; self.ylabel = "North latitude (degrees)"258 self.prepare(ndx=ndx,ndy=ndy)259 self.xcoord = np.linspace(startx,endx,ndx) ; self.ycoord = np.linspace(starty,endy,ndy)260 for i in range(ndx):261 for j in range(ndy):262 self.lon = self.xcoord[i] ; self.lat = self.ycoord[j] ; self.update() ; self.put2d(i,j)263 264 290 def makeplot1d(self,choice,vertplot=0): 265 291 ### one 1D plot is created for the user-defined variable in choice. … … 268 294 else: ordo = self.xcoord ; absc = field ; absclab = fieldlab ; ordolab = self.xlabel 269 295 mpl.plot(absc,ordo,'-bo') ; mpl.ylabel(ordolab) ; mpl.xlabel(absclab) #; mpl.xticks(query.xcoord) 296 mpl.figtext(0.5, 0.01, "Mars Climate Database (c) LMD/OU/IAA/ESA/CNES", ha='center') 270 297 271 298 def plot1d(self,tabtodo,vertplot=0): … … 280 307 ################### 281 308 309 def latlon(self,ndx=37,startx=-180.,endx=180.,ndy=19,starty=-90.,endy=90.,fixedlt=False): 310 ### retrieve a latitude/longitude slice 311 ### default is: local time is not fixed. user-defined local time is at longitude 0. 312 self.xlabel = "East longitude (degrees)" ; self.ylabel = "North latitude (degrees)" 313 self.prepare(ndx=ndx,ndy=ndy) 314 self.xcoord = np.linspace(startx,endx,ndx) ; self.ycoord = np.linspace(starty,endy,ndy) 315 if not fixedlt: umst = self.loct 316 for i in range(ndx): 317 for j in range(ndy): 318 self.lon = self.xcoord[i] ; self.lat = self.ycoord[j] 319 if not fixedlt: self.loct = (umst + self.lon/15.) % 24 320 self.update() ; self.put2d(i,j) 321 if not fixedlt: self.loct = umst 322 282 323 def put2d(self,i,j): 283 324 ## fill in subscript i,j in output arrays 284 325 ## (arrays must have been correctly defined through prepare) 285 if self.prestab is None: errormess("arrays must be prepared first through self.prepare")326 if self.prestab is None: myplot.errormess("arrays must be prepared first through self.prepare") 286 327 self.prestab[i,j] = self.pres ; self.denstab[i,j] = self.dens ; self.temptab[i,j] = self.temp 287 328 self.zonwindtab[i,j] = self.zonwind ; self.merwindtab[i,j] = self.merwind … … 289 330 self.extvartab[i,j,1:100] = self.extvar[0:99] ## note: var numbering according to MCD manual is kept 290 331 291 def makemap2d(self,choice,incwind=False ):332 def makemap2d(self,choice,incwind=False,fixedlt=False): 292 333 ### one 2D map is created for the user-defined variable in choice. 293 self.latlon( ) ## a map is implicitely a lat-lon plot. otherwise it is a plot (cf. makeplot2d)334 self.latlon(fixedlt=fixedlt) ## a map is implicitely a lat-lon plot. otherwise it is a plot (cf. makeplot2d) 294 335 (field, fieldlab) = self.definefield(choice) 295 336 if incwind: … … 299 340 else: 300 341 myplot.maplatlon(self.xcoord,self.ycoord,field,title=fieldlab,proj="moll") 301 302 def map2d(self,tabtodo,incwind=False): 342 mpl.figtext(0.5, 0.0, "Mars Climate Database (c) LMD/OU/IAA/ESA/CNES", ha='center') 343 344 def map2d(self,tabtodo,incwind=False,fixedlt=False): 303 345 ### complete 2D figure with possible multiplots 304 346 if isinstance(tabtodo,np.str): tabtodo=[tabtodo] ## so that asking one element without [] is possible. 305 347 if isinstance(tabtodo,np.int): tabtodo=[tabtodo] ## so that asking one element without [] is possible. 306 348 fig = mpl.figure() ; subv,subh = myplot.definesubplot( len(tabtodo) , fig ) 307 for i in range(len(tabtodo)): mpl.subplot(subv,subh,i+1) ; self.makemap2d(tabtodo[i],incwind=incwind )308 309 ### TODO: makeplot2d, plot2d, passer plot settings , vecteurs, plot loct pas fixe310 349 for i in range(len(tabtodo)): mpl.subplot(subv,subh,i+1) ; self.makemap2d(tabtodo[i],incwind=incwind,fixedlt=fixedlt) 350 351 ### TODO: makeplot2d, plot2d, passer plot settings 352 -
trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py
r639 r761 4 4 ################################################## 5 5 ### A Python CGI for the Mars Climate Database ### 6 ### ------------------------------------------ -###7 ### Aymeric SPIGA 18-19/04/2012 8 ### ------------------------------------------ -###6 ### ------------------------------------------ ### 7 ### Aymeric SPIGA 18-19/04/2012 ~ 11/08/2012 ### 8 ### ------------------------------------------ ### 9 9 ### (see mcdtest.py for examples of use) ### 10 10 ################################################## … … 27 27 query = mcd() 28 28 29 # Get data from user-defined fields 30 query.lat = float(form.getvalue("latitude")) 31 query.lon = float(form.getvalue("longitude")) 32 query.loct = float(form.getvalue("localtime")) 29 # Get data from user-defined fields and define free dimensions 30 getlat = form.getvalue("latitude") 31 if getlat == "all": islatfree = 1 ; query.lat = -9999. 32 else: islatfree = 0 ; query.lat = float(getlat) 33 getlon = form.getvalue("longitude") 34 if getlon == "all": islonfree = 1 ; query.lon = -9999. 35 else: islonfree = 0 ; query.lon = float(getlon) 36 getloct = form.getvalue("localtime") 37 if getloct == "all": isloctfree = 1 ; query.loct = -9999. 38 else: isloctfree = 0 ; query.loct = float(getloct) 39 getalt = form.getvalue("altitude") 40 if getalt == "all": isaltfree = 1 ; query.xz = -9999. 41 else: isaltfree = 0 ; query.xz = float(getalt) 42 sumfree = islatfree + islonfree + isloctfree + isaltfree 43 if sumfree > 2: exit() ## only 1D or 2D plots for the moment 33 44 query.xdate = float(form.getvalue("ls")) 34 query.xz = float(form.getvalue("altitude"))35 45 query.hrkey = int(form.getvalue("hrkey")) 36 46 query.dust = int(form.getvalue("dust")) … … 40 50 # self.gwlength = 0. #gravity Wave wavelength (unused if perturkey=0) 41 51 42 # Get free dimensions 43 islatfree = float(form.getvalue("islatfree")) 44 islonfree = float(form.getvalue("islonfree")) 45 isloctfree = float(form.getvalue("isloctfree")) 46 isaltfree = float(form.getvalue("isaltfree")) 47 sumfree = islatfree + islonfree + isloctfree + isaltfree 48 if sumfree > 2: exit() ## only 1D or 2D plots for the moment 52 # Get variables to plot 53 var1 = form.getvalue("var1") 54 var2 = form.getvalue("var2") 55 var3 = form.getvalue("var3") 56 var4 = form.getvalue("var4") 57 vartoplot = [var1] 58 if var2 != "none": vartoplot = np.append(vartoplot,var2) 59 if var3 != "none": vartoplot = np.append(vartoplot,var3) 60 if var4 != "none": vartoplot = np.append(vartoplot,var4) 61 iswind = form.getvalue("iswind") 62 if iswind == "on": iswindlog = True 63 else: iswindlog = False 64 isfixedlt = form.getvalue("isfixedlt") 65 if isfixedlt == "on": input_fixedlt=True 66 else: input_fixedlt=False 49 67 50 68 # reference name (to test which figures are already in the database) 51 reference = str(islatfree)+str(islonfree)+str(isloctfree)+str(isaltfree)+query.getnameset() 69 reference = str(islatfree)+str(islonfree)+str(isloctfree)+str(isaltfree)+query.getnameset()+str(var1)+str(var2)+str(var3)+str(var4)+str(iswind)+str(isfixedlt) 52 70 figname = 'img/'+reference+'.jpg' 53 71 testexist = daos.path.isfile(figname) … … 67 85 68 86 ### generic building of figure 69 query.plot1d(["t","p","u","v"],vertplot=isaltfree) 87 #query.plot1d(["t","p","u","v"],vertplot=isaltfree) 88 query.plot1d(vartoplot,vertplot=isaltfree) 70 89 mpl.savefig("img/temp.png",dpi=85,bbox_inches='tight',pad_inches=0.25) 71 90 Image.open("img/temp.png").save(figname,'JPEG') … … 77 96 if islatfree == 1 and islonfree == 1: query.latlon() 78 97 else: exit() 79 80 query.map2d(["t","u"]) 98 99 ### figure 100 query.map2d(vartoplot,incwind=iswindlog,fixedlt=input_fixedlt) 81 101 mpl.savefig("img/temp.png",dpi=110,bbox_inches='tight',pad_inches=0.4) 82 102 Image.open("img/temp.png").save(figname,'JPEG') ##lighter images … … 92 112 93 113 ## Now the part which differs 94 if sumfree == 0: query.update() ; query. printmeanvar()114 if sumfree == 0: query.update() ; query.htmlprinttabextvar(vartoplot) #query.printmeanvar() 95 115 elif sumfree >= 1: print "<img src='../"+figname+"'><br />" 96 116 else: exit() 97 117 98 118 ## This is quite common 99 print "Based on the <a href='http://www-mars.lmd.jussieu.fr'>Mars Climate Database</a> (c) LMD/OU/IAA/ESA/CNES.<br />"119 #print "Based on the <a href='http://www-mars.lmd.jussieu.fr'>Mars Climate Database</a> (c) LMD/OU/IAA/ESA/CNES.<br />" 100 120 print "<hr>" 101 query.printset() 121 print "<a href='../index.html'>Click here to start a new query</a>." 122 #query.printset() 123 print "<hr>" 102 124 print "</body>" 103 125 print "</html>" -
trunk/UTIL/PYTHON/mcd/proto/index.html
r760 r761 11 11 </head> 12 12 13 <body onload="DefaultDateValues();DefaultTimeValues();Convert2Ls();PlaceValues(0.,0.) ">13 <body onload="DefaultDateValues();DefaultTimeValues();Convert2Ls();PlaceValues(0.,0.);DefaultSpaceTime()"> 14 14 15 15 <!-- aussi possible: get a la place de post. pour avoir un beau lien --> 16 16 17 <form name="calendar" action="./cgi-bin/mcdcgi.py" method="post"> 17 <form name="calendar" action="./cgi-bin/mcdcgi.py" method="post"> <!--target="_new">--> 18 19 <center> 20 <img src="PIA03610_red.jpg" height=80 width=1200> 21 </center> 18 22 19 23 <table align="center" border="1" width="1200" bgcolor="#F5DEB3"> 20 <tr> 21 <td align="center"> 22 <b>Step 1 : CHOOSE EARTH TIME</b><br /> 23 Year / Month / Day @ hh:mm:ss [UTC time]<br /> 24 25 <tr> 26 <td align="center"> 27 <i>Beginners' column (1-click presets)</i> 28 </td> 29 <td align="center"> 30 <i>Regular users' column</i> 31 </td> 32 <td align="center"> 33 <i>Advanced settings and information</i> 34 </td> 35 </tr> 36 <tr><td align="center"></td><td align="center"></td><td align="center"></td></tr> 37 <tr> 38 <td align="center"> 39 <b>1) LANDING DATE</b> 40 <input type="radio" name="lander" value="Now!" onClick="DefaultDateValues();DefaultTimeValues();Convert2Ls();PlaceValues(0.0,0.0)" checked>Land now!<br /> 41 <input type="radio" name="lander" value="Curiosity" onClick="DateAndTimeValues(2012,8,6,05,17,57);Convert2Ls();PlaceValues(137.4,-4.6)">Curiosity 42 <input type="radio" name="lander" value="Phoenix" onClick="DateAndTimeValues(2008,5,25,23,38,23);Convert2Ls();PlaceValues(234.25,68.22)">Phoenix<br /> 43 <input type="radio" name="lander" value="Opportunity" onClick="DateAndTimeValues(2004,1,25,4,55,0);Convert2Ls();PlaceValues(354.47,-1.95)">Opportunity 44 <input type="radio" name="lander" value="Spirit" onClick="DateAndTimeValues(2004,1,4,4,26,0);Convert2Ls();PlaceValues(175.48,-14.57)">Spirit 45 <input type="radio" name="lander" value="Pathfinder" onClick="DateAndTimeValues(1997,7,4,16,56,55);Convert2Ls();PlaceValues(-33.22,19.13)">Pathfinder <br /> 46 <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 47 <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 /> 48 </td> 49 <td align="center"> 50 <b>CUSTOMIZE EARTH TIME</b><br /> 51 Year / Month / Day @ hh:mm:ss [UTC]<br /> 24 52 <input type="text" size="3" name="year"> / <input type="text" size="1" name="month"> / <input type="text" size="1" name="day"> @ 25 53 <input type="text" size="1" name="hours">:<input type="text" size="1" name="minutes">:<input type="text" size="1" name="seconds"><br /> … … 35 63 <tr> 36 64 <td align="center"> 37 <b>Step 2 : CHOOSE COORDINATES ON MARS</b><br /> 65 <hr> 66 <b>2) TIME</b> 67 <input type="radio" name="tata" value="Morning" onClick="PlaceValues2(9.)" checked>Morning 68 <input type="radio" name="tata" value="Afternoon" onClick="PlaceValues2(15.)">Afternoon<br /> 69 <input type="radio" name="tata" value="Evening" onClick="PlaceValues2(21.)">Evening 70 <input type="radio" name="tata" value="Night" onClick="PlaceValues2(3.)">Night<br /> 71 <!--<input type="radio" name="tata" value="Whole day!" onClick="PlaceValues2('all')"><i>Whole day!</i><br />--> 72 <hr> 73 <b>3) ALTITUDE</b> 74 <input type="radio" name="toto" value="Near surface" onClick="PlaceValues3(2.)" checked>Near-surface<br /> 75 <input type="radio" name="toto" value="Boundary layer" onClick="PlaceValues3(1000.)">Boundary layer 76 <input type="radio" name="toto" value="Troposphere" onClick="PlaceValues3(10000.)">Troposphere<br/> 77 <input type="radio" name="toto" value="Mesophere" onClick="PlaceValues3(80000.)">Mesosphere<br /> 78 <!--<input type="radio" name="toto" value="Whole profile!" onClick="PlaceValues3('all')"><i>Whole profile!</i><br />--> 79 <hr> 80 <!-- 81 <b>4) COORDINATES</b> Automatic! <br /> 82 <input type="button" value="... or click here for global map!" onClick="PlaceValues('all','all')"><br /> 83 --> 84 <!-- 85 <b>4)</b> 86 <input type="button" value="Click here for a global map!" onClick="PlaceValues('all','all')"><br /> 87 --> 88 <!-- 89 <input type="radio" name="titi" value="Global map" onClick="PlaceValues('all','all')">Global map<br /> 90 <input type="radio" name="toto" value="Vertical profile" onClick="PlaceValues3('all')">Vertical profile 91 <input type="radio" name="tata" value="Diurnal cycle" onClick="PlaceValues2('all')">Diurnal cycle<br /> 92 --> 93 </td> 94 <td align="center"> 95 <b>CUSTOMIZE COORDINATES ON MARS</b><br /> 38 96 <ul> 97 <li>Latitude <input type="text" size="3" name="latitude" value="0."> (write a value or 'all') 98 <li>Longitude <input type="text" size="3" name="longitude" value="0."> (write a value or 'all') 99 <li>Local Time <input type="text" size="2" name="localtime" value="0."> (write a value or 'all') 100 <li>Altitude (m) <input type="text" size="3" name="altitude" value="10."> (write a value or 'all') 101 <!-- 39 102 <li>Latitude 40 103 <input type="radio" name="islatfree" value="0" checked> Value: <input type="text" size="2" name="latitude" value="0."> 41 104 <input type="radio" name="islatfree" value="1"> All [-90 ; 90] 42 105 </li> 43 <li>Longitude 106 <li>Longitude 44 107 <input type="radio" name="islonfree" value="0" checked> Value: <input type="text" size="2" name="longitude" value="0."> 45 108 <input type="radio" name="islonfree" value="1"> All [-180 ; 180] … … 53 116 <input type="radio" name="isaltfree" value="1"> All [0 ; 100000] m 54 117 </li> 118 --> 55 119 </ul> 56 120 </td> 57 121 <td align="center"> 58 [Advanced settings for well-informed Martians]<br />122 <!--[Advanced settings for well-informed Martians]<br />--> 59 123 <ul> 60 <li>Force Mar tiansolar longitude to be <input type="text" size="3" name="ls"> degrees</li>124 <li>Force Mars solar longitude to be <input type="text" size="3" name="ls"> degrees</li> 61 125 <li>High resolution topography? <input type="radio" name="hrkey" value="1" checked /> Yes <input type="radio" name="hrkey" value="0" /> No </li> 62 126 <li>Dust scenario? <select name="dust"> … … 70 134 <option value="8" >cold scenario (low dust, min solar)</option> 71 135 </select></li> 72 < li>Presets73 < !--<input type="button" value="Now!" onClick="DefaultDateValues();DefaultTimeValues();Convert2Ls();">-->136 <!--<li>Presets 137 <input type="button" value="Now!" onClick="DefaultDateValues();DefaultTimeValues();Convert2Ls();"> 74 138 <input type="button" value="Curiosity" onClick="DateAndTimeValues(2012,8,6,05,30,00);Convert2Ls();PlaceValues(137.4,-4.6)"> 75 139 <input type="button" value="Phoenix" onClick="DateAndTimeValues(2008,5,25,23,38,23);Convert2Ls();PlaceValues(234.25,68.22)"> 76 140 <input type="button" value="Opportunity" onClick="DateAndTimeValues(2004,1,25,4,55,0);Convert2Ls();PlaceValues(354.47,-1.95)"> 77 <input type="button" value="Spirit" onClick="DateAndTimeValues(2004,1,4,4,26,0);Convert2Ls();PlaceValues(175.48,-14.57)"> <br />141 <input type="button" value="Spirit" onClick="DateAndTimeValues(2004,1,4,4,26,0);Convert2Ls();PlaceValues(175.48,-14.57)"> 78 142 <input type="button" value="Pathfinder" onClick="DateAndTimeValues(1997,7,4,16,56,55);Convert2Ls();PlaceValues(-33.22,19.13)"> 79 143 <input type="button" value="Viking Lander 2" onClick="DateAndTimeValues(1976,9,3,22,58,20);Convert2Ls();PlaceValues(-225.74,47.97)"> 80 144 <input type="button" value="Viking Lander 1" onClick="DateAndTimeValues(1976,7,20,11,53,6);Convert2Ls();PlaceValues(-49.97,22.48)"> 81 </li> 145 </li>--> 82 146 </ul> 83 147 </td> … … 85 149 <tr> 86 150 <td align="center"> 87 <b>Step 3 : </b> <input type="submit" value="SUBMIT" style="font-weight:bold"/> 88 </td> 89 <td align="center"> 90 Based on the <a href="http://www-mars.lmd.jussieu.fr">Mars Climate Database</a> (c) LMD/OU/IAA/ESA/CNES. 151 <b>4) INTEREST</b> 152 <input type="radio" name="yeah" value="Atmosphere" onClick="PlaceVar('t','p','none','none')" checked>Atmosphere<br /> 153 <input type="radio" name="yeah" value="Winds" onClick="PlaceVar('u','v','none','none')">Winds 154 <input type="radio" name="yeah" value="Weather" onClick="PlaceVar('ps_ddv','t','none','none')">Weather<br /> 155 <input type="radio" name="yeah" value="Water clouds" onClick="PlaceVar('h2ovap','mtot','h2oice','icetot')">Water clouds 156 <input type="radio" name="yeah" value="Chemistry" onClick="PlaceVar('o3','h2ovap','o','co')">Chemistry<br /> 157 <input type="radio" name="yeah" value="Landing engineering" onClick="PlaceVar('rho','rho_ddv','cp','visc')">Landing engineering<br /> 158 <input type="radio" name="yeah" value="Glaciology" onClick="PlaceVar('tsurfmn','tsurfmx','co2ice','icetot')">Glaciology 159 <input type="radio" name="yeah" value="Surface meteorology" onClick="PlaceVar('ps','tsurf','none','none')">Surface meteorology<br /> 160 <input type="radio" name="yeah" value="Radiative balance" onClick="PlaceVar('lwdown','swdown','lwup','swup')">Radiative balance<br /> 161 <!--<input type="button" value="Surface data" onClick="PlaceVar('ps','tsurf','none','none')">--> 162 </td> 163 <td align="center"> 164 <b>CUSTOMIZE VARIABLE(S) TO BE DISPLAYED</b><br /> 165 <br /> 166 Variable 1 <select name="var1"> 167 <option value="t" selected>Temperature (K)</option> 168 <option value="p" >Pressure (Pa)</option> 169 <option value="rho" >Density (kg/m3)</option> 170 <option value="u" >W-E wind component (m/s)</option> 171 <option value="v" >S-N wind component (m/s)</option> 172 <option value="tsurf" >Surface temperature (K)</option> 173 <option value="ps" >Surface pressure (Pa)</option> 174 <option value="mtot" >Water vapor column (kg/m2)</option> 175 <option value="icetot" >Water ice column (kg/m2)</option> 176 <option value="h2ovap" >Water vapor vol. mixing ratio (mol/mol)</option> 177 <option value="h2oice" >Water ice mixing ratio (mol/mol)</option> 178 <option value="ps_ddv" >Surface pressure DTD RMS (Pa)</option> 179 <option value="co2ice" >surface CO2 ice layer (kg/m2)</option> 180 <option value="cp" >Air heat capacity Cp (J kg-1 K-1)</option> 181 <option value="rho_ddv" >density DTD RMS (kg/m^3)</option> 182 <option value="tsurfmx" >daily max mean surf temperature (K)</option> 183 <option value="tsurfmn" >daily min mean surf temperature (K)</option> 184 <option value="lwdown" >thermal IR flux to surface (W/m2)</option> 185 <option value="swdown" >solar flux to surface (W/m2)</option> 186 <option value="lwup" >thermal IR flux to space (W/m2)</option> 187 <option value="swup" >solar flux reflected to space (W/m2)</option> 188 <option value="o3" >O3 ozone vol. mixing ratio (mol/mol)</option> 189 <option value="o" >[O] vol. mixing ratio (mol/mol)</option> 190 <option value="co" >[CO] vol. mixing ratio (mol/mol)</option> 191 <option value="visc" >Air viscosity estimation (N s m-2)</option> 192 </select> 193 <br /> 194 Variable 2 <select name="var2"> 195 <option value="none" >(None)</option> 196 <option value="t" >Temperature (K)</option> 197 <option value="p" selected>Pressure (Pa)</option> 198 <option value="rho" >Density (kg/m3)</option> 199 <option value="u" >W-E wind component (m/s)</option> 200 <option value="v" >S-N wind component (m/s)</option> 201 <option value="tsurf" >Surface temperature (K)</option> 202 <option value="ps" >Surface pressure (Pa)</option> 203 <option value="mtot" >Water vapor column (kg/m2)</option> 204 <option value="icetot" >Water ice column (kg/m2)</option> 205 <option value="h2ovap" >Water vapor vol. mixing ratio (mol/mol)</option> 206 <option value="h2oice" >Water ice mixing ratio (mol/mol)</option> 207 <option value="ps_ddv" >Surface pressure DTD RMS (Pa)</option> 208 <option value="co2ice" >surface CO2 ice layer (kg/m2)</option> 209 <option value="cp" >Air heat capacity Cp (J kg-1 K-1)</option> 210 <option value="rho_ddv" >density DTD RMS (kg/m^3)</option> 211 <option value="tsurfmx" >daily max mean surf temperature (K)</option> 212 <option value="tsurfmn" >daily min mean surf temperature (K)</option> 213 <option value="lwdown" >thermal IR flux to surface (W/m2)</option> 214 <option value="swdown" >solar flux to surface (W/m2)</option> 215 <option value="lwup" >thermal IR flux to space (W/m2)</option> 216 <option value="swup" >solar flux reflected to space (W/m2)</option> 217 <option value="o3" >O3 ozone vol. mixing ratio (mol/mol)</option> 218 <option value="o" >[O] vol. mixing ratio (mol/mol)</option> 219 <option value="co" >[CO] vol. mixing ratio (mol/mol)</option> 220 <option value="visc" >Air viscosity estimation (N s m-2)</option> 221 </select> 222 <br /> 223 Variable 3 <select name="var3"> 224 <option value="none" selected>(None)</option> 225 <option value="t" >Temperature (K)</option> 226 <option value="p" >Pressure (Pa)</option> 227 <option value="rho" >Density (kg/m3)</option> 228 <option value="u" >W-E wind component (m/s)</option> 229 <option value="v" >S-N wind component (m/s)</option> 230 <option value="tsurf" >Surface temperature (K)</option> 231 <option value="ps" >Surface pressure (Pa)</option> 232 <option value="mtot" >Water vapor column (kg/m2)</option> 233 <option value="icetot" >Water ice column (kg/m2)</option> 234 <option value="h2ovap" >Water vapor vol. mixing ratio (mol/mol)</option> 235 <option value="h2oice" >Water ice mixing ratio (mol/mol)</option> 236 <option value="ps_ddv" >Surface pressure DTD RMS (Pa)</option> 237 <option value="co2ice" >surface CO2 ice layer (kg/m2)</option> 238 <option value="cp" >Air heat capacity Cp (J kg-1 K-1)</option> 239 <option value="rho_ddv" >density DTD RMS (kg/m^3)</option> 240 <option value="tsurfmx" >daily max mean surf temperature (K)</option> 241 <option value="tsurfmn" >daily min mean surf temperature (K)</option> 242 <option value="lwdown" >thermal IR flux to surface (W/m2)</option> 243 <option value="swdown" >solar flux to surface (W/m2)</option> 244 <option value="lwup" >thermal IR flux to space (W/m2)</option> 245 <option value="swup" >solar flux reflected to space (W/m2)</option> 246 <option value="o3" >O3 ozone vol. mixing ratio (mol/mol)</option> 247 <option value="o" >[O] vol. mixing ratio (mol/mol)</option> 248 <option value="co" >[CO] vol. mixing ratio (mol/mol)</option> 249 <option value="visc" >Air viscosity estimation (N s m-2)</option> 250 </select> 251 <br /> 252 Variable 4 <select name="var4"> 253 <option value="none" selected>(None)</option> 254 <option value="t" >Temperature (K)</option> 255 <option value="p" >Pressure (Pa)</option> 256 <option value="rho" >Density (kg/m3)</option> 257 <option value="u" >W-E wind component (m/s)</option> 258 <option value="v" >S-N wind component (m/s)</option> 259 <option value="tsurf" >Surface temperature (K)</option> 260 <option value="ps" >Surface pressure (Pa)</option> 261 <option value="mtot" >Water vapor column (kg/m2)</option> 262 <option value="icetot" >Water ice column (kg/m2)</option> 263 <option value="h2ovap" >Water vapor vol. mixing ratio (mol/mol)</option> 264 <option value="h2oice" >Water ice mixing ratio (mol/mol)</option> 265 <option value="ps_ddv" >Surface pressure DTD RMS (Pa)</option> 266 <option value="co2ice" >surface CO2 ice layer (kg/m2)</option> 267 <option value="cp" >Air heat capacity Cp (J kg-1 K-1)</option> 268 <option value="rho_ddv" >density DTD RMS (kg/m^3)</option> 269 <option value="tsurfmx" >daily max mean surf temperature (K)</option> 270 <option value="tsurfmn" >daily min mean surf temperature (K)</option> 271 <option value="lwdown" >thermal IR flux to surface (W/m2)</option> 272 <option value="swdown" >solar flux to surface (W/m2)</option> 273 <option value="lwup" >thermal IR flux to space (W/m2)</option> 274 <option value="swup" >solar flux reflected to space (W/m2)</option> 275 <option value="o3" >O3 ozone vol. mixing ratio (mol/mol)</option> 276 <option value="o" >[O] vol. mixing ratio (mol/mol)</option> 277 <option value="co" >[CO] vol. mixing ratio (mol/mol)</option> 278 <option value="visc" >Air viscosity estimation (N s m-2)</option> 279 </select> 280 </td> 281 <td align="center"> 282 <!--[Additional settings]<br />--> 283 <ul> 284 <li> Add wind vectors 285 <input type="radio" name="iswind" value="off" checked /> No 286 <input type="radio" name="iswind" value="on" /> Yes</li> 287 <li> Set same LT on whole planet 288 <input type="radio" name="isfixedlt" value="off" checked /> No 289 <input type="radio" name="isfixedlt" value="on" /> Yes</li> 290 <!-- 291 <li> Add another variable 292 <input type="radio" name="superimposed" value="0" checked /> side-by-side 293 <input type="radio" name="superimposed" value="1" /> superimposed</li> 294 --> 295 <!-- 296 <li> 297 Presets 298 <input type="button" value="Usual meteorology" onClick="PlaceVar('p','t','u','v')"> 299 <input type="button" value="Surface data" onClick="PlaceVar('ps','tsurf','none','none')"> 300 <input type="button" value="Water cycle" onClick="PlaceVar('mtot','icetot','none','none')"> 301 </select> 302 --> 303 </li> 304 </ul> 305 </td> 306 </tr> 307 <tr> 308 <td align="center"> 309 <input type="submit" value="Values" style="font-weight:bold" /> 310 <input type="submit" value="Daily cycle" style="font-weight:bold" onClick="PlaceValues2('all')"/><br /> 311 <input type="submit" value="Vertical profile" style="font-weight:bold" onClick="PlaceValues3('all')"/> 312 <input type="submit" value="Global map" style="font-weight:bold" onClick="PlaceValues('all','all')"/><br /> 313 </td> 314 <td align="center"> 315 <input type="submit" value="SUBMIT" style="font-weight:bold"/> 316 </td> 317 <td align="center"> 318 <a href="http://www-mars.lmd.jussieu.fr">Mars Climate Database</a> (c) LMD/OU/IAA/ESA/CNES.<br /> 319 Interface by Aymeric Spiga (LMD).<br /> 91 320 </td> 92 321 </tr> -
trunk/UTIL/PYTHON/mcd/proto/martian_time.js
r639 r761 367 367 var lon; 368 368 var lat; 369 var savlon; 370 var savlat; 371 var yeah; 372 savlon=document.calendar.longitude.value; 373 savlat=document.calendar.latitude.value; 369 374 document.calendar.longitude.value=lon; 370 375 document.calendar.latitude.value=lat; 371 } 376 yeah=document.calendar.toto.value; 377 // to be improved. lon and lat should be separated. but for the moment 378 // only mapping capabilities exist as 2D plots which means if lon is all 379 // lat is all and vice versa. 380 if ( document.calendar.longitude.value == "all") { 381 if ( document.calendar.altitude.value == "all") { 382 alert("Not allowed! Altitude and time must be fixed in mapping mode."); 383 document.calendar.longitude.value=savlon; 384 document.calendar.latitude.value=savlat; 385 document.calendar.toto.value=yeah; 386 } 387 if ( document.calendar.localtime.value == "all") { 388 alert("Not allowed! Altitude and time must be fixed in mapping mode."); 389 document.calendar.longitude.value=savlon; 390 document.calendar.latitude.value=savlat; 391 document.calendar.toto.value=yeah; 392 } 393 } 394 } 395 396 function PlaceVar(var1,var2,var3,var4){ 397 var var1; 398 var var2; 399 var var3; 400 var var4; 401 document.calendar.var1.value=var1; 402 document.calendar.var2.value=var2; 403 document.calendar.var3.value=var3; 404 document.calendar.var4.value=var4; 405 } 406 407 function DefaultSpaceTime(){ 408 document.calendar.localtime.value = 9 409 document.calendar.altitude.value = 2 410 } 411 412 // this is separated from PlaceValues because 413 // allows easier determination through earth time 414 // if needed (e.g. example case with rovers) 415 function PlaceValues2(localtime){ 416 var localtime; 417 var savlocaltime; 418 savlocaltime=document.calendar.localtime.value 419 document.calendar.localtime.value=localtime; 420 if ( document.calendar.localtime.value == "all" ) { 421 if ( document.calendar.altitude.value == "all" ) { 422 alert("Not allowed! Now choose either a fixed altitude or a fixed time."); 423 //document.calendar.localtime.value=savlocaltime; 424 } 425 } 426 if ( document.calendar.localtime.value == "all" ) { 427 if ( document.calendar.longitude.value == "all" ) { 428 alert("Not allowed! Now choose either a lander or a fixed time."); 429 //document.calendar.localtime.value=savlocaltime; 430 } 431 } 432 } 433 function PlaceValues3(altitude){ 434 var altitude; 435 var savaltitude; 436 savaltitude=document.calendar.altitude.value 437 document.calendar.altitude.value=altitude; 438 if ( document.calendar.altitude.value == "all" ) { 439 if ( document.calendar.localtime.value == "all") { 440 alert("Not allowed! Now choose either a fixed time or a fixed altitude."); 441 //document.calendar.altitude.value=savaltitude; 442 } 443 } 444 if ( document.calendar.altitude.value == "all" ) { 445 if ( document.calendar.longitude.value == "all") { 446 alert("Not allowed! Now choose either a lander or a fixed altitude."); 447 //document.calendar.altitude.value=savaltitude; 448 } 449 } 450 } 451
Note: See TracChangeset
for help on using the changeset viewer.