- Timestamp:
- Feb 27, 2015, 6:28:02 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r335 r336 10959 10959 rvarvalst = np.ones((dimz,Nrad*2+1,Nrad*2+1),dtype=np.float)* \ 10960 10960 fillValue 10961 print 'Lluis cslicev:',cslicev,'cslice2D:',cslice2D10962 10961 rvarvalst[tuple(cslice2D)] = varobj[tuple(cslicev)] 10963 10962 for iz in range(dimz): … … 11187 11186 # Circle values 11188 11187 cslicev.append(gtrajvals[it,0]) 11189 if gtrajvals[it,2]-Nrad < 0 or gtrajvals[it,2]+Nrad + 1 > dimy + 1 \ 11190 or gtrajvals[it,1]-Nrad < 0 or gtrajvals[it,1]+Nrad + 1 > dimx + 1: 11191 cslicev.append(slice(cyrangeslice[it][0],cyrangeslice[it][1])) 11192 cslicev.append(slice(cxrangeslice[it][0],cxrangeslice[it][1])) 11188 if gtrajvals[it,2]-Nrad < 0 or gtrajvals[it,2]+Nrad + 1 >= dimy \ 11189 or gtrajvals[it,1]-Nrad < 0 or gtrajvals[it,1]+Nrad + 1 >= dimx: 11190 maxx = np.min([cxrangeslice[it][1], dimx]) 11191 maxy = np.min([cyrangeslice[it][1], dimy]) 11192 cslicev.append(slice(cyrangeslice[it][0],maxy)) 11193 cslicev.append(slice(cxrangeslice[it][0],maxx)) 11193 11194 11194 11195 cslicevnoT.append(slice(cyrangeslice[it][0],cyrangeslice[it][1])) 11195 11196 cslicevnoT.append(slice(cxrangeslice[it][0],cxrangeslice[it][1])) 11196 11197 11197 cslice2D.append(slice(0, cyrangeslice[it][1]-cyrangeslice[it][0]))11198 cslice2D.append(slice(0, cxrangeslice[it][1]-cxrangeslice[it][0]))11198 cslice2D.append(slice(0,maxy - cyrangeslice[it][0])) 11199 cslice2D.append(slice(0,maxx - cxrangeslice[it][0])) 11199 11200 11200 11201 rvarvalst = np.ones((Nrad*2+1,Nrad*2+1),dtype=np.float)*fillValue
Note: See TracChangeset
for help on using the changeset viewer.