Changeset 13440
- Timestamp:
- 09/25/12 15:43:03 (12 years ago)
- Location:
- issm/trunk-jpl/src/m/plot
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/applyoptions.py
r13424 r13440 139 139 #grid {{{ 140 140 if options.exist('grid'): 141 p.grid() 141 if 'on' in options.getfieldvalue('grid','on'): 142 p.grid() 142 143 #}}} 143 144 … … 146 147 #wrapping 147 148 148 #colorbar 149 #colorbar {{{ 150 if 'on' in options.getfieldvalue('colorbar','on'): 151 p.colorbar() 152 #}}} 149 153 150 154 #area … … 161 165 162 166 #contours 163 164 165 166 167 167 168 #axis positions -
issm/trunk-jpl/src/m/plot/plot_manager.py
r13424 r13440 1 1 from pairoptions import * 2 2 import pylab as p 3 from checkplotoptions import * 4 from plot_mesh import * 3 from checkplotoptions import checkplotoptions 4 from plot_mesh import plot_mesh 5 from processmesh import processmesh 6 from processdata import processdata 7 from plot_unit import plot_unit 8 from applyoptions import applyoptions 5 9 6 10 def plot_manager(md,options,subplotwidth,nlines,ncols,i): … … 25 29 26 30 # convert string to lower case for a case-insensitive comparison 27 if data.lower()=='mesh': plot_mesh(md,options,nlines,ncols,i) 31 if data.lower()=='mesh': 32 plot_mesh(md,options,nlines,ncols,i) 33 return 28 34 else: 29 35 print "WARNING: '%s' is not implemented or is not a valid string for option 'data'" % data 30 36 31 37 #elif data in vars(md): 32 else:33 print "'data' not a string, plotting model properties yet to be implemented..."38 #else: 39 #print "'data' not a string, plotting model properties yet to be implemented..." 34 40 35 41 #Overlay plot 42 43 #Gridded plot 44 45 #Section plot 46 47 #Profile plot 48 49 #process data and model 50 x,y,z,elements,is2d,isplanet=processmesh(md,data,options) 51 data2,datatype=processdata(md,data,options) 52 53 #standard plot 54 p.subplot(nlines,ncols,i) 55 56 #plot unit 57 plot_unit(x,y,z,elements,data2,is2d,isplanet,datatype,options) 58 59 #apply all options 60 applyoptions(md,data2,options) 61 62 #ground overlay on kml plot_unit -
issm/trunk-jpl/src/m/plot/plot_mesh.py
r13417 r13440 13 13 ''' 14 14 15 x,y,z,elements,is2d =processmesh(md,[],options)15 x,y,z,elements,is2d,isplanet=processmesh(md,[],options) 16 16 17 17 if is2d: -
issm/trunk-jpl/src/m/plot/plotmodel.py
r13417 r13440 41 41 #Go through plots 42 42 if numberofplots: 43 43 44 44 #Create figure 45 45 #plots will be visible by default if ipython is run in interactive mode (invoked by ipython --pylab) … … 52 52 else: 53 53 p.figure(figurenumber) 54 55 54 56 55 #try: 57 56 for i in xrange(numberofplots): -
issm/trunk-jpl/src/m/plot/processdata.m
r13275 r13440 48 48 end 49 49 50 %get data type50 %get datasize 51 51 datasize=size(data); 52 52 53 %Process NaN if any (do not now before mask is applied)53 %Process NaN if any (do not know before mask is applied) 54 54 if exist(options,'nan') 55 55 data(find(isnan(data)))=getfieldvalue(options,'nan',0); -
issm/trunk-jpl/src/m/plot/processmesh.py
r13417 r13440 17 17 raise ValueError('processmesh error: the number of elements is the same as the number of nodes') 18 18 19 if not dataor not isinstance(data,dict):19 if len(data)==0 or not isinstance(data,dict): 20 20 21 21 if 'latlon' not in options.getfieldvalue('coord','xy').lower(): #convert to lower case for comparison … … 52 52 is2d=0 53 53 else: 54 raise ValueError('processmesh error: dim = %d not supported' )54 raise ValueError('processmesh error: dim = %d not supported' % md.mesh.dimension) 55 55 56 56 #layer projection? … … 58 58 if 'latlon' in options.getfieldvalue('coord','xy').lower(): 59 59 raise ValueError('processmesh error: cannot work with 3D mesh in lat-lon coords') 60 #we modify (w/c?)the mesh temporarily to a 2D mesh from which the 3D mesh was extruded60 #we modify the mesh temporarily to a 2D mesh from which the 3D mesh was extruded 61 61 x=x2d 62 62 y=y2d … … 65 65 66 66 else: 67 #Process mesh for plotting (triangulation for 2D, polycollection for 3D?)67 #Process mesh for plotting 68 68 if md.mesh.dimension==2: 69 69 is2d=1 … … 79 79 z=z*unit 80 80 81 ##is model a member of planet class? (won't work until planet class defined) 82 #if isinstance(md,planet): 83 # isplanet=1 84 #else: 85 # isplanet=0 86 return x,y,z,elements,is2d 81 #is model a member of planet class? (workaround until planet class defined) 82 if md.__class__.__name__!='model': 83 isplanet=1 84 else: 85 isplanet=0 86 87 return x,y,z,elements,is2d,isplanet
Note:
See TracChangeset
for help on using the changeset viewer.