metradar 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. metradar/__init__.py +7 -0
  2. metradar/cnrad_level2.py +1326 -0
  3. metradar/comm_func.py +135 -0
  4. metradar/construct_aws_refvpr_mainprog.py +515 -0
  5. metradar/construct_aws_refvpr_mainprog_cams.py +310 -0
  6. metradar/construct_aws_refvpr_mainprog_datan3d.py +386 -0
  7. metradar/construct_aws_refvpr_mainprog_swan.py +306 -0
  8. metradar/decode_fmt_pyart.py +200 -0
  9. metradar/decode_pup_rose.py +1993 -0
  10. metradar/draw_mosaic_new.py +421 -0
  11. metradar/draw_radar_aws_jilin_new.py +206 -0
  12. metradar/draw_radar_comp_func.py +1379 -0
  13. metradar/exceptions.py +50 -0
  14. metradar/geo_transforms_pyart.py +627 -0
  15. metradar/get_cross_section_from_pyart.py +354 -0
  16. metradar/get_tlogp_from_sharppy.py +93 -0
  17. metradar/grid.py +281 -0
  18. metradar/grid_data.py +64 -0
  19. metradar/main_pydda.py +653 -0
  20. metradar/make_gif.py +24 -0
  21. metradar/make_mosaic_mp_archive.py +538 -0
  22. metradar/mosaic_merge.py +64 -0
  23. metradar/mosaic_quickdraw.py +338 -0
  24. metradar/nowcast_by_pysteps.py +219 -0
  25. metradar/oa_couhua.py +166 -0
  26. metradar/oa_dig_func.py +955 -0
  27. metradar/parse_pal.py +148 -0
  28. metradar/pgmb_io.py +169 -0
  29. metradar/prepare_for_radar_draw.py +197 -0
  30. metradar/read_new_mosaic.py +33 -0
  31. metradar/read_new_mosaic_func.py +231 -0
  32. metradar/retrieve_cmadaas.py +3126 -0
  33. metradar/retrieve_micaps_server.py +2061 -0
  34. metradar/rose_structer.py +807 -0
  35. metradar/trans_nc_pgmb.py +62 -0
  36. metradar/trans_new_mosaic_nc.py +309 -0
  37. metradar/trans_polor2grid_func.py +203 -0
  38. metradar-0.1.0.dist-info/METADATA +12 -0
  39. metradar-0.1.0.dist-info/RECORD +41 -0
  40. metradar-0.1.0.dist-info/WHEEL +5 -0
  41. metradar-0.1.0.dist-info/top_level.txt +1 -0
