source: trunk/UTIL/PYTHON/mymath.py @ 384

Last change on this file since 384 was 349, checked in by aslmd, 14 years ago

PYTHON GRAPHICS: A REFERENCE VERSION FOR BOTH GCM AND MESOSCALE USE!

Merged recent changes by TN for better GCM handling + 1D/2D plots with AS mesoscale version [winds.py]

Now

  • there is a common function named planetoplot in planetoplot.py which supports both GCM and mesoscale plots

    this will be a common reference for future development

  • mesoscale users might want to use the script meso.py
  • GCM users might want to use the script gcm.py

Todo

  • a few capabilities that were in winds.py are broken in meso.py, this will be fixed soon. the 'old' reference script winds.py is still here anyway!
  • there is still a bug with 'ortho' projection with GCM fields. still searching...

Misc

  • A few modifications were done in myplot.py and mymath.py
  • Added a simple stupid little.py script illustrating very simple use of Python graphics
  • Added the script doing statistical analysis for dust devils
File size: 654 bytes
Line 
1def min (field,axis=None): 
2        import numpy as np
3        if field is None: return None
4        else: return np.array(field).min(axis=axis)
5
6def max (field,axis=None):
7        import numpy as np
8        if field is None: return None
9        else: return np.array(field).max(axis=axis)
10
11def mean (field,axis=None):
12        import numpy as np
13        if field is None: return None
14        else: return np.array(field).mean(axis=axis)
15
16def deg ():
17        return u'\u00b0'
18
19def writeascii ( tab, filename ):
20    mydata = tab
21    myfile = open(filename, 'w')
22    for line in mydata:
23        myfile.write(str(line) + '\n')
24    myfile.close()
25    return
26
Note: See TracBrowser for help on using the repository browser.