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/user/H8mess.py DELETED
@@ -1,317 +0,0 @@
1
- import numpy as np
2
- from hjn.mkNCHJN import envelope
3
- import datetime
4
-
5
- class parseHimawari():
6
- def __init__(self):
7
- self.res = 12100000
8
- self.nlin = 1100
9
- self.ncol = 11000
10
- self.data=None
11
-
12
- def read_Himawari(self,inputfile):
13
- resolution=int(inputfile[-12:-10])
14
- if resolution==10:
15
- self.res=12100000
16
- self.nlin=1100
17
- self.ncol=11000
18
- elif resolution==20:
19
- self.res=3025000
20
- self.nlin=550
21
- self.ncol=5500
22
- elif resolution == 5:
23
- self.res=48400000
24
- self.nlin=2200
25
- self.ncol=22000
26
- band=int(inputfile[-21:-19])
27
- if band < 7:
28
- formation = [('Block number1', 'i1', 1), \
29
- ('Block length1', 'i2', 1), \
30
- ('Total number of header blocks ', 'i2', 1), \
31
- ('Byte order', 'i1', 1), \
32
- ('Satellite name', 'S1', 16), \
33
- ('Processing center name', 'S1', 16), \
34
- ('Observation area', 'S1', 4), \
35
- ('Other observation information', 'S1', 2), \
36
- ('Observation timeline', 'i2', 1), \
37
- ('Observation start time', 'float64', 1), \
38
- ('Observation end time', 'float64', 1), \
39
- ('File creation time', 'float64', 1), \
40
- ('Total header length', 'i4', 1), \
41
- ('Total data length', 'i4', 1), \
42
- ('Quality flag 1', 'i1', 1), \
43
- ('Quality flag 2 ', 'i1', 1), \
44
- ('Quality flag 3', 'i1', 1), \
45
- ('Quality flag 4', 'i1', 1), \
46
- ('File format version', 'S1', 32), \
47
- ('File name ', 'S1', 128), \
48
- ('Spare1', 'S1', 40), \
49
-
50
- ('Block number2', 'i1', 1), \
51
- ('Block length2', 'i2', 1), \
52
- ('Number of bits per pixel', 'i2', 1), \
53
- ('Number of columns', 'i2', 1), \
54
- ('Number of lines', 'i2', 1), \
55
- ('Compression flag for data', 'i1', 1), \
56
- ('Spare2', 'S1', 40), \
57
-
58
- ('Block number3', 'i1', 1), \
59
- ('Block length3', 'i2', 1), \
60
- ('sub_lon', 'float64', 1), \
61
- ('Column scaling factor', 'i4', 1), \
62
- ('Line scaling factor', 'i4', 1), \
63
- ('Column offset', 'float32', 1), \
64
- ('Line offset', 'float32', 1), \
65
- ('Distance from Earth’s center to virtual satellite', 'float64', 1), \
66
- ('Earth’s equatorial radius', 'float64', 1), \
67
- ('Earth’s polar radius', 'float64', 1), \
68
- ('var1', 'float64', 1), \
69
- ('var2', 'float64', 1), \
70
- ('var3', 'float64', 1), \
71
- ('Coefficient for sd', 'float64', 1), \
72
- ('Resampling types', 'i2', 1), \
73
- ('Resampling size', 'i2', 1), \
74
- ('Spare3', 'S1', 40), \
75
-
76
- ('Block number4', 'i1', 1), \
77
- ('Block length4', 'i2', 1), \
78
- ('Navigation information time', 'float64', 1), \
79
- ('SSP longitude', 'float64', 1), \
80
- ('SSP latitude', 'float64', 1), \
81
- ('Distance from Earth’s center to Satellite', 'float64', 1), \
82
- ('Nadir longitude', 'float64', 1), \
83
- ('Nadir latitude', 'float64', 1), \
84
- ('Sun’s position', 'float64', 3), \
85
- ('Moon’s position', 'float64', 3), \
86
- ('Spare4', 'S1', 40), \
87
-
88
- ('Block number5', 'i1', 1), \
89
- ('Block length5', 'i2', 1), \
90
- ('Band number', 'i2', 1), \
91
- ('Central wave length', 'float64', 1), \
92
- ('Valid number of bits per pixel', 'i2', 1), \
93
- ('Count value of error pixels', 'uint16', 1), \
94
- ('Count value of pixels outside scan area', 'uint16', 1), \
95
- ('Slope for count-radiance conversion equation', 'float64', 1), \
96
- ('Intercept for count-radiance conversion equation', 'float64', 1), \
97
- ('Coefficient for transformation from radiance to albedo', 'float64', 1), \
98
- ('Update time of the values of the following No. 12 and No. 13', 'float64', 1), \
99
- ('Calibrated Slope for count-radiance conversion equation_updated value of No. 8 of this block ', 'float64', 1),\
100
- ('Calibrated Intercept for count-radiance conversion equation_updated value of No. 9 of this block ', 'float64', 1),\
101
- ('Spare5', 'S1', 80), \
102
-
103
- ('Block number6', 'i1', 1), \
104
- ('Block length6', 'i2', 1), \
105
- ('GSICS calibration coefficient_Intercept', 'float64', 1), \
106
- ('GSICS calibration coefficient_Slope', 'float64', 1), \
107
- ('GSICS calibration coefficient_Quadratic term', 'float64', 1), \
108
- ('Radiance bias for standard scene', 'float64', 1), \
109
- ('Uncertainty of radiance bias for standard scene', 'float64', 1), \
110
- ('Radiance for standard scene', 'float64', 1), \
111
- ('Start time of GSICS Correction validity period', 'float64', 1), \
112
- ('End time of GSICS Correction validity period', 'float64', 1), \
113
- ('Radiance validity range of GSICS calibration coefficients_upper limit', 'float32', 1), \
114
- ('Radiance validity range of GSICS calibration coefficients_lower limit', 'float32', 1), \
115
- ('File name of GSICS Correction', 'S1', 128), \
116
- ('Spare6', 'S1', 56), \
117
-
118
- ('Block number7', 'i1', 1), \
119
- ('Block length7', 'i2', 1), \
120
- ('Total number of segments', 'i1', 1), \
121
- ('Segment sequence number', 'i1', 1), \
122
- ('First line number of image segment', 'i2', 1), \
123
- ('Spare7', 'S1', 40), \
124
-
125
- ('Block number8', 'i1', 1), \
126
- ('Block length8', 'i2', 1), \
127
- ('Center column of rotation', 'float32', 1), \
128
- ('Center line of rotation', 'float32', 1), \
129
- ('Amount of rotational correction', 'float64', 1), \
130
- ('Number of correction information data for column and line direction', 'i2', 1), \
131
- ('Line number after rotation', 'i2', 1), \
132
- ('Shift amount for column direction', 'float32', 1), \
133
- ('Shift amount for line direction8', 'float32', 1), \
134
- ('Spare8', 'S1', 50), \
135
-
136
- ('Block number9', 'i1', 1), \
137
- ('Block length9', 'i2', 1), \
138
- ('Number of observation times9', 'i2', 1), \
139
- ('Line number9', 'i2', 1), \
140
- ('Observation time9', 'float64', 1), \
141
- ('Spare9', 'S1', 70), \
142
-
143
- ('Block number10', 'i1', 1), \
144
- ('Block length10', 'i4', 1), \
145
- ('Number of error information data', 'i2', 1), \
146
- ('Line number10', 'i2', 1), \
147
- ('Number of error pixels per line10', 'i2', 1), \
148
- ('Spare10', 'S1', 36), \
149
-
150
- ('Block number11', 'i1', 1), \
151
- ('Block length11', 'i2', 1), \
152
- ('Spare11', 'S1', 256), \
153
-
154
- ('Count value of each pixel', 'i2', self.res)]
155
- else:
156
- formation=[('Block number1','i1',1),\
157
- ('Block length1','i2',1),\
158
- ('Total number of header blocks ','i2',1),\
159
- ('Byte order','i1',1),\
160
- ('Satellite name','S1',16),\
161
- ('Processing center name','S1',16),\
162
- ('Observation area','S1',4),\
163
- ('Other observation information','S1',2),\
164
- ('Observation timeline','i2',1),\
165
- ('Observation start time','float64',1),\
166
- ('Observation end time','float64',1),\
167
- ('File creation time','float64',1),\
168
- ('Total header length','i4',1),\
169
- ('Total data length','i4',1),\
170
- ('Quality flag 1','i1',1),\
171
- ('Quality flag 2 ','i1',1),\
172
- ('Quality flag 3','i1',1),\
173
- ('Quality flag 4','i1',1),\
174
- ('File format version','S1',32),\
175
- ('File name ','S1',128),\
176
- ('Spare1','S1',40),\
177
-
178
- ('Block number2','i1',1),\
179
- ('Block length2','i2',1),\
180
- ('Number of bits per pixel','i2',1),\
181
- ('Number of columns','i2',1),\
182
- ('Number of lines','i2',1),\
183
- ('Compression flag for data','i1',1),\
184
- ('Spare2','S1',40),\
185
-
186
- ('Block number3','i1',1),\
187
- ('Block length3','i2',1),\
188
- ('sub_lon','float64',1),\
189
- ('Column scaling factor','i4',1),\
190
- ('Line scaling factor','i4',1),\
191
- ('Column offset','float32',1),\
192
- ('Line offset','float32',1),\
193
- ('Distance from Earth’s center to virtual satellite','float64',1),\
194
- ('Earth’s equatorial radius','float64',1),\
195
- ('Earth’s polar radius','float64',1),\
196
- ('var1','float64',1),\
197
- ('var2','float64',1),\
198
- ('var3','float64',1),\
199
- ('Coefficient for sd','float64',1),\
200
- ('Resampling types','i2',1),\
201
- ('Resampling size','i2',1),\
202
- ('Spare3','S1',40),\
203
-
204
- ('Block number4','i1',1),\
205
- ('Block length4','i2',1),\
206
- ('Navigation information time','float64',1),\
207
- ('SSP longitude','float64',1),\
208
- ('SSP latitude','float64',1),\
209
- ('Distance from Earth’s center to Satellite','float64',1),\
210
- ('Nadir longitude','float64',1),\
211
- ('Nadir latitude','float64',1),\
212
- ('Sun’s position','float64',3),\
213
- ('Moon’s position','float64',3),\
214
- ('Spare4','S1',40),\
215
-
216
- ('Block number5','i1',1),\
217
- ('Block length5','i2',1),\
218
- ('Band number','i2',1),\
219
- ('Central wave length','float64',1),\
220
- ('Valid number of bits per pixel','i2',1),\
221
- ('Count value of error pixels','i2',1),\
222
- ('Count value of pixels outside scan area','i2',1),\
223
- ('Slope for count-radiance conversion equation','float64',1),\
224
- ('Intercept for count-radiance conversion equation','float64',1),\
225
- ('radiance to brightness temperature_c0','float64',1),\
226
- ('radiance to brightness temperature_c1','float64',1),\
227
- ('radiance to brightness temperature_c2','float64',1),\
228
- ('brightness temperature to radiance_C0','float64',1),\
229
- ('brightness temperature to radianceC1','float64',1),\
230
- ('brightness temperature to radianceC2','float64',1),\
231
- ('Speed of light','float64',1),\
232
- ('Planck constant','float64',1),\
233
- ('Boltzmann constant','float64',1),\
234
- ('Spare5','S1',40), \
235
-
236
- ('Block number6', 'i1', 1), \
237
- ('Block length6', 'i2', 1), \
238
- ('GSICS calibration coefficient_Intercept', 'float64', 1), \
239
- ('GSICS calibration coefficient_Slope', 'float64', 1), \
240
- ('GSICS calibration coefficient_Quadratic term', 'float64', 1), \
241
- ('Radiance bias for standard scene', 'float64', 1), \
242
- ('Uncertainty of radiance bias for standard scene', 'float64', 1), \
243
- ('Radiance for standard scene', 'float64', 1), \
244
- ('Start time of GSICS Correction validity period', 'float64', 1), \
245
- ('End time of GSICS Correction validity period', 'float64', 1), \
246
- ('Radiance validity range of GSICS calibration coefficients_upper limit', 'float32', 1), \
247
- ('Radiance validity range of GSICS calibration coefficients_lower limit', 'float32', 1), \
248
- ('File name of GSICS Correction', 'S1', 128), \
249
- ('Spare6', 'S1', 56), \
250
-
251
- ('Block number7', 'i1', 1), \
252
- ('Block length7', 'i2', 1), \
253
- ('Total number of segments', 'i1', 1), \
254
- ('Segment sequence number', 'i1', 1), \
255
- ('First line number of image segment', 'i2', 1), \
256
- ('Spare7', 'S1', 40), \
257
-
258
- ('Block number8', 'i1', 1), \
259
- ('Block length8', 'i2', 1), \
260
- ('Center column of rotation', 'float32', 1), \
261
- ('Center line of rotation', 'float32', 1), \
262
- ('Amount of rotational correction', 'float64', 1), \
263
- ('Number of correction information data for column and line direction', 'i2', 1), \
264
- ('Line number after rotation', 'i2', 1), \
265
- ('Shift amount for column direction', 'float32', 1), \
266
- ('Shift amount for line direction8', 'float32', 1), \
267
- ('Spare8', 'S1', 50), \
268
-
269
- ('Block number9', 'i1', 1), \
270
- ('Block length9', 'i2', 1), \
271
- ('Number of observation times9', 'i2', 1), \
272
- ('Line number9', 'i2', 1), \
273
- ('Observation time9', 'float64', 1), \
274
- ('Spare9', 'S1', 70), \
275
-
276
- ('Block number10', 'i1', 1), \
277
- ('Block length10', 'i4', 1), \
278
- ('Number of error information data', 'i2', 1), \
279
- ('Line number10', 'i2', 1), \
280
- ('Number of error pixels per line10', 'i2', 1), \
281
- ('Spare10', 'S1', 36), \
282
-
283
- ('Block number11', 'i1', 1), \
284
- ('Block length11', 'i2', 1), \
285
- ('Spare11', 'S1', 256), \
286
-
287
-
288
- ('Count value of each pixel', 'i2', self.res)]
289
-
290
- self.data=np.fromfile(inputfile,dtype=formation)[0]
291
- band=int(inputfile[-21:-19])
292
-
293
- mat = self.data["Count value of each pixel"].reshape([self.nlin, self.ncol])
294
- mat=self.toRealVal(mat,band)
295
- return mat
296
-
297
- def toRealVal(self,mat,bandNo):
298
- radiance1=mat * self.data["Slope for count-radiance conversion equation"] + self.data["Intercept for count-radiance conversion equation"]
299
-
300
- radiance2 = radiance1*self.data["Coefficient for transformation from radiance to albedo"] if bandNo >= 1 and bandNo <= 6 else self.hisd_radiance_to_tbb(radiance1)
301
-
302
- return radiance2
303
-
304
- def hisd_radiance_to_tbb(self, radiance0):
305
- lmbd = self.data['Central wave length'] / 1000000.0
306
- radiance = radiance0 * 1000000.0
307
- planck_c1 = 2.0 * self.data['Planck constant'] * self.data['Speed of light']**2.0 / lmbd**5.0
308
- planck_c2 = self.data['Planck constant'] * self.data['Speed of light'] / (self.data['Boltzmann constant'] * lmbd)
309
- effective_temperature = planck_c2 / np.log((planck_c1 / radiance) + 1.0)
310
- 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
311
- tbb[radiance<0]=np.nan
312
- return tbb
313
-
314
- if __name__=="__main__":
315
- h8P=parseHimawari()
316
- data = h8P.read_Himawari("")
317
-
shancx/user/__init__.py DELETED
@@ -1,137 +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
- def mkDir(path):
23
- if "." in path:
24
- os.makedirs(os.path.dirname(path),exist_ok=True)
25
- else:
26
- os.makedirs(path, exist_ok=True)
27
-
28
- loggers = logging.getLogger()
29
- loggers.setLevel(logging.INFO)
30
- log_name = '/home/scx/logs/project_user.log'
31
- mkDir(log_name)
32
- logfile = log_name
33
- time_rotating_file_handler = handlers.TimedRotatingFileHandler(filename=logfile, when='D', encoding='utf-8')
34
- time_rotating_file_handler.setLevel(logging.INFO)
35
- formatter = logging.Formatter("%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s")
36
- time_rotating_file_handler.setFormatter(formatter)
37
- loggers.addHandler(time_rotating_file_handler)
38
-
39
-
40
- """
41
- import tracback
42
- try:
43
-
44
- except Exception as e:
45
-
46
- logger.info(traceback.format_exc())
47
- """
48
- '''
49
- ##定義一個streamHandler
50
- # print_handler = logging.StreamHandler()
51
- # print_handler.setFormatter(formatter)
52
- # loggers.addHandler(print_handler)
53
- '''
54
-
55
-
56
- """
57
- from main import makeAll,options
58
- from multiprocessing import Pool
59
- import datetime
60
- from config import logger,output
61
- import time
62
- import pandas as pd
63
- import os
64
- from itertools import product
65
- import threading
66
-
67
- def excuteCommand(cmd):
68
- print(cmd)
69
- os.system(cmd)
70
-
71
- def gpuPro(makeListUTC, isPhase, isDebug, gpu, isOverwrite):
72
- productList = product(makeListUTC, [isPhase], [isDebug], [gpu], [isOverwrite])
73
-
74
- with Pool(4) as p:
75
- p.map(makeAll, productList)
76
-
77
- if __name__ == '__main__':
78
- cfg = options()
79
- isPhase = cfg.isPhase
80
- isDebug = cfg.isDebug
81
- sepSec = cfg.sepSec
82
- gpu = cfg.gpu
83
- pool = cfg.pool
84
- isOverwrite = cfg.isOverwrite
85
- timeList = pd.date_range(cfg.times[0], cfg.times[-1], freq=f"{sepSec}s")
86
- logger.info(f"时间段check {timeList}")
87
- gpuNum = 2
88
- eachGPU = 4
89
-
90
- makeListUTC = []
91
- for UTC in timeList:
92
- UTCStr = UTC.strftime("%Y%m%d%H%M")
93
- outpath = f"{output}/{UTCStr[:4]}/{UTCStr[:8]}/MSP2_WTX_AIW_QPF_L88_CHN_{UTCStr}_00000-00300-00006.nc"
94
- if not os.path.exists(outpath) or isOverwrite:
95
- makeListUTC.append(UTC)
96
- [print(element) for element in makeListUTC]
97
-
98
- phaseCMD = "--isPhase" if isPhase else ""
99
- debugCMD = "--isDebug" if isDebug else ""
100
- OverwriteCMD = "--isOverwrite"
101
- gpuCMD = f"--gpu={gpu}"
102
- # cmdList = list(map(lambda x:f"python main.py --times={x.strftime('%Y%m%d%H%M')} {phaseCMD} {debugCMD} {OverwriteCMD} {gpuCMD}",makeListUTC))
103
- cmdList = list(map(lambda x:f"python main.py --times={x.strftime('%Y%m%d%H%M')} {phaseCMD} {debugCMD} {gpuCMD}",makeListUTC))
104
-
105
- with Pool(pool) as p:
106
- p.map(excuteCommand, cmdList)
107
- """
108
-
109
-
110
- '''
111
- # @Time : 2023/09/27 下午8:52
112
- # @Author : shanchangxi
113
- # @File : util_log.py
114
- import time
115
- import logging
116
- from logging import handlers
117
-
118
- logger = logging.getLogger()
119
- logger.setLevel(logging.INFO)
120
- log_name = 'project_tim_tor.log'
121
- logfile = log_name
122
- time_rotating_file_handler = handlers.TimedRotatingFileHandler(filename=logfile, when='D', encoding='utf-8')
123
- time_rotating_file_handler.setLevel(logging.INFO)
124
- formatter = logging.Formatter("%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s")
125
- time_rotating_file_handler.setFormatter(formatter)
126
- logger.addHandler(time_rotating_file_handler)
127
- print_handler = logging.StreamHandler()
128
- print_handler.setFormatter(formatter)
129
- logger.addHandler(print_handler)
130
-
131
- '''
132
-
133
- '''
134
- ###解决方法 pip install torch==2.4.0 torchvision torchaudio三个同时安装 python 3.12 解决cuda启动不了的问题
135
-
136
- Res网络
137
- '''