Changeset 13970


Ignore:
Timestamp:
11/15/12 14:54:27 (12 years ago)
Author:
cborstad
Message:

BUG: catch rank-1 arrays in SetIceShelfBC and reshape to match spc arrays

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py

    r13470 r13970  
    4242        #Dirichlet Values
    4343        if isinstance(md.inversion.vx_obs,numpy.ndarray) and numpy.size(md.inversion.vx_obs,axis=0)==md.mesh.numberofvertices and isinstance(md.inversion.vy_obs,numpy.ndarray) and numpy.size(md.inversion.vy_obs,axis=0)==md.mesh.numberofvertices:
     44                #reshape to rank-2 if necessary to match spc arrays
     45                if numpy.ndim(md.inversion.vx_obs)==1:
     46                        md.inversion.vx_obs=md.inversion.vx_obs.reshape(-1,1)
     47                if numpy.ndim(md.inversion.vy_obs)==1:
     48                        md.inversion.vy_obs=md.inversion.vy_obs.reshape(-1,1)
    4449                print "      boundary conditions for diagnostic model: spc set as observed velocities"
    4550                md.diagnostic.spcvx[pos]=md.inversion.vx_obs[pos]
Note: See TracChangeset for help on using the changeset viewer.