Changeset 17597


Ignore:
Timestamp:
03/28/14 12:15:43 (11 years ago)
Author:
cborstad
Message:

BUG: some fixes for new mesh handling

Location:
issm/trunk-jpl/src/m/plot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/processdata.m

    r17474 r17597  
    2222end
    2323
    24 %special case for mesg 2dvertical
     24%special case for mesh 2dvertical
    2525if strcmp(meshtype(md.mesh),'2Dvertical'),
    2626        [data datatype] = processdata(md.mesh,md,data,options);
  • issm/trunk-jpl/src/m/plot/processdata.py

    r13969 r17597  
    2222
    2323        #needed later on
    24         if md.mesh.numberofvertices2d:
     24        if 'numberofvertices2d' in dir(md.mesh):
    2525                numberofvertices2d=md.mesh.numberofvertices2d
    2626                numberofelements2d=md.mesh.numberofelements2d
  • issm/trunk-jpl/src/m/plot/processmesh.py

    r17581 r17597  
    11from math import isnan
    22import MatlabFuncs as m
     3import numpy as npy
    34
    45def processmesh(md,data,options):
     
    2223                if 'latlon' not in options.getfieldvalue('coord','xy').lower(): #convert to lower case for comparison
    2324                        x=md.mesh.x
    24                         if not isnan(md.mesh.x2d): x2d=md.mesh.x2d
     25                        if 'x2d' in dir(md.mesh): x2d=md.mesh.x2d
    2526                        y=md.mesh.y
    26                         if not isnan(md.mesh.y2d): y2d=md.mesh.y2d
     27                        if 'y2d' in dir(md.mesh): y2d=md.mesh.x2d
    2728                else:
    2829                        x=md.mesh.long
    2930                        y=md.mesh.lat
    3031
    31                 z_field=options.getfieldvalue('z',md.mesh.z)
    32                 #if isinstance(z_field,basestring): # how could z be a string?
    33                 #       z=md.(z_field)
    34                 if isinstance(z_field,(int,long,float)):  # isnumeric
    35                         z=z_field
     32                if 'z' in dir(md.mesh):
     33                        z=md.mesh.z
    3634                else:
    37                         z=md.mesh.z
     35                        z=npy.zeros_like(md.mesh.x)
    3836               
    39                 if not isnan(md.mesh.elements2d):
     37                if 'elements2d' in dir(md.mesh):
    4038                        elements2d=md.mesh.elements2d
    41                         elements2d=elements2d-1
    42                 # subtract one since python indexes from zero
     39                        elements2d=elements2d-1  # subtract one since python indexes from zero
    4340                elements=md.mesh.elements
    4441                elements=elements-1
Note: See TracChangeset for help on using the changeset viewer.