#-------------------------------------------------------- #Interpolate data in height #-------------------------------------------------------- [Pi, Ti, Vi] = PyAPS.intP2H(lvls, hgt, gph, tmp, vpr, cdic) #-------------------------------------------------------- #Computing Delay functions #-------------------------------------------------------- [DDry, DWet] = PyAPS.PTV2del(Pi, Ti, Vi, hgt, cdic) Delfn = DDry+DWet #-------------------------------------------------------- #Building the interpolation function #-------------------------------------------------------- fnc = PyAPS.make3dintp(Delfn, xi, yi, hgt, hgtscale) #-------------------------------------------------------- #Writing to File #-------------------------------------------------------- print 'PROGRESS: WRITING TO FILE' yarr = np.arange(1, ny+1) xarr = np.arange(1, nx+1) # fin = open(dname, 'rb') fout = open(oname, 'wb') for m in range(0, 2*ny, 2): dem = np.fromfile(file=dname, dtype=np.float32, count=nx) dem[dem < minAltp] = minAltp demy = dem.astype(np.float64)
#################Reading in Weather Data from NARR file############# [lvls,latlist,lonlist,gph,tmp,vpr] = PyAPS.get_era(fname,lat[0]-bufspc,lat[1]+bufspc,lon[0]-bufspc,lon[1]+bufspc,cdict) ##########Interpolating to heights from Pressure levels########### [Presi,Tempi,Vpri] = PyAPS.intP2H(lvls,hgt,gph,tmp,vpr,cdict) ###########Computing the delay function ############################### [DDry,DWet] = PyAPS.PTV2del(Presi,Tempi,Vpri,hgt,cdict) Delfn = DDry+DWet del DDry del DWet #########Reading in DEM and writing output ################# #######################make_geomap.f90####################### fnc = PyAPS.make3dintp(Delfn,lonlist,latlist,hgt,hgtscale) print 'PROGRESS: INTERPOLATION FUNCTION READY' minAltp = cdict['minAltP'] laty = np.linspace(lat[1], lat[0], ny) lonx = np.linspace(lon[0], lon[1], nx) fout = open(oname, 'wb') for m in range(ny): dem = np.fromfile(dname, dtype=np.int16, count=nx) dem[dem<minAltp] = minAltp demy = dem.astype(np.float64) llh = np.zeros((nx, 3)) llh[:, 0] = lonx llh[:, 1] = laty[m]