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.
- shancx/3D/__init__.py +25 -0
- shancx/Algo/Class.py +11 -0
- shancx/Algo/CudaPrefetcher1.py +112 -0
- shancx/Algo/Fake_image.py +24 -0
- shancx/Algo/Hsml.py +391 -0
- shancx/Algo/L2Loss.py +10 -0
- shancx/Algo/MetricTracker.py +132 -0
- shancx/Algo/Normalize.py +66 -0
- shancx/Algo/OptimizerWScheduler.py +38 -0
- shancx/Algo/Rmageresize.py +79 -0
- shancx/Algo/Savemodel.py +33 -0
- shancx/Algo/SmoothL1_losses.py +27 -0
- shancx/Algo/Tqdm.py +62 -0
- shancx/Algo/__init__.py +121 -0
- shancx/Algo/checknan.py +28 -0
- shancx/Algo/iouJU.py +83 -0
- shancx/Algo/mask.py +25 -0
- shancx/Algo/psnr.py +9 -0
- shancx/Algo/ssim.py +70 -0
- shancx/Algo/structural_similarity.py +308 -0
- shancx/Algo/tool.py +704 -0
- shancx/Calmetrics/__init__.py +97 -0
- shancx/Calmetrics/calmetrics.py +14 -0
- shancx/Calmetrics/calmetricsmatrixLib.py +147 -0
- shancx/Calmetrics/rmseR2score.py +35 -0
- shancx/Clip/__init__.py +50 -0
- shancx/Cmd.py +126 -0
- shancx/Config_.py +26 -0
- shancx/Df/DataFrame.py +11 -2
- shancx/Df/__init__.py +17 -0
- shancx/Df/tool.py +0 -0
- shancx/Diffm/Psamples.py +18 -0
- shancx/Diffm/__init__.py +0 -0
- shancx/Diffm/test.py +207 -0
- shancx/Doc/__init__.py +214 -0
- shancx/E/__init__.py +178 -152
- shancx/Fillmiss/__init__.py +0 -0
- shancx/Fillmiss/imgidwJU.py +46 -0
- shancx/Fillmiss/imgidwLatLonJU.py +82 -0
- shancx/Gpu/__init__.py +55 -0
- shancx/H9/__init__.py +126 -0
- shancx/H9/ahi_read_hsd.py +877 -0
- shancx/H9/ahisearchtable.py +298 -0
- shancx/H9/geometry.py +2439 -0
- shancx/Hug/__init__.py +81 -0
- shancx/Inst.py +22 -0
- shancx/Lib.py +31 -0
- shancx/Mos/__init__.py +37 -0
- shancx/NN/__init__.py +235 -106
- shancx/Path1.py +161 -0
- shancx/Plot/GlobMap.py +276 -116
- shancx/Plot/__init__.py +491 -1
- shancx/Plot/draw_day_CR_PNG.py +4 -21
- shancx/Plot/exam.py +116 -0
- shancx/Plot/plotGlobal.py +325 -0
- shancx/{radar_nmc.py → Plot/radarNmc.py} +4 -34
- shancx/{subplots_single_china_map.py → Plot/single_china_map.py} +1 -1
- shancx/Point.py +46 -0
- shancx/QC.py +223 -0
- shancx/RdPzl/__init__.py +32 -0
- shancx/Read.py +72 -0
- shancx/Resize.py +79 -0
- shancx/SN/__init__.py +62 -123
- shancx/Time/GetTime.py +9 -3
- shancx/Time/__init__.py +66 -1
- shancx/Time/timeCycle.py +302 -0
- shancx/Time/tool.py +0 -0
- shancx/Train/__init__.py +74 -0
- shancx/Train/makelist.py +187 -0
- shancx/Train/multiGpu.py +27 -0
- shancx/Train/prepare.py +161 -0
- shancx/Train/renet50.py +157 -0
- shancx/ZR.py +12 -0
- shancx/__init__.py +333 -262
- shancx/args.py +27 -0
- shancx/bak.py +768 -0
- shancx/df2database.py +62 -2
- shancx/geosProj.py +80 -0
- shancx/info.py +38 -0
- shancx/netdfJU.py +231 -0
- shancx/sendM.py +59 -0
- shancx/tensBoard/__init__.py +28 -0
- shancx/wait.py +246 -0
- {shancx-1.8.92.dist-info → shancx-1.9.33.218.dist-info}/METADATA +15 -5
- shancx-1.9.33.218.dist-info/RECORD +91 -0
- {shancx-1.8.92.dist-info → shancx-1.9.33.218.dist-info}/WHEEL +1 -1
- my_timer_decorator/__init__.py +0 -10
- shancx/Dsalgor/__init__.py +0 -19
- shancx/E/DFGRRIB.py +0 -30
- shancx/EN/DFGRRIB.py +0 -30
- shancx/EN/__init__.py +0 -148
- shancx/FileRead.py +0 -44
- shancx/Gray2RGB.py +0 -86
- shancx/M/__init__.py +0 -137
- shancx/MN/__init__.py +0 -133
- shancx/N/__init__.py +0 -131
- shancx/Plot/draw_day_CR_PNGUS.py +0 -206
- shancx/Plot/draw_day_CR_SVG.py +0 -275
- shancx/Plot/draw_day_pre_PNGUS.py +0 -205
- shancx/Plot/glob_nation_map.py +0 -116
- shancx/Plot/radar_nmc.py +0 -61
- shancx/Plot/radar_nmc_china_map_compare1.py +0 -50
- shancx/Plot/radar_nmc_china_map_f.py +0 -121
- shancx/Plot/radar_nmc_us_map_f.py +0 -128
- shancx/Plot/subplots_compare_devlop.py +0 -36
- shancx/Plot/subplots_single_china_map.py +0 -45
- shancx/S/__init__.py +0 -138
- shancx/W/__init__.py +0 -132
- shancx/WN/__init__.py +0 -132
- shancx/code.py +0 -331
- shancx/draw_day_CR_PNG.py +0 -200
- shancx/draw_day_CR_PNGUS.py +0 -206
- shancx/draw_day_CR_SVG.py +0 -275
- shancx/draw_day_pre_PNGUS.py +0 -205
- shancx/makenetCDFN.py +0 -42
- shancx/mkIMGSCX.py +0 -92
- shancx/netCDF.py +0 -130
- shancx/radar_nmc_china_map_compare1.py +0 -50
- shancx/radar_nmc_china_map_f.py +0 -125
- shancx/radar_nmc_us_map_f.py +0 -67
- shancx/subplots_compare_devlop.py +0 -36
- shancx/tool.py +0 -18
- shancx/user/H8mess.py +0 -317
- shancx/user/__init__.py +0 -137
- shancx/user/cinradHJN.py +0 -496
- shancx/user/examMeso.py +0 -293
- shancx/user/hjnDAAS.py +0 -26
- shancx/user/hjnFTP.py +0 -81
- shancx/user/hjnGIS.py +0 -320
- shancx/user/hjnGPU.py +0 -21
- shancx/user/hjnIDW.py +0 -68
- shancx/user/hjnKDTree.py +0 -75
- shancx/user/hjnLAPSTransform.py +0 -47
- shancx/user/hjnMiscellaneous.py +0 -182
- shancx/user/hjnProj.py +0 -162
- shancx/user/inotify.py +0 -41
- shancx/user/matplotlibMess.py +0 -87
- shancx/user/mkNCHJN.py +0 -623
- shancx/user/newTypeRadar.py +0 -492
- shancx/user/test.py +0 -6
- shancx/user/tlogP.py +0 -129
- shancx/util_log.py +0 -33
- shancx/wtx/H8mess.py +0 -315
- shancx/wtx/__init__.py +0 -151
- shancx/wtx/cinradHJN.py +0 -496
- shancx/wtx/colormap.py +0 -64
- shancx/wtx/examMeso.py +0 -298
- shancx/wtx/hjnDAAS.py +0 -26
- shancx/wtx/hjnFTP.py +0 -81
- shancx/wtx/hjnGIS.py +0 -330
- shancx/wtx/hjnGPU.py +0 -21
- shancx/wtx/hjnIDW.py +0 -68
- shancx/wtx/hjnKDTree.py +0 -75
- shancx/wtx/hjnLAPSTransform.py +0 -47
- shancx/wtx/hjnLog.py +0 -78
- shancx/wtx/hjnMiscellaneous.py +0 -201
- shancx/wtx/hjnProj.py +0 -161
- shancx/wtx/inotify.py +0 -41
- shancx/wtx/matplotlibMess.py +0 -87
- shancx/wtx/mkNCHJN.py +0 -613
- shancx/wtx/newTypeRadar.py +0 -492
- shancx/wtx/test.py +0 -6
- shancx/wtx/tlogP.py +0 -129
- shancx-1.8.92.dist-info/RECORD +0 -99
- /shancx/{Dsalgor → Algo}/dsalgor.py +0 -0
- {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
|
-
'''
|