Changeset 808 in lmdz_wrf for trunk


Ignore:
Timestamp:
Jun 7, 2016, 11:59:25 AM (9 years ago)
Author:
lfita
Message:

Adding error message when overpassing dimension limits in `slice_variable'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing_tools.py

    r801 r808  
    259259                        monodim.append(vardims[idd])
    260260                    else:
     261                        if int(dimcutv) > varobj.shape[idd]-1:
     262                            print errormsg
     263                            print '  ' + fname + ': given value:', int(dimcutv),     \
     264                              "is larger than length of dimension '" + dimcutn +     \
     265                              "':", varobj.shape[idd],'(C-like!) !!'
     266                            quit(-1)
    261267                        varvalsdim.append(int(dimcutv))
    262268                        monodim.append(vardims[idd])
     
    267273            varvalsdim.append(slice(0,varobj.shape[idd]))
    268274            dimnslice.append(vardims[idd])
     275
    269276    varvalues = varobj[tuple(varvalsdim)]
    270 
    271277    varvalues = np.squeeze(varobj[tuple(varvalsdim)])
    272278
Note: See TracChangeset for help on using the changeset viewer.