<jupyter_start><jupyter_text>define in and out paths<jupyter_code>in_path = '\\Users\\bialas-j\\Documents\\standard-gap.azi\\Azimuts\\Reference\\Ref_def\\'
out_path_npz = '\\Users\\bialas-j\\Documents\\standard-gap.azi\\Azimuts\\Reference\\Ref_mean\\'
out_path_png = '\\Users\\bialas-j\\Documents\\standard-gap.azi\\Azimuts\\Reference\\Ref_mean\\_png\\'
#os.mkdir(path_map)
#os.mkdir(path_map_png)
#os.mkdir(path_corr)
#os.mkdir(path_corr_png)
file_list=os.listdir(in_path)
#print(file_list)

data_sum=0.0
Ref_sum_lin=0.0
n=60  ## how many clutter scans to accumulate

for file in file_list[:n]:
    #time_file=int(float(file[:16]))
    #print(file_name)
    #print(time_file)
    XML_data=0.0
    data=0.0
    ## load XML_data and data
    z=np.load(in_path+file)
    XML_data=z['XML_data']
    data=z['data']
    #print(XML_data)
    #print(data)
    #data_sum=data_sum+data
    Ref_sum_lin=Ref_sum_lin+wradlib.trafo.idecibel(data)
    Ref_dBZ_mean=wradlib.trafo.decibel(Ref_sum_lin/(n+0.0))<jupyter_output><empty_output><jupyter_text>cleen up first ranges<jupyter_code>Ref_dBZ_mean[:,:5] = -31.<jupyter_output><empty_output><jupyter_text>show results prepair data<jupyter_code>max_r = 500
r = np.arange(0,50000, 100)[:max_r]/1000.
az = np.arange(0, 360,2)

data = []
data = Ref_dBZ_mean[:,:max_r]
##Zugspitze only
#data = Ref_dBZ_mean[:,:max_r]*np.nan
#data[172/2:192/2,330:370] = Ref_dBZ_mean[172/2:192/2,330:370]

#Time_RS = num2date(time_RS[i],units='hours since 2000-01-01 00:50:00.0',calendar='standard')
time_file_s=int(float(file_list[0][:12]))
time_file_e=int(float(file_list[n][:12]))
#print(time_file_s)
time_start = datetime.datetime.strptime(str(time_file_s),'%Y%m%d%H%M')
time_end = datetime.datetime.strptime(str(time_file_e),'%Y%m%d%H%M')
print(time_start)
print(time_end)

title = 'Ref_dBZ_mean'+ '\n'+str(time_start)+'  to  '+str(time_end)+'\ncumul.= '+str(n)+' scans'
units = 'dBZ'<jupyter_output>2014-07-23 01:20:00
2014-08-01 00:10:00<jupyter_text>plot data<jupyter_code>fig = plt.figure(figsize=(13,5))
subplot = 121

#fraction=0.1
#shrink=1
#pad=0.09
#fontsize=12

Show.polar_plot(data, r, az, title, units, subplot)<jupyter_output>C:\Continuum\Anaconda2\envs\wradlib09\lib\site-packages\matplotlib\projections\polar.py:157: RuntimeWarning: invalid value encountered in remainder
  theta %= 2 * np.pi<jupyter_text>plot histogram<jupyter_code>data_show2 = Ref_dBZ_mean[:,:max_r]
## Zugspitze only
#data_show2 = Ref_dBZ_mean[172/2:192/2,330:370]
Max_b = 45
Min_b = -10
width_of_bin = 0.5
fig = plt.figure(figsize=(13,5))
subplot = 121

Max, Min, Mean, Median = Show.histogram(data_show2, Max_b, Min_b, width_of_bin, title, units, fig, subplot)
break<jupyter_output><empty_output><jupyter_text>save results<jupyter_code>file_name = 'Ref_simple_mean_test_'+str(n)
filename_npz = out_path_npz + file_name + '.npz'
filename_png = out_path_png + file_name + '.png'
    
XML_desc=(['Version', 'algorythm','# of scans'])
XML_value=([Version, 'simple_mean', n,])
XML_clutter=np.vstack((XML_desc,XML_value))
np.savez_compressed(filename_npz, XML_clutter = XML_clutter, Ref_dBZ_mean = Ref_dBZ_mean)

plt.savefig(filename_png, dpi=130)
plt.close()
print('End')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1702061211742661, 'fraction_numerical': 0.05246720799500312, 'mean_word_length': 6.662679425837321, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '547419', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1528, 'n_tokens_neox': 1395, 'n_words': 174, 'path': 'joachims_code/Reference_simple_mean_1.ipynb', 'repo_name': 'cchwala/rainscanner', 'size': '3202'}