source: issm/trunk/src/m/plot/plot_icefront.py@ 21341

Last change on this file since 21341 was 21341, checked in by Mathieu Morlighem, 8 years ago

merged trunk-jpl and trunk for revision 21337

File size: 1.1 KB
Line 
1try:
2 import pylab as p
3except ImportError:
4 print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
5import numpy as np
6from processmesh import processmesh
7from applyoptions import applyoptions
8
9def plot_icefront(md,options,fig,ax):
10 #PLOT_ICEFRONT - plot segment on neumann BC
11 #
12 # Usage:
13 # plot_icefront(md,options,width,i)
14 #
15 # See also: PLOTMODEL
16#process mesh and data
17 x,y,z,elements,is2d,isplanet=processmesh(md,[],options)
18 icefront=np.where(np.logical_and(np.sum(md.mask.ice_levelset[elements],1)<3,np.sum(md.mask.ice_levelset[elements],1)>-3))
19 onlyice=np.where(np.sum(md.mask.ice_levelset[elements],1)==-3)
20 noice=np.where(np.sum(md.mask.ice_levelset[elements],1)==3)
21
22 #plot mesh
23 ax.triplot(x,y,elements)
24
25 #highlight elements on neumann
26 colors=np.asarray([0.5 for element in elements[icefront]])
27
28 ax.tripcolor(x,y,elements[icefront],facecolors=colors,alpha=0.5,label='elements on ice front')#,facecolor='b'
29
30 #apply options
31 options.addfielddefault('title','Neumann boundary conditions')
32 options.addfielddefault('colorbar','off')
33 applyoptions(md,[],options,fig,ax)
Note: See TracBrowser for help on using the repository browser.