Changeset 1075 for trunk/UTIL


Ignore:
Timestamp:
Oct 18, 2013, 5:24:05 PM (11 years ago)
Author:
aslmd
Message:

UTIL PYTHON. MCD online. previous changes after progress meeting were not committed.

Location:
trunk/UTIL/PYTHON/mcd
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/mcd/inimeso/inimeso5.py

    r943 r1075  
    2222
    2323### GET and WRITE SURFACE VALUES
    24 query.xz = 0. ; query.update() ; query.printmeanvar()
     24query.xz = 0.1 ; query.update() ; query.printmeanvar()
    2525sounding.write( "%10.2f%12.2f%12.2f\n" % (query.pres/100.,query.temp*(610./query.pres)**(1.0/3.9),0.) )
    2626more.write( "%10.2f%10.2f" % (query.extvar[1],query.extvar[14]) ) ; more.close()
    2727
    2828### GET and WRITE VERTICAL PROFILE
    29 query.profile( tabperso = np.append([0,5,10,20,50,100],np.linspace(200.,float(split(lines[4])[0])*1000.,float(split(lines[5])[0]))) )
     29query.profile( tabperso = np.append([0.1,5,10,20,50,100],np.linspace(200.,float(split(lines[4])[0])*1000.,float(split(lines[5])[0]))) )
    3030for iz in range(len(query.prestab)):
    3131    sounding.write(   "%10.2f%12.2f%12.2f%12.2f%12.2f\n" % ( \
  • trunk/UTIL/PYTHON/mcd/inimeso/input_coord

    r943 r1075  
    1 353.87  lon
    2 -1.88   lat
    3 244.    ls
    4 06.     lct
    5 20      ztop
     1173.0   lon
     2-1.0    lat
     3120.    ls
     405.     lct
     525      ztop
    66100.    nz
  • trunk/UTIL/PYTHON/mcd/mcd.py

    r971 r1075  
    2828        self.name      = "MCD v4.3"
    2929        self.ack       = "Mars Climate Database (c) LMD/OU/IAA/ESA/CNES"
    30         self.dset      = '/home/aymeric/Science/MCD_v4.3/data/'
    31         #self.dset      = '/home/marshttp/MCD_v4.3/data/'
     30        #self.dset      = '/home/aymeric/Science/MCD_v4.3/data/'
     31        self.dset      = '/home/marshttp/MCD_v4.3/data/'
    3232        ## 1. spatio-temporal coordinates
    3333        self.lat       = 0.
     
    8282        self.max2d = None
    8383        self.dpi = 80.
     84        self.islog = False
    8485
    8586    def toversion5(self):
     
    231232        if "(K)" in dastuff:      self.fmt="%.0f"
    232233        elif "effective radius" in dastuff: self.fmt="%.2e"
    233         elif "(Pa)" in dastuff:   self.fmt="%.1f"
     234        elif "(Pa)" in dastuff:   self.fmt="%.2e"
    234235        elif "(W/m2)" in dastuff: self.fmt="%.0f"
    235236        elif "(m/s)" in dastuff:  self.fmt="%.1f"
     
    472473      if "(mol/mol)" in fieldlab or "(kg/kg)" in fieldlab or "(kg/m2)" in fieldlab or "(W/m2)" in fieldlab:
    473474         ind = np.where(field < 1.e-30)
    474          if ind != -1: field[ind] = 1.e-30  ## 0 does not work everywhere.
     475         if ind != -1: field[ind] = 0.e0 #1.e-30  ## 0 does not work everywhere.
    475476      return field,fieldlab
    476477
     
    603604      else:                  ordo = self.xcoord ; absc = field ; absclab = fieldlab ; ordolab = self.xlabel
    604605      mpl.plot(absc,ordo,'-bo') ; mpl.ylabel(ordolab) ; mpl.xlabel(absclab) #; mpl.xticks(query.xcoord)
     606      # cases with log axis
    605607      if self.zkey == 4: mpl.semilogy() ; ax = mpl.gca() ; ax.set_ylim(ax.get_ylim()[::-1])
     608      if not self.vertplot and self.islog: mpl.semilogy()
     609      if self.vertplot and self.islog: mpl.semilogx()
    606610      mpl.figtext(0.5, 0.01, self.ack, ha='center')
    607611
     
    633637        choice = tabtodo[i]
    634638        (field, fieldlab) = self.definefield(choice)
     639
     640        # in log plots we do not show the negative values
     641        if self.islog: field[np.where(field <= 0.e0)] = np.nan
     642
    635643        if not self.vertplot:  absc = self.xcoord ; ordo = field ; ordolab = fieldlab ; absclab = self.xlabel
    636644        else:                  ordo = self.xcoord ; absc = field ; absclab = fieldlab ; ordolab = self.xlabel
     645
    637646        yeah.plot(absc,ordo,'-bo') #; mpl.xticks(query.xcoord)
    638647        ax = fig.gca() ; ax.set_ylabel(ordolab) ; ax.set_xlabel(absclab)
    639648
    640649        if self.xzs is not None and self.zkey == 4: ax.set_yscale('log') ; ax.set_ylim(ax.get_ylim()[::-1])
     650        if not self.vertplot and self.islog: ax.set_yscale('log')
     651        if self.vertplot and self.islog: ax.set_xscale('log')
    641652
    642653        if self.lats is not None:      ax.set_xticks(np.arange(-90,91,15)) ; ax.set_xbound(lower=self.lats, upper=self.late)
  • trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py

    r971 r1075  
    145145if badrange:
    146146    errormess = errormess+"<li>One or several coordinate intervals are not... intervals. Set either a real range or an unique value."
     147if query.xdate == 666.:
     148    errormess = "<li>CONGRATULATIONS! <br><img src='../surprise.jpg'><br> You reached secret mode.<br> You can <a href='http://www.youtube.com/watch?v=fTpQOZcNASw'>watch a nice video</a>."
    147149
    148150# Get how many free dimensions we have
     
    196198else:                  query.zonmean=False
    197199
     200islog = form.getvalue("islog")
     201if islog  == "on": query.islog=True
     202else:              query.islog=False
     203
    198204### now, proceed...
    199205if errormess == "":
    200206
    201207 # reference name (to test which figures are already in the database)
    202  try: 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)
     208 try: 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)+str(islog)
    203209 except: reference = "test"
    204210 if yeaheps:  figname = '../img/'+reference+'.eps'
  • trunk/UTIL/PYTHON/mcd/proto/index4.html

    r971 r1075  
    286286<input type="radio" name="zonmean" value="on"          /> on
    287287</li>
     288<li>Log(values) in 1D plots
     289<input type="radio" name="islog" value="off" checked /> off
     290<input type="radio" name="islog" value="on" /> on
     291</li>
    288292</ul>
    289293</td>
     
    303307<a href="http://www-mars.lmd.jussieu.fr">Mars Climate Database</a> (c) LMD/OU/IAA/ESA/CNES.<br />
    304308Interface written by <a href="http://www.lmd.jussieu.fr/~aslmd/">A. Spiga</a> (LMD) using <a href="http://www.python.org">Python</a>.<br />
     309Javascript time conversion by <a href="http://www.lmd.jussieu.fr/~emlmd">E. Millour</a> (<a href="http://www-mars.lmd.jussieu.fr/mars/time/martian_time.html">link</a>).
    305310</td>
    306311</tr>
  • trunk/UTIL/PYTHON/mcd/proto/index5.html

    r1074 r1075  
    389389<input type="radio" name="zonmean" value="on"          /> on
    390390</li>
     391<li>Log(values) in 1D plots
     392<input type="radio" name="islog" value="off" checked /> off
     393<input type="radio" name="islog" value="on" /> on
     394</li>
    391395</ul>
    392396</td>
     
    406410<a href="http://www-mars.lmd.jussieu.fr">Mars Climate Database</a> (c) LMD/OU/IAA/ESA/CNES.<br />
    407411Interface written by <a href="http://www.lmd.jussieu.fr/~aslmd/">A. Spiga</a> (LMD) using Python.<br />
     412Javascript time conversion by <a href="http://www.lmd.jussieu.fr/~emlmd">E. Millour</a> (<a href="http://www-mars.lmd.jussieu.fr/mars/time/martian_time.html">link</a>).
    408413</td>
    409414</tr>
Note: See TracChangeset for help on using the changeset viewer.