Changeset 26818


Ignore:
Timestamp:
01/25/22 13:26:22 (3 years ago)
Author:
vverjans
Message:

BUG: working on Python syntax wrt revision 26810

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/m/classes/SMBautoregression.py

    r26816 r26818  
    129129            temprefelevation = np.zeros((md.smb.num_basins))
    130130            areas = GetAreas(md.mesh.elements, md.mesh.x, md.mesh.y)
    131             for ii in range(int(md.smb.num_basins)):
    132                 indices = np.where(md.smb.basin_id==ii+1)[0]
     131            for ii,bid in enumerate(np.unique(md.smb.basin_id)):
     132                indices = np.where(md.smb.basin_id==bid)[0]
    133133                elemsh  = np.zeros((len(indices)))
    134134                for jj in range(len(indices)):
     
    142142                    elemsh[jj] = sumval/cntval
    143143                temprefelevation[ii] = np.sum(areas[indices]*elemsh)/np.sum(areas[indices])
    144                 print(indices)
    145                 print(areas[indices])
    146                 print(elemsh)
    147144            if(np.any(templapserate_pos!=0) or np.any(templapserate_neg!=0)):
    148145                print('      smb.refelevation not specified: Reference elevations set to mean surface elevation of basins')
Note: See TracChangeset for help on using the changeset viewer.