shancx 1.8.92__py3-none-any.whl → 1.9.33.218__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 (166) hide show
  1. shancx/3D/__init__.py +25 -0
  2. shancx/Algo/Class.py +11 -0
  3. shancx/Algo/CudaPrefetcher1.py +112 -0
  4. shancx/Algo/Fake_image.py +24 -0
  5. shancx/Algo/Hsml.py +391 -0
  6. shancx/Algo/L2Loss.py +10 -0
  7. shancx/Algo/MetricTracker.py +132 -0
  8. shancx/Algo/Normalize.py +66 -0
  9. shancx/Algo/OptimizerWScheduler.py +38 -0
  10. shancx/Algo/Rmageresize.py +79 -0
  11. shancx/Algo/Savemodel.py +33 -0
  12. shancx/Algo/SmoothL1_losses.py +27 -0
  13. shancx/Algo/Tqdm.py +62 -0
  14. shancx/Algo/__init__.py +121 -0
  15. shancx/Algo/checknan.py +28 -0
  16. shancx/Algo/iouJU.py +83 -0
  17. shancx/Algo/mask.py +25 -0
  18. shancx/Algo/psnr.py +9 -0
  19. shancx/Algo/ssim.py +70 -0
  20. shancx/Algo/structural_similarity.py +308 -0
  21. shancx/Algo/tool.py +704 -0
  22. shancx/Calmetrics/__init__.py +97 -0
  23. shancx/Calmetrics/calmetrics.py +14 -0
  24. shancx/Calmetrics/calmetricsmatrixLib.py +147 -0
  25. shancx/Calmetrics/rmseR2score.py +35 -0
  26. shancx/Clip/__init__.py +50 -0
  27. shancx/Cmd.py +126 -0
  28. shancx/Config_.py +26 -0
  29. shancx/Df/DataFrame.py +11 -2
  30. shancx/Df/__init__.py +17 -0
  31. shancx/Df/tool.py +0 -0
  32. shancx/Diffm/Psamples.py +18 -0
  33. shancx/Diffm/__init__.py +0 -0
  34. shancx/Diffm/test.py +207 -0
  35. shancx/Doc/__init__.py +214 -0
  36. shancx/E/__init__.py +178 -152
  37. shancx/Fillmiss/__init__.py +0 -0
  38. shancx/Fillmiss/imgidwJU.py +46 -0
  39. shancx/Fillmiss/imgidwLatLonJU.py +82 -0
  40. shancx/Gpu/__init__.py +55 -0
  41. shancx/H9/__init__.py +126 -0
  42. shancx/H9/ahi_read_hsd.py +877 -0
  43. shancx/H9/ahisearchtable.py +298 -0
  44. shancx/H9/geometry.py +2439 -0
  45. shancx/Hug/__init__.py +81 -0
  46. shancx/Inst.py +22 -0
  47. shancx/Lib.py +31 -0
  48. shancx/Mos/__init__.py +37 -0
  49. shancx/NN/__init__.py +235 -106
  50. shancx/Path1.py +161 -0
  51. shancx/Plot/GlobMap.py +276 -116
  52. shancx/Plot/__init__.py +491 -1
  53. shancx/Plot/draw_day_CR_PNG.py +4 -21
  54. shancx/Plot/exam.py +116 -0
  55. shancx/Plot/plotGlobal.py +325 -0
  56. shancx/{radar_nmc.py → Plot/radarNmc.py} +4 -34
  57. shancx/{subplots_single_china_map.py → Plot/single_china_map.py} +1 -1
  58. shancx/Point.py +46 -0
  59. shancx/QC.py +223 -0
  60. shancx/RdPzl/__init__.py +32 -0
  61. shancx/Read.py +72 -0
  62. shancx/Resize.py +79 -0
  63. shancx/SN/__init__.py +62 -123
  64. shancx/Time/GetTime.py +9 -3
  65. shancx/Time/__init__.py +66 -1
  66. shancx/Time/timeCycle.py +302 -0
  67. shancx/Time/tool.py +0 -0
  68. shancx/Train/__init__.py +74 -0
  69. shancx/Train/makelist.py +187 -0
  70. shancx/Train/multiGpu.py +27 -0
  71. shancx/Train/prepare.py +161 -0
  72. shancx/Train/renet50.py +157 -0
  73. shancx/ZR.py +12 -0
  74. shancx/__init__.py +333 -262
  75. shancx/args.py +27 -0
  76. shancx/bak.py +768 -0
  77. shancx/df2database.py +62 -2
  78. shancx/geosProj.py +80 -0
  79. shancx/info.py +38 -0
  80. shancx/netdfJU.py +231 -0
  81. shancx/sendM.py +59 -0
  82. shancx/tensBoard/__init__.py +28 -0
  83. shancx/wait.py +246 -0
  84. {shancx-1.8.92.dist-info → shancx-1.9.33.218.dist-info}/METADATA +15 -5
  85. shancx-1.9.33.218.dist-info/RECORD +91 -0
  86. {shancx-1.8.92.dist-info → shancx-1.9.33.218.dist-info}/WHEEL +1 -1
  87. my_timer_decorator/__init__.py +0 -10
  88. shancx/Dsalgor/__init__.py +0 -19
  89. shancx/E/DFGRRIB.py +0 -30
  90. shancx/EN/DFGRRIB.py +0 -30
  91. shancx/EN/__init__.py +0 -148
  92. shancx/FileRead.py +0 -44
  93. shancx/Gray2RGB.py +0 -86
  94. shancx/M/__init__.py +0 -137
  95. shancx/MN/__init__.py +0 -133
  96. shancx/N/__init__.py +0 -131
  97. shancx/Plot/draw_day_CR_PNGUS.py +0 -206
  98. shancx/Plot/draw_day_CR_SVG.py +0 -275
  99. shancx/Plot/draw_day_pre_PNGUS.py +0 -205
  100. shancx/Plot/glob_nation_map.py +0 -116
  101. shancx/Plot/radar_nmc.py +0 -61
  102. shancx/Plot/radar_nmc_china_map_compare1.py +0 -50
  103. shancx/Plot/radar_nmc_china_map_f.py +0 -121
  104. shancx/Plot/radar_nmc_us_map_f.py +0 -128
  105. shancx/Plot/subplots_compare_devlop.py +0 -36
  106. shancx/Plot/subplots_single_china_map.py +0 -45
  107. shancx/S/__init__.py +0 -138
  108. shancx/W/__init__.py +0 -132
  109. shancx/WN/__init__.py +0 -132
  110. shancx/code.py +0 -331
  111. shancx/draw_day_CR_PNG.py +0 -200
  112. shancx/draw_day_CR_PNGUS.py +0 -206
  113. shancx/draw_day_CR_SVG.py +0 -275
  114. shancx/draw_day_pre_PNGUS.py +0 -205
  115. shancx/makenetCDFN.py +0 -42
  116. shancx/mkIMGSCX.py +0 -92
  117. shancx/netCDF.py +0 -130
  118. shancx/radar_nmc_china_map_compare1.py +0 -50
  119. shancx/radar_nmc_china_map_f.py +0 -125
  120. shancx/radar_nmc_us_map_f.py +0 -67
  121. shancx/subplots_compare_devlop.py +0 -36
  122. shancx/tool.py +0 -18
  123. shancx/user/H8mess.py +0 -317
  124. shancx/user/__init__.py +0 -137
  125. shancx/user/cinradHJN.py +0 -496
  126. shancx/user/examMeso.py +0 -293
  127. shancx/user/hjnDAAS.py +0 -26
  128. shancx/user/hjnFTP.py +0 -81
  129. shancx/user/hjnGIS.py +0 -320
  130. shancx/user/hjnGPU.py +0 -21
  131. shancx/user/hjnIDW.py +0 -68
  132. shancx/user/hjnKDTree.py +0 -75
  133. shancx/user/hjnLAPSTransform.py +0 -47
  134. shancx/user/hjnMiscellaneous.py +0 -182
  135. shancx/user/hjnProj.py +0 -162
  136. shancx/user/inotify.py +0 -41
  137. shancx/user/matplotlibMess.py +0 -87
  138. shancx/user/mkNCHJN.py +0 -623
  139. shancx/user/newTypeRadar.py +0 -492
  140. shancx/user/test.py +0 -6
  141. shancx/user/tlogP.py +0 -129
  142. shancx/util_log.py +0 -33
  143. shancx/wtx/H8mess.py +0 -315
  144. shancx/wtx/__init__.py +0 -151
  145. shancx/wtx/cinradHJN.py +0 -496
  146. shancx/wtx/colormap.py +0 -64
  147. shancx/wtx/examMeso.py +0 -298
  148. shancx/wtx/hjnDAAS.py +0 -26
  149. shancx/wtx/hjnFTP.py +0 -81
  150. shancx/wtx/hjnGIS.py +0 -330
  151. shancx/wtx/hjnGPU.py +0 -21
  152. shancx/wtx/hjnIDW.py +0 -68
  153. shancx/wtx/hjnKDTree.py +0 -75
  154. shancx/wtx/hjnLAPSTransform.py +0 -47
  155. shancx/wtx/hjnLog.py +0 -78
  156. shancx/wtx/hjnMiscellaneous.py +0 -201
  157. shancx/wtx/hjnProj.py +0 -161
  158. shancx/wtx/inotify.py +0 -41
  159. shancx/wtx/matplotlibMess.py +0 -87
  160. shancx/wtx/mkNCHJN.py +0 -613
  161. shancx/wtx/newTypeRadar.py +0 -492
  162. shancx/wtx/test.py +0 -6
  163. shancx/wtx/tlogP.py +0 -129
  164. shancx-1.8.92.dist-info/RECORD +0 -99
  165. /shancx/{Dsalgor → Algo}/dsalgor.py +0 -0
  166. {shancx-1.8.92.dist-info → shancx-1.9.33.218.dist-info}/top_level.txt +0 -0
