oafuncs 0.0.96__py2.py3-none-any.whl → 0.0.97__py2.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.
oafuncs/__init__.py CHANGED
@@ -4,8 +4,8 @@
4
4
  Author: Liu Kun && 16031215@qq.com
5
5
  Date: 2024-09-17 16:09:20
6
6
  LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2024-12-13 12:31:06
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_s\\__init__.py
7
+ LastEditTime: 2025-03-09 16:28:01
8
+ FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\__init__.py
9
9
  Description:
10
10
  EditPlatform: vscode
11
11
  ComputerInfo: XPS 15 9510
@@ -14,6 +14,7 @@ Python Version: 3.12
14
14
  """
15
15
 
16
16
 
17
+
17
18
  # 会导致OAFuncs直接导入所有函数,不符合模块化设计
18
19
  # from oafuncs.oa_s.oa_cmap import *
19
20
  # from oafuncs.oa_s.oa_data import *
@@ -27,18 +28,24 @@ Python Version: 3.12
27
28
  # path: My_Funcs/OAFuncs/oafuncs/
28
29
  from .oa_cmap import *
29
30
  from .oa_data import *
31
+
32
+ # ------------------- 2024-12-13 12:31:06 -------------------
33
+ # path: My_Funcs/OAFuncs/oafuncs/oa_down/
34
+ from .oa_down import *
30
35
  from .oa_draw import *
31
36
  from .oa_file import *
32
37
  from .oa_help import *
33
38
  from .oa_nc import *
34
39
  from .oa_python import *
35
- # ------------------- 2024-12-13 12:31:06 -------------------
36
- # path: My_Funcs/OAFuncs/oafuncs/oa_down/
37
- from .oa_down import *
40
+
38
41
  # ------------------- 2024-12-13 12:31:06 -------------------
39
42
  # path: My_Funcs/OAFuncs/oafuncs/oa_sign/
40
43
  from .oa_sign import *
44
+
41
45
  # ------------------- 2024-12-13 12:31:06 -------------------
42
46
  # path: My_Funcs/OAFuncs/oafuncs/oa_tool/
43
47
  from .oa_tool import *
44
48
  # ------------------- 2024-12-13 12:31:06 -------------------
49
+ # path: My_Funcs/OAFuncs/oafuncs/oa_model/
50
+ from .oa_model import *
51
+ # ------------------- 2025-03-09 16:28:01 -------------------
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env python
2
+ # coding=utf-8
3
+ """
4
+ Author: Liu Kun && 16031215@qq.com
5
+ Date: 2025-03-09 16:28:42
6
+ LastEditors: Liu Kun && 16031215@qq.com
7
+ LastEditTime: 2025-03-09 16:28:42
8
+ FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_model\\__init__.py
9
+ Description:
10
+ EditPlatform: vscode
11
+ ComputerInfo: XPS 15 9510
12
+ SystemInfo: Windows 11
13
+ Python Version: 3.12
14
+ """
15
+
16
+
17
+ # 会导致OAFuncs直接导入所有函数,不符合模块化设计
18
+ from .roms import *
19
+ from .wrf import *
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env python
2
+ # coding=utf-8
3
+ """
4
+ Author: Liu Kun && 16031215@qq.com
5
+ Date: 2025-03-09 16:30:02
6
+ LastEditors: Liu Kun && 16031215@qq.com
7
+ LastEditTime: 2025-03-09 18:23:30
8
+ FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_model\\roms\\__init__.py
9
+ Description:
10
+ EditPlatform: vscode
11
+ ComputerInfo: XPS 15 9510
12
+ SystemInfo: Windows 11
13
+ Python Version: 3.12
14
+ """
15
+
16
+
17
+
18
+
19
+ # 会导致OAFuncs直接导入所有函数,不符合模块化设计
20
+ from .test import *
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env python
2
+ # coding=utf-8
3
+ """
4
+ Author: Liu Kun && 16031215@qq.com
5
+ Date: 2025-03-09 16:30:54
6
+ LastEditors: Liu Kun && 16031215@qq.com
7
+ LastEditTime: 2025-03-09 16:30:54
8
+ FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_model\\roms\\depth.py
9
+ Description:
10
+ EditPlatform: vscode
11
+ ComputerInfo: XPS 15 9510
12
+ SystemInfo: Windows 11
13
+ Python Version: 3.12
14
+ """
15
+
16
+ __all__ = ['test']
17
+
18
+ def test():
19
+ print('test')
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env python
2
+ # coding=utf-8
3
+ """
4
+ Author: Liu Kun && 16031215@qq.com
5
+ Date: 2025-03-09 16:29:59
6
+ LastEditors: Liu Kun && 16031215@qq.com
7
+ LastEditTime: 2025-03-09 16:29:59
8
+ FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_model\\wrf\\__init__.py
9
+ Description:
10
+ EditPlatform: vscode
11
+ ComputerInfo: XPS 15 9510
12
+ SystemInfo: Windows 11
13
+ Python Version: 3.12
14
+ """
15
+
16
+
17
+ # 会导致OAFuncs直接导入所有函数,不符合模块化设计
18
+ from .little_r import *
@@ -0,0 +1,186 @@
1
+ #!/usr/bin/env python
2
+ # coding=utf-8
3
+ """
4
+ Author: Liu Kun && 16031215@qq.com
5
+ Date: 2025-03-09 16:31:45
6
+ LastEditors: Liu Kun && 16031215@qq.com
7
+ LastEditTime: 2025-03-09 16:31:45
8
+ FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_model\\wrf\\little_r.py
9
+ Description:
10
+ EditPlatform: vscode
11
+ ComputerInfo: XPS 15 9510
12
+ SystemInfo: Windows 11
13
+ Python Version: 3.12
14
+ """
15
+
16
+ __all__ = ["header_record", "data_record", "ending_record", "tail_record"]
17
+
18
+ import sys
19
+
20
+
21
+ def header_record(Latitude, Longitude, ID, Platform, Elevation, Bogus, Date, SLP, name):
22
+ """
23
+ Latitude : F20.5 纬度,浮点数,总共20位,小数点后保留5位
24
+ Lontitude : F20.5 经度,浮点数,总共20位,小数点后保留5位
25
+ Platform : A40 FM 编码的浮标编号,总共40位
26
+ Elevation : F20.5 浮标高度,单位为米,浮点数,总共20位,小数点后保留5位
27
+ Bogus : logical 标志数据是否有效,True为无效,False为有效
28
+ Date : A20 日期,总共20位
29
+ """
30
+ # 存放header record的字典
31
+ dict_header = {}
32
+ dict_header["Latitude"] = str_F20p5(Latitude)
33
+ dict_header["Longitude"] = str_F20p5(Longitude)
34
+ dict_header["ID"] = str_A40_Front_Space(ID)
35
+ dict_header["Name"] = str_A40_Front_Space(name)
36
+ dict_header["Platform"] = str_A40_Front_Space(Platform)
37
+ dict_header["Source"] = " N/A" # A40
38
+ dict_header["Elevation"] = str_F20p5(Elevation)
39
+ dict_header["ValidFields"] = " 1" # I10
40
+ dict_header["NumErrors"] = " -888888" # I10
41
+ dict_header["NumWarnings"] = " -888888" # I10
42
+ dict_header["SequenceNumber"] = " 890" # I10
43
+ dict_header["NumDuplicates"] = " -888888" # I10
44
+ dict_header["IsSounding"] = " F" # logical 10
45
+ dict_header["IsBogus"] = str_L10(Bogus)
46
+ dict_header["Discard"] = " F" # logical 10
47
+ dict_header["UnixTime"] = " -888888" # I10
48
+ dict_header["JulianDay"] = " -888888" # I10
49
+ dict_header["Date"] = str_A20_Behind_Space(Date)
50
+ dict_header["SLP-QC"] = str_F13p5(SLP) + " 0" # F13.5 I7
51
+ dict_header["RefPressure-QC"] = "-888888.00000 0" # F13.5 I7
52
+ dict_header["GroundTemp-QC"] = "-888888.00000 0" # F13.5 I7
53
+ dict_header["SST-QC"] = "-888888.00000 0" # F13.5 I7
54
+ dict_header["SFCPressure-QC"] = "-888888.00000 0" # F13.5 I7
55
+ dict_header["Precip-QC"] = "-888888.00000 0" # F13.5 I7
56
+ dict_header["DailyMaxT-QC"] = "-888888.00000 0" # F13.5 I7
57
+ dict_header["DailyMinT-QC"] = "-888888.00000 0" # F13.5 I7
58
+ dict_header["NightMinT-TC"] = "-888888.00000 0" # F13.5 I7
59
+ dict_header["3hrPresChange-QC"] = "-888888.00000 0" # F13.5 I7
60
+ dict_header["24hrChange-QC"] = "-888888.00000 0" # F13.5 I7
61
+ dict_header["CloudCover-QC"] = "-888888.00000 0" # F13.5 I7
62
+ dict_header["Ceiling-QC"] = "-888888.00000 0" # F13.5 I7
63
+ dict_header["PrecipitableWater-QC"] = "-888888.00000 0" # F13.5 I7
64
+
65
+ # 生成文件头的字符串,固定长度为620
66
+ header_str = ""
67
+ for iKey in dict_header.keys():
68
+ header_str = header_str + dict_header[iKey]
69
+ if len(header_str) != 620:
70
+ print("Error: The header record len =", len(header_str), ",The correct length should be 620!")
71
+ sys.exit(1)
72
+ return header_str
73
+
74
+
75
+ def data_record(Pressure, Height, Temperature, DewPoint, WindSpeed, WindDirection, WindU, WindV, RelativeHumidity, Thickness):
76
+ """
77
+ Pressure : F13.5, Pa
78
+ Height : F13.5, m
79
+ Temperature : F13.5, K
80
+ DewPoint : F13.5, K
81
+ WindSpeed : F13.5, m/s
82
+ WindDirection : F13.5, deg
83
+ WindU : F13.5, m/s
84
+ WindV : F13.5, m/s
85
+ RelativeHumidity : F13.5, %
86
+ Thickness : F13.5, m
87
+ """
88
+ dict_data = {}
89
+ dict_data["Pressure"] = str_F13p5(Pressure) # F13.5
90
+ dict_data["QC1"] = " 0" # I7
91
+ dict_data["Height"] = str_F13p5(Height) # F13.5
92
+ dict_data["QC2"] = " 0" # I7
93
+ dict_data["Temperature"] = str_F13p5(Temperature) # F13.5
94
+ dict_data["QC3"] = " 0" # I7
95
+ dict_data["DewPoint"] = str_F13p5(DewPoint) # F13.5
96
+ dict_data["QC4"] = " 0" # I7
97
+ dict_data["WindSpeed"] = str_F13p5(WindSpeed) # F13.5
98
+ dict_data["QC5"] = " 0" # I7
99
+ dict_data["WindDirection"] = str_F13p5(WindDirection) # F13.5
100
+ dict_data["QC6"] = " 0" # I7
101
+ dict_data["WindU"] = str_F13p5(WindU) # F13.5
102
+ dict_data["QC7"] = " 0" # I7
103
+ dict_data["WindV"] = str_F13p5(WindV) # F13.5
104
+ dict_data["QC8"] = " 0" # I7
105
+ dict_data["RelativeHumidity"] = str_F13p5(RelativeHumidity) # F13.5
106
+ dict_data["QC9"] = " 0" # I7
107
+ dict_data["Thickness"] = str_F13p5(Thickness) # F13.5
108
+ dict_data["QC10"] = " 0" # I7
109
+
110
+ # 生成数据记录,固定长度为200
111
+ data_str = ""
112
+ for iKey in dict_data.keys():
113
+ data_str = data_str + dict_data[iKey]
114
+ if len(data_str) != 200:
115
+ print("Error: The data record len =", len(data_str), ",The correct length should be 200!")
116
+ sys.exit(1)
117
+ return data_str
118
+
119
+
120
+ def ending_record():
121
+ ending_str = "-777777.00000 0-777777.00000 0-888888.00000 0-888888.00000 0-888888.00000 0-888888.00000 0-888888.00000 0-888888.00000 0-888888.00000 0-888888.00000 0"
122
+ return ending_str
123
+
124
+
125
+ def tail_record(ValidFields):
126
+ """
127
+ ValidFields : integer
128
+ """
129
+ NumErrors = " 0"
130
+ NumWarnings = " 0"
131
+ tail_str = str_I7(ValidFields) + NumErrors + NumWarnings
132
+ if len(tail_str) != 21:
133
+ print("Error: The tail record len =", len(tail_str), ",The correct length should be 21!")
134
+ sys.exit(1)
135
+ return tail_str
136
+
137
+
138
+ # 将浮点数格式化为长度为13位,小数点后保留5位的字符串,并在前面添加合适的空格
139
+ def str_F13p5(float):
140
+ a = "%.5f" % float
141
+ space = " " * (13 - len(a))
142
+ return space + str(a)
143
+
144
+
145
+ # 将浮点数格式化为长度为20位,小数点后保留5位的字符串,并在前面添加合适的空格
146
+ def str_F20p5(float):
147
+ a = "%.5f" % float
148
+ space = " " * (20 - len(a))
149
+ return space + str(a)
150
+
151
+
152
+ # 将字符串格式化为长度为40位的字符串,并在前面添加合适的空格。如果原始字符串超过了40位,会将其截断为前40位。
153
+ def str_A40_Front_Space(string):
154
+ # valid string in Front of space
155
+ string0 = str(string).strip()
156
+ space = " " * (40 - len(string0))
157
+ return string0 + space
158
+
159
+
160
+ # 将字符串格式化为长度为20位的字符串,并在后面添加合适的空格。如果原始字符串超过了20位,会将其截断为前20位。
161
+ def str_A20_Behind_Space(string):
162
+ # valid string Behind space
163
+ string0 = str(string).strip()
164
+ space = " " * (20 - len(string0))
165
+ return space + string0
166
+
167
+
168
+ # 将整数格式化为长度为10位的字符串,并在前面添加合适的空格
169
+ def str_I10(int0):
170
+ space = " " * (10 - len(int0))
171
+ return space + str(int0)
172
+
173
+
174
+ # 将整数格式化为长度为7位的字符串,并在前面添加合适的空格
175
+ def str_I7(int0):
176
+ space = " " * (7 - len(str(int0)))
177
+ return space + str(int0)
178
+
179
+
180
+ # 将布尔值格式化为长度为10位的字符串,如果为True则返回字符串' T',如果为False则返回字符串' F'
181
+ def str_L10(logical):
182
+ if logical:
183
+ string = " T"
184
+ else:
185
+ string = " F"
186
+ return string
@@ -16,3 +16,4 @@ Python Version: 3.12
16
16
  # 会导致OAFuncs直接导入所有函数,不符合模块化设计
17
17
  from .email import *
18
18
  from .parallel import *
19
+ from .time import *
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env python
2
+ # coding=utf-8
3
+ """
4
+ Author: Liu Kun && 16031215@qq.com
5
+ Date: 2025-03-09 13:55:46
6
+ LastEditors: Liu Kun && 16031215@qq.com
7
+ LastEditTime: 2025-03-09 13:55:46
8
+ FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_tool\\time.py
9
+ Description:
10
+ EditPlatform: vscode
11
+ ComputerInfo: XPS 15 9510
12
+ SystemInfo: Windows 11
13
+ Python Version: 3.12
14
+ """
15
+
16
+
17
+ import calendar
18
+
19
+ __all__ = ["get_days"]
20
+
21
+ def get_days(year, month):
22
+ return calendar.monthrange(year, month)[1]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: oafuncs
3
- Version: 0.0.96
3
+ Version: 0.0.97
4
4
  Summary: Oceanic and Atmospheric Functions
5
5
  Home-page: https://github.com/Industry-Pays/OAFuncs
6
6
  Author: Kun Liu
@@ -33,6 +33,7 @@ Requires-Dist: geopandas
33
33
  Requires-Dist: Cartopy
34
34
  Requires-Dist: rasterio
35
35
  Requires-Dist: salem
36
+ Requires-Dist: calendar
36
37
  Dynamic: author
37
38
  Dynamic: author-email
38
39
  Dynamic: classifier
@@ -1,4 +1,4 @@
1
- oafuncs/__init__.py,sha256=glcIlhQ9xSK4WtL58dq7Od2S3JPqsuEyhUQ-VWO8hOc,1426
1
+ oafuncs/__init__.py,sha256=kbdiyCPv2MTapIPRw0LRqNF13auPqRKinU6jpFKmdeQ,1560
2
2
  oafuncs/oa_cmap.py,sha256=azVg9QR_IlG9lXCCXXVs1LS1kFci8yjxDmb_VA_TdTQ,7408
3
3
  oafuncs/oa_data.py,sha256=Skhi70IY7T4lHd_eu3BxcSAfpXMH8SzUURR8gB7bj74,7679
4
4
  oafuncs/oa_draw.py,sha256=QypQp4vJIrbAyFddEVxd9K9Q4d85PRYqYQi9xDUmSZw,11150
@@ -15,15 +15,21 @@ oafuncs/oa_down/idm.py,sha256=XfYCNnQWADxOhhJd-T8sNYN0nGiRrAs7zbQcsB5-UmI,1668
15
15
  oafuncs/oa_down/literature.py,sha256=2bF9gSKQbzcci9LcKE81j8JEjIJwON7jbwQB3gDDA3E,11331
16
16
  oafuncs/oa_down/test_ua.py,sha256=0IQq3NjqfNr7KkyjS_U-a4mYu-r-E7gzawwo4IfEa6Y,10851
17
17
  oafuncs/oa_down/user_agent.py,sha256=TsPcAxFmMTYAEHRFjurI1bQBJfDhcA70MdHoUPwQmks,785
18
+ oafuncs/oa_model/__init__.py,sha256=__ImltHkP1bSsIpsmKpDE8QwwA-2Z8K7mZUHGGcRdro,484
19
+ oafuncs/oa_model/roms/__init__.py,sha256=g-_iv2vUFUnSsKWc7pzGRfkNUvhxfG-Bn4deqfGwxyo,474
20
+ oafuncs/oa_model/roms/test.py,sha256=j3xiZdf3YtQQbNoT3Op_-GxI_zjKYtS3Hk6CTcnoBmA,425
21
+ oafuncs/oa_model/wrf/__init__.py,sha256=_2qUijimSlu7fsqlZunkZ4NF_FXSENwU5YmlJ9BZ6fM,473
22
+ oafuncs/oa_model/wrf/little_r.py,sha256=wx9vzfGznVuaa4T6m_4N89I1a57KZSLQ382EA5iu2Io,7458
18
23
  oafuncs/oa_sign/__init__.py,sha256=QKqTFrJDFK40C5uvk48GlRRbGFzO40rgkYwu6dYxatM,563
19
24
  oafuncs/oa_sign/meteorological.py,sha256=mLbupsZSq427HTfVbZMvIlFzDHwSzQAbK3X19o8anFY,6525
20
25
  oafuncs/oa_sign/ocean.py,sha256=xrW-rWD7xBWsB5PuCyEwQ1Q_RDKq2KCLz-LOONHgldU,5932
21
26
  oafuncs/oa_sign/scientific.py,sha256=a4JxOBgm9vzNZKpJ_GQIQf7cokkraV5nh23HGbmTYKw,5064
22
- oafuncs/oa_tool/__init__.py,sha256=bNTy9abznDhg3k_Irx0YieXl37r-oDRMtTAxf57Stzs,487
27
+ oafuncs/oa_tool/__init__.py,sha256=WPrWq_vWWcUVQ32tsjA4jPQiV0LCxhxS0l4vmX43xDg,508
23
28
  oafuncs/oa_tool/email.py,sha256=4lJxV_KUzhxgLYfVwYTqp0qxRugD7fvsZkXDe5WkUKo,3052
24
29
  oafuncs/oa_tool/parallel.py,sha256=kYbiIFDB7EoxasmXGSomaEDVUsg9Rfvdgbw93lBOY7o,3770
25
- oafuncs-0.0.96.dist-info/LICENSE.txt,sha256=rMtLpVg8sKiSlwClfR9w_Dd_5WubTQgoOzE2PDFxzs4,1074
26
- oafuncs-0.0.96.dist-info/METADATA,sha256=Nh6i-B0Mt9WoTMNYRZ8-bTj9cjHXK_7NDPaZxEPOLk0,3618
27
- oafuncs-0.0.96.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
28
- oafuncs-0.0.96.dist-info/top_level.txt,sha256=bgC35QkXbN4EmPHEveg_xGIZ5i9NNPYWqtJqaKqTPsQ,8
29
- oafuncs-0.0.96.dist-info/RECORD,,
30
+ oafuncs/oa_tool/time.py,sha256=n8Ir5QFxJGZlEsOI3frxyQcN92wIvmS7-2SPQHYCg_c,486
31
+ oafuncs-0.0.97.dist-info/LICENSE.txt,sha256=rMtLpVg8sKiSlwClfR9w_Dd_5WubTQgoOzE2PDFxzs4,1074
32
+ oafuncs-0.0.97.dist-info/METADATA,sha256=0oNzhZSmE-bd4JJK_UjoKdxdPRsA8_2MC1ixhlb0XzY,3643
33
+ oafuncs-0.0.97.dist-info/WHEEL,sha256=rF4EZyR2XVS6irmOHQIJx2SUqXLZKRMUrjsg8UwN-XQ,109
34
+ oafuncs-0.0.97.dist-info/top_level.txt,sha256=bgC35QkXbN4EmPHEveg_xGIZ5i9NNPYWqtJqaKqTPsQ,8
35
+ oafuncs-0.0.97.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any