Changeset 2173 in lmdz_wrf for trunk/tools
- Timestamp:
- Oct 9, 2018, 8:19:21 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r2169 r2173 25954 25954 str(stlats[ist])) 25955 25955 stdataij[stns[ist]] = [ijst, dst] 25956 dlon = lon[ijst[ 0],ijst[1]]25957 dlat = lat[ijst[ 0],ijst[1]]25956 dlon = lon[ijst[1],ijst[0]] 25957 dlat = lat[ijst[1],ijst[0]] 25958 25958 25959 25959 # Writing in file station values from grid 25960 newvari[ist] = ijst[ 1]25961 newvarj[ist] = ijst[ 0]25960 newvari[ist] = ijst[0] 25961 newvarj[ist] = ijst[1] 25962 25962 newvarlon[ist] = dlon 25963 25963 newvarlat[ist] = dlat … … 25971 25971 weights = np.ones((1), dtype=np.float) 25972 25972 elif method == 'mean' or method == 'dist': 25973 ddx = lon[ijst[ 0],ijst[1]+1] - dlon25974 ddy = lat[ijst[ 0]+1,ijst[1]] - dlat25973 ddx = lon[ijst[1],ijst[0]+1] - dlon 25974 ddy = lat[ijst[1]+1,ijst[0]] - dlat 25975 25975 signx = np.abs(ddx)/ddx 25976 25976 signy = np.abs(ddy)/ddy … … 25982 25982 25983 25983 # Avoiding outside shape 25984 xij = np.min([ijst[ 1]+incx, ddimx-1])25985 yij = np.min([ijst[ 0]+incy, ddimy-1])25984 xij = np.min([ijst[0]+incx, ddimx-1]) 25985 yij = np.min([ijst[1]+incy, ddimy-1]) 25986 25986 xij = int(np.max([0, xij])) 25987 25987 yij = int(np.max([0, yij])) 25988 25988 25989 25989 ptvslice.append(ijst) 25990 ptvslice.append([ijst[ 0],xij])25991 ptvslice.append([yij,ijst[ 1]])25990 ptvslice.append([ijst[1],xij]) 25991 ptvslice.append([yij,ijst[0]]) 25992 25992 ptvslice.append([yij,xij]) 25993 25993
Note: See TracChangeset
for help on using the changeset viewer.