Changeset 2373 in lmdz_wrf for trunk


Ignore:
Timestamp:
Feb 28, 2019, 5:57:23 PM (6 years ago)
Author:
lfita
Message:

Fixing right length of the slicing along the dimension in ordder to reach all length

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r2372 r2373  
    1529115291    for dimn in intdims.keys():
    1529215292        slicev = range(0,dims[dimn],intdims[dimn])
    15293         if np.mod(dims[dimn],intdims[dimn]) != 0: slicev.append(dims[dimn])
     15293        Nslcs = len(slicev)
     15294        if slicev[Nslcs-1] != dims[dimn]: slicev.append(dims[dimn])
    1529415295
    1529515296        intslices[dimn] = slicev
     
    1535315354    return slices, inddims
    1535415355
    15355 #slcs, inds = range_slicing(['z', 't', 'y', 'x'], [2, 3, 10, 20], {'x': 5, 'y': 7})
     15356#slcs, inds = range_slicing(['z', 't', 'y', 'x'], [2, 3, 300, 300], {'y': 50})
    1535615357#Nslcs = len(slcs)
    1535715358#for i in range(Nslcs):
     
    1535915360#    for j in range(4):
    1536015361#        print '  ' , '(', inds[i,j,0], ',', inds[i,j,1], ')'
    15361 #print range_slicing(['z', 't', 'y', 'x'], [2, 3, 10, 20], {'x': 5, 'y': 7})
    15362 
    1536315362#quit()
    1536415363
Note: See TracChangeset for help on using the changeset viewer.