1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
import matplotlib.pyplot as plt import pyart from sys import exit
if __name__=='__main__': radar=pyart.io.read_cfradial('CfRadial_1.nc') if radar.scan_type!='ppi': exit('Error: 请使用扫描方式为PPI的数据文件') spec_at,cor_z=art.correct.calculate_attenuation( radar,0,refl_field='reflectivity', ncp_field='SNR',rhv_field='cross_correlation_ratio', phidp_field='differential_phase') radar.add_field('specific_attenuation',spec_at) radar.add_field('corrected_reflectivity_horizontal',cor_z) lyrNo=0 fig=plt.figure(figsize=(15,5)) ax1=fig.add_subplot(121) display=pyart.graph.RadarDisply(radar) display.plot('reflectivity',lyrNo,ax=ax1,vmin=-20,vmax=60., colorbar_label='',title='Raw Reflectivity',cmap='jet') display.set_limits((-150,150),(-150,150),ax=ax1) ax2=fig.add_subplot(122) display.plot('corrected_reflectivity_horizontal',lyrNo, vmin=-20,vmax=60.,colorbar_label='',ax=ax2, title='Corrected Reflectivity',cmap='jet') display.set_limits((-150,150),(-150,150),ax=ax2) plt.suptitle('Attenuation correction using Py-ART',fontsize=16) plt.show()
|
Comments