vortex-by-gitdeeper 0.1.0__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.
- vortex_by_gitdeeper-0.1.0/AUTHORS.md +44 -0
- vortex_by_gitdeeper-0.1.0/LICENSE +21 -0
- vortex_by_gitdeeper-0.1.0/MANIFEST.in +0 -0
- vortex_by_gitdeeper-0.1.0/PKG-INFO +8 -0
- vortex_by_gitdeeper-0.1.0/README.md +204 -0
- vortex_by_gitdeeper-0.1.0/pyproject.toml +3 -0
- vortex_by_gitdeeper-0.1.0/setup.cfg +4 -0
- vortex_by_gitdeeper-0.1.0/setup.py +17 -0
- vortex_by_gitdeeper-0.1.0/src/__init__.py +13 -0
- vortex_by_gitdeeper-0.1.0/src/algorithms/__init__.py +20 -0
- vortex_by_gitdeeper-0.1.0/src/algorithms/integration.py +204 -0
- vortex_by_gitdeeper-0.1.0/src/algorithms/normalization.py +1 -0
- vortex_by_gitdeeper-0.1.0/src/algorithms/probability.py +217 -0
- vortex_by_gitdeeper-0.1.0/src/algorithms/time_stepping.py +310 -0
- vortex_by_gitdeeper-0.1.0/src/algorithms/time_stepping_fixed.py +281 -0
- vortex_by_gitdeeper-0.1.0/src/core/__init__.py +14 -0
- vortex_by_gitdeeper-0.1.0/src/core/thermodynamic_model.py +80 -0
- vortex_by_gitdeeper-0.1.0/src/core/vortex_engine.py +150 -0
- vortex_by_gitdeeper-0.1.0/src/io/__init__.py +1 -0
- vortex_by_gitdeeper-0.1.0/src/parameters/__init__.py +24 -0
- vortex_by_gitdeeper-0.1.0/src/parameters/dynamical.py +60 -0
- vortex_by_gitdeeper-0.1.0/src/parameters/environmental.py +52 -0
- vortex_by_gitdeeper-0.1.0/src/parameters/oceanic.py +178 -0
- vortex_by_gitdeeper-0.1.0/src/parameters/structural.py +59 -0
- vortex_by_gitdeeper-0.1.0/src/utils/__init__.py +17 -0
- vortex_by_gitdeeper-0.1.0/src/utils/paths.py +81 -0
- vortex_by_gitdeeper-0.1.0/src/visualization/__init__.py +1 -0
- vortex_by_gitdeeper-0.1.0/vortex_by_gitdeeper.egg-info/PKG-INFO +8 -0
- vortex_by_gitdeeper-0.1.0/vortex_by_gitdeeper.egg-info/SOURCES.txt +49 -0
- vortex_by_gitdeeper-0.1.0/vortex_by_gitdeeper.egg-info/dependency_links.txt +1 -0
- vortex_by_gitdeeper-0.1.0/vortex_by_gitdeeper.egg-info/requires.txt +1 -0
- vortex_by_gitdeeper-0.1.0/vortex_by_gitdeeper.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Authors
|
|
2
|
+
|
|
3
|
+
## Principal Researcher & Developer
|
|
4
|
+
|
|
5
|
+
### Samir Baladi
|
|
6
|
+
- **Role**: Interdisciplinary AI Researcher, Scientific Software Developer
|
|
7
|
+
- **Email**: gitdeeper@gmail.com
|
|
8
|
+
- **ORCID**: 0009-0003-8903-0029
|
|
9
|
+
- **Phone**: +1-614-264-2074
|
|
10
|
+
- **GitLab**: https://gitlab.com/gitdeeper3
|
|
11
|
+
- **Research Interests**: Applied AI/ML in geosciences, computational meteorology, scientific software development
|
|
12
|
+
|
|
13
|
+
## Current Projects
|
|
14
|
+
|
|
15
|
+
### Vortex Framework
|
|
16
|
+
- **Primary Repository**: https://gitlab.com/gitdeeper3/vortex
|
|
17
|
+
- **Mirror Repositories**:
|
|
18
|
+
- **Codeberg**: https://codeberg.org/gitdeeper2/vortex/
|
|
19
|
+
- **Bitbucket**: https://bitbucket.org/gitdeeper3/vortex/
|
|
20
|
+
- **GitHub**: https://github.com/gitdeeper3/vortex/
|
|
21
|
+
- **Description**: Multi-parameter assessment protocol for tropical cyclone rapid intensification forecasting
|
|
22
|
+
- **Status**: Active development
|
|
23
|
+
|
|
24
|
+
## Contact for Collaboration
|
|
25
|
+
|
|
26
|
+
For research collaboration or technical discussions:
|
|
27
|
+
- **Email**: gitdeeper@gmail.com
|
|
28
|
+
- **GitLab**: @gitdeeper
|
|
29
|
+
|
|
30
|
+
## Open Source Commitment
|
|
31
|
+
|
|
32
|
+
All projects follow open science principles:
|
|
33
|
+
- Source code publicly available under MIT License
|
|
34
|
+
- Research methodologies transparently documented
|
|
35
|
+
- Peer review and community feedback welcome
|
|
36
|
+
|
|
37
|
+
## How to Contribute
|
|
38
|
+
|
|
39
|
+
1. Fork any of the repositories above
|
|
40
|
+
2. Create a feature branch
|
|
41
|
+
3. Make your improvements
|
|
42
|
+
4. Submit a merge request
|
|
43
|
+
|
|
44
|
+
See individual project CONTRIBUTING.md files for specific guidelines.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 gitdeeper3
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
File without changes
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# Vortex Framework
|
|
2
|
+
## Multi-Parameter Assessment Protocol for Tropical Cyclone Rapid Intensification
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
## 📍 Repository Locations
|
|
9
|
+
|
|
10
|
+
This project is mirrored across multiple platforms:
|
|
11
|
+
|
|
12
|
+
- **Primary Repository**: https://gitlab.com/gitdeeper3/vortex
|
|
13
|
+
- **Mirrors**:
|
|
14
|
+
- **Codeberg**: https://codeberg.org/gitdeeper2/vortex/
|
|
15
|
+
- **Bitbucket**: https://bitbucket.org/gitdeeper3/vortex/
|
|
16
|
+
- **PyPI**: https://pypi.org/project/vortex/
|
|
17
|
+
|
|
18
|
+
## Overview
|
|
19
|
+
|
|
20
|
+
The **Vortex Multi-Parameter Assessment Protocol** is an operational research framework for predicting Rapid Intensification (RI) in tropical cyclones.
|
|
21
|
+
|
|
22
|
+
## Core Parameters (8-Parameter Framework)
|
|
23
|
+
|
|
24
|
+
| # | Parameter | Symbol | Description |
|
|
25
|
+
|---|-----------|--------|-------------|
|
|
26
|
+
| 1 | Ocean Heat Content | OHC | Thermal energy in upper ocean |
|
|
27
|
+
| 2 | Eyewall Symmetry | σ_sym | Structural organization index |
|
|
28
|
+
| 3 | Vertical Wind Shear | VWS | 850-200 hPa wind difference |
|
|
29
|
+
| 4 | Mid-Level Humidity | RH_mid | 700-500 hPa relative humidity |
|
|
30
|
+
| 5 | Low-Level Vorticity | ζ_850 | 850 hPa relative vorticity |
|
|
31
|
+
| 6 | Convective Organization | Org_conv | Inner-core convection coherence |
|
|
32
|
+
| 7 | Outflow Efficiency | Eff_outflow | Upper-level ventilation |
|
|
33
|
+
| 8 | Intensity Trend | ΔInt_trend | 6-12h intensity changes |
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Clone from any repository
|
|
39
|
+
git clone https://gitlab.com/gitdeeper3/vortex.git
|
|
40
|
+
cd vortex
|
|
41
|
+
|
|
42
|
+
# Install dependencies
|
|
43
|
+
pip install -r requirements.txt
|
|
44
|
+
|
|
45
|
+
# Install in development mode
|
|
46
|
+
pip install -e .
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Project Structure
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
vortex/
|
|
53
|
+
├── src/ # Source code
|
|
54
|
+
├── data/ # Data directory
|
|
55
|
+
├── config/ # Configuration files
|
|
56
|
+
├── tests/ # Test suite
|
|
57
|
+
├── reports/ # Report system
|
|
58
|
+
├── examples/ # Usage examples
|
|
59
|
+
└── docs/ # Documentation
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Installation
|
|
63
|
+
|
|
64
|
+
Basic Installation
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install -r requirements.txt
|
|
68
|
+
pip install -e .
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
From PyPI
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Install from PyPI
|
|
75
|
+
pip install vortex
|
|
76
|
+
|
|
77
|
+
# Install specific version
|
|
78
|
+
pip install vortex==1.0.0
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Usage
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from vortex.core.vortex_engine import VortexEngine
|
|
85
|
+
from vortex.algorithms.time_stepping import EnhancedTimeSteppingForecast
|
|
86
|
+
|
|
87
|
+
# Initialize engine for Atlantic basin
|
|
88
|
+
engine = VortexEngine(basin="atlantic")
|
|
89
|
+
|
|
90
|
+
# Initialize forecaster
|
|
91
|
+
forecaster = EnhancedTimeSteppingForecast()
|
|
92
|
+
|
|
93
|
+
# Generate forecast
|
|
94
|
+
forecast = forecaster.forecast_intensity(
|
|
95
|
+
initial_intensity_kt=75.0,
|
|
96
|
+
mpi_trajectory=[80.0, 85.0, 90.0, 95.0],
|
|
97
|
+
environmental_trends={
|
|
98
|
+
"vws": [12.0, 10.0, 8.0, 6.0],
|
|
99
|
+
"sst": [28.5, 28.8, 29.0, 29.2]
|
|
100
|
+
},
|
|
101
|
+
time_horizon_hours=24
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
print(f"RI Probability: {forecast['ri_probability_time_series'][-1]:.1%}")
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Documentation
|
|
108
|
+
|
|
109
|
+
Full documentation is available in the docs/ directory:
|
|
110
|
+
|
|
111
|
+
· API Reference
|
|
112
|
+
· Scientific Methodology
|
|
113
|
+
· Validation Results
|
|
114
|
+
· Installation Guides
|
|
115
|
+
|
|
116
|
+
Contributing
|
|
117
|
+
|
|
118
|
+
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting contributions.
|
|
119
|
+
|
|
120
|
+
License
|
|
121
|
+
|
|
122
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
123
|
+
|
|
124
|
+
Citation and Distribution
|
|
125
|
+
|
|
126
|
+
📚 Academic Citation (Zenodo)
|
|
127
|
+
|
|
128
|
+
For academic publications, please cite using the Zenodo DOI:
|
|
129
|
+
|
|
130
|
+
```bibtex
|
|
131
|
+
@software{vortex_framework_2026,
|
|
132
|
+
author = {Baladi, Samir},
|
|
133
|
+
title = {Vortex Multi-Parameter Assessment Protocol for Tropical Cyclone Rapid Intensification},
|
|
134
|
+
year = {2026},
|
|
135
|
+
publisher = {Zenodo},
|
|
136
|
+
doi = {10.5281/zenodo.xxxxxxx},
|
|
137
|
+
url = {https://doi.org/10.5281/zenodo.xxxxxxx},
|
|
138
|
+
version = {1.0.0}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Zenodo Archive: https://zenodo.org/records/xxxxxxx
|
|
143
|
+
|
|
144
|
+
📦 Package Distribution (PyPI)
|
|
145
|
+
|
|
146
|
+
The Vortex package is available on PyPI:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Install from PyPI
|
|
150
|
+
pip install vortex
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
PyPI Package: https://pypi.org/project/vortex/
|
|
154
|
+
|
|
155
|
+
Current Version: 1.0.0
|
|
156
|
+
|
|
157
|
+
PyPI Citation:
|
|
158
|
+
|
|
159
|
+
```bibtex
|
|
160
|
+
@software{vortex_pypi_2026,
|
|
161
|
+
author = {Baladi, Samir},
|
|
162
|
+
title = {vortex: Python package for tropical cyclone RI forecasting},
|
|
163
|
+
year = {2026},
|
|
164
|
+
publisher = {PyPI},
|
|
165
|
+
url = {https://pypi.org/project/vortex/},
|
|
166
|
+
version = {1.0.0}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
🔗 Repository Citations
|
|
171
|
+
|
|
172
|
+
For referencing specific repository versions:
|
|
173
|
+
|
|
174
|
+
GitLab:
|
|
175
|
+
|
|
176
|
+
```bibtex
|
|
177
|
+
@software{vortex_gitlab_2026,
|
|
178
|
+
author = {Baladi, Samir},
|
|
179
|
+
title = {Vortex Framework - GitLab Repository},
|
|
180
|
+
year = {2026},
|
|
181
|
+
publisher = {GitLab},
|
|
182
|
+
url = {https://gitlab.com/gitdeeper3/vortex},
|
|
183
|
+
note = {Version 1.0.0, commit: [specific commit hash]}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Contact
|
|
188
|
+
|
|
189
|
+
Samir Baladi
|
|
190
|
+
|
|
191
|
+
· Role: Interdisciplinary AI Researcher, Scientific Software Developer
|
|
192
|
+
· Email: gitdeeper@gmail.com
|
|
193
|
+
· ORCID: 0009-0003-8903-0029
|
|
194
|
+
· Phone: +1-614-264-2074
|
|
195
|
+
· GitLab: @gitdeeper
|
|
196
|
+
· Research Interests: Applied AI/ML in geosciences, computational meteorology, scientific software development
|
|
197
|
+
|
|
198
|
+
Project Links
|
|
199
|
+
|
|
200
|
+
· GitLab (Primary): https://gitlab.com/gitdeeper3/vortex
|
|
201
|
+
· Codeberg: https://codeberg.org/gitdeeper2/vortex/
|
|
202
|
+
· Bitbucket: https://bitbucket.org/gitdeeper3/vortex/
|
|
203
|
+
· PyPI: https://pypi.org/project/vortex/
|
|
204
|
+
· Zenodo: https://zenodo.org/records/xxxxxxx
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from setuptools import setup
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="vortex-by-gitdeeper",
|
|
5
|
+
version="0.1.0",
|
|
6
|
+
packages=[
|
|
7
|
+
'src',
|
|
8
|
+
'src.algorithms',
|
|
9
|
+
'src.core',
|
|
10
|
+
'src.io',
|
|
11
|
+
'src.parameters',
|
|
12
|
+
'src.utils',
|
|
13
|
+
'src.visualization'
|
|
14
|
+
],
|
|
15
|
+
package_dir={'': '.'}, # المفتاح هنا!
|
|
16
|
+
install_requires=["numpy>=1.20.0"],
|
|
17
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Vortex Simulation Package
|
|
3
|
+
Computational fluid dynamics and vortex modeling
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
__version__ = "0.1.0"
|
|
7
|
+
__author__ = "gitdeeper3"
|
|
8
|
+
|
|
9
|
+
# استيرادات اختيارية - يمكن حذفها إذا كانت تسبب مشاكل
|
|
10
|
+
# from src.core.vortex_engine import VortexEngine
|
|
11
|
+
# from src.algorithms.time_stepping import TimeStepper
|
|
12
|
+
|
|
13
|
+
# __all__ = ['VortexEngine', 'TimeStepper']
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Algorithm modules for the Vortex framework.
|
|
3
|
+
|
|
4
|
+
Contains forecasting algorithms and computational methods for
|
|
5
|
+
tropical cyclone intensity prediction and RI probability calculation.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .time_stepping import EnhancedTimeSteppingForecast, TimeStepper
|
|
9
|
+
from .probability import RIProbabilityCalculator
|
|
10
|
+
from .integration import ParameterIntegration
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
'EnhancedTimeSteppingForecast',
|
|
14
|
+
'TimeStepper',
|
|
15
|
+
'RIProbabilityCalculator',
|
|
16
|
+
'ParameterIntegration',
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
__version__ = "1.0.0"
|
|
20
|
+
__description__ = "Forecasting algorithms for Vortex framework"
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Parameter Integration Algorithm
|
|
3
|
+
Implements the Vortex RI Index from equation 2.3
|
|
4
|
+
"""
|
|
5
|
+
import numpy as np
|
|
6
|
+
from typing import Dict, List, Optional
|
|
7
|
+
import yaml
|
|
8
|
+
import logging
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
class ParameterIntegration:
|
|
13
|
+
"""
|
|
14
|
+
Integrate 8 parameters into Vortex RI Index
|
|
15
|
+
|
|
16
|
+
Vortex Index = Σ(α_i * P_i)
|
|
17
|
+
where α_i are basin-dependent weights
|
|
18
|
+
P_i are normalized parameters (0-1 scale)
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(self, basin: str = "atlantic"):
|
|
22
|
+
"""
|
|
23
|
+
Initialize integration for specific basin
|
|
24
|
+
|
|
25
|
+
Parameters:
|
|
26
|
+
-----------
|
|
27
|
+
basin : str
|
|
28
|
+
Tropical cyclone basin
|
|
29
|
+
"""
|
|
30
|
+
self.basin = basin
|
|
31
|
+
self.weights = self._load_basin_weights(basin)
|
|
32
|
+
|
|
33
|
+
def _load_basin_weights(self, basin: str) -> Dict:
|
|
34
|
+
"""Load basin-specific weights from config"""
|
|
35
|
+
config_path = f"config/basins/{basin}.yaml"
|
|
36
|
+
try:
|
|
37
|
+
with open(config_path, 'r') as f:
|
|
38
|
+
config = yaml.safe_load(f)
|
|
39
|
+
return config.get('weights', {}).get('initial_phase', {})
|
|
40
|
+
except FileNotFoundError:
|
|
41
|
+
logger.warning(f"Config for {basin} not found, using defaults")
|
|
42
|
+
return self._get_default_weights()
|
|
43
|
+
|
|
44
|
+
def _get_default_weights(self) -> Dict:
|
|
45
|
+
"""Default weights if config not available"""
|
|
46
|
+
return {
|
|
47
|
+
'ohc': 0.15,
|
|
48
|
+
'sigma_sym': 0.10,
|
|
49
|
+
'vws': 0.20,
|
|
50
|
+
'rh_mid': 0.15,
|
|
51
|
+
'vorticity': 0.10,
|
|
52
|
+
'outflow': 0.10,
|
|
53
|
+
'conv_org': 0.10,
|
|
54
|
+
'int_trend': 0.10
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
def integrate(self, parameters: Dict[str, float],
|
|
58
|
+
storm_stage: str = "initial_phase") -> Dict[str, float]:
|
|
59
|
+
"""
|
|
60
|
+
Integrate normalized parameters into indices
|
|
61
|
+
|
|
62
|
+
Parameters:
|
|
63
|
+
-----------
|
|
64
|
+
parameters : dict
|
|
65
|
+
Dictionary of normalized parameters (0-1 scale)
|
|
66
|
+
storm_stage : str
|
|
67
|
+
Storm stage: 'initial_phase', 'intensifying_phase', 'mature_phase'
|
|
68
|
+
|
|
69
|
+
Returns:
|
|
70
|
+
--------
|
|
71
|
+
dict: Integrated indices
|
|
72
|
+
"""
|
|
73
|
+
try:
|
|
74
|
+
# Load appropriate weights for storm stage
|
|
75
|
+
weights = self._get_weights_for_stage(storm_stage)
|
|
76
|
+
|
|
77
|
+
# Calculate individual indices
|
|
78
|
+
thermodynamic_idx = self._calculate_thermodynamic_index(
|
|
79
|
+
parameters.get('ohc_normalized', 0),
|
|
80
|
+
parameters.get('sst_normalized', 0)
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
structural_idx = self._calculate_structural_index(
|
|
84
|
+
parameters.get('sigma_sym', 0),
|
|
85
|
+
parameters.get('convective_org_score', 0)
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
environmental_idx = self._calculate_environmental_index(
|
|
89
|
+
parameters.get('vws_normalized', 0),
|
|
90
|
+
parameters.get('rh_mid_normalized', 0)
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# Calculate combined Vortex Index (equation 2.3)
|
|
94
|
+
vortex_index = 0.0
|
|
95
|
+
total_weight = 0.0
|
|
96
|
+
|
|
97
|
+
# Parameter mapping
|
|
98
|
+
param_mapping = {
|
|
99
|
+
'ohc': 'ohc_normalized',
|
|
100
|
+
'sigma_sym': 'sigma_sym',
|
|
101
|
+
'vws': 'vws_normalized',
|
|
102
|
+
'rh_mid': 'rh_mid_normalized',
|
|
103
|
+
'vorticity': 'vorticity_normalized',
|
|
104
|
+
'outflow': 'outflow_efficiency',
|
|
105
|
+
'conv_org': 'convective_org_score',
|
|
106
|
+
'int_trend': 'intensity_trend'
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
for param_name, weight in weights.items():
|
|
110
|
+
param_key = param_mapping.get(param_name)
|
|
111
|
+
if param_key and param_key in parameters:
|
|
112
|
+
param_value = parameters[param_key]
|
|
113
|
+
# Apply inverse transformation for VWS (equation 2.3: VWS⁻¹)
|
|
114
|
+
if param_name == 'vws' and param_value > 0:
|
|
115
|
+
param_value = 1.0 / param_value if param_value > 0.1 else 1.0
|
|
116
|
+
|
|
117
|
+
vortex_index += weight * param_value
|
|
118
|
+
total_weight += weight
|
|
119
|
+
|
|
120
|
+
if total_weight > 0:
|
|
121
|
+
vortex_index /= total_weight
|
|
122
|
+
|
|
123
|
+
# Apply sigmoid transformation for some parameters
|
|
124
|
+
vortex_index = self._sigmoid_transform(vortex_index)
|
|
125
|
+
|
|
126
|
+
logger.info(f"Vortex Index calculated: {vortex_index:.3f}")
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
'thermodynamic_index': thermodynamic_idx,
|
|
130
|
+
'structural_index': structural_idx,
|
|
131
|
+
'environmental_index': environmental_idx,
|
|
132
|
+
'combined_index': vortex_index,
|
|
133
|
+
'weights_used': weights,
|
|
134
|
+
'storm_stage': storm_stage
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
except Exception as e:
|
|
138
|
+
logger.error(f"Error in parameter integration: {e}")
|
|
139
|
+
return {
|
|
140
|
+
'thermodynamic_index': 0.0,
|
|
141
|
+
'structural_index': 0.0,
|
|
142
|
+
'environmental_index': 0.0,
|
|
143
|
+
'combined_index': 0.0
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
def _get_weights_for_stage(self, storm_stage: str) -> Dict:
|
|
147
|
+
"""Get weights for specific storm stage"""
|
|
148
|
+
try:
|
|
149
|
+
config_path = f"config/basins/{self.basin}.yaml"
|
|
150
|
+
with open(config_path, 'r') as f:
|
|
151
|
+
config = yaml.safe_load(f)
|
|
152
|
+
return config.get('weights', {}).get(storm_stage, self._get_default_weights())
|
|
153
|
+
except:
|
|
154
|
+
return self._get_default_weights()
|
|
155
|
+
|
|
156
|
+
def _calculate_thermodynamic_index(self, ohc_norm: float, sst_norm: float) -> float:
|
|
157
|
+
"""Calculate thermodynamic potential index"""
|
|
158
|
+
return 0.6 * ohc_norm + 0.4 * sst_norm
|
|
159
|
+
|
|
160
|
+
def _calculate_structural_index(self, sigma_sym: float, conv_org: float) -> float:
|
|
161
|
+
"""Calculate structural organization index"""
|
|
162
|
+
return 0.7 * sigma_sym + 0.3 * conv_org
|
|
163
|
+
|
|
164
|
+
def _calculate_environmental_index(self, vws_norm: float, rh_mid_norm: float) -> float:
|
|
165
|
+
"""Calculate environmental favorability index"""
|
|
166
|
+
# VWS is inverse relationship (lower is better)
|
|
167
|
+
vws_component = 1.0 - vws_norm
|
|
168
|
+
return 0.6 * vws_component + 0.4 * rh_mid_norm
|
|
169
|
+
|
|
170
|
+
def _sigmoid_transform(self, x: float) -> float:
|
|
171
|
+
"""Apply sigmoid transformation to limit range"""
|
|
172
|
+
return 1.0 / (1.0 + np.exp(-10.0 * (x - 0.5)))
|
|
173
|
+
|
|
174
|
+
def _normalize_vws(self, vws_value: float) -> float:
|
|
175
|
+
"""Normalize vertical wind shear (0-1, where 0 is most favorable)"""
|
|
176
|
+
# From paper: <5 m/s highly favorable, >15 m/s inhibitor
|
|
177
|
+
if vws_value < 5.0:
|
|
178
|
+
return 0.1 # Very favorable
|
|
179
|
+
elif vws_value < 10.0:
|
|
180
|
+
return 0.3 # Moderately favorable
|
|
181
|
+
elif vws_value < 15.0:
|
|
182
|
+
return 0.7 # Unfavorable
|
|
183
|
+
else:
|
|
184
|
+
return 1.0 # RI inhibitor
|
|
185
|
+
|
|
186
|
+
# Test function
|
|
187
|
+
if __name__ == "__main__":
|
|
188
|
+
integrator = ParameterIntegration("atlantic")
|
|
189
|
+
|
|
190
|
+
# Example parameters (normalized 0-1)
|
|
191
|
+
example_params = {
|
|
192
|
+
'ohc_normalized': 0.8,
|
|
193
|
+
'sst_normalized': 0.9,
|
|
194
|
+
'sigma_sym': 0.7,
|
|
195
|
+
'vws_normalized': 0.2,
|
|
196
|
+
'rh_mid_normalized': 0.6,
|
|
197
|
+
'vorticity_normalized': 0.5,
|
|
198
|
+
'outflow_efficiency': 0.4,
|
|
199
|
+
'convective_org_score': 0.6,
|
|
200
|
+
'intensity_trend': 0.3
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
results = integrator.integrate(example_params, "intensifying_phase")
|
|
204
|
+
print("Integration Results:", results)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Placeholder for future implementation
|