Changeset 280 in lmdz_wrf
- Timestamp:
- Feb 25, 2015, 12:12:56 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r279 r280 10446 10446 yrangeslice2D.append([yinit2D, yend2D]) 10447 10447 xrangeslice2D.append([xinit2D, xend2D]) 10448 else: 10449 yrangeslice.append([gtrajvals[it,2]-box2, gtrajvals[it,2]+box2 + 1]) 10450 xrangeslice.append([gtrajvals[it,1]-box2, gtrajvals[it,1]+box2 + 1]) 10451 yrangeslice2D.append([gtrajvals[it,2]-box2, gtrajvals[it,2]+box2 + 1]) 10452 xrangeslice2D.append([gtrajvals[it,1]-box2, gtrajvals[it,1]+box2 + 1]) 10448 10453 10449 10454 # circle values … … 10486 10491 cyrangeslice2D.append([yinit2D, yend2D]) 10487 10492 cxrangeslice2D.append([xinit2D, xend2D]) 10493 else: 10494 cyrangeslice.append([gtrajvals[it,2]-Nrad, gtrajvals[it,2]+Nrad + 1]) 10495 cxrangeslice.append([gtrajvals[it,1]-Nrad, gtrajvals[it,1]+Nrad + 1]) 10496 cyrangeslice2D.append([gtrajvals[it,2]-Nrad, gtrajvals[it,2]+Nrad + 1]) 10497 cxrangeslice2D.append([gtrajvals[it,1]-Nrad, gtrajvals[it,1]+Nrad + 1]) 10498 10488 10499 10489 10500 iline = iline + 1 10490 10501 10491 10502 trajobj.close() 10503 10504 print 'Lluis _________' 10505 print yrangeslice 10506 10507 quit() 10492 10508 10493 10509 # Creation of the netCDF file … … 10526 10542 10527 10543 if not objofile.dimensions.has_key('z'): 10528 newdim = objofile.createDimension('z', dim t)10544 newdim = objofile.createDimension('z', dimz) 10529 10545 10530 10546 varzobj = objfile.variables[zn] … … 10560 10576 for it in range(dimt): 10561 10577 # box values 10562 slicev.appen(slice(0,dimz)) 10563 slicev.appen(slice(yrangeslice[it])) 10564 slicev.appen(slice(xrangeslice[it])) 10565 10566 slicevnoT.appen(slice(0,dimz)) 10567 slicevnoT.appen(slice(yrangeslice[it])) 10568 slicevnoT.appen(slice(xrangeslice[it])) 10569 10570 slice2D.appen(slice(0,dimz)) 10571 slice2D.appen(slice(yrangeslice2D[it])) 10572 slice2D.appen(slice(xrangeslice2D[it])) 10578 print it,'/',dimt, yrangeslice 10579 quit() 10580 slicev.append(slice(0,dimz)) 10581 slicev.append(slice(yrangeslice[it])) 10582 slicev.append(slice(xrangeslice[it])) 10583 10584 slicevnoT.append(slice(0,dimz)) 10585 slicevnoT.append(slice(yrangeslice[it])) 10586 slicevnoT.append(slice(xrangeslice[it])) 10587 10588 slice2D.append(slice(0,dimz)) 10589 slice2D.append(slice(yrangeslice2D[it])) 10590 slice2D.append(slice(xrangeslice2D[it])) 10573 10591 10574 10592 if gtrajvals[it,2]-box2 < 0 or gtrajvals[it,2]+box2 + 1 > dimy + 1 \ … … 10622 10640 10623 10641 # Circle values 10624 cslicev.appen (slice(0,dimz))10625 cslicev.appen (slice(cyrangeslice[it]))10626 cslicev.appen (slice(cxrangeslice[it]))10627 10628 cslicevnoT.appen (slice(0,dimz))10629 cslicevnoT.appen (slice(cyrangeslice[it]))10630 cslicevnoT.appen (slice(cxrangeslice[it]))10631 10632 cslice2D.appen (slice(0,dimz))10633 cslice2D.appen (slice(cyrangeslice2D[it]))10634 cslice2D.appen (slice(cxrangeslice2D[it]))10642 cslicev.append(slice(0,dimz)) 10643 cslicev.append(slice(cyrangeslice[it])) 10644 cslicev.append(slice(cxrangeslice[it])) 10645 10646 cslicevnoT.append(slice(0,dimz)) 10647 cslicevnoT.append(slice(cyrangeslice[it])) 10648 cslicevnoT.append(slice(cxrangeslice[it])) 10649 10650 cslice2D.append(slice(0,dimz)) 10651 cslice2D.append(slice(cyrangeslice2D[it])) 10652 cslice2D.append(slice(cxrangeslice2D[it])) 10635 10653 10636 10654 if gtrajvals[it,2]-Nrad < 0 or gtrajvals[it,2]+Nrad + 1 > dimy + 1 \ … … 10771 10789 for it in range(dimt): 10772 10790 # box values 10773 slicev.appen (slice(yrangeslice[it]))10774 slicev.appen (slice(xrangeslice[it]))10775 10776 slicevnoT.appen (slice(yrangeslice[it]))10777 slicevnoT.appen (slice(xrangeslice[it]))10778 10779 slice2D.appen (slice(yrangeslice2D[it]))10780 slice2D.appen (slice(xrangeslice2D[it]))10791 slicev.append(slice(yrangeslice[it])) 10792 slicev.append(slice(xrangeslice[it])) 10793 10794 slicevnoT.append(slice(yrangeslice[it])) 10795 slicevnoT.append(slice(xrangeslice[it])) 10796 10797 slice2D.append(slice(yrangeslice2D[it])) 10798 slice2D.append(slice(xrangeslice2D[it])) 10781 10799 10782 10800 if gtrajvals[it,2]-box2 < 0 or gtrajvals[it,2]+box2 + 1 > dimy + 1 \ … … 10839 10857 10840 10858 # Circle values 10841 cslicev.appen (slice(cyrangeslice[it]))10842 cslicev.appen (slice(cxrangeslice[it]))10843 10844 cslicevnoT.appen (slice(cyrangeslice[it]))10845 cslicevnoT.appen (slice(cxrangeslice[it]))10846 10847 cslice2D.appen (slice(cyrangeslice2D[it]))10848 cslice2D.appen (slice(cxrangeslice2D[it]))10859 cslicev.append(slice(cyrangeslice[it])) 10860 cslicev.append(slice(cxrangeslice[it])) 10861 10862 cslicevnoT.append(slice(cyrangeslice[it])) 10863 cslicevnoT.append(slice(cxrangeslice[it])) 10864 10865 cslice2D.append(slice(cyrangeslice2D[it])) 10866 cslice2D.append(slice(cxrangeslice2D[it])) 10849 10867 if gtrajvals[it,2]-Nrad < 0 or gtrajvals[it,2]+Nrad + 1 > dimy + 1 \ 10850 10868 or gtrajvals[it,1]-Nrad < 0 or gtrajvals[it,1]+Nrad + 1 > dimx + 1:
Note: See TracChangeset
for help on using the changeset viewer.