shancx/wtx/H8mess.py DELETED
@@ -1,315 +0,0 @@
1
- import numpy as np
2
-
3
- class parseHimawari():
4
- def __init__(self):
5
- self.res = 12100000
6
- self.nlin = 1100
7
- self.ncol = 11000
8
- self.data=None
9
-
10
- def read_Himawari(self,inputfile):
11
- resolution=int(inputfile[-12:-10])
12
- if resolution==10:
13
- self.res=12100000
14
- self.nlin=1100
15
- self.ncol=11000
16
- elif resolution==20:
17
- self.res=3025000
18
- self.nlin=550
19
- self.ncol=5500
20
- elif resolution == 5:
21
- self.res=48400000
22
- self.nlin=2200
23
- self.ncol=22000
24
- band=int(inputfile[-21:-19])
25
- if band < 7:
26
- formation = [('Block number1', 'i1', 1), \
27
- ('Block length1', 'i2', 1), \
28
- ('Total number of header blocks ', 'i2', 1), \
29
- ('Byte order', 'i1', 1), \
30
- ('Satellite name', 'S1', 16), \
31
- ('Processing center name', 'S1', 16), \
32
- ('Observation area', 'S1', 4), \
33
- ('Other observation information', 'S1', 2), \
34
- ('Observation timeline', 'i2', 1), \
35
- ('Observation start time', 'float64', 1), \
36
- ('Observation end time', 'float64', 1), \
37
- ('File creation time', 'float64', 1), \
38
- ('Total header length', 'i4', 1), \
39
- ('Total data length', 'i4', 1), \
40
- ('Quality flag 1', 'i1', 1), \
41
- ('Quality flag 2 ', 'i1', 1), \
42
- ('Quality flag 3', 'i1', 1), \
43
- ('Quality flag 4', 'i1', 1), \
44
- ('File format version', 'S1', 32), \
45
- ('File name ', 'S1', 128), \
46
- ('Spare1', 'S1', 40), \
47
-
48
- ('Block number2', 'i1', 1), \
49
- ('Block length2', 'i2', 1), \
50
- ('Number of bits per pixel', 'i2', 1), \
51
- ('Number of columns', 'i2', 1), \
52
- ('Number of lines', 'i2', 1), \
53
- ('Compression flag for data', 'i1', 1), \
54
- ('Spare2', 'S1', 40), \
55
-
56
- ('Block number3', 'i1', 1), \
57
- ('Block length3', 'i2', 1), \
58
- ('sub_lon', 'float64', 1), \
59
- ('Column scaling factor', 'i4', 1), \
60
- ('Line scaling factor', 'i4', 1), \
61
- ('Column offset', 'float32', 1), \
62
- ('Line offset', 'float32', 1), \
63
- ('Distance from Earth’s center to virtual satellite', 'float64', 1), \
64
- ('Earth’s equatorial radius', 'float64', 1), \
65
- ('Earth’s polar radius', 'float64', 1), \
66
- ('var1', 'float64', 1), \
67
- ('var2', 'float64', 1), \
68
- ('var3', 'float64', 1), \
69
- ('Coefficient for sd', 'float64', 1), \
70
- ('Resampling types', 'i2', 1), \
71
- ('Resampling size', 'i2', 1), \
72
- ('Spare3', 'S1', 40), \
73
-
74
- ('Block number4', 'i1', 1), \
75
- ('Block length4', 'i2', 1), \
76
- ('Navigation information time', 'float64', 1), \
77
- ('SSP longitude', 'float64', 1), \
78
- ('SSP latitude', 'float64', 1), \
79
- ('Distance from Earth’s center to Satellite', 'float64', 1), \
80
- ('Nadir longitude', 'float64', 1), \
81
- ('Nadir latitude', 'float64', 1), \
82
- ('Sun’s position', 'float64', 3), \
83
- ('Moon’s position', 'float64', 3), \
84
- ('Spare4', 'S1', 40), \
85
-
86
- ('Block number5', 'i1', 1), \
87
- ('Block length5', 'i2', 1), \
88
- ('Band number', 'i2', 1), \
89
- ('Central wave length', 'float64', 1), \
90
- ('Valid number of bits per pixel', 'i2', 1), \
91
- ('Count value of error pixels', 'uint16', 1), \
92
- ('Count value of pixels outside scan area', 'uint16', 1), \
93
- ('Slope for count-radiance conversion equation', 'float64', 1), \
94
- ('Intercept for count-radiance conversion equation', 'float64', 1), \
95
- ('Coefficient for transformation from radiance to albedo', 'float64', 1), \
96
- ('Update time of the values of the following No. 12 and No. 13', 'float64', 1), \
97
- ('Calibrated Slope for count-radiance conversion equation_updated value of No. 8 of this block ', 'float64', 1),\
98
- ('Calibrated Intercept for count-radiance conversion equation_updated value of No. 9 of this block ', 'float64', 1),\
99
- ('Spare5', 'S1', 80), \
100
-
101
- ('Block number6', 'i1', 1), \
102
- ('Block length6', 'i2', 1), \
103
- ('GSICS calibration coefficient_Intercept', 'float64', 1), \
104
- ('GSICS calibration coefficient_Slope', 'float64', 1), \
105
- ('GSICS calibration coefficient_Quadratic term', 'float64', 1), \
106
- ('Radiance bias for standard scene', 'float64', 1), \
107
- ('Uncertainty of radiance bias for standard scene', 'float64', 1), \
108
- ('Radiance for standard scene', 'float64', 1), \
109
- ('Start time of GSICS Correction validity period', 'float64', 1), \
110
- ('End time of GSICS Correction validity period', 'float64', 1), \
111
- ('Radiance validity range of GSICS calibration coefficients_upper limit', 'float32', 1), \
112
- ('Radiance validity range of GSICS calibration coefficients_lower limit', 'float32', 1), \
113
- ('File name of GSICS Correction', 'S1', 128), \
114
- ('Spare6', 'S1', 56), \
115
-
116
- ('Block number7', 'i1', 1), \
117
- ('Block length7', 'i2', 1), \
118
- ('Total number of segments', 'i1', 1), \
119
- ('Segment sequence number', 'i1', 1), \
120
- ('First line number of image segment', 'i2', 1), \
121
- ('Spare7', 'S1', 40), \
122
-
123
- ('Block number8', 'i1', 1), \
124
- ('Block length8', 'i2', 1), \
125
- ('Center column of rotation', 'float32', 1), \
126
- ('Center line of rotation', 'float32', 1), \
127
- ('Amount of rotational correction', 'float64', 1), \
128
- ('Number of correction information data for column and line direction', 'i2', 1), \
129
- ('Line number after rotation', 'i2', 1), \
130
- ('Shift amount for column direction', 'float32', 1), \
131
- ('Shift amount for line direction8', 'float32', 1), \
132
- ('Spare8', 'S1', 50), \
133
-
134
- ('Block number9', 'i1', 1), \
135
- ('Block length9', 'i2', 1), \
136
- ('Number of observation times9', 'i2', 1), \
137
- ('Line number9', 'i2', 1), \
138
- ('Observation time9', 'float64', 1), \
139
- ('Spare9', 'S1', 70), \
140
-
141
- ('Block number10', 'i1', 1), \
142
- ('Block length10', 'i4', 1), \
143
- ('Number of error information data', 'i2', 1), \
144
- ('Line number10', 'i2', 1), \
145
- ('Number of error pixels per line10', 'i2', 1), \
146
- ('Spare10', 'S1', 36), \
147
-
148
- ('Block number11', 'i1', 1), \
149
- ('Block length11', 'i2', 1), \
150
- ('Spare11', 'S1', 256), \
151
-
152
- ('Count value of each pixel', 'i2', self.res)]
153
- else:
154
- formation=[('Block number1','i1',1),\
155
- ('Block length1','i2',1),\
156
- ('Total number of header blocks ','i2',1),\
157
- ('Byte order','i1',1),\
158
- ('Satellite name','S1',16),\
159
- ('Processing center name','S1',16),\
160
- ('Observation area','S1',4),\
161
- ('Other observation information','S1',2),\
162
- ('Observation timeline','i2',1),\
163
- ('Observation start time','float64',1),\
164
- ('Observation end time','float64',1),\
165
- ('File creation time','float64',1),\
166
- ('Total header length','i4',1),\
167
- ('Total data length','i4',1),\
168
- ('Quality flag 1','i1',1),\
169
- ('Quality flag 2 ','i1',1),\
170
- ('Quality flag 3','i1',1),\
171
- ('Quality flag 4','i1',1),\
172
- ('File format version','S1',32),\
173
- ('File name ','S1',128),\
174
- ('Spare1','S1',40),\
175
-
176
- ('Block number2','i1',1),\
177
- ('Block length2','i2',1),\
178
- ('Number of bits per pixel','i2',1),\
179
- ('Number of columns','i2',1),\
180
- ('Number of lines','i2',1),\
181
- ('Compression flag for data','i1',1),\
182
- ('Spare2','S1',40),\
183
-
184
- ('Block number3','i1',1),\
185
- ('Block length3','i2',1),\
186
- ('sub_lon','float64',1),\
187
- ('Column scaling factor','i4',1),\
188
- ('Line scaling factor','i4',1),\
189
- ('Column offset','float32',1),\
190
- ('Line offset','float32',1),\
191
- ('Distance from Earth’s center to virtual satellite','float64',1),\
192
- ('Earth’s equatorial radius','float64',1),\
193
- ('Earth’s polar radius','float64',1),\
194
- ('var1','float64',1),\
195
- ('var2','float64',1),\
196
- ('var3','float64',1),\
197
- ('Coefficient for sd','float64',1),\
198
- ('Resampling types','i2',1),\
199
- ('Resampling size','i2',1),\
200
- ('Spare3','S1',40),\
201
-
202
- ('Block number4','i1',1),\
203
- ('Block length4','i2',1),\
204
- ('Navigation information time','float64',1),\
205
- ('SSP longitude','float64',1),\
206
- ('SSP latitude','float64',1),\
207
- ('Distance from Earth’s center to Satellite','float64',1),\
208
- ('Nadir longitude','float64',1),\
209
- ('Nadir latitude','float64',1),\
210
- ('Sun’s position','float64',3),\
211
- ('Moon’s position','float64',3),\
212
- ('Spare4','S1',40),\
213
-
214
- ('Block number5','i1',1),\
215
- ('Block length5','i2',1),\
216
- ('Band number','i2',1),\
217
- ('Central wave length','float64',1),\
218
- ('Valid number of bits per pixel','i2',1),\
219
- ('Count value of error pixels','i2',1),\
220
- ('Count value of pixels outside scan area','i2',1),\
221
- ('Slope for count-radiance conversion equation','float64',1),\
222
- ('Intercept for count-radiance conversion equation','float64',1),\
223
- ('radiance to brightness temperature_c0','float64',1),\
224
- ('radiance to brightness temperature_c1','float64',1),\
225
- ('radiance to brightness temperature_c2','float64',1),\
226
- ('brightness temperature to radiance_C0','float64',1),\
227
- ('brightness temperature to radianceC1','float64',1),\
228
- ('brightness temperature to radianceC2','float64',1),\
229
- ('Speed of light','float64',1),\
230
- ('Planck constant','float64',1),\
231
- ('Boltzmann constant','float64',1),\
232
- ('Spare5','S1',40), \
233
-
234
- ('Block number6', 'i1', 1), \
235
- ('Block length6', 'i2', 1), \
236
- ('GSICS calibration coefficient_Intercept', 'float64', 1), \
237
- ('GSICS calibration coefficient_Slope', 'float64', 1), \
238
- ('GSICS calibration coefficient_Quadratic term', 'float64', 1), \
239
- ('Radiance bias for standard scene', 'float64', 1), \
240
- ('Uncertainty of radiance bias for standard scene', 'float64', 1), \
241
- ('Radiance for standard scene', 'float64', 1), \
242
- ('Start time of GSICS Correction validity period', 'float64', 1), \
243
- ('End time of GSICS Correction validity period', 'float64', 1), \
244
- ('Radiance validity range of GSICS calibration coefficients_upper limit', 'float32', 1), \
245
- ('Radiance validity range of GSICS calibration coefficients_lower limit', 'float32', 1), \
246
- ('File name of GSICS Correction', 'S1', 128), \
247
- ('Spare6', 'S1', 56), \
248
-
249
- ('Block number7', 'i1', 1), \
250
- ('Block length7', 'i2', 1), \
251
- ('Total number of segments', 'i1', 1), \
252
- ('Segment sequence number', 'i1', 1), \
253
- ('First line number of image segment', 'i2', 1), \
254
- ('Spare7', 'S1', 40), \
255
-
256
- ('Block number8', 'i1', 1), \
257
- ('Block length8', 'i2', 1), \
258
- ('Center column of rotation', 'float32', 1), \
259
- ('Center line of rotation', 'float32', 1), \
260
- ('Amount of rotational correction', 'float64', 1), \
261
- ('Number of correction information data for column and line direction', 'i2', 1), \
262
- ('Line number after rotation', 'i2', 1), \
263
- ('Shift amount for column direction', 'float32', 1), \
264
- ('Shift amount for line direction8', 'float32', 1), \
265
- ('Spare8', 'S1', 50), \
266
-
267
- ('Block number9', 'i1', 1), \
268
- ('Block length9', 'i2', 1), \
269
- ('Number of observation times9', 'i2', 1), \
270
- ('Line number9', 'i2', 1), \
271
- ('Observation time9', 'float64', 1), \
272
- ('Spare9', 'S1', 70), \
273
-
274
- ('Block number10', 'i1', 1), \
275
- ('Block length10', 'i4', 1), \
276
- ('Number of error information data', 'i2', 1), \
277
- ('Line number10', 'i2', 1), \
278
- ('Number of error pixels per line10', 'i2', 1), \
279
- ('Spare10', 'S1', 36), \
280
-
281
- ('Block number11', 'i1', 1), \
282
- ('Block length11', 'i2', 1), \
283
- ('Spare11', 'S1', 256), \
284
-
285
-
286
- ('Count value of each pixel', 'i2', self.res)]
287
-
288
- self.data=np.fromfile(inputfile,dtype=formation)[0]
289
- band=int(inputfile[-21:-19])
290
-
291
- mat = self.data["Count value of each pixel"].reshape([self.nlin, self.ncol])
292
- mat=self.toRealVal(mat,band)
293
- return mat
294
-
295
- def toRealVal(self,mat,bandNo):
296
- radiance1=mat * self.data["Slope for count-radiance conversion equation"] + self.data["Intercept for count-radiance conversion equation"]
297
-
298
- radiance2 = radiance1*self.data["Coefficient for transformation from radiance to albedo"] if bandNo >= 1 and bandNo <= 6 else self.hisd_radiance_to_tbb(radiance1)
299
-
300
- return radiance2
301
-
302
- def hisd_radiance_to_tbb(self, radiance0):
303
- lmbd = self.data['Central wave length'] / 1000000.0
304
- radiance = radiance0 * 1000000.0
305
- planck_c1 = 2.0 * self.data['Planck constant'] * self.data['Speed of light']**2.0 / lmbd**5.0
306
- planck_c2 = self.data['Planck constant'] * self.data['Speed of light'] / (self.data['Boltzmann constant'] * lmbd)
307
- effective_temperature = planck_c2 / np.log((planck_c1 / radiance) + 1.0)
308
- tbb = self.data['radiance to brightness temperature_c0'] + self.data['radiance to brightness temperature_c1'] * effective_temperature + self.data['radiance to brightness temperature_c2'] * effective_temperature**2
309
- tbb[radiance<0]=np.nan
310
- return tbb
311
-
312
- if __name__=="__main__":
313
- h8P=parseHimawari()
314
- data = h8P.read_Himawari("")
315
-
shancx/wtx/__init__.py DELETED
@@ -1,151 +0,0 @@
1
- #!/usr/bin/python
2
- # -*- coding: utf-8 -*-
3
- import os
4
- def start():
5
- print("import successful")
6
- # constants
7
-
8
-
9
- __author__ = 'shancx'
10
-
11
- __author_email__ = 'shancx@126.com'
12
-
13
-
14
-
15
- # @Time : 2023/09/27 下午8:52
16
- # @Author : shanchangxi
17
- # @File : util_log.py
18
- import time
19
- import logging
20
- from logging import handlers
21
-
22
- loggers = logging.getLogger()
23
- loggers.setLevel(logging.INFO)
24
- log_name = '/home/scx/logs/project_wtx.log'
25
- logfile = log_name
26
- time_rotating_file_handler = handlers.TimedRotatingFileHandler(filename=logfile, when='D', encoding='utf-8')
27
- time_rotating_file_handler.setLevel(logging.INFO)
28
- formatter = logging.Formatter("%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s")
29
- time_rotating_file_handler.setFormatter(formatter)
30
- loggers.addHandler(time_rotating_file_handler)
31
-
32
-
33
-
34
- def Tim_Tor(func):
35
- def wrapper(*args, **kwargs):
36
- start_time = time.time()
37
- result = func(*args, **kwargs)
38
- end_time = time.time()
39
- print(f"{func.__name__} took {end_time - start_time:.4f} seconds")
40
- loggers.info(f"{func.__name__} took {end_time - start_time:.4f} seconds")
41
- return result
42
- return wrapper
43
-
44
- from itertools import product
45
- from multiprocessing import Pool
46
-
47
-
48
-
49
- def Mul_Ess(map_fun,tuple_list,num = 31):
50
- productList = product(tuple_list[0])
51
- with Pool(num) as p:
52
- P_data = p.map(map_fun, productList)
53
- return P_data
54
-
55
- def mkDir(path):
56
- if "." in path:
57
- os.makedirs(os.path.dirname(path),exist_ok=True)
58
- else:
59
- os.makedirs(path, exist_ok=True)
60
-
61
-
62
- '''
63
- ##定義一個streamHandler
64
- # print_handler = logging.StreamHandler()
65
- # print_handler.setFormatter(formatter)
66
- # loggers.addHandler(print_handler)
67
- '''
68
-
69
-
70
- """
71
- from main import makeAll,options
72
- from multiprocessing import Pool
73
- import datetime
74
- from config import logger,output
75
- import time
76
- import pandas as pd
77
- import os
78
- from itertools import product
79
- import threading
80
-
81
- def excuteCommand(cmd):
82
- print(cmd)
83
- os.system(cmd)
84
-
85
- def gpuPro(makeListUTC, isPhase, isDebug, gpu, isOverwrite):
86
- productList = product(makeListUTC, [isPhase], [isDebug], [gpu], [isOverwrite])
87
-
88
- with Pool(4) as p:
89
- p.map(makeAll, productList)
90
-
91
- if __name__ == '__main__':
92
- cfg = options()
93
- isPhase = cfg.isPhase
94
- isDebug = cfg.isDebug
95
- sepSec = cfg.sepSec
96
- gpu = cfg.gpu
97
- pool = cfg.pool
98
- isOverwrite = cfg.isOverwrite
99
- timeList = pd.date_range(cfg.times[0], cfg.times[-1], freq=f"{sepSec}s")
100
- logger.info(f"时间段check {timeList}")
101
- gpuNum = 2
102
- eachGPU = 4
103
-
104
- makeListUTC = []
105
- for UTC in timeList:
106
- UTCStr = UTC.strftime("%Y%m%d%H%M")
107
- outpath = f"{output}/{UTCStr[:4]}/{UTCStr[:8]}/MSP2_WTX_AIW_QPF_L88_CHN_{UTCStr}_00000-00300-00006.nc"
108
- if not os.path.exists(outpath) or isOverwrite:
109
- makeListUTC.append(UTC)
110
- [print(element) for element in makeListUTC]
111
-
112
- phaseCMD = "--isPhase" if isPhase else ""
113
- debugCMD = "--isDebug" if isDebug else ""
114
- OverwriteCMD = "--isOverwrite"
115
- gpuCMD = f"--gpu={gpu}"
116
- # cmdList = list(map(lambda x:f"python main.py --times={x.strftime('%Y%m%d%H%M')} {phaseCMD} {debugCMD} {OverwriteCMD} {gpuCMD}",makeListUTC))
117
- cmdList = list(map(lambda x:f"python main.py --times={x.strftime('%Y%m%d%H%M')} {phaseCMD} {debugCMD} {gpuCMD}",makeListUTC))
118
-
119
- with Pool(pool) as p:
120
- p.map(excuteCommand, cmdList)
121
- """
122
-
123
-
124
- '''
125
- # @Time : 2023/09/27 下午8:52
126
- # @Author : shanchangxi
127
- # @File : util_log.py
128
- import time
129
- import logging
130
- from logging import handlers
131
-
132
- logger = logging.getLogger()
133
- logger.setLevel(logging.INFO)
134
- log_name = 'project_tim_tor.log'
135
- logfile = log_name
136
- time_rotating_file_handler = handlers.TimedRotatingFileHandler(filename=logfile, when='D', encoding='utf-8')
137
- time_rotating_file_handler.setLevel(logging.INFO)
138
- formatter = logging.Formatter("%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s")
139
- time_rotating_file_handler.setFormatter(formatter)
140
- logger.addHandler(time_rotating_file_handler)
141
- print_handler = logging.StreamHandler()
142
- print_handler.setFormatter(formatter)
143
- logger.addHandler(print_handler)
144
-
145
- '''
146
-
147
- '''
148
- ###解决方法 pip install torch==2.4.0 torchvision torchaudio三个同时安装 python 3.12 解决cuda启动不了的问题
149
-
150
- Res网络
151
- '''