Ignore:
Timestamp:
Nov 2, 2012, 5:15:38 PM (12 years ago)
Author:
aslmd
Message:

PYTHON UTIL mcd interface. few improvements: set bounds, set better resolution for figs, address Steve remarks.

Location:
trunk/UTIL/PYTHON/mcd/proto
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py

    r821 r827  
    9090try: query.datekey = int(form.getvalue("datekeyhtml"))
    9191except: query.datekey = float(1)
     92badlschar = False
    9293if query.datekey == 1:
    9394    try: query.xdate = float(form.getvalue("ls"))
    94     except: query.xdate = float(1)
     95    except: query.xdate = float(1) ; badlschar = True
    9596else:
    9697    try: query.xdate = float(form.getvalue("julian"))
     
    105106if badls:
    106107    errormess = errormess+"<li>Solar longitude must be between 0 and 360."
     108if 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."
    107110badloct = (isloctfree == 0 and query.loct > 24.) \
    108111       or (isloctfree == 1 and (query.locts > 24. or query.locte > 24.)) \
     
    153156except: query.colorm = "jet"
    154157
     158try: query.min2d = float(form.getvalue("minval"))
     159except: query.min2d = None
     160try: query.max2d = float(form.getvalue("maxval"))
     161except: query.max2d = None
     162
     163try: query.dpi = float(form.getvalue("dpi"))
     164except: query.dpi = 80.
     165
     166
    155167# Get variables to plot
    156168var1 = form.getvalue("var1")
     
    182194
    183195 # 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)
    185197 figname = '../img/'+reference+'.png'
    186198 txtname = '../txt/'+reference+'.txt'
  • trunk/UTIL/PYTHON/mcd/proto/index.html

    r821 r827  
    107107<td align="center">
    108108<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">
    111110<option value="1"         >MY24 min solar</option>
    112111<option value="2" selected>MY24 ave solar</option>
     
    118117<option value="8"         >cold scenario (low dust, min solar)</option>
    119118</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>
    120120</ul>
    121121</td>
     
    254254<td align="center">
    255255<ul>
    256 <li> Add wind vectors
    257 <input type="radio" name="iswind" value="off" checked /> No
    258 <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
    259259</li>
    260260<li> Set colormap
     
    269269</select>
    270270</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
    274282</li>
    275283</ul>
Note: See TracChangeset for help on using the changeset viewer.