metradar 0.1.6__py3-none-any.whl → 0.1.8.2__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 (78) hide show
  1. metradar/__init__.py +4 -2
  2. metradar/config.py +53 -0
  3. metradar/core/__init__.py +9 -0
  4. metradar/{get_cross_section_from_pyart.py → core/get_cross_section.py} +5 -157
  5. metradar/{mosaic_merge.py → core/mosaic_merge.py} +3 -1
  6. metradar/{oa_dig_func.py → core/oa_dig_func.py} +83 -333
  7. metradar/graph/__init__.py +9 -0
  8. metradar/{mosaic_quickdraw.py → graph/draw_comp_mosaic.py} +71 -68
  9. metradar/{draw_mosaic_new.py → graph/draw_latlon_func.py} +177 -173
  10. metradar/graph/draw_radar_aws.py +212 -0
  11. metradar/{draw_radar_comp_func.py → graph/draw_radar_comp_func.py} +319 -248
  12. metradar/graph/parse_pal.py +157 -0
  13. metradar/io/__init__.py +9 -0
  14. metradar/{cnrad_level2.py → io/cnrad_level2.py} +45 -2
  15. metradar/{decode_fmt_pyart.py → io/decode_fmt_pyart.py} +20 -3
  16. metradar/{decode_pup_rose.py → io/decode_pup_rose.py} +241 -684
  17. metradar/{read_new_mosaic_func.py → io/read_new_mosaic_func.py} +30 -2
  18. metradar/io/read_swan.py +250 -0
  19. metradar/{rose_structer.py → io/rose_structer.py} +2 -0
  20. metradar/project/__init__.py +9 -0
  21. metradar/project/make_mosaic/__init__.py +9 -0
  22. metradar/project/make_mosaic/batch_draw_mosaic.py +32 -0
  23. metradar/{make_mosaic_mp_archive.py → project/make_mosaic/make_mosaic_func.py} +144 -175
  24. metradar/project/make_mosaic/make_mosaic_mp.ini +29 -0
  25. metradar/project/make_mosaic/make_mosaic_mp.py +70 -0
  26. metradar/project/make_vpr_aws/__init__.py +9 -0
  27. metradar/project/make_vpr_aws/construct_aws_refvpr_mainprog.ini +39 -0
  28. metradar/project/make_vpr_aws/construct_aws_refvpr_mainprog.py +565 -0
  29. metradar/project/make_vpr_aws/make_mosaic_20230731_daxing.ini +29 -0
  30. metradar/project/make_vpr_aws/make_mosaic_basefile.ini +29 -0
  31. metradar/project/nowcasting/__init__.py +9 -0
  32. metradar/project/nowcasting/nowcast_by_pysteps.py +214 -0
  33. metradar/{trans_nc_pgmb.py → project/nowcasting/trans_mosaic_pgmb.py} +19 -17
  34. metradar/project/qpe/Archive /346/250/241/345/274/217/350/257/264/346/230/216.txt" +2 -0
  35. metradar/project/qpe/__init__.py +9 -0
  36. metradar/project/qpe/archive_main_qpe_cfg.ini +91 -0
  37. metradar/project/qpe/do_s1.sh +6 -0
  38. metradar/project/qpe/do_s2.sh +6 -0
  39. metradar/project/qpe/do_s3.sh +6 -0
  40. metradar/project/qpe/do_s4.sh +6 -0
  41. metradar/project/qpe/do_s5.sh +6 -0
  42. metradar/project/qpe/exec_all.sh +11 -0
  43. metradar/project/qpe/get_rainrate_func.py +80 -0
  44. metradar/project/qpe/main_qpe_cfg.ini +85 -0
  45. metradar/project/qpe/s1_download_radar_region_cmadaas.py +123 -0
  46. metradar/project/qpe/s2_pre_process_single_radar.py +183 -0
  47. metradar/project/qpe/s3_trans_rainrate_to_qpe.py +499 -0
  48. metradar/project/qpe/s4_mosaic_qpe.py +523 -0
  49. metradar/project/qpe/s5_draw_qpe_mosaic.py +308 -0
  50. metradar/project/wind_retrieval/__init__.py +9 -0
  51. metradar/project/wind_retrieval/config_3dwind.ini +45 -0
  52. metradar/{main_pydda.py → project/wind_retrieval/main_pydda.py} +152 -149
  53. metradar/util/__init__.py +9 -0
  54. metradar/{comm_func.py → util/comm_func.py} +1 -41
  55. metradar/util/exceptions.py +50 -0
  56. metradar/util/geo_transforms_pyart.py +627 -0
  57. metradar/{get_tlogp_from_sharppy.py → util/get_tlogp_from_sharppy.py} +16 -5
  58. metradar/{parse_pal.py → util/parse_pal.py} +147 -147
  59. metradar/util/radar_common.py +16 -0
  60. metradar/{trans_new_mosaic_nc.py → util/trans_new_mosaic_nc.py} +1 -1
  61. metradar-0.1.8.2.dist-info/METADATA +90 -0
  62. metradar-0.1.8.2.dist-info/RECORD +69 -0
  63. {metradar-0.1.6.dist-info → metradar-0.1.8.2.dist-info}/WHEEL +1 -1
  64. metradar-0.1.8.2.dist-info/licenses/LICENSE +21 -0
  65. {metradar-0.1.6.dist-info → metradar-0.1.8.2.dist-info}/top_level.txt +0 -1
  66. cfg/config.py +0 -90
  67. metradar/grid.py +0 -281
  68. metradar/grid_data.py +0 -64
  69. metradar/oa_couhua.py +0 -166
  70. metradar/read_new_mosaic.py +0 -33
  71. metradar/retrieve_cmadaas.py +0 -3126
  72. metradar/retrieve_micaps_server.py +0 -2061
  73. metradar-0.1.6.dist-info/METADATA +0 -37
  74. metradar-0.1.6.dist-info/RECORD +0 -34
  75. /metradar/{pgmb_io.py → io/pgmb_io.py} +0 -0
  76. /metradar/{exceptions.py → project/make_vpr_aws/exceptions.py} +0 -0
  77. /metradar/{geo_transforms_pyart.py → project/make_vpr_aws/geo_transforms_pyart.py} +0 -0
  78. /metradar/{make_gif.py → util/make_gif.py} +0 -0
