Ejemplo n.º 1
0
def test_newpres():
	gp_0740=read_rays.construct_lassen_scan(path='/bm/gdata/scollis/gunn_pt/20060122_074001/')
	ber_0740=read_rays.construct_uf_scan(path='/bm/gdata/scollis/berrimah/20060122_074003/')	
	ber_loc=[-12.457, 130.925]
	gp_loc=	 [-12.2492,  131.0444]
	ldict={'lat_0':gp_loc[0], 'lon_0':gp_loc[1],'llcrnrlat':-13.0, 'llcrnrlon':130.2, 'urcrnrlat':-12.0 , 'urcrnrlon':131.2, 'lat_ts':gp_loc[0]}
	az_scan=0
	pres.plot_ppi(ber_0740[az_scan], 'CZ', radar_loc=ber_loc, loc_dict=ldict, fig_name='ber_cz_ppi.png')
	pres.plot_ppi(gp_0740[az_scan], 'CZ', radar_loc=gp_loc, loc_dict=ldict, fig_name='gp_cz_ppi.png')
	pres.plot_ppi(ber_0740[az_scan], 'VR', radar_loc=ber_loc, loc_dict=ldict, fig_name='ber_vr_ppi.png')
	pres.plot_ppi(gp_0740[az_scan], 'VR', radar_loc=gp_loc, loc_dict=ldict, fig_name='gp_vr_ppi.png')
	disp=mathematics.corner_to_point(gp_loc, ber_loc)
	xar=linspace(-50.,50., 100)*1000.0
	yar=linspace(-50.,50., 100)*1000.0
	lev=1000.0
	lstr="%(lev)05d" %{'lev':lev}
	pref_dir='20062201_0740_caps/'
	cap_gp_vr=radar_to_cart.make_cappi(gp_0740, xar, yar, lev, 'VR')
	cap_ber_vr=radar_to_cart.make_cappi(ber_0740, xar-disp[0], yar-disp[1], lev, 'VR')
	pres.plot_cappi(xar,yar,cap_gp_vr,gp_0740[0], parm='VR', fig_name=pref_dir+'gp_cappi_vr_'+lstr+'.png', loc_dict=ldict, radar_loc=gp_loc)
	pres.plot_cappi(xar,yar,cap_ber_vr,ber_0740[0], parm='VR', fig_name=pref_dir+'ber_cappi_vr_'+lstr+'.png', loc_dict=ldict, radar_loc=gp_loc)
	#cap_gp_test=radar_to_cart.make_cappi_testmode(gp_0740, xar, yar, lev, 'VR')
	#plot_cappi(xar,yar,cap_gp_test,ber_0740[0], parm='TEST', fig_name='test.png', loc_dict=ldict, radar_loc=gp_loc) 
	
	gp_cube_vr=zeros([100,100,31], dtype=float)
	ber_cube_vr=zeros([100,100,31], dtype=float)
	levs=linspace(500, 10500, 31)
	xar=linspace(-50.,50., 100)*1000.0
	yar=linspace(-50.,50., 100)*1000.0
	
	for i in range(31):
		gp_cap_vr=radar_to_cart.make_cappi(gp_0740, xar, yar, levs[i], 'CZ')
		gp_cube_vr[:,:,i]=gp_cap_vr
		ber_cap_vr=radar_to_cart.make_cappi(ber_0740, xar-disp[0], yar-disp[1], levs[i], 'CZ')
		ber_cube_vr[:,:,i]=ber_cap_vr
	
	for i in range(31):
		lstr="%(lev)05d" %{'lev':levs[i]}
		pres.plot_cappi(xar,yar,gp_cube_vr[:,:,i],gp_0740[0], parm='CZ', fig_name=pref_dir+'gp_cappi_cz_'+lstr+'.png', loc_dict=ldict, radar_loc=gp_loc)
		pres.plot_cappi(xar,yar,ber_cube_vr[:,:,i],ber_0740[0], parm='CZ', fig_name=pref_dir+'ber_cappi_cz_'+lstr+'.png', loc_dict=ldict, radar_loc=gp_loc)
		print 'Done', i, ' of 31'