- Timestamp:
- Mar 25, 2019, 3:51:57 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r2404 r2416 30011 30011 30012 30012 # removing monotones. Fortran only accepts rank <= 7 arrays !! 30013 Nmaxgridsinone = False 30014 if sin.shape[1] == 1: Nmaxgridsinone = True 30015 30013 30016 sN, Ndims = gen.remove_monotones(sN, oNslice.dimensions) 30014 30017 sin, indims = gen.remove_monotones(sin, oslicein.dimensions) … … 30020 30023 dimsslice = list(Ndims) 30021 30024 shapeslice = list(sN.shape) 30025 30026 # Due to the removal of monotones we are losing the cases when Nmaxgrisin == 1 30027 if Nmaxgridsinone: 30028 print warnmsg 30029 print ' ' + fname + ": maximum number of grid points per slice == 1 !!" 30030 print ' adjusting accordingly certain matrices ...' 30031 shapein = list(sin.shape) 30032 Lshape = len(shapein) 30033 reshapein = [shapein[0]] + [1] + shapein[1:Lshape+1] 30034 30035 sin0 = sin + 0 30036 30037 newsin = np.zeros(tuple(reshapein), dtype=int) 30038 for i in range(shapein[0]): 30039 newsin[i,0,...] = sin[i,...] 30040 30041 sin = None 30042 sin = newsin+ 0 30022 30043 30023 30044 sNt = sN.transpose()
Note: See TracChangeset
for help on using the changeset viewer.