* AERMOD ( 19191): A Simple Example Problem for the AERMOD Model with PRIME 03/28/21
* AERMET ( 15181): 17:48:56
* MODELING OPTIONS USED: RegDFAULT CONC ELEV RURAL MMIF_Data
* PLOT FILE OF PERIOD VALUES AVERAGED ACROSS 0 YEARS FOR SOURCE GROUP: ALL
* FOR A TOTAL OF 1600 RECEPTORS.
* FORMAT: (3(1X,F13.5),3(1X,F8.2),2X,A6,2X,A8,2X,I8.8,2X,A8)* X Y AVERAGE CONC ZELEV ZHILL ZFLAG AVE GRP NUM HRS NET ID
* ____________ ____________ ____________ ______ ______ ______ ______ ________ ________ ________
271200.00000 2765700.00000 0.01421 39.00 39.00 0.00 PERIOD ALL 00008761 LINKO
271520.00000 2765700.00000 0.01309 41.30 41.30 0.00 PERIOD ALL 00008761 LINKO
271840.00000 2765700.00000 0.01203 41.70 41.70 0.00 PERIOD ALL 00008761 LINKO
272160.00000 2765700.00000 0.01106 47.00 47.00 0.00 PERIOD ALL 00008761 LINKO
272480.00000 2765700.00000 0.01028 50.40 52.00 0.00 PERIOD ALL 00008761 LINKO
272800.00000 2765700.00000 0.00975 47.00 48.00 0.00 PERIOD ALL 00008761 LINKO
...
283680.00000 2778180.00000 0.02015 -15.50 -15.50 0.00 PERIOD ALL 00008761 LINKO
讀取時先將所有內容按行讀入,再一一分解。
程式說明
desc:有關模擬個案的敘述(TITLEONE)
x,y,c:東西向、南北向座標值,濃度序列
# read the iscst result plot file, must be in TWD97-m system, with 8 lines as header
withopen(fname,'r')asf:g=[lineforlineinf]#description txt is read from the third line
desc=' 'ifg[0][0:3]in['* A','* I']:desc=g[:3]g=g[8:]lg=len(g)x,y,c=(np.array([float(i.split()[j])foriing])forjinrange(3))
# 1-d X/Y coordinates
fac=1.nx,ny=int(max(int(np.sqrt(lg)),len(set(x)))*fac),int(max(int(np.sqrt(lg)),len(set(y)))*fac)#the domain of meshes must smaller than data domain to avoid extra_polation
dx,dy=(np.max(x)-np.min(x))/nx,(np.max(y)-np.min(y))/nyx_mesh=np.linspace(np.min(x)+dx,np.max(x)-dx,nx)y_mesh=np.linspace(np.min(y)+dy,np.max(y)-dy,ny)Xcent,Ycent=(x[0]+x[-1])/2.,(y[0]+y[-1])/2.Lat,Lon=twd97.towgs84(Xcent,Ycent)pnyc=Proj(proj='lcc',datum='NAD83',lat_1=10,lat_2=40,lat_0=Lat,lon_0=Lon,x_0=0,y_0=0.0)# 2-d mesh coordinates, both in TWD97 and WGS84
x_g,y_g=np.meshgrid(x_mesh,y_mesh)#lat,lon pairs are used in KML locations
xgl,ygl=x_g-Xcent,y_g-Ycentlon,lat=pnyc(xgl,ygl,inverse=True)points=[(i,j)fori,jinzip(x,y)]grid_z2=griddata(points,c,(x_g,y_g),method='linear')