Changeset 827 for trunk/UTIL
- Timestamp:
- Nov 2, 2012, 5:15:38 PM (12 years ago)
- Location:
- trunk/UTIL/PYTHON/mcd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/mcd/mcd.py
r821 r827 80 80 self.fixedlt = False 81 81 self.zonmean = False 82 self.min2d = None 83 self.max2d = None 84 self.dpi = 80. 82 85 83 86 def viking1(self): self.name = "Viking 1 site. MCD v4.3 output" ; self.lat = 22.48 ; self.lon = -49.97 ; self.xdate = 97. … … 101 104 if not oneline: self.title = self.title + "\n" 102 105 if self.lats is None: self.title = self.title + " Latitude " + str(self.lat) + "N" 103 if self.zonmean: self.title = self.title + "Zonal mean over all longitudes." 104 elif self.lons is None: self.title = self.title + " Longitude " + str(self.lon) + "E" 106 if self.zonmean and self.lats is not None and self.xzs is not None: 107 self.title = self.title + "Zonal mean over all longitudes." 108 elif self.lons is None: 109 self.title = self.title + " Longitude " + str(self.lon) + "E" 105 110 if self.xzs is None: 106 111 self.vertunits() … … 513 518 # The size * the dpi gives the final image size 514 519 # a4"x4" image * 80 dpi ==> 320x320 pixel image 515 canvas.print_figure(figname, dpi= 80)520 canvas.print_figure(figname, dpi=self.dpi) 516 521 517 522 ################### … … 704 709 ## define field. bound field. 705 710 what_I_plot = np.transpose(field) 706 zevmin, zevmax = myplot.calculate_bounds(what_I_plot ) ## vmin=min(what_I_plot_frame), vmax=max(what_I_plot_frame))711 zevmin, zevmax = myplot.calculate_bounds(what_I_plot,vmin=self.min2d,vmax=self.max2d) 707 712 what_I_plot = myplot.bounds(what_I_plot,zevmin,zevmax) 708 713 ## define contour field levels. define color palette … … 734 739 # The size * the dpi gives the final image size 735 740 # a4"x4" image * 80 dpi ==> 320x320 pixel image 736 canvas.print_figure(figname, dpi= 80)741 canvas.print_figure(figname, dpi=self.dpi) 737 742 738 743 def htmlplot2d(self,tabtodo,figname="temp.png"): … … 775 780 ## define field. bound field. 776 781 what_I_plot = np.transpose(field) 777 zevmin, zevmax = myplot.calculate_bounds(what_I_plot ) ## vmin=min(what_I_plot_frame), vmax=max(what_I_plot_frame))782 zevmin, zevmax = myplot.calculate_bounds(what_I_plot,vmin=self.min2d,vmax=self.max2d) 778 783 what_I_plot = myplot.bounds(what_I_plot,zevmin,zevmax) 779 784 ## define contour field levels. define color palette … … 806 811 # The size * the dpi gives the final image size 807 812 # a4"x4" image * 80 dpi ==> 320x320 pixel image 808 canvas.print_figure(figname, dpi= 80)813 canvas.print_figure(figname, dpi=self.dpi) 809 814 810 815 -
trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py
r821 r827 90 90 try: query.datekey = int(form.getvalue("datekeyhtml")) 91 91 except: query.datekey = float(1) 92 badlschar = False 92 93 if query.datekey == 1: 93 94 try: query.xdate = float(form.getvalue("ls")) 94 except: query.xdate = float(1) 95 except: query.xdate = float(1) ; badlschar = True 95 96 else: 96 97 try: query.xdate = float(form.getvalue("julian")) … … 105 106 if badls: 106 107 errormess = errormess+"<li>Solar longitude must be between 0 and 360." 108 if badlschar: 109 errormess = errormess+"<li>Solar longitude is in the wrong format. It should be a positive number between 0 and 360. Intervals of solar longitude are not allowed." 107 110 badloct = (isloctfree == 0 and query.loct > 24.) \ 108 111 or (isloctfree == 1 and (query.locts > 24. or query.locte > 24.)) \ … … 153 156 except: query.colorm = "jet" 154 157 158 try: query.min2d = float(form.getvalue("minval")) 159 except: query.min2d = None 160 try: query.max2d = float(form.getvalue("maxval")) 161 except: query.max2d = None 162 163 try: query.dpi = float(form.getvalue("dpi")) 164 except: query.dpi = 80. 165 166 155 167 # Get variables to plot 156 168 var1 = form.getvalue("var1") … … 182 194 183 195 # reference name (to test which figures are already in the database) 184 reference = query.getnameset()+str(var1)+str(var2)+str(var3)+str(var4)+str(iswind)+str(isfixedlt)+str(iszonmean)+query.colorm 196 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) 185 197 figname = '../img/'+reference+'.png' 186 198 txtname = '../txt/'+reference+'.txt' -
trunk/UTIL/PYTHON/mcd/proto/index.html
r821 r827 107 107 <td align="center"> 108 108 <ul> 109 <li>High resolution mode? <input type="radio" name="hrkey" value="1" checked /> Yes <input type="radio" name="hrkey" value="0" /> No </li> 110 <li>Dust scenario? <select name="dust"> 109 <li>Dust scenario <select name="dust"> 111 110 <option value="1" >MY24 min solar</option> 112 111 <option value="2" selected>MY24 ave solar</option> … … 118 117 <option value="8" >cold scenario (low dust, min solar)</option> 119 118 </select></li> 119 <li>Interpolate using MOLA topography <input type="radio" name="hrkey" value="1" checked /> on <input type="radio" name="hrkey" value="0" /> off </li> 120 120 </ul> 121 121 </td> … … 254 254 <td align="center"> 255 255 <ul> 256 <li> Add wind vectors257 <input type="radio" name=" iswind" value="off" checked /> No258 <input type="radio" name=" iswind" value="on" /> Yes</li>256 <li> Set picture resolution 257 <input type="radio" name="dpi" value="80" checked> medium 258 <input type="radio" name="dpi" value="160"> high 259 259 </li> 260 260 <li> Set colormap … … 269 269 </select> 270 270 </li> 271 <li> Ask for zonal mean in lat/alt plot<br /> 272 <input type="radio" name="zonmean" value="off" checked /> No 273 <input type="radio" name="zonmean" value="on" /> Yes (please be patient) 271 <li> Set bounds in 2D plots 272 <input type="text" size="2" name="minval"> min 273 <input type="text" size="2" name="maxval"> max 274 </li> 275 <li> Wind vectors in lat/lon plot 276 <input type="radio" name="iswind" value="off" checked /> off 277 <input type="radio" name="iswind" value="on" /> on</li> 278 </li> 279 <li> Zonal average in lat/alt plot 280 <input type="radio" name="zonmean" value="off" checked /> off 281 <input type="radio" name="zonmean" value="on" /> on 274 282 </li> 275 283 </ul>
Note: See TracChangeset
for help on using the changeset viewer.