metradar/parse_pal.py ADDED
@@ -0,0 +1,148 @@
1
+ import numpy as np
2
+ from matplotlib.colors import LinearSegmentedColormap, Normalize
3
+ import matplotlib.pyplot as plt
4
+ from matplotlib.colorbar import ColorbarBase
5
+ import re
6
+
7
+ # 请将色标文件中的solidcolor字段替换为color
8
+ def parse(file):
9
+ lines = []
10
+ vals = []
11
+ red = []
12
+ green = []
13
+ blue = []
14
+ last_color = None
15
+ transit_flag = False
16
+ with open(file, 'r',encoding='gb18030') as f:
17
+ for line in f:
18
+ if not line.lower().startswith('color:'):
19
+ continue
20
+ l = line.lower().lstrip('color: ').strip()
21
+ lines.append(l)
22
+ lines.sort(key=lambda x: float(x.split(' ')[0]))
23
+ color_len = len(lines)
24
+ for idx, l in enumerate(lines):
25
+ segs = [i for i in l.split(' ') if i]
26
+ vals.append(float(segs[0]))
27
+ current_color = tuple(int(i) / 255 for i in segs[1:4])
28
+ if color_len - idx == 2:
29
+ transit_flag = transit_flag if transit_flag else False
30
+ if not isinstance(last_color, tuple) and len(segs) == 3:
31
+ red.append((0, current_color[0]))
32
+ green.append((0, current_color[1]))
33
+ blue.append((0, current_color[2]))
34
+ last_color = current_color
35
+ else:
36
+ if len(segs) == 7 or color_len - idx == 2:
37
+ transit_color = tuple(int(i) / 255 for i in segs[4:7])
38
+ if transit_flag:
39
+ red.append((last_color[0], current_color[0]))
40
+ green.append((last_color[1], current_color[1]))
41
+ blue.append((last_color[2], current_color[2]))
42
+ else:
43
+ red.append((current_color[0], current_color[0]))
44
+ green.append((current_color[1], current_color[1]))
45
+ blue.append((current_color[2], current_color[2]))
46
+ last_color = transit_color
47
+ transit_flag = True
48
+ else:
49
+ red.append((current_color[0], current_color[0]))
50
+ green.append((current_color[1], current_color[1]))
51
+ blue.append((current_color[2], current_color[2]))
52
+ last_color = current_color
53
+ transit_flag = False
54
+ norm_array = (np.array(vals) - vals[0]) / (vals[-1] - vals[0])
55
+ cdict = {'red':[], 'green':[], 'blue':[]}
56
+ for idx in range(len(norm_array)):
57
+ cdict['red'].append((norm_array[idx],) + red[idx])
58
+ cdict['green'].append((norm_array[idx],) + green[idx])
59
+ cdict['blue'].append((norm_array[idx],) + blue[idx])
60
+ return LinearSegmentedColormap('cmap', cdict), Normalize(vals[0], vals[-1])
61
+
62
+ # 可以支持alpha,朱文剑,20210831
63
+ def parse_pro(file):
64
+ lines = []
65
+ vals = []
66
+ red = []
67
+ green = []
68
+ blue = []
69
+ alpha=[]
70
+ last_color = None
71
+ transit_flag = False
72
+ units=''
73
+ with open(file, 'r') as f:
74
+ for line in f:
75
+ if line.lower().startswith('units'):
76
+ units = re.split(r"[ ]+",line)[1].strip()
77
+ if not line.lower().startswith('color'):
78
+ continue
79
+ lines.append(line.strip())
80
+ lines.sort(key=lambda x: float(re.split(r"[ ]+",x)[1]))
81
+ color_len = len(lines)
82
+ for idx, l in enumerate(lines):
83
+ segs = [i for i in l.split(' ') if i]
84
+ vals.append(float(segs[1]))
85
+
86
+ current_color = tuple(int(i) / 255 for i in segs[2::])
87
+
88
+ if color_len - idx == 2:
89
+ transit_flag = transit_flag if transit_flag else False
90
+
91
+ if len(segs) >=8 or color_len - idx == 2:
92
+ if len(segs) == 10:
93
+ transit_color = tuple(int(i) / 255 for i in segs[6:10])
94
+ elif len(segs)==8:
95
+ transit_color = tuple(int(i) / 255 for i in segs[5:8])
96
+
97
+ if transit_flag:
98
+ red.append((last_color[0], current_color[0]))
99
+ green.append((last_color[1], current_color[1]))
100
+ blue.append((last_color[2], current_color[2]))
101
+ if segs[0]=='Color4:':
102
+ alpha.append((last_color[3], current_color[3]))
103
+ else:
104
+ alpha.append((1, 1))
105
+ else:
106
+ red.append((current_color[0], current_color[0]))
107
+ green.append((current_color[1], current_color[1]))
108
+ blue.append((current_color[2], current_color[2]))
109
+ if segs[0]=='Color4:':
110
+ alpha.append((current_color[3], current_color[3]))
111
+ else:
112
+ alpha.append((1.0, 1.0))
113
+ if len(segs) == 10 or len(segs) == 8:
114
+ last_color = transit_color
115
+ transit_flag = True
116
+ else:
117
+ red.append((current_color[0], current_color[0]))
118
+ green.append((current_color[1], current_color[1]))
119
+ blue.append((current_color[2], current_color[2]))
120
+ if segs[0]=='Color4:':
121
+ alpha.append((current_color[3], current_color[3]))
122
+ else:
123
+ alpha.append((1.0, 1.0))
124
+ last_color = current_color
125
+ transit_flag = False
126
+
127
+ norm_array = (np.array(vals) - vals[0]) / (vals[-1] - vals[0])
128
+ cdict = {'red':[], 'green':[], 'blue':[], 'alpha':[]}
129
+
130
+ for idx in range(len(norm_array)):
131
+ cdict['red'].append((norm_array[idx],) + red[idx])
132
+ cdict['green'].append((norm_array[idx],) + green[idx])
133
+ cdict['blue'].append((norm_array[idx],) + blue[idx])
134
+ cdict['alpha'].append((norm_array[idx],) + alpha[idx])
135
+
136
+ outdic=dict()
137
+ outdic['cmap'] = LinearSegmentedColormap('cmap', cdict)
138
+ outdic['norm'] = Normalize(vals[0], vals[-1])
139
+ outdic['units'] = units
140
+ return outdic
141
+
142
+ if __name__ == "__main__":
143
+
144
+ outdic = parse_pro('gr2_colors/IR_dark_alpha.pal')
145
+ fig = plt.figure(figsize=(3, 11))
146
+ ax = plt.gca()
147
+ cbar = ColorbarBase(ax, orientation="vertical", cmap=outdic['cmap'], norm=outdic['norm'])
148
+ plt.show()
metradar/pgmb_io.py ADDED
@@ -0,0 +1,169 @@
1
+ #! /usr/bin/python3
2
+ #
3
+ def pgmb_write ( file_name,params, width, height, maxval, gray ):
4
+
5
+ #*****************************************************************************80
6
+ #
7
+ ## PGMB_WRITE writes a binary PGM graphics file.
8
+ #
9
+ # Licensing:
10
+ #
11
+ # This code is distributed under the GNU LGPL license.
12
+ #
13
+ # Modified:
14
+ #
15
+ # 14 September 2018
16
+ #
17
+ # Author:
18
+ #
19
+ # John Burkardt
20
+ #
21
+ # Parameters:
22
+ #
23
+ # Input, string FILE_NAME, the name of the file.
24
+ #
25
+ # Input, integer WIDTH, HEIGHT, the width and height of the graphics image.
26
+ #
27
+ # Input, integer MAXVAL, the maximum allowed gray value.
28
+ #
29
+ # Input, integer GRAY[WIDTH*HEIGHT], values between 0 and MAXVAL.
30
+ #
31
+ import numpy as np
32
+ import struct
33
+
34
+ file_handle = open ( file_name, 'wb' )
35
+ #
36
+ # Set up the header.
37
+ #
38
+ # params['obstimestr'] = 201609281600
39
+ # params['left_lon'] = 109
40
+ # params['right_lon'] = 117
41
+ # params['bottom_lat'] = 33
42
+ # params['upper_lat'] = 37
43
+
44
+ pgm_header = 'P5\n'
45
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
46
+
47
+ pgm_header = '# composite_area FIN\n'
48
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
49
+ pgm_header = '# obstime %s\n'%params['obstimestr']
50
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
51
+ pgm_header = '# producttype CAPPI\n'
52
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
53
+ pgm_header = '# productname LOWEST\n'
54
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
55
+ pgm_header = '# param CorrectedReflectivity\n'
56
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
57
+ pgm_header = '# metersperpixel_x 999.674053\n'
58
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
59
+ pgm_header = '# metersperpixel_y 999.62859\n'
60
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
61
+ pgm_header = '# projection radar {\n'
62
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
63
+ pgm_header = '# type stereographic\n'
64
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
65
+ pgm_header = '# centrallongitude 110\n'
66
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
67
+ pgm_header = '# centrallatitude 90\n'
68
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
69
+ pgm_header = '# truelatitude 60\n'
70
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
71
+ pgm_header = '# bottomleft %.3f %.3f\n'%(params['left_lon'],params['bottom_lat'])
72
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
73
+ pgm_header = '# topright %.3f %.3f\n'%(params['right_lon'],params['upper_lat'])
74
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
75
+ pgm_header = '# }\n'
76
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
77
+ # b'# composite_area FIN\n'
78
+ # b'# projection_name SUOMI1\n'
79
+
80
+ # b'# obstime 201609281600\n'
81
+ # b'# producttype CAPPI\n'
82
+ # b'# productname LOWEST\n'
83
+ # b'# param CorrectedReflectivity\n'
84
+ # b'# metersperpixel_x 999.674053\n'
85
+ # b'# metersperpixel_y 999.62859\n'
86
+ # b'# projection radar {\n'
87
+ # b'# type stereographic\n'
88
+ # b'# centrallongitude 25\n'
89
+ # b'# centrallatitude 90\n'
90
+ # b'# truelatitude 60\n'
91
+ # b'# bottomleft 18.600000 57.930000\n'
92
+ # b'# topright 34.903000 69.005000\n'
93
+ # b'# }\n'
94
+
95
+ pgm_header = f'{width} {height}\n'
96
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
97
+ pgm_header = f'{maxval}\n'
98
+ file_handle.write ( bytearray ( pgm_header, 'ascii' ) )
99
+ #
100
+ # Convert 2D array to 1D vector.
101
+ #
102
+ grayV = np.reshape ( gray, width * height )
103
+ #
104
+ # Pack entries of vector into a string of bytes, replacing each integer
105
+ # as an unsigned 1 byte character.
106
+ #
107
+ grayB = struct.pack ( '%sB' % len(grayV), *grayV )
108
+ file_handle.write ( grayB )
109
+
110
+ file_handle.close ( )
111
+
112
+ return
113
+
114
+ def pgmb_write_test ( ):
115
+
116
+ #*****************************************************************************80
117
+ #
118
+ ## PGMB_WRITE_TEST tests PGMB_WRITE.
119
+ #
120
+ # Licensing:
121
+ #
122
+ # This code is distributed under the GNU LGPL license.
123
+ #
124
+ # Modified:
125
+ #
126
+ # 14 May 2017
127
+ #
128
+ # Author:
129
+ #
130
+ # John Burkardt
131
+ #
132
+ import numpy as np
133
+ import platform
134
+
135
+ print ( '' )
136
+ print ( 'PGMB_WRITE_TEST:' )
137
+ print ( ' Python version: %s' % ( platform.python_version ( ) ) )
138
+ print ( ' PGMB_WRITE writes a binary PGM graphics file.' )
139
+
140
+ file_name = '/Users/wenjianzhu/Downloads/pgmb_io_test.pgm'
141
+ width = 24
142
+ height = 7
143
+ maxval = 255
144
+
145
+ gray = np.array \
146
+ ( [ \
147
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \
148
+ [ 0, 64, 64, 64, 64, 0, 0, 128, 128, 128, 128, 0, 0, 192, 192, 192, 192, 0, 0, 255, 255, 255, 255, 0], \
149
+ [ 0, 64, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 255, 0, 0, 255, 0], \
150
+ [ 0, 64, 64, 64, 0, 0, 0, 128, 128, 128, 0, 0, 0, 192, 192, 192, 0, 0, 0, 255, 255, 255, 255, 0], \
151
+ [ 0, 64, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0], \
152
+ [ 0, 64, 0, 0, 0, 0, 0, 128, 128, 128, 128, 0, 0, 192, 192, 192, 192, 0, 0, 255, 0, 0, 0, 0], \
153
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] \
154
+ ] )
155
+
156
+ pgmb_write ( file_name, width, height, maxval, gray )
157
+
158
+ print ( '' )
159
+ print ( ' Graphics data stored in file "%s".' % ( file_name ) )
160
+ #
161
+ # Terminate.
162
+ #
163
+ print ( '' )
164
+ print ( 'PGMB_WRITE_TEST:' )
165
+ print ( ' Normal end of execution.' )
166
+ return
167
+
168
+ if ( __name__ == '__main__' ):
169
+ pgmb_write_test ( )
@@ -0,0 +1,197 @@
1
+ '''
2
+ prepare for radar_draw_aws.py
3
+
4
+ '''
5
+
6
+ import os
7
+ import sys
8
+ import pandas as pd
9
+
10
+ #递归查找
11
+ def show_files(path, all_files,allpaths):
12
+ # 首先遍历当前目录所有文件及文件夹
13
+ file_list = os.listdir(path)
14
+ # 准备循环判断每个元素是否是文件夹还是文件,是文件的话,把名称传入list,是文件夹的话,递归
15
+ for file in file_list:
16
+ # 利用os.path.join()方法取得路径全名,并存入cur_path变量,否则每次只能遍历一层目录
17
+ cur_path = os.path.join(path, file)
18
+
19
+ if file.startswith('.') or file.startswith('..'):
20
+ continue
21
+
22
+ # 判断是否是文件夹
23
+ if os.path.isdir(cur_path):
24
+ show_files(cur_path, all_files,allpaths)
25
+ else:
26
+ all_files.append(file)
27
+ allpaths.append(path)
28
+
29
+ return all_files
30
+
31
+ def mainfunc(dic_param):
32
+
33
+ allfiles = []
34
+ allpaths = []
35
+ show_files(dic_param['filepath'],allfiles,allpaths)
36
+
37
+ start_lat=[]
38
+ end_lat=[]
39
+ start_lon=[]
40
+ end_lon=[]
41
+ alloutpaths=[]
42
+
43
+ for nn in range(len(allfiles)):
44
+ curout = dic_param['rootout'] + os.sep + allpaths[nn].split(os.sep)[-1]
45
+ # print(curout)
46
+
47
+ # alloutpaths.append(curout)
48
+ # start_lat.append('')
49
+ # end_lat.append('')
50
+ # start_lon.append('')
51
+ # end_lon.append('')
52
+
53
+ alloutpaths.append(curout)
54
+ start_lat.append(dic_param['startlat'])
55
+ end_lat.append(dic_param['endlat'])
56
+ start_lon.append(dic_param['startlon'])
57
+ end_lon.append(dic_param['endlon'])
58
+
59
+ outdic = {
60
+ 'sourcepath':allpaths,
61
+ 'outpath':alloutpaths,
62
+ 'filename':allfiles,
63
+ 'start_lat':start_lat,
64
+ 'end_lat':end_lat,
65
+ 'start_lon':start_lon,
66
+ 'end_lon':end_lon,
67
+ }
68
+
69
+ outpd = pd.DataFrame(outdic)
70
+ newpd = outpd.sort_values(by='filename')
71
+ newpd.to_csv(dic_param['outname'],encoding='gb18030')
72
+ print(dic_param['outname'] + ' done!')
73
+
74
+ if __name__ == "__main__":
75
+
76
+ # dic_param={}
77
+ # dic_param['filepath'] = '/Users/wenjianzhu/Downloads/雷达数据-王婷婷/ar2v/20190602-辽源'
78
+ # dic_param['rootout']='/Users/wenjianzhu/Downloads/雷达数据-王婷婷/pic'
79
+ # dic_param['outname'] = 'radardrawlist_20190602.csv'
80
+
81
+ # dic_param['startlon'] = 124.2
82
+ # dic_param['endlon'] = 126
83
+ # dic_param['startlat'] = 43.5
84
+ # dic_param['endlat'] = 44.4
85
+
86
+ # mainfunc(dic_param=dic_param)
87
+
88
+ type = '强度'
89
+
90
+ if type == '强度':
91
+ outpath = '/Users/wenjianzhu/Downloads/雷达数据-王婷婷/绘图参数/回波强度'
92
+ elif type == '速度':
93
+ outpath = '/Users/wenjianzhu/Downloads/雷达数据-王婷婷/绘图参数/径向速度'
94
+
95
+ if not os.path.exists(outpath):
96
+ os.makedirs(outpath)
97
+
98
+
99
+ #==================================================================================
100
+ # dic_param={}
101
+ # dic_param['filepath'] = '/Users/wenjianzhu/Downloads/雷达数据-王婷婷/ar2v/20120612-白城'
102
+ # dic_param['rootout']='/Users/wenjianzhu/Downloads/雷达数据-王婷婷/pic'
103
+ # dic_param['outname'] = outpath + os.sep + 'radardrawlist_20120612.csv'
104
+
105
+ # if type == '强度':
106
+ # dic_param['startlon'] = 122.37
107
+ # dic_param['endlon'] = 122.97
108
+ # dic_param['startlat'] = 45.34
109
+ # dic_param['endlat'] = 45.89
110
+ # elif type == '速度':
111
+ # dic_param['startlon'] = 122.6
112
+ # dic_param['endlon'] = 122.83
113
+ # dic_param['startlat'] = 45.58
114
+ # dic_param['endlat'] = 45.76
115
+
116
+ # mainfunc(dic_param=dic_param)
117
+
118
+
119
+ # dic_param={}
120
+ # dic_param['filepath'] = '/Users/wenjianzhu/Downloads/雷达数据-王婷婷/ar2v/20120701-白城'
121
+ # dic_param['rootout']='/Users/wenjianzhu/Downloads/雷达数据-王婷婷/pic'
122
+ # dic_param['outname'] = outpath + os.sep + 'radardrawlist_20120701.csv'
123
+
124
+ # if type == '强度':
125
+ # dic_param['startlon'] = 123.1
126
+ # dic_param['endlon'] = 124.32
127
+ # dic_param['startlat'] = 45.11
128
+ # dic_param['endlat'] = 45.97
129
+ # elif type == '速度':
130
+ # dic_param['startlon'] = 123.65
131
+ # dic_param['endlon'] = 124.32
132
+ # dic_param['startlat'] = 45.45
133
+ # dic_param['endlat'] = 45.97
134
+
135
+ # mainfunc(dic_param=dic_param)
136
+
137
+
138
+ # dic_param={}
139
+ # dic_param['filepath'] = '/Users/wenjianzhu/Downloads/雷达数据-王婷婷/ar2v/20150608-白城'
140
+ # dic_param['rootout']='/Users/wenjianzhu/Downloads/雷达数据-王婷婷/pic'
141
+ # dic_param['outname'] = outpath + os.sep + 'radardrawlist_20150608.csv'
142
+
143
+ # if type == '强度':
144
+ # dic_param['startlon'] = 122.3
145
+ # dic_param['endlon'] = 124.3
146
+ # dic_param['startlat'] = 44.2
147
+ # dic_param['endlat'] = 45.5
148
+ # elif type == '速度':
149
+ # dic_param['startlon'] = 122.7
150
+ # dic_param['endlon'] = 123.5
151
+ # dic_param['startlat'] = 44.3
152
+ # dic_param['endlat'] = 44.95
153
+
154
+ # mainfunc(dic_param=dic_param)
155
+
156
+
157
+ # dic_param={}
158
+ # dic_param['filepath'] = '/Users/wenjianzhu/Downloads/雷达数据-王婷婷/ar2v/20170905-松原'
159
+ # dic_param['rootout']='/Users/wenjianzhu/Downloads/雷达数据-王婷婷/pic'
160
+ # dic_param['outname'] = outpath + os.sep + 'radardrawlist_20170905.csv'
161
+
162
+ # if type == '强度':
163
+ # dic_param['startlon'] = 125.2
164
+ # dic_param['endlon'] = 126.2
165
+ # dic_param['startlat'] = 44.9
166
+ # dic_param['endlat'] = 45.7
167
+ # elif type == '速度':
168
+ # dic_param['startlon'] = 125.4
169
+ # dic_param['endlon'] = 126.2
170
+ # dic_param['startlat'] = 45
171
+ # dic_param['endlat'] = 45.5
172
+
173
+ # mainfunc(dic_param=dic_param)
174
+
175
+
176
+ dic_param={}
177
+ dic_param['filepath'] = '/Users/wenjianzhu/Downloads/雷达数据-王婷婷/ar2v/20210909-长春'
178
+ dic_param['rootout']='/Users/wenjianzhu/Downloads/雷达数据-王婷婷/pic'
179
+ dic_param['outname'] = outpath + os.sep + 'radardrawlist_20210909.csv'
180
+
181
+ if type == '强度':
182
+ # dic_param['startlon'] = 124.5
183
+ # dic_param['endlon'] = 125.8
184
+ # dic_param['startlat'] = 43.3
185
+ # dic_param['endlat'] = 44.2
186
+
187
+ dic_param['startlon'] = 124.9
188
+ dic_param['endlon'] = 125.6
189
+ dic_param['startlat'] = 43.6
190
+ dic_param['endlat'] = 44.1
191
+ elif type == '速度':
192
+ dic_param['startlon'] = 124.9
193
+ dic_param['endlon'] = 125.6
194
+ dic_param['startlat'] = 43.6
195
+ dic_param['endlat'] = 44.1
196
+
197
+ mainfunc(dic_param=dic_param)
@@ -0,0 +1,33 @@
1
+ '''
2
+ 读取新的雷达拼图数据
3
+
4
+ '''
5
+ from read_new_mosaic_func import decode_mosaic
6
+ from draw_mosaic_new import draw_mosaic
7
+
8
+ if __name__ == '__main__':
9
+ # filepath = '/Users/wenjianzhu/Downloads/CMADAAS/rdmosaic_bin/202208/'1
10
+ # filepath = '/Users/wenjianzhu/Library/CloudStorage/OneDrive-个人/推广应用/GR2/四川/测试数据/雷达拼图'
11
+ filepath = 'testdata/national_mosaic'
12
+ # filename = 'Z_RADA_C_BABJ_20220826001200_P_DOR_ACHN_QREF_20220826_001821.bin'
13
+ filename = 'ACHN_CREF_20210918_155000.BIN'
14
+ outpath = 'pic'
15
+ outname = filename + '.png'
16
+ data = decode_mosaic(filepath,filename)
17
+
18
+ pass
19
+ slat = 15.0
20
+ nlat = 56
21
+ wlon = 70.
22
+ elon = 140.
23
+ # newdata = data.CREF.sel(lat=slice(slat,nlat),lon=slice(wlon,elon))
24
+ # tstr = filename.split('_')[4]
25
+ # draw_mosaic(newdata.data,newdata.lat.data,newdata.lon.data,slat,nlat,wlon,elon,outpath,outname,tstr,thred=15,dpi=800)
26
+
27
+
28
+ newdata = data.CREF.sel(lat=slice(slat,nlat),lon=slice(wlon,elon))
29
+ tstr = filename.split('_')[2]+'_'+filename.split('_')[3]
30
+ draw_mosaic(newdata.data,newdata.lat.data,newdata.lon.data,slat,nlat,wlon,elon,outpath,outname,tstr,add_title=1,
31
+ prefix_title='雷达组合反射率拼图',units='dBZ',thred=0,dpi=800)
32
+
33
+ # %%