Changeset 1737 in lmdz_wrf
- Timestamp:
- Dec 16, 2017, 7:15:39 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r1736 r1737 20697 20697 """ Function to reconstruct a 2D matrix from a pair of syncronized vectors with 20698 20698 the positions on x and y coordinates 20699 values=[varXpos]:[varYpos]:[Xmin]:[Xmax]:[Ymin]:[Ymax]:[matProj]:[ maxdiff]20699 values=[varXpos]:[varYpos]:[Xmin]:[Xmax]:[Ymin]:[Ymax]:[matProj]:[resX]:[resY]:[maxdiff] 20700 20700 [varXpos]: variable with the vector of X positions 20701 20701 [varYpos]: variable with the vector of Y positions … … 20706 20706 [matProj]: assumed projection of the final matrix 20707 20707 'latlon': regular lon/lat projection 20708 [resX]: resolution along the x-axis (to be interpreted according to the projection) 20709 [resY]: resolution along the y-axis (to be interpreted according to the projection) 20708 20710 [maxdiff]: maximum allowed distance between matrix grid point and vector location 20709 20711 ncfile= netCDF file to use … … 20721 20723 20722 20724 expectargs = '[varXpos]:[varYpos]:[Xmin]:[Xmax]:[Ymin]:[Ymax]:[matProj]:' + \ 20723 '[ maxdiff]'20725 '[resX]:[resY]:[maxdiff]' 20724 20726 gen.check_arguments(fname, values, expectargs, ':') 20725 20727 … … 20734 20736 Xmin = values.split(':')[2] 20735 20737 matProj = values.split(':')[6] 20736 maxdiff = np.float(values.split(':')[7]) 20738 resX = np.float(values.split(':')[7]) 20739 resY = np.float(values.split(':')[8]) 20740 maxdiff = np.float(values.split(':')[9]) 20737 20741 20738 20742 if not gen.searchInlist(availProj, matProj): … … 20799 20803 # Matrix values 20800 20804 if matProj == 'latlon': 20801 ddx = xposv[1]- xposv[0] 20802 ddy = yposv[1]- yposv[0] 20803 dimx = (Xmax - Xmin+ddx)/ddx 20804 dimy = (Ymax - Ymin+ddy)/ddy 20805 dimx = (Xmax - Xmin+resX)/resX 20806 dimy = (Ymax - Ymin+resY)/resY 20805 20807 20806 20808 print dir(Sci)
Note: See TracChangeset
for help on using the changeset viewer.