climkit 0.0.3__tar.gz
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.
- climkit-0.0.3/LICENSE +28 -0
- climkit-0.0.3/MANIFEST.in +1 -0
- climkit-0.0.3/PKG-INFO +190 -0
- climkit-0.0.3/README.md +142 -0
- climkit-0.0.3/climkit/Cquiver.py +1754 -0
- climkit-0.0.3/climkit/K_Mean.py +178 -0
- climkit-0.0.3/climkit/TN_WaveActivityFlux.py +380 -0
- climkit-0.0.3/climkit/__init__.py +1 -0
- climkit-0.0.3/climkit/average_filter.py +40 -0
- climkit-0.0.3/climkit/corr_reg.py +66 -0
- climkit-0.0.3/climkit/data_read.py +196 -0
- climkit-0.0.3/climkit/draw_plot.py +279 -0
- climkit-0.0.3/climkit/filter.py +294 -0
- climkit-0.0.3/climkit/force_file.py +607 -0
- climkit-0.0.3/climkit/lead_lag_corr.py +49 -0
- climkit-0.0.3/climkit/lonlat_transform.py +28 -0
- climkit-0.0.3/climkit/masked.py +17 -0
- climkit-0.0.3/climkit/move_detrend.py +54 -0
- climkit-0.0.3/climkit/pre_whitening.py +41 -0
- climkit-0.0.3/climkit/significance_test.py +90 -0
- climkit-0.0.3/climkit/specx_anal.py +81 -0
- climkit-0.0.3/climkit/sub_adjust.py +23 -0
- climkit-0.0.3/climkit/temperature_budget.py +166 -0
- climkit-0.0.3/climkit/wavelet.py +235 -0
- climkit-0.0.3/climkit.egg-info/PKG-INFO +190 -0
- climkit-0.0.3/climkit.egg-info/SOURCES.txt +40 -0
- climkit-0.0.3/climkit.egg-info/dependency_links.txt +1 -0
- climkit-0.0.3/climkit.egg-info/requires.txt +26 -0
- climkit-0.0.3/climkit.egg-info/top_level.txt +2 -0
- climkit-0.0.3/requirements.txt +26 -0
- climkit-0.0.3/setup.cfg +4 -0
- climkit-0.0.3/setup.py +47 -0
- climkit-0.0.3/test/__init__.py +0 -0
- climkit-0.0.3/test/f2py/__init__.py +0 -0
- climkit-0.0.3/test/f2py/copy.py +11 -0
- climkit-0.0.3/test/f2py/dim.py +43 -0
- climkit-0.0.3/test/f2py/dsphe.py +86 -0
- climkit-0.0.3/test/f2py/ufftp.py +1144 -0
- climkit-0.0.3/test/f2py/usphe.py +315 -0
- climkit-0.0.3/test/f2py/xabort.py +7 -0
- climkit-0.0.3/test/frc_draw.py +109 -0
- climkit-0.0.3/test/lbm.py +0 -0
climkit-0.0.3/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, Tingyang Song
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include requirements.txt
|
climkit-0.0.3/PKG-INFO
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: climkit
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: Some tool function package for Climate
|
|
5
|
+
Home-page: https://github.com/hhhopsong/climkit
|
|
6
|
+
Author: Tingyang Song
|
|
7
|
+
Author-email: 1057422494@qq.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Requires-Python: >=3.8
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: numpy>=1.26
|
|
13
|
+
Requires-Dist: pandas>=2.2
|
|
14
|
+
Requires-Dist: scipy>=1.12
|
|
15
|
+
Requires-Dist: xarray>=2024.1
|
|
16
|
+
Requires-Dist: netCDF4>=1.6
|
|
17
|
+
Requires-Dist: cftime>=1.6
|
|
18
|
+
Requires-Dist: bottleneck>=1.3
|
|
19
|
+
Requires-Dist: matplotlib>=3.8
|
|
20
|
+
Requires-Dist: metpy>=1.6
|
|
21
|
+
Requires-Dist: scikit-learn>=1.4
|
|
22
|
+
Requires-Dist: joblib>=1.3
|
|
23
|
+
Requires-Dist: cartopy>=0.22
|
|
24
|
+
Requires-Dist: shapely>=1.0
|
|
25
|
+
Requires-Dist: pyproj>=3.6
|
|
26
|
+
Requires-Dist: xgrads>=0.2.0
|
|
27
|
+
Requires-Dist: cmaps>=1.5
|
|
28
|
+
Requires-Dist: func_timeout>=1.0
|
|
29
|
+
Requires-Dist: numba>=0.53
|
|
30
|
+
Requires-Dist: salem>=0.2
|
|
31
|
+
Requires-Dist: eofs>=1.0
|
|
32
|
+
Requires-Dist: geopandas>=0.10
|
|
33
|
+
Requires-Dist: pymannkendall>=1.0
|
|
34
|
+
Requires-Dist: statsmodels>=0.9
|
|
35
|
+
Requires-Dist: pycwt
|
|
36
|
+
Requires-Dist: alive_progress
|
|
37
|
+
Requires-Dist: pyproj>=3.6.1
|
|
38
|
+
Dynamic: author
|
|
39
|
+
Dynamic: author-email
|
|
40
|
+
Dynamic: classifier
|
|
41
|
+
Dynamic: description
|
|
42
|
+
Dynamic: description-content-type
|
|
43
|
+
Dynamic: home-page
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
Dynamic: requires-dist
|
|
46
|
+
Dynamic: requires-python
|
|
47
|
+
Dynamic: summary
|
|
48
|
+
|
|
49
|
+
<p align="center">
|
|
50
|
+
<img src="docs/logo.pdf" alt="ClimKit logo" width="200" />
|
|
51
|
+
</p>
|
|
52
|
+
# 📘 ClimKit — A Climate Data Analysis Toolkit
|
|
53
|
+
|
|
54
|
+
**ClimKit** 是一个用于气候数据及绘图的 Python 工具集。它包含多种常用数据处理工具,例如波谱分析、温度收支、矢量场可视化等,适用于科研人员、地球科学研究者及数据分析工程师。
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 🌟 功能概览
|
|
59
|
+
|
|
60
|
+
ClimKit 提供以下核心功能模块:
|
|
61
|
+
|
|
62
|
+
### 🔸 1. **Wavelet Analysis(小波分析和功率谱分析)**
|
|
63
|
+
|
|
64
|
+
位于 `climkit.wavelet` 和 `climkit.specx_anal`
|
|
65
|
+
|
|
66
|
+
* 执行连续小波变换(CWT)
|
|
67
|
+
* 分析气候/海洋数据的周期性与多尺度特征
|
|
68
|
+
* 提供功率谱、显著性检验等方法
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### 🔸 2. **Temperature Budget(温度收支分析)**
|
|
73
|
+
|
|
74
|
+
位于 `climkit.temperature_budget`
|
|
75
|
+
|
|
76
|
+
* 计算局地温度场的收支项
|
|
77
|
+
* 用于大气热力诊断
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
### 🔸 3. **K-Means 聚类工具**
|
|
82
|
+
|
|
83
|
+
位于 `climkit.K_Mean`
|
|
84
|
+
|
|
85
|
+
* 常用于气候系统聚类分型分析
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### 🔸 4. **Cquiver — 矢量场绘图**
|
|
90
|
+
|
|
91
|
+
位于 `climkit.Cquiver`
|
|
92
|
+
|
|
93
|
+
* 扩展版 matplotlib.quiver
|
|
94
|
+
* 更美观的可视化风场、流场
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### 🔸 5. **Subfig Adjustment(子图调整)**
|
|
99
|
+
|
|
100
|
+
位于 `climkit.sub_adjust`
|
|
101
|
+
|
|
102
|
+
* 绘制地图子图(如:中国黄海;中国南海)
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
### 🔸 6. **Filter (信号滤波)**
|
|
107
|
+
|
|
108
|
+
位于 `climkit.filter`
|
|
109
|
+
|
|
110
|
+
* 洛伦兹滤波、滑动滤波、巴特霍夫滤波等
|
|
111
|
+
* 用于对信号进行滤波,并可以绘制响应函数
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
### 🔸 7. **Lonlat transform (经度格式转换)**
|
|
116
|
+
|
|
117
|
+
位于 `climkit.lonlat_transform`
|
|
118
|
+
|
|
119
|
+
* 对360度和180度制的经度格式提供互相转换功能
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### 🔸 8. **Masked (数据裁切)**
|
|
124
|
+
|
|
125
|
+
位于 `climkit.masked`
|
|
126
|
+
|
|
127
|
+
* 基于SHP文件对NetCDF数据进行数据裁切
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### 🔸 9. **LBM forcing data (制作线性斜压模式强迫数据)**
|
|
132
|
+
|
|
133
|
+
位于 `climkit.force_file`
|
|
134
|
+
|
|
135
|
+
* 制作NetCDF格式的LBM强迫数据
|
|
136
|
+
* 目前仅支持T42 & 垂直20层配置下的LBM
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### 🔸 10. **T-N Wave Activity Flux (计算T-N波活动通量)**
|
|
141
|
+
|
|
142
|
+
位于 `climkit.TN_WaveActivityFlux`
|
|
143
|
+
|
|
144
|
+
* 基于气候态水平风速场和异常位势高度场计算波活动通量
|
|
145
|
+
* 支持二维和三维波活动通量的计算(三维波活动通量需要提供气候态温度场)
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 🚀 安装方式
|
|
150
|
+
|
|
151
|
+
### **方式一:pip(推荐)**
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
pip install climkit
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### **方式二:从源码安装**
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
git clone https://example.com/climkit.git
|
|
161
|
+
cd climkit
|
|
162
|
+
pip install -e .
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 🧪 快速开始
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### 示例:矢量风场绘图
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
from climkit.Cquiver import Curlyquiver
|
|
175
|
+
import matplotlib.pyplot as plt
|
|
176
|
+
|
|
177
|
+
fig = plt.figure()
|
|
178
|
+
ax = fig.add_subplot(projection=*)
|
|
179
|
+
Curlyquiver(ax, x, y, U, V)
|
|
180
|
+
plt.show()
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 🛠 其他
|
|
186
|
+
|
|
187
|
+
项目包含 Pytorch 代码用于GPU加速(可选)。
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
climkit-0.0.3/README.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/logo.pdf" alt="ClimKit logo" width="200" />
|
|
3
|
+
</p>
|
|
4
|
+
# 📘 ClimKit — A Climate Data Analysis Toolkit
|
|
5
|
+
|
|
6
|
+
**ClimKit** 是一个用于气候数据及绘图的 Python 工具集。它包含多种常用数据处理工具,例如波谱分析、温度收支、矢量场可视化等,适用于科研人员、地球科学研究者及数据分析工程师。
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🌟 功能概览
|
|
11
|
+
|
|
12
|
+
ClimKit 提供以下核心功能模块:
|
|
13
|
+
|
|
14
|
+
### 🔸 1. **Wavelet Analysis(小波分析和功率谱分析)**
|
|
15
|
+
|
|
16
|
+
位于 `climkit.wavelet` 和 `climkit.specx_anal`
|
|
17
|
+
|
|
18
|
+
* 执行连续小波变换(CWT)
|
|
19
|
+
* 分析气候/海洋数据的周期性与多尺度特征
|
|
20
|
+
* 提供功率谱、显著性检验等方法
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
### 🔸 2. **Temperature Budget(温度收支分析)**
|
|
25
|
+
|
|
26
|
+
位于 `climkit.temperature_budget`
|
|
27
|
+
|
|
28
|
+
* 计算局地温度场的收支项
|
|
29
|
+
* 用于大气热力诊断
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### 🔸 3. **K-Means 聚类工具**
|
|
34
|
+
|
|
35
|
+
位于 `climkit.K_Mean`
|
|
36
|
+
|
|
37
|
+
* 常用于气候系统聚类分型分析
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### 🔸 4. **Cquiver — 矢量场绘图**
|
|
42
|
+
|
|
43
|
+
位于 `climkit.Cquiver`
|
|
44
|
+
|
|
45
|
+
* 扩展版 matplotlib.quiver
|
|
46
|
+
* 更美观的可视化风场、流场
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
### 🔸 5. **Subfig Adjustment(子图调整)**
|
|
51
|
+
|
|
52
|
+
位于 `climkit.sub_adjust`
|
|
53
|
+
|
|
54
|
+
* 绘制地图子图(如:中国黄海;中国南海)
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### 🔸 6. **Filter (信号滤波)**
|
|
59
|
+
|
|
60
|
+
位于 `climkit.filter`
|
|
61
|
+
|
|
62
|
+
* 洛伦兹滤波、滑动滤波、巴特霍夫滤波等
|
|
63
|
+
* 用于对信号进行滤波,并可以绘制响应函数
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### 🔸 7. **Lonlat transform (经度格式转换)**
|
|
68
|
+
|
|
69
|
+
位于 `climkit.lonlat_transform`
|
|
70
|
+
|
|
71
|
+
* 对360度和180度制的经度格式提供互相转换功能
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
### 🔸 8. **Masked (数据裁切)**
|
|
76
|
+
|
|
77
|
+
位于 `climkit.masked`
|
|
78
|
+
|
|
79
|
+
* 基于SHP文件对NetCDF数据进行数据裁切
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### 🔸 9. **LBM forcing data (制作线性斜压模式强迫数据)**
|
|
84
|
+
|
|
85
|
+
位于 `climkit.force_file`
|
|
86
|
+
|
|
87
|
+
* 制作NetCDF格式的LBM强迫数据
|
|
88
|
+
* 目前仅支持T42 & 垂直20层配置下的LBM
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
### 🔸 10. **T-N Wave Activity Flux (计算T-N波活动通量)**
|
|
93
|
+
|
|
94
|
+
位于 `climkit.TN_WaveActivityFlux`
|
|
95
|
+
|
|
96
|
+
* 基于气候态水平风速场和异常位势高度场计算波活动通量
|
|
97
|
+
* 支持二维和三维波活动通量的计算(三维波活动通量需要提供气候态温度场)
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 🚀 安装方式
|
|
102
|
+
|
|
103
|
+
### **方式一:pip(推荐)**
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
pip install climkit
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### **方式二:从源码安装**
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
git clone https://example.com/climkit.git
|
|
113
|
+
cd climkit
|
|
114
|
+
pip install -e .
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 🧪 快速开始
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### 示例:矢量风场绘图
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
from climkit.Cquiver import Curlyquiver
|
|
127
|
+
import matplotlib.pyplot as plt
|
|
128
|
+
|
|
129
|
+
fig = plt.figure()
|
|
130
|
+
ax = fig.add_subplot(projection=*)
|
|
131
|
+
Curlyquiver(ax, x, y, U, V)
|
|
132
|
+
plt.show()
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 🛠 其他
|
|
138
|
+
|
|
139
|
+
项目包含 Pytorch 代码用于GPU加速(可选)。
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|