@@ -1,148 +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'])
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
148
  plt.show()
@@ -0,0 +1,16 @@
1
+
2
+ '''
3
+ ZhuWJ
4
+ '''
5
+ # defin return code
6
+
7
+
8
+ class RADAR_COMMON:
9
+ def __init__(self) -> None:
10
+
11
+ self.RETURN_CODE_SUCESSED = 1
12
+ self.RETURN_CODE_PARAM_ERROR = -1
13
+ self.RETURN_CODE_OPEN_ERROR = -2
14
+ self.RETURN_CODE_FORMAT_ERROR = -3
15
+ self.RETURN_CODE_DATA_ERROR = -4
16
+
@@ -1,7 +1,7 @@
1
1
  '''
2
2
  读取新的雷达拼图数据
3
3
  朱文剑
4
- 20210830
4
+
5
5
 
6
6
  数据格式说明
7
7
 
@@ -0,0 +1,90 @@
1
+ Metadata-Version: 2.4
2
+ Name: metradar
3
+ Version: 0.1.8.2
4
+ Summary: radar data processing
5
+ Author-email: Wenjian Zhu <kevin2075@163.com>
6
+ Project-URL: Homepage, https://github.com/nmcdev/metradar
7
+ Project-URL: Repository, https://github.com/nmcdev/metradar
8
+ Project-URL: Documentation, https://github.com/nmcdev/metradar#readme
9
+ Keywords: Weather,Radar
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Operating System :: Unix
14
+ Classifier: Operating System :: Microsoft
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Scientific/Engineering
18
+ Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
19
+ Classifier: Topic :: Scientific/Engineering :: GIS
20
+ Classifier: Topic :: Scientific/Engineering :: Hydrology
21
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
22
+ Requires-Python: <3.13,>=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: openpyxl>=3.1.5
26
+ Requires-Dist: pydda==2.2.0
27
+ Requires-Dist: tqdm>=4.67.0
28
+ Requires-Dist: wradlib>=2.6.1
29
+ Requires-Dist: MetPy>=1.7.1
30
+ Requires-Dist: matplotlib>=3.10.8
31
+ Requires-Dist: nmc_met_io>=0.1.15.0
32
+ Requires-Dist: netCDF4>=1.7.4
33
+ Requires-Dist: schedule>=1.2.2
34
+ Requires-Dist: nmc_met_graphics>=0.1.5.4
35
+ Dynamic: license-file
36
+
37
+ <div align="center">
38
+
39
+ # Welcome to METRADAR📡
40
+
41
+ ## 🚀 Quick start
42
+ ### 📡metradar 主要面向一线气象工作者,提供简单易用的python接口,用于读取、处理和可视化中国天气雷达数据,并利用国际成熟的雷达工具包如pyart、wradlib、pydda、pysteps构建了质量控制、降水反演、风场反演、临近预报等工程。
43
+
44
+
45
+ <div align="left">
46
+
47
+ ### ✨强烈推荐先从examples目录下的所有notebook入手!
48
+ ### ✨由于很多算法功能都是以完整项目形式共享,因此,建议用户将整个代码包从github上下载到本地进行后续开发!
49
+
50
+ ### 📚主要功能包括
51
+ * 1,雷达数据下载,自动站数据下载,下载功能集成在nmc_met_io工具包中;
52
+ * 2,雷达基数据的读取(中国气象局最新的标准数据格式FMT)、绘图;
53
+ * 3,ROSE PUP 产品读取、绘图;
54
+ * 4,雷达拼图解码、绘图,支持SWAN格式拼图、中国气象探测中心拼图等;
55
+ * 5,雷达和自动站综合分析及绘图,自动站数据诊断分析包括散度、涡度计算、等值线客观分析等。
56
+ * 6,雷达质控、批量绘图、三维组网产品制作、降水估测、三维风场反演、回波临近预报、雷达和自动站时间序列图等,其中部分算法以项目形式开源,提供一键式处理流程。
57
+
58
+ ## 🛠️Install
59
+ Using the fellowing command to install packages:
60
+
61
+ * 使用pypi安装源安装(https://pypi.org/project/metradar/)
62
+ ```
63
+ pip install metradar
64
+ ```
65
+ ### 📂若要构建全功能运行环境,建议安装顺序如下:
66
+ * conda create -n radar312 python=3.12
67
+ * conda activate radar312
68
+ * conda install -c conda-forge pysteps -y
69
+ * pip install metradar
70
+ * conda install -c conda-forge arm_pyart -y
71
+ * conda install -c conda-forge gdal -y
72
+ * pip install tensorflow
73
+ * pip install tensorflow-probability
74
+ * pip install tf_keras
75
+
76
+ ## 📜设置配置文件
77
+
78
+ * 在系统用户目录下("C:\Users\用户名"(windows)或"/home/用户名/"(Linux)), 建立文件夹".metradar"(若Windows下无法直接创建, 在命令窗口中输入`mkdir .metradar`创建)
79
+ * 在".metradar"中创建文本文件"config.ini", 内容模板为:
80
+ ```
81
+ # 用于metradar相关参数设置
82
+ # 建议使用vscode进行编辑,或notepad++等编辑器进行编辑
83
+ # RESOURCES_PATH路径下存放了各种资源文件,包括地图、字体、色标等
84
+ [SETTING]
85
+ RESOURCES_PATH = /home/wjzhu/metradar/resources
86
+ ```
87
+
88
+ ### ⚠️注意事项:
89
+ * 资源文件RESOURCES 目录下的stations目录下的文件都是样例文件,不代表真实坐标,使用时,请自行按照同样的格式准备站点文件。
90
+ * 样例测试数据需要单独下载,链接:https://github.com/zhuwenjian/metradar_testdata
@@ -0,0 +1,69 @@
1
+ metradar/__init__.py,sha256=DGjxs_m8pKrlY0w9exlB7J6ND4_RUDROMEV_y-CsbOQ,212
2
+ metradar/config.py,sha256=6fwtlhT9hNHz9vm7h22ONex6Hy3Znvc6Dnjl_wbo19s,1113
3
+ metradar/core/__init__.py,sha256=VjuiUQUKT5GgCX-t-Jg0e0YyEcz0Fqvl2Rfn-eyojJ8,204
4
+ metradar/core/get_cross_section.py,sha256=iMelBDtj4feYRmJRUwERl5JDcK7Dwo42YjO6QnU0Byw,6666
5
+ metradar/core/mosaic_merge.py,sha256=EjTEnmG1Op_nGY8_46nIZee9h0aQRdcSXU7kiLNZbiU,1701
6
+ metradar/core/oa_dig_func.py,sha256=48jly_qiYRo_-lzvXS8iUAyrfs02W_Z131llLAIG1ec,23824
7
+ metradar/graph/__init__.py,sha256=DGjxs_m8pKrlY0w9exlB7J6ND4_RUDROMEV_y-CsbOQ,212
8
+ metradar/graph/draw_comp_mosaic.py,sha256=7H-NUTafx8JKyOdTCopp6J0OhIMVZj9IrT8l1cswvKg,11749
9
+ metradar/graph/draw_latlon_func.py,sha256=n4FVhoAHAoa_7sXQznt9wDQaRhKQaSwdm5feTb_w7Eo,15557
10
+ metradar/graph/draw_radar_aws.py,sha256=9rRr1dPFB328HZE1IoCG2dVIXwPPIsB3GkKrtWmdbbI,8196
11
+ metradar/graph/draw_radar_comp_func.py,sha256=qzjK3HZmEGFvrvBKKYkvweY2ku7M3Rkx46dxRw369xc,64825
12
+ metradar/graph/parse_pal.py,sha256=z7Ml7vV4FW-lN7MMM1X9s6AWlWP7H7wuNKlCq2Nt9Yw,5158
13
+ metradar/io/__init__.py,sha256=f7qGp4p_yyLSMbVsFvFnWeBPH2p5P-xqJcYqd-DjjeM,212
14
+ metradar/io/cnrad_level2.py,sha256=lwtEhKGx3fpzEixHVNzDK5ky7trBw1hKmxSRDwRJxc4,45913
15
+ metradar/io/decode_fmt_pyart.py,sha256=yL6FAf4aV86meSrn4h1Ba2v37pO4L7A2Fs4RPEEvfk0,8359
16
+ metradar/io/decode_pup_rose.py,sha256=fWx9_f3k0WPpXB2uyWjViT7myxZqxLu-kdH5h4V0xDk,61854
17
+ metradar/io/pgmb_io.py,sha256=4D7beTSazhKTAzGwsQHaTxSn6PMqJpF4oOmMDIMuGio,5459
18
+ metradar/io/read_new_mosaic_func.py,sha256=PYLp945310_2OokYNCWOsPv3RGaLGEvLuIHc2QW84TY,8122
19
+ metradar/io/read_swan.py,sha256=K7koS2sOEJyPYwh-WX9yuevV73bnECKW0eEmVPqgRwE,8984
20
+ metradar/io/rose_structer.py,sha256=vbecVDw1elXcgizGpNKviT_Gx2d29txjkcC_7gu4R_0,25320
21
+ metradar/project/__init__.py,sha256=QpYCIlPXmoWRbDjBv6rmO1HGYRLcjrWZ_NOfabojKlY,204
22
+ metradar/project/make_mosaic/__init__.py,sha256=QpYCIlPXmoWRbDjBv6rmO1HGYRLcjrWZ_NOfabojKlY,204
23
+ metradar/project/make_mosaic/batch_draw_mosaic.py,sha256=uCenpGYzEToJbhEirDpDLxaZJD9wqbxEJv5bHj-m4GY,720
24
+ metradar/project/make_mosaic/make_mosaic_func.py,sha256=Jyl8JZ8pNUjBpFMXZnEvCJKGBbkIi3q4GLtGDgkI2m8,17655
25
+ metradar/project/make_mosaic/make_mosaic_mp.ini,sha256=oI0aWgSNShaFo5v6rJX0paxyhk6Ffz-KO6d9VO9ebdI,673
26
+ metradar/project/make_mosaic/make_mosaic_mp.py,sha256=QrxjGQR60nDWpnsb7ghKQJbmyHR-S4iG3JCZ6iEUJa4,2108
27
+ metradar/project/make_vpr_aws/__init__.py,sha256=QpYCIlPXmoWRbDjBv6rmO1HGYRLcjrWZ_NOfabojKlY,204
28
+ metradar/project/make_vpr_aws/construct_aws_refvpr_mainprog.ini,sha256=1c97mXmoanabn2q2q9EzNKxsv5dd-LZ1lCDSuMJ-3pk,1200
29
+ metradar/project/make_vpr_aws/construct_aws_refvpr_mainprog.py,sha256=uXfux19A3XBENLPP7dSzmyLcmcC5gdD5UiUHSVnTmiw,24060
30
+ metradar/project/make_vpr_aws/exceptions.py,sha256=C5jsADZix3E6Ah1sUPyBtgrGygy69lFc0QD5wO07a00,1300
31
+ metradar/project/make_vpr_aws/geo_transforms_pyart.py,sha256=7yOJOVLUaBnUQiesgvKZuESSNOx1uEYDilcRQAw5avM,21941
32
+ metradar/project/make_vpr_aws/make_mosaic_20230731_daxing.ini,sha256=dz_tUARU4rvHLagfm2ntIHbRmlgwzq6t6vOZbHhqmMY,673
33
+ metradar/project/make_vpr_aws/make_mosaic_basefile.ini,sha256=dz_tUARU4rvHLagfm2ntIHbRmlgwzq6t6vOZbHhqmMY,673
34
+ metradar/project/nowcasting/__init__.py,sha256=QpYCIlPXmoWRbDjBv6rmO1HGYRLcjrWZ_NOfabojKlY,204
35
+ metradar/project/nowcasting/nowcast_by_pysteps.py,sha256=oGMMc8vKxSfutLNn5U5BuMFMktYlPhu-1tLTJtfwbEY,7083
36
+ metradar/project/nowcasting/trans_mosaic_pgmb.py,sha256=SqRydyr32V7Hiex5Ev8jy-NX3Eye9Fjq0uO05ciIV9Q,1765
37
+ metradar/project/qpe/Archive 模式说明.txt,sha256=qg3iBXwuJpLjrv8BACouth0XWYq2FDRwYfydUZ2X9G4,139
38
+ metradar/project/qpe/__init__.py,sha256=QpYCIlPXmoWRbDjBv6rmO1HGYRLcjrWZ_NOfabojKlY,204
39
+ metradar/project/qpe/archive_main_qpe_cfg.ini,sha256=UVF-KmWABvZ8qEoArVAb7tkq7WS8IUmoMBecicTeslw,2534
40
+ metradar/project/qpe/do_s1.sh,sha256=zcbytnZbT2X7_96WFEj6qyuxl88d6VYezN211o0wfEk,145
41
+ metradar/project/qpe/do_s2.sh,sha256=QoNAH_vQuuPhsdj8Ku1d805BG9QkwYe-gpz1GoAwR0A,154
42
+ metradar/project/qpe/do_s3.sh,sha256=eExmd2hk92L6nBHD0XyN3hotF5LQShDKeHKTNILChPs,151
43
+ metradar/project/qpe/do_s4.sh,sha256=__Qkkmoosokvbg7jV1RW7rZtkH8YNeC4xOq6ZVXOySE,140
44
+ metradar/project/qpe/do_s5.sh,sha256=s42Lz5cITTV3OzWPcpV3kVwC0skE98fbBEm2yRfjYgE,145
45
+ metradar/project/qpe/exec_all.sh,sha256=My1Cr39DcVotYTLPYKOQDecqeoFxQq_CZW0Vp31vqqk,422
46
+ metradar/project/qpe/get_rainrate_func.py,sha256=3sc95Fh84CxLwVqJUoTDiNsMG0M2dQuu807_0yUJRDU,2527
47
+ metradar/project/qpe/main_qpe_cfg.ini,sha256=NnWvaivIwPGcQYqPbQBOsBubQQ3Z3EbRChWewTCGK68,2409
48
+ metradar/project/qpe/s1_download_radar_region_cmadaas.py,sha256=kaEdz9LyQG93NV4O0d4K4Qdo-dlKzZCVcatgchljaIY,3908
49
+ metradar/project/qpe/s2_pre_process_single_radar.py,sha256=7azABbub0YumgkZy02E812_3fhAj5svjAaKelxoFWQc,5998
50
+ metradar/project/qpe/s3_trans_rainrate_to_qpe.py,sha256=bgcQneFQBvp5M4KIXvR4NjtFEZ2ovF_V59V1EV3j5vE,17207
51
+ metradar/project/qpe/s4_mosaic_qpe.py,sha256=Q-6f0JIm6STaR8rmFd8rXUDPOVTAXSj1i5ns8x0UNA4,21155
52
+ metradar/project/qpe/s5_draw_qpe_mosaic.py,sha256=ZsaZuscVmgMCy_3mRO725EiW7UC8OSyODuWjEXcLgqc,10940
53
+ metradar/project/wind_retrieval/__init__.py,sha256=DGjxs_m8pKrlY0w9exlB7J6ND4_RUDROMEV_y-CsbOQ,212
54
+ metradar/project/wind_retrieval/config_3dwind.ini,sha256=wrJtkIRzgsDBV0KWT3EmNnY2PUJYgiw0HCssaGwWXKI,1223
55
+ metradar/project/wind_retrieval/main_pydda.py,sha256=n8_Q_FnGX4LfxxeZz9Kz0uZGVaPxljYOakwW4Fp-gXA,28103
56
+ metradar/util/__init__.py,sha256=DGjxs_m8pKrlY0w9exlB7J6ND4_RUDROMEV_y-CsbOQ,212
57
+ metradar/util/comm_func.py,sha256=qlAyeqEzbvjpgcu7XwiB8FHe_ZbRWBolXNXcEnXidvE,2618
58
+ metradar/util/exceptions.py,sha256=C5jsADZix3E6Ah1sUPyBtgrGygy69lFc0QD5wO07a00,1300
59
+ metradar/util/geo_transforms_pyart.py,sha256=TVtiGf3216e8nIsIS-EPfxiNInWzvADpEafPhjXTF8o,21955
60
+ metradar/util/get_tlogp_from_sharppy.py,sha256=jIO1EUN4X6LWAzdRnCfbJL5KGzGYqrC7Z_NKwVrgVPI,3021
61
+ metradar/util/make_gif.py,sha256=rDNqhZXKAyQB_B2adU-ven07QgOTXwdY6eRFVsjTrdI,563
62
+ metradar/util/parse_pal.py,sha256=G13_jP6eGwcOrxecqsOzmWjGvXFGwBFtlAUa5slXV-M,4925
63
+ metradar/util/radar_common.py,sha256=nyOfeEZfPjPyQyxg0SctqeUJzw8tVK_wVtjLH874XLo,301
64
+ metradar/util/trans_new_mosaic_nc.py,sha256=0xLc8xtHSX-G3037GRcGrhArhu8GmVndtq6_gImwF4I,9697
65
+ metradar-0.1.8.2.dist-info/licenses/LICENSE,sha256=xtelbmQdJcDqhEH2YHXT8eYCocUS7NdT91Qp5vNCH5M,1119
66
+ metradar-0.1.8.2.dist-info/METADATA,sha256=1Rd1_gIqYU4ZUdXTXT1vR1GleR_9fQZ-oI8zZL1pngE,4097
67
+ metradar-0.1.8.2.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
68
+ metradar-0.1.8.2.dist-info/top_level.txt,sha256=vwxtTxux8rWm6wgfnwf0YWYrWjN16TZQCOy4h_OVwoE,9
69
+ metradar-0.1.8.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (80.10.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 R & D Center for Weather Forecasting Technology (NMC-WFT, CMA)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
cfg/config.py DELETED
@@ -1,90 +0,0 @@
1
- # _*_ coding: utf-8 _*_
2
-
3
- # Copyright (c) 2019 NMC Developers.
4
- # Distributed under the terms of the GPL V3 License.
5
-
6
- """
7
- Read configure file.
8
- """
9
-
10
- import os
11
- import datetime
12
- import shutil
13
- import configparser
14
- from pathlib import Path
15
-
16
-
17
- def _get_config_dir():
18
- """
19
- Get default configuration directory.
20
- """
21
- config_dir = Path.home() / ".nmcdev"
22
- config_dir.mkdir(parents=True, exist_ok=True)
23
- return config_dir
24
-
25
- # Global Variables
26
- CONFIG_DIR = _get_config_dir()
27
-
28
-
29
- def _ConfigFetchError(BaseException):
30
- pass
31
-
32
-
33
- def _get_config_from_rcfile(rc='config_cassandra.ini'):
34
- """
35
- Get configure information from config_dk_met_io.ini file.
36
- """
37
- # rc = CONFIG_DIR / "config.ini"
38
- # rc = 'config_met_io.ini'
39
- if not os.path.exists(rc):
40
- print(rc + ' not exists!')
41
- return None
42
- # if not rc.is_file():
43
- # rc = Path("~/config_met_io.ini").expanduser()
44
- try:
45
- config = configparser.ConfigParser()
46
- config.read(rc,encoding='utf-8')
47
- except IOError as e:
48
- raise _ConfigFetchError(str(e))
49
- except BaseException as e:
50
- raise _ConfigFetchError(str(e))
51
-
52
- return config
53
-
54
- # Global Variables
55
- CONFIG = _get_config_from_rcfile()
56
-
57
-
58
- def get_cache_file(sub_dir, filename, name=None, cache_clear=True):
59
- """
60
- Get the cache file pathname.
61
-
62
- :param sub_dir: sub directory string.
63
- :param filename: cache filename
64
- :param name: cache name, like "MICAPS_DATA"
65
- :param cache_clear: if True, clear old cache folder
66
- """
67
- # get cache file directory
68
- if CONFIG.has_option('CACHE', 'CACHE_DIR'):
69
- cache_dir = Path(CONFIG['CACHE']['CACHE_DIR']).expanduser() / "cache"
70
- else:
71
- cache_dir = CONFIG_DIR / "cache"
72
-
73
- # Add cache name, if neccessary
74
- if name is not None:
75
- cache_dir = cache_dir / name
76
-
77
- # Use the week number of year as subdir
78
- cache_subdir1 = cache_dir / datetime.date.today().strftime("%Y%U")
79
- cache_subdir2 = cache_subdir1 / sub_dir
80
- cache_subdir2.mkdir(parents=True, exist_ok=True)
81
-
82
- # clear old cache folders
83
- if cache_clear:
84
- for f in cache_dir.iterdir():
85
- if f != cache_subdir1:
86
- shutil.rmtree(f)
87
-
88
- # return cache file pathname
89
- cache_file = cache_subdir2 / filename
90
- return cache_file