- Timestamp:
- Oct 1, 2012, 8:45:43 AM (12 years ago)
- Location:
- trunk/UTIL/PYTHON/mcd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/mcd/mcd.py
r796 r797 41 41 self.locte = None 42 42 self.xdate = 0. # see datekey 43 self.xdates = None 44 self.xdatee = None 43 45 self.xz = 10. # see zkey 44 46 self.xzs = None … … 46 48 ## 1bis. related settings 47 49 self.zkey = 3 # specify that xz is the altitude above surface (m) 50 # zkey : <integer> type of vertical coordinate xz 51 # 1 = radius from centre of planet (m) 52 # 2 = height above areoid (m) (MOLA zero datum) 53 # 3 = height above surface (m) 54 # 4 = pressure level (Pa) 55 # 5 = altitude above mean Mars Radius(=3396000m) (m) 48 56 self.datekey = 1 # 0 = "Earth time": xdate is given in Julian days (localtime must be set to zero) 49 57 # 1 = "Mars date": xdate is the value of Ls … … 256 264 return field,fieldlab 257 265 266 def ininterv(self,dstart,dend,nd,start=None,end=None,yaxis=False): 267 ### user-defined start and end are used to create xcoord (or ycoord) vector 268 if start is not None and end is not None: first, second = self.correctbounds(start,end) 269 else: first, second = self.correctbounds(dstart,dend) 270 if not yaxis: self.xcoord = np.linspace(first,second,nd) 271 else: self.ycoord = np.linspace(first,second,nd) 272 ## here we should code the log axis for pressure 273 274 def correctbounds(self,start,end): 275 if self.zkey != 4: 276 # regular altitudes 277 if start > end: first = end ; second = start 278 else: first = start ; second = end 279 else: 280 # pressure: reversed avis 281 if start < end: first = end ; second = start 282 else: first = start ; second = end 283 return first, second 284 258 285 ################### 259 286 ### 1D analysis ### … … 272 299 ### retrieve a local time slice 273 300 self.xlabel = "Local time (Martian hour)" 274 self.prepare(ndx=nd) 275 if self.locts is not None and self.locte is not None: 276 if self.locts > self.locte: yeah = self.locts ; self.locts = self.locte ; self.locte = yeah 277 self.xcoord = np.linspace(self.locts,self.locte,nd) 278 else: 279 self.xcoord = np.linspace(0.,24.,nd) 301 self.prepare(ndx=nd) ; self.ininterv(0.,24.,nd,start=self.locts,end=self.locte) 280 302 for i in range(nd): self.loct = self.xcoord[i] ; self.update() ; self.put1d(i) 281 303 … … 283 305 ### retrieve a longitude slice 284 306 self.xlabel = "East longitude (degrees)" 285 self.prepare(ndx=nd) 286 if self.lons is not None and self.lone is not None: 287 if self.lons > self.lone: yeah = self.lons ; self.lons = self.lone ; self.lone = yeah 288 self.xcoord = np.linspace(self.lons,self.lone,nd) 289 else: 290 self.xcoord = np.linspace(-180.,180.,nd) 307 self.prepare(ndx=nd) ; self.ininterv(-180.,180.,nd,start=self.lons,end=self.lone) 291 308 for i in range(nd): self.lon = self.xcoord[i] ; self.update() ; self.put1d(i) 292 309 … … 294 311 ### retrieve a latitude slice 295 312 self.xlabel = "North latitude (degrees)" 296 self.prepare(ndx=nd) 297 if self.lats is not None and self.late is not None: 298 if self.lats > self.late: yeah = self.lats ; self.lats = self.late ; self.late = yeah 299 self.xcoord = np.linspace(self.lats,self.late,nd) 300 else: 301 self.xcoord = np.linspace(-90.,90.,nd) 313 self.prepare(ndx=nd) ; self.ininterv(-90.,90.,nd,start=self.lats,end=self.late) 302 314 for i in range(nd): self.lat = self.xcoord[i] ; self.update() ; self.put1d(i) 303 315 … … 306 318 self.xlabel = "Altitude (m)" 307 319 if tabperso is not None: nd = len(tabperso) 308 self.prepare(ndx=nd) 309 if tabperso is not None: 310 self.xcoord = tabperso 311 elif self.xzs is not None and self.xze is not None: 312 ## here we should code the log axis for pressure 313 self.xcoord = np.linspace(self.xzs,self.xze,nd) 314 else: 315 self.xcoord = np.linspace(0.,120000.,nd) 320 correct = False 321 self.prepare(ndx=nd) ; self.ininterv(0.,120000.,nd,start=self.xzs,end=self.xze) 322 if tabperso is not None: self.xcoord = tabperso 316 323 for i in range(nd): self.xz = self.xcoord[i] ; self.update() ; self.put1d(i) 317 324 318 def seasonal(self,nd=12 ,start=0.,end=360.):325 def seasonal(self,nd=12): 319 326 ### retrieve a seasonal slice 320 327 self.xlabel = "Areocentric longitude (degrees)" 321 self.prepare(ndx=nd) ; self. xcoord = np.linspace(start,end,nd)328 self.prepare(ndx=nd) ; self.ininterv(0.,360.,nd,start=self.xdates,end=self.xdatee) 322 329 for i in range(nd): self.xdate = self.xcoord[i] ; self.update() ; self.put1d(i) 323 330 … … 369 376 self.xlabel = "East longitude (degrees)" ; self.ylabel = "North latitude (degrees)" 370 377 self.prepare(ndx=ndx,ndy=ndy) 371 if self.lons is not None and self.lone is not None: 372 if self.lons > self.lone: yeah = self.lons ; self.lons = self.lone ; self.lone = yeah 373 self.xcoord = np.linspace(self.lons,self.lone,ndx) 374 else: 375 self.xcoord = np.linspace(-180.,180.,ndx) 376 if self.lats is not None and self.late is not None: 377 if self.lats > self.late: yeah = self.lats ; self.lats = self.late ; self.late = yeah 378 self.ycoord = np.linspace(self.lats,self.late,ndy) 379 else: 380 self.ycoord = np.linspace(-90.,90.,ndy) 378 self.ininterv(-180.,180.,ndx,start=self.lons,end=self.lone) 379 self.ininterv(-90., 90.,ndy,start=self.lats,end=self.late,yaxis=True) 381 380 if not fixedlt: umst = self.loct 382 381 for i in range(ndx): -
trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py
r796 r797 75 75 try: query.dust = int(form.getvalue("dust")) 76 76 except: query.dust = int(1) 77 # self.zkey = 3 # specify that xz is the altitude above surface (m) 77 try: query.zkey = int(form.getvalue("zkey")) 78 except: query.zkey = int(3) 78 79 # self.perturkey = 0 #integer perturkey ! perturbation type (0: none) 79 80 # self.seedin = 1 #random number generator seed (unused if perturkey=0) … … 154 155 155 156 print header 157 #print query.printset() 158 #print "<br />" 156 159 157 160 ## Now the part which differs -
trunk/UTIL/PYTHON/mcd/proto/index.html
r796 r797 96 96 <td align="center"> 97 97 <b>CUSTOMIZE COORDINATES ON MARS</b><br /> 98 please give:a value (or) a range val1;val2 (or) 'all'<br />98 write a value (or) a range val1;val2 (or) 'all'<br /> 99 99 <ul> 100 <li>North Latitude <input type="text" size="7" name="latitude" value="0."> 101 <li>East Longitude <input type="text" size="7" name="longitude" value="0."> 102 <li>Local Time <input type="text" size="7" name="localtime" value="0."> 103 <li>Altitude (m) <input type="text" size="7" name="altitude" value="10."> 100 <li>Latitude <input type="text" size="7" name="latitude" value="0."> degree North 101 <li>Longitude <input type="text" size="7" name="longitude" value="0."> degree East 102 <li>Local Time <input type="text" size="7" name="localtime" value="0."> Martian hour 103 <li>Altitude <input type="text" size="9" name="altitude" value="10."> <select name="zkey"> 104 <option value="1" >m (O: Mars center)</option> 105 <option value="2" >m (O: "sea level")</option> 106 <option value="3" selected>m (O: surface)</option> 107 <option value="4" >Pa (pressure)</option> 108 <option value="5" >m (O: 3396 km)</option> 109 </select> 104 110 <!-- 105 111 <li>Latitude
Note: See TracChangeset
for help on using the changeset viewer.