pyhardisp 0.2.0__tar.gz → 0.2.2__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.
- {pyhardisp-0.2.0/pyhardisp.egg-info → pyhardisp-0.2.2}/PKG-INFO +20 -10
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/README.md +33 -36
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/README_PYTHON_CONVERSION.md +19 -9
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/pyhardisp/__init__.py +1 -1
- {pyhardisp-0.2.0 → pyhardisp-0.2.2/pyhardisp.egg-info}/PKG-INFO +20 -10
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/pyproject.toml +1 -1
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/LICENCE +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/LICENSE_IERS.txt +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/MANIFEST.in +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/ocean_loading_nm_s2.csv +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/pyhardisp/core.py +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/pyhardisp.egg-info/SOURCES.txt +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/pyhardisp.egg-info/dependency_links.txt +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/pyhardisp.egg-info/requires.txt +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/pyhardisp.egg-info/top_level.txt +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/setup.cfg +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/src/ADMINT.F +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/src/ETUTC.F +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/src/EVAL.F +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/src/HARDISP.F +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/src/JULDAT.F +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/src/LEAP.F +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/src/MDAY.F +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/src/RECURS.F +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/src/SHELLS.F +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/src/SPLINE.F +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/src/TDFRPH.F +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/src/TOYMD.F +0 -0
- {pyhardisp-0.2.0 → pyhardisp-0.2.2}/tests/tests.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyhardisp
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Ocean loading tidal displacement calculator - Python conversion of IERS HARDISP Fortran program
|
|
5
5
|
Author: IERS Conventions, Python Conversion - Craig Miller
|
|
6
6
|
License-Expression: LicenseRef-IERS
|
|
@@ -37,6 +37,7 @@ This document describes the Python conversion of the **HARDISP** (Harmonic Displ
|
|
|
37
37
|
## What is HARDISP?
|
|
38
38
|
|
|
39
39
|
HARDISP is a scientific program developed by the International Earth Rotation and Reference Systems Service (IERS) for calculating tidal ocean loading effects at geodetic stations. Depending on the coefficients provided by the ocean loading provider, it computes either:
|
|
40
|
+
|
|
40
41
|
- **Tidal displacements** (vertical, horizontal components) - when displacement coefficients are provided
|
|
41
42
|
- **Tidal gravity effects** (gravity disturbances) - when gravity-type coefficients are provided
|
|
42
43
|
|
|
@@ -55,6 +56,7 @@ The program is part of the **IERS Conventions 2010** recommendations (Class 1 mo
|
|
|
55
56
|
Given ocean loading coefficients in BLQ format (from the Bos-Scherneck loading service or equivalent providers), HARDISP computes a time series of tidal ocean loading effects in three components:
|
|
56
57
|
|
|
57
58
|
**Output type depends on the ocean loading provider's coefficients:**
|
|
59
|
+
|
|
58
60
|
- **Displacement coefficients**: Returns displacements
|
|
59
61
|
- **dU**: Vertical (radial) displacement (meters)
|
|
60
62
|
- **dS**: South (North-South) displacement (meters)
|
|
@@ -74,8 +76,8 @@ HARDISP processes the coefficients as-is, with no automatic conversions between
|
|
|
74
76
|
The Python conversion consists of:
|
|
75
77
|
**core.py** - Main Python module with optimized implementation
|
|
76
78
|
|
|
77
|
-
|
|
78
79
|
Original Fortran files (for reference):
|
|
80
|
+
|
|
79
81
|
- `HARDISP.F` - Main program
|
|
80
82
|
- `ADMINT.F` - Admittance interpolation
|
|
81
83
|
- `RECURS.F` - Recursive harmonic evaluation
|
|
@@ -221,6 +223,7 @@ for day_val in range(1, 8): # Process days 1-7
|
|
|
221
223
|
### Coordinate System
|
|
222
224
|
|
|
223
225
|
The output displacements are in a **local geodetic frame** at the station:
|
|
226
|
+
|
|
224
227
|
- **dU**: Radial (positive upward)
|
|
225
228
|
- **dS**: South component (positive southward, i.e., negative latitude direction)
|
|
226
229
|
- **dW**: West component (positive westward, i.e., negative longitude direction)
|
|
@@ -228,6 +231,7 @@ The output displacements are in a **local geodetic frame** at the station:
|
|
|
228
231
|
### Tidal Constituents Used
|
|
229
232
|
|
|
230
233
|
The 11 input harmonics (from BLQ format) represent:
|
|
234
|
+
|
|
231
235
|
1. M₂ - Principal lunar semi-diurnal (12.42 hours)
|
|
232
236
|
2. S₂ - Principal solar semi-diurnal (12.00 hours)
|
|
233
237
|
3. N₂ - Lunar elliptic semi-diurnal (12.66 hours)
|
|
@@ -282,7 +286,6 @@ The Python code was converted from these 13 Fortran files:
|
|
|
282
286
|
12. `ETUTC.F` (284 lines) - ET-UTC calculation
|
|
283
287
|
13. `TOYS.F` - (not in workspace but referenced)
|
|
284
288
|
|
|
285
|
-
|
|
286
289
|
## Function Name Mapping (Original Fortran → New Python)
|
|
287
290
|
|
|
288
291
|
| Original Fortran | New Python Name | Purpose |
|
|
@@ -306,6 +309,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
306
309
|
## Features Implemented
|
|
307
310
|
|
|
308
311
|
### Complete Conversion
|
|
312
|
+
|
|
309
313
|
- [x] All 342 tidal constituents support
|
|
310
314
|
- [x] Recursive harmonic evaluation (efficient)
|
|
311
315
|
- [x] Cubic spline interpolation
|
|
@@ -317,6 +321,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
317
321
|
- [x] Delaunay argument calculations
|
|
318
322
|
|
|
319
323
|
### Additional Features
|
|
324
|
+
|
|
320
325
|
- [x] Object-oriented design with HardispComputer class
|
|
321
326
|
- [x] NumPy integration for high performance
|
|
322
327
|
- [x] Comprehensive error handling
|
|
@@ -327,6 +332,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
327
332
|
## Core Components Converted
|
|
328
333
|
|
|
329
334
|
### 1. Date/Time Functions (7 functions)
|
|
335
|
+
|
|
330
336
|
```
|
|
331
337
|
✓ is_leap_year(year) - Check leap year
|
|
332
338
|
✓ days_before_month(year, month) - Days before month start
|
|
@@ -336,6 +342,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
336
342
|
```
|
|
337
343
|
|
|
338
344
|
### 2. Spline Interpolation (3 functions)
|
|
345
|
+
|
|
339
346
|
```
|
|
340
347
|
✓ cublic_spline(x, u) - Compute cubic spline coefficients
|
|
341
348
|
✓ spline_eval(y, x, u, s) - Evaluate spline at point
|
|
@@ -343,6 +350,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
343
350
|
```
|
|
344
351
|
|
|
345
352
|
### 3. Tidal Frequency Calculations (3 functions)
|
|
353
|
+
|
|
346
354
|
```
|
|
347
355
|
✓ calculate_tidal_arguments(year, day, h, m, s) - Initialize tidal calculations
|
|
348
356
|
✓ tidal_frequency_and_phase(doodson_number) - Get frequency and phase from Doodson number
|
|
@@ -350,33 +358,34 @@ The Python code was converted from these 13 Fortran files:
|
|
|
350
358
|
```
|
|
351
359
|
|
|
352
360
|
### 4. Harmonic Recursion (1 function)
|
|
361
|
+
|
|
353
362
|
```
|
|
354
363
|
✓ recursion(n, hc, nf, om) - Efficient recursive harmonic evaluation
|
|
355
364
|
```
|
|
356
365
|
|
|
357
366
|
### 5. Utility Functions (2 functions)
|
|
367
|
+
|
|
358
368
|
```
|
|
359
369
|
✓ pyshells(x) - Sort array with indices (Shell sort)
|
|
360
370
|
✓ fortran_int_divide(a, b) - Fortran-style integer division
|
|
361
371
|
```
|
|
362
372
|
|
|
363
373
|
### 6. Main Class: HardispComputer
|
|
374
|
+
|
|
364
375
|
```
|
|
365
376
|
✓ read_blq_format(amp, phase) - Load ocean loading coefficients
|
|
366
377
|
✓ compute_ocean_loading(...) - Main computation engine
|
|
367
378
|
```
|
|
368
379
|
|
|
369
|
-
|
|
370
|
-
|
|
371
380
|
## References
|
|
372
381
|
|
|
373
382
|
1. Petit, G. and Luzum, B. (eds.), **IERS Conventions (2010)**, IERS Technical Note No. 36, BKG (2010)
|
|
374
|
-
- Available at: https://www.iers.org/IERS/EN/Publications/TechnicalNotes/tn36.php
|
|
383
|
+
- Available at: <https://www.iers.org/IERS/EN/Publications/TechnicalNotes/tn36.php>
|
|
375
384
|
|
|
376
385
|
2. Agnew, D. C., et al., **HARDISP**: Original algorithm and implementation
|
|
377
386
|
|
|
378
387
|
3. Scherneck, H.-G., and M. S. Bos, **Ocean Loading Service**: BLQ format specification
|
|
379
|
-
- Available at: http://www.oso.chalmers.se/~loading
|
|
388
|
+
- Available at: <http://www.oso.chalmers.se/~loading/>
|
|
380
389
|
|
|
381
390
|
4. Cartwright, D. E., and A. C. Edden, **Tides of the Planet Earth**, Geophys. J. R. Astron. Soc. 65, 615-630, 1981
|
|
382
391
|
|
|
@@ -387,10 +396,11 @@ This Python conversion maintains the same IERS Conventions Software License as t
|
|
|
387
396
|
## Contact
|
|
388
397
|
|
|
389
398
|
For questions or issues with the Fortran original:
|
|
390
|
-
|
|
391
|
-
-
|
|
399
|
+
|
|
400
|
+
- IERS Conventions Center: <https://www.iers.org/>
|
|
401
|
+
- Email: <gpetit@bipm.org> or <brian.luzum@usno.navy.mil>
|
|
392
402
|
|
|
393
403
|
---
|
|
394
404
|
|
|
395
|
-
*Python conversion completed:
|
|
405
|
+
*Python conversion completed: 2026*
|
|
396
406
|
*Original Fortran: IERS Conventions 2010*
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
# pyhardisp Python Module - Quick Start Guide
|
|
2
|
+
|
|
2
3
|
[](https://codecov.io/gh/craigmillernz/pyhardisp)
|
|
3
|
-
[](https://github.com/craigmillernz/pyhardisp/actions/workflows/build.yml)
|
|
5
|
+
[](https://doi.org/10.5281/zenodo.20189637)
|
|
4
6
|
|
|
5
7
|
## 📋 What is HARDISP vs pyhardisp?
|
|
6
8
|
|
|
7
9
|
**HARDISP** computes ocean loading tidal effects for geodetic stations. It processes coefficients provided by ocean loading providers ([such as the Bos-Scherneck service](https://barre.oso.chalmers.se/loading/l.php)) to compute either:
|
|
10
|
+
|
|
8
11
|
- **Displacements** (vertical and horizontal) when displacement-type coefficients are provided
|
|
9
12
|
- **Gravity effects** (gravity (nm/s^2) and tilt(nrads)) when gravity-type coefficients are provided
|
|
10
13
|
|
|
@@ -12,33 +15,34 @@ It's part of the IERS Conventions 2010 recommended models for correcting space g
|
|
|
12
15
|
|
|
13
16
|
**pyhardisp** is a python conversion of the original HARDISP fortran code from IERS (available in the src dir).
|
|
14
17
|
|
|
15
|
-
|
|
16
18
|
## Installation & Requirements
|
|
17
19
|
|
|
18
20
|
```bash
|
|
19
21
|
# Requires:
|
|
20
|
-
- Python 3.
|
|
21
|
-
- NumPy (
|
|
22
|
+
- Python 3.8+
|
|
23
|
+
- NumPy (> 1.19)
|
|
22
24
|
|
|
23
25
|
# Installation:
|
|
24
|
-
1.
|
|
25
|
-
2.
|
|
26
|
+
1. pip install pyhardisp
|
|
27
|
+
2. conda install -c conda-forge pyhardisp
|
|
26
28
|
|
|
27
29
|
```
|
|
28
30
|
|
|
29
31
|
## 📂 Files in This Directory
|
|
30
32
|
|
|
31
33
|
### Python Module
|
|
32
|
-
|
|
34
|
+
|
|
35
|
+
- **`core.py`**
|
|
33
36
|
- Complete Python implementation of HARDISP
|
|
34
37
|
- Vectorised routines for speed enhancement
|
|
35
38
|
|
|
36
39
|
### Documentation
|
|
40
|
+
|
|
37
41
|
- **`README_PYTHON_CONVERSION.md`** - Complete user guide with examples
|
|
38
|
-
- **`CONVERSION_SUMMARY.md`** - Technical overview and specifications
|
|
39
42
|
- **`README.md`** - This file
|
|
40
43
|
|
|
41
44
|
### Original Fortran Code from IERS (Reference Only)
|
|
45
|
+
|
|
42
46
|
- `HARDISP.F` - Main program
|
|
43
47
|
- `ADMINT.F` - Admittance interpolation
|
|
44
48
|
- `RECURS.F` - Recursive evaluation
|
|
@@ -52,16 +56,19 @@ It's part of the IERS Conventions 2010 recommended models for correcting space g
|
|
|
52
56
|
## 🚀 Quick Start (5 minutes)
|
|
53
57
|
|
|
54
58
|
### 1. Import the Module
|
|
59
|
+
|
|
55
60
|
```python
|
|
56
61
|
import pyhardisp
|
|
57
62
|
```
|
|
58
63
|
|
|
59
64
|
### 2. Create a Computer
|
|
65
|
+
|
|
60
66
|
```python
|
|
61
67
|
computer = pyhardisp.HardispComputer()
|
|
62
68
|
```
|
|
63
69
|
|
|
64
70
|
### 3. Load Your Data
|
|
71
|
+
|
|
65
72
|
```python
|
|
66
73
|
# Ocean loading coefficients (from BLQ format)
|
|
67
74
|
# 3 rows (vertical, east, north) × 11 columns (tidal constituents)
|
|
@@ -80,6 +87,7 @@ computer.read_blq_format(amplitudes, phases, units="nm/s2")
|
|
|
80
87
|
```
|
|
81
88
|
|
|
82
89
|
### 4. Compute Displacements
|
|
90
|
+
|
|
83
91
|
```python
|
|
84
92
|
dz, ds, dw = computer.compute_ocean_loading(
|
|
85
93
|
year=2018, month=4, day=5,
|
|
@@ -90,13 +98,15 @@ dz, ds, dw = computer.compute_ocean_loading(
|
|
|
90
98
|
```
|
|
91
99
|
|
|
92
100
|
### 5. Use the Results
|
|
101
|
+
|
|
93
102
|
```python
|
|
94
103
|
# Results are in nm/s^2 for vertical or nrad for horizontal components
|
|
95
104
|
for i in range(24):
|
|
96
105
|
print(f"Hour {i}: Gravity={dz[i]:.6f} nm/s^2, South_tilt={ds[i]:.6f} nrad, West_tilt={dw[i]:.6f} nrad")
|
|
97
106
|
```
|
|
98
107
|
|
|
99
|
-
##
|
|
108
|
+
## Example Output
|
|
109
|
+
|
|
100
110
|
```
|
|
101
111
|
Hour 0: Gravity=-46.218473 nm/s^2, South_tilt=31.320275 nrad, West_tilt=-62.009276 nrad
|
|
102
112
|
Hour 1: Gravity=-46.166374 nm/s^2, South_tilt=31.286324 nrad, West_tilt=-62.111623 nrad
|
|
@@ -110,7 +120,7 @@ Hour 8: Gravity=-45.799106 nm/s^2, South_tilt=31.046809 nrad, West_tilt=-62.8244
|
|
|
110
120
|
Hour 9: Gravity=-45.746273 nm/s^2, South_tilt=31.012328 nrad, West_tilt=-62.925713 nrad
|
|
111
121
|
```
|
|
112
122
|
|
|
113
|
-
##
|
|
123
|
+
## Key Functions Reference
|
|
114
124
|
|
|
115
125
|
| Function | Purpose |
|
|
116
126
|
|----------|---------|
|
|
@@ -135,13 +145,7 @@ For detailed information, see:
|
|
|
135
145
|
- Algorithm explanations
|
|
136
146
|
- Validation results
|
|
137
147
|
|
|
138
|
-
|
|
139
|
-
- Overview of conversion
|
|
140
|
-
- List of implemented features
|
|
141
|
-
- Quality metrics
|
|
142
|
-
- Performance information
|
|
143
|
-
|
|
144
|
-
## 🔬 Technical Highlights
|
|
148
|
+
## Technical Highlights
|
|
145
149
|
|
|
146
150
|
- **342 tidal constituents** for precision of ~0.1%
|
|
147
151
|
- **Recursive harmonic evaluation** for fast computation
|
|
@@ -158,7 +162,7 @@ Comparion with Quicktide Pro (QTP) and hardisp_x64.exe
|
|
|
158
162
|
|
|
159
163
|

|
|
160
164
|
|
|
161
|
-
##
|
|
165
|
+
## Understanding the Input Data
|
|
162
166
|
|
|
163
167
|
The BLQ format contains 11 tidal constituents:
|
|
164
168
|
|
|
@@ -176,17 +180,18 @@ The BLQ format contains 11 tidal constituents:
|
|
|
176
180
|
|
|
177
181
|
These are expanded to 342 constituents by the program for higher precision.
|
|
178
182
|
|
|
179
|
-
##
|
|
183
|
+
## Data Sources
|
|
180
184
|
|
|
181
185
|
Ocean loading coefficients can be obtained from:
|
|
182
186
|
|
|
183
187
|
**Bos & Scherneck Loading Service**
|
|
184
|
-
|
|
188
|
+
|
|
189
|
+
- URL: <http://https://barre.oso.chalmers.se/loading/l.php/>
|
|
185
190
|
- Format: BLQ (Binary Loading Queue)
|
|
186
191
|
- Coverage: Global
|
|
187
192
|
- Models: Various (CSR, FES, etc.)
|
|
188
193
|
|
|
189
|
-
##
|
|
194
|
+
## References
|
|
190
195
|
|
|
191
196
|
1. **IERS Conventions (2010)**
|
|
192
197
|
- Petit, G. and Luzum, B. (eds.)
|
|
@@ -200,12 +205,12 @@ Ocean loading coefficients can be obtained from:
|
|
|
200
205
|
- Cartwright & Edden (1981)
|
|
201
206
|
- Doodson numbers and Darwin notation
|
|
202
207
|
|
|
203
|
-
##
|
|
208
|
+
## Related Tools
|
|
204
209
|
|
|
205
210
|
- **SPOTL** - SPOTL ocean loading (original basis for HARDISP)
|
|
206
211
|
- **IERS Conventions Software** - Complete IERS implementations
|
|
207
212
|
|
|
208
|
-
##
|
|
213
|
+
## Common Questions
|
|
209
214
|
|
|
210
215
|
**Q: What are BLQ files?**
|
|
211
216
|
A: Ocean loading coefficients in binary format from the Chalmers university loading service.
|
|
@@ -222,20 +227,12 @@ A: Yes, modify the IDT array in the HardispComputer class
|
|
|
222
227
|
**Q: What about non-Gregorian calendars?**
|
|
223
228
|
A: The code assumes Gregorian calendar (since ~1582)
|
|
224
229
|
|
|
225
|
-
##
|
|
230
|
+
## Support
|
|
226
231
|
|
|
227
|
-
- **For the original Fortran**: Contact IERS (gpetit@bipm.org)
|
|
228
|
-
- **For this Python version**:
|
|
229
|
-
- **For BLQ data**: Contact Hans-Georg Scherneck (scherneck@oso.chalmers.se)
|
|
232
|
+
- **For the original Fortran**: Contact IERS (<gpetit@bipm.org>)
|
|
233
|
+
- **For this Python version**: Make an [issue](https://github.com/craigmillernz/pyhardisp)
|
|
234
|
+
- **For BLQ data**: Contact Hans-Georg Scherneck (<scherneck@oso.chalmers.se>)
|
|
230
235
|
|
|
231
|
-
##
|
|
236
|
+
## License
|
|
232
237
|
|
|
233
238
|
This Python version maintains the same IERS Conventions Software License as the original Fortran code. See copyright notices in the source files.
|
|
234
|
-
|
|
235
|
-
---
|
|
236
|
-
|
|
237
|
-
**Happy computing! 🌐**
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
*Based on: IERS Conventions 2010, Fortran HARDISP*
|
|
@@ -7,6 +7,7 @@ This document describes the Python conversion of the **HARDISP** (Harmonic Displ
|
|
|
7
7
|
## What is HARDISP?
|
|
8
8
|
|
|
9
9
|
HARDISP is a scientific program developed by the International Earth Rotation and Reference Systems Service (IERS) for calculating tidal ocean loading effects at geodetic stations. Depending on the coefficients provided by the ocean loading provider, it computes either:
|
|
10
|
+
|
|
10
11
|
- **Tidal displacements** (vertical, horizontal components) - when displacement coefficients are provided
|
|
11
12
|
- **Tidal gravity effects** (gravity disturbances) - when gravity-type coefficients are provided
|
|
12
13
|
|
|
@@ -25,6 +26,7 @@ The program is part of the **IERS Conventions 2010** recommendations (Class 1 mo
|
|
|
25
26
|
Given ocean loading coefficients in BLQ format (from the Bos-Scherneck loading service or equivalent providers), HARDISP computes a time series of tidal ocean loading effects in three components:
|
|
26
27
|
|
|
27
28
|
**Output type depends on the ocean loading provider's coefficients:**
|
|
29
|
+
|
|
28
30
|
- **Displacement coefficients**: Returns displacements
|
|
29
31
|
- **dU**: Vertical (radial) displacement (meters)
|
|
30
32
|
- **dS**: South (North-South) displacement (meters)
|
|
@@ -44,8 +46,8 @@ HARDISP processes the coefficients as-is, with no automatic conversions between
|
|
|
44
46
|
The Python conversion consists of:
|
|
45
47
|
**core.py** - Main Python module with optimized implementation
|
|
46
48
|
|
|
47
|
-
|
|
48
49
|
Original Fortran files (for reference):
|
|
50
|
+
|
|
49
51
|
- `HARDISP.F` - Main program
|
|
50
52
|
- `ADMINT.F` - Admittance interpolation
|
|
51
53
|
- `RECURS.F` - Recursive harmonic evaluation
|
|
@@ -191,6 +193,7 @@ for day_val in range(1, 8): # Process days 1-7
|
|
|
191
193
|
### Coordinate System
|
|
192
194
|
|
|
193
195
|
The output displacements are in a **local geodetic frame** at the station:
|
|
196
|
+
|
|
194
197
|
- **dU**: Radial (positive upward)
|
|
195
198
|
- **dS**: South component (positive southward, i.e., negative latitude direction)
|
|
196
199
|
- **dW**: West component (positive westward, i.e., negative longitude direction)
|
|
@@ -198,6 +201,7 @@ The output displacements are in a **local geodetic frame** at the station:
|
|
|
198
201
|
### Tidal Constituents Used
|
|
199
202
|
|
|
200
203
|
The 11 input harmonics (from BLQ format) represent:
|
|
204
|
+
|
|
201
205
|
1. M₂ - Principal lunar semi-diurnal (12.42 hours)
|
|
202
206
|
2. S₂ - Principal solar semi-diurnal (12.00 hours)
|
|
203
207
|
3. N₂ - Lunar elliptic semi-diurnal (12.66 hours)
|
|
@@ -252,7 +256,6 @@ The Python code was converted from these 13 Fortran files:
|
|
|
252
256
|
12. `ETUTC.F` (284 lines) - ET-UTC calculation
|
|
253
257
|
13. `TOYS.F` - (not in workspace but referenced)
|
|
254
258
|
|
|
255
|
-
|
|
256
259
|
## Function Name Mapping (Original Fortran → New Python)
|
|
257
260
|
|
|
258
261
|
| Original Fortran | New Python Name | Purpose |
|
|
@@ -276,6 +279,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
276
279
|
## Features Implemented
|
|
277
280
|
|
|
278
281
|
### Complete Conversion
|
|
282
|
+
|
|
279
283
|
- [x] All 342 tidal constituents support
|
|
280
284
|
- [x] Recursive harmonic evaluation (efficient)
|
|
281
285
|
- [x] Cubic spline interpolation
|
|
@@ -287,6 +291,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
287
291
|
- [x] Delaunay argument calculations
|
|
288
292
|
|
|
289
293
|
### Additional Features
|
|
294
|
+
|
|
290
295
|
- [x] Object-oriented design with HardispComputer class
|
|
291
296
|
- [x] NumPy integration for high performance
|
|
292
297
|
- [x] Comprehensive error handling
|
|
@@ -297,6 +302,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
297
302
|
## Core Components Converted
|
|
298
303
|
|
|
299
304
|
### 1. Date/Time Functions (7 functions)
|
|
305
|
+
|
|
300
306
|
```
|
|
301
307
|
✓ is_leap_year(year) - Check leap year
|
|
302
308
|
✓ days_before_month(year, month) - Days before month start
|
|
@@ -306,6 +312,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
306
312
|
```
|
|
307
313
|
|
|
308
314
|
### 2. Spline Interpolation (3 functions)
|
|
315
|
+
|
|
309
316
|
```
|
|
310
317
|
✓ cublic_spline(x, u) - Compute cubic spline coefficients
|
|
311
318
|
✓ spline_eval(y, x, u, s) - Evaluate spline at point
|
|
@@ -313,6 +320,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
313
320
|
```
|
|
314
321
|
|
|
315
322
|
### 3. Tidal Frequency Calculations (3 functions)
|
|
323
|
+
|
|
316
324
|
```
|
|
317
325
|
✓ calculate_tidal_arguments(year, day, h, m, s) - Initialize tidal calculations
|
|
318
326
|
✓ tidal_frequency_and_phase(doodson_number) - Get frequency and phase from Doodson number
|
|
@@ -320,33 +328,34 @@ The Python code was converted from these 13 Fortran files:
|
|
|
320
328
|
```
|
|
321
329
|
|
|
322
330
|
### 4. Harmonic Recursion (1 function)
|
|
331
|
+
|
|
323
332
|
```
|
|
324
333
|
✓ recursion(n, hc, nf, om) - Efficient recursive harmonic evaluation
|
|
325
334
|
```
|
|
326
335
|
|
|
327
336
|
### 5. Utility Functions (2 functions)
|
|
337
|
+
|
|
328
338
|
```
|
|
329
339
|
✓ pyshells(x) - Sort array with indices (Shell sort)
|
|
330
340
|
✓ fortran_int_divide(a, b) - Fortran-style integer division
|
|
331
341
|
```
|
|
332
342
|
|
|
333
343
|
### 6. Main Class: HardispComputer
|
|
344
|
+
|
|
334
345
|
```
|
|
335
346
|
✓ read_blq_format(amp, phase) - Load ocean loading coefficients
|
|
336
347
|
✓ compute_ocean_loading(...) - Main computation engine
|
|
337
348
|
```
|
|
338
349
|
|
|
339
|
-
|
|
340
|
-
|
|
341
350
|
## References
|
|
342
351
|
|
|
343
352
|
1. Petit, G. and Luzum, B. (eds.), **IERS Conventions (2010)**, IERS Technical Note No. 36, BKG (2010)
|
|
344
|
-
- Available at: https://www.iers.org/IERS/EN/Publications/TechnicalNotes/tn36.php
|
|
353
|
+
- Available at: <https://www.iers.org/IERS/EN/Publications/TechnicalNotes/tn36.php>
|
|
345
354
|
|
|
346
355
|
2. Agnew, D. C., et al., **HARDISP**: Original algorithm and implementation
|
|
347
356
|
|
|
348
357
|
3. Scherneck, H.-G., and M. S. Bos, **Ocean Loading Service**: BLQ format specification
|
|
349
|
-
- Available at: http://www.oso.chalmers.se/~loading
|
|
358
|
+
- Available at: <http://www.oso.chalmers.se/~loading/>
|
|
350
359
|
|
|
351
360
|
4. Cartwright, D. E., and A. C. Edden, **Tides of the Planet Earth**, Geophys. J. R. Astron. Soc. 65, 615-630, 1981
|
|
352
361
|
|
|
@@ -357,10 +366,11 @@ This Python conversion maintains the same IERS Conventions Software License as t
|
|
|
357
366
|
## Contact
|
|
358
367
|
|
|
359
368
|
For questions or issues with the Fortran original:
|
|
360
|
-
|
|
361
|
-
-
|
|
369
|
+
|
|
370
|
+
- IERS Conventions Center: <https://www.iers.org/>
|
|
371
|
+
- Email: <gpetit@bipm.org> or <brian.luzum@usno.navy.mil>
|
|
362
372
|
|
|
363
373
|
---
|
|
364
374
|
|
|
365
|
-
*Python conversion completed:
|
|
375
|
+
*Python conversion completed: 2026*
|
|
366
376
|
*Original Fortran: IERS Conventions 2010*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyhardisp
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Ocean loading tidal displacement calculator - Python conversion of IERS HARDISP Fortran program
|
|
5
5
|
Author: IERS Conventions, Python Conversion - Craig Miller
|
|
6
6
|
License-Expression: LicenseRef-IERS
|
|
@@ -37,6 +37,7 @@ This document describes the Python conversion of the **HARDISP** (Harmonic Displ
|
|
|
37
37
|
## What is HARDISP?
|
|
38
38
|
|
|
39
39
|
HARDISP is a scientific program developed by the International Earth Rotation and Reference Systems Service (IERS) for calculating tidal ocean loading effects at geodetic stations. Depending on the coefficients provided by the ocean loading provider, it computes either:
|
|
40
|
+
|
|
40
41
|
- **Tidal displacements** (vertical, horizontal components) - when displacement coefficients are provided
|
|
41
42
|
- **Tidal gravity effects** (gravity disturbances) - when gravity-type coefficients are provided
|
|
42
43
|
|
|
@@ -55,6 +56,7 @@ The program is part of the **IERS Conventions 2010** recommendations (Class 1 mo
|
|
|
55
56
|
Given ocean loading coefficients in BLQ format (from the Bos-Scherneck loading service or equivalent providers), HARDISP computes a time series of tidal ocean loading effects in three components:
|
|
56
57
|
|
|
57
58
|
**Output type depends on the ocean loading provider's coefficients:**
|
|
59
|
+
|
|
58
60
|
- **Displacement coefficients**: Returns displacements
|
|
59
61
|
- **dU**: Vertical (radial) displacement (meters)
|
|
60
62
|
- **dS**: South (North-South) displacement (meters)
|
|
@@ -74,8 +76,8 @@ HARDISP processes the coefficients as-is, with no automatic conversions between
|
|
|
74
76
|
The Python conversion consists of:
|
|
75
77
|
**core.py** - Main Python module with optimized implementation
|
|
76
78
|
|
|
77
|
-
|
|
78
79
|
Original Fortran files (for reference):
|
|
80
|
+
|
|
79
81
|
- `HARDISP.F` - Main program
|
|
80
82
|
- `ADMINT.F` - Admittance interpolation
|
|
81
83
|
- `RECURS.F` - Recursive harmonic evaluation
|
|
@@ -221,6 +223,7 @@ for day_val in range(1, 8): # Process days 1-7
|
|
|
221
223
|
### Coordinate System
|
|
222
224
|
|
|
223
225
|
The output displacements are in a **local geodetic frame** at the station:
|
|
226
|
+
|
|
224
227
|
- **dU**: Radial (positive upward)
|
|
225
228
|
- **dS**: South component (positive southward, i.e., negative latitude direction)
|
|
226
229
|
- **dW**: West component (positive westward, i.e., negative longitude direction)
|
|
@@ -228,6 +231,7 @@ The output displacements are in a **local geodetic frame** at the station:
|
|
|
228
231
|
### Tidal Constituents Used
|
|
229
232
|
|
|
230
233
|
The 11 input harmonics (from BLQ format) represent:
|
|
234
|
+
|
|
231
235
|
1. M₂ - Principal lunar semi-diurnal (12.42 hours)
|
|
232
236
|
2. S₂ - Principal solar semi-diurnal (12.00 hours)
|
|
233
237
|
3. N₂ - Lunar elliptic semi-diurnal (12.66 hours)
|
|
@@ -282,7 +286,6 @@ The Python code was converted from these 13 Fortran files:
|
|
|
282
286
|
12. `ETUTC.F` (284 lines) - ET-UTC calculation
|
|
283
287
|
13. `TOYS.F` - (not in workspace but referenced)
|
|
284
288
|
|
|
285
|
-
|
|
286
289
|
## Function Name Mapping (Original Fortran → New Python)
|
|
287
290
|
|
|
288
291
|
| Original Fortran | New Python Name | Purpose |
|
|
@@ -306,6 +309,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
306
309
|
## Features Implemented
|
|
307
310
|
|
|
308
311
|
### Complete Conversion
|
|
312
|
+
|
|
309
313
|
- [x] All 342 tidal constituents support
|
|
310
314
|
- [x] Recursive harmonic evaluation (efficient)
|
|
311
315
|
- [x] Cubic spline interpolation
|
|
@@ -317,6 +321,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
317
321
|
- [x] Delaunay argument calculations
|
|
318
322
|
|
|
319
323
|
### Additional Features
|
|
324
|
+
|
|
320
325
|
- [x] Object-oriented design with HardispComputer class
|
|
321
326
|
- [x] NumPy integration for high performance
|
|
322
327
|
- [x] Comprehensive error handling
|
|
@@ -327,6 +332,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
327
332
|
## Core Components Converted
|
|
328
333
|
|
|
329
334
|
### 1. Date/Time Functions (7 functions)
|
|
335
|
+
|
|
330
336
|
```
|
|
331
337
|
✓ is_leap_year(year) - Check leap year
|
|
332
338
|
✓ days_before_month(year, month) - Days before month start
|
|
@@ -336,6 +342,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
336
342
|
```
|
|
337
343
|
|
|
338
344
|
### 2. Spline Interpolation (3 functions)
|
|
345
|
+
|
|
339
346
|
```
|
|
340
347
|
✓ cublic_spline(x, u) - Compute cubic spline coefficients
|
|
341
348
|
✓ spline_eval(y, x, u, s) - Evaluate spline at point
|
|
@@ -343,6 +350,7 @@ The Python code was converted from these 13 Fortran files:
|
|
|
343
350
|
```
|
|
344
351
|
|
|
345
352
|
### 3. Tidal Frequency Calculations (3 functions)
|
|
353
|
+
|
|
346
354
|
```
|
|
347
355
|
✓ calculate_tidal_arguments(year, day, h, m, s) - Initialize tidal calculations
|
|
348
356
|
✓ tidal_frequency_and_phase(doodson_number) - Get frequency and phase from Doodson number
|
|
@@ -350,33 +358,34 @@ The Python code was converted from these 13 Fortran files:
|
|
|
350
358
|
```
|
|
351
359
|
|
|
352
360
|
### 4. Harmonic Recursion (1 function)
|
|
361
|
+
|
|
353
362
|
```
|
|
354
363
|
✓ recursion(n, hc, nf, om) - Efficient recursive harmonic evaluation
|
|
355
364
|
```
|
|
356
365
|
|
|
357
366
|
### 5. Utility Functions (2 functions)
|
|
367
|
+
|
|
358
368
|
```
|
|
359
369
|
✓ pyshells(x) - Sort array with indices (Shell sort)
|
|
360
370
|
✓ fortran_int_divide(a, b) - Fortran-style integer division
|
|
361
371
|
```
|
|
362
372
|
|
|
363
373
|
### 6. Main Class: HardispComputer
|
|
374
|
+
|
|
364
375
|
```
|
|
365
376
|
✓ read_blq_format(amp, phase) - Load ocean loading coefficients
|
|
366
377
|
✓ compute_ocean_loading(...) - Main computation engine
|
|
367
378
|
```
|
|
368
379
|
|
|
369
|
-
|
|
370
|
-
|
|
371
380
|
## References
|
|
372
381
|
|
|
373
382
|
1. Petit, G. and Luzum, B. (eds.), **IERS Conventions (2010)**, IERS Technical Note No. 36, BKG (2010)
|
|
374
|
-
- Available at: https://www.iers.org/IERS/EN/Publications/TechnicalNotes/tn36.php
|
|
383
|
+
- Available at: <https://www.iers.org/IERS/EN/Publications/TechnicalNotes/tn36.php>
|
|
375
384
|
|
|
376
385
|
2. Agnew, D. C., et al., **HARDISP**: Original algorithm and implementation
|
|
377
386
|
|
|
378
387
|
3. Scherneck, H.-G., and M. S. Bos, **Ocean Loading Service**: BLQ format specification
|
|
379
|
-
- Available at: http://www.oso.chalmers.se/~loading
|
|
388
|
+
- Available at: <http://www.oso.chalmers.se/~loading/>
|
|
380
389
|
|
|
381
390
|
4. Cartwright, D. E., and A. C. Edden, **Tides of the Planet Earth**, Geophys. J. R. Astron. Soc. 65, 615-630, 1981
|
|
382
391
|
|
|
@@ -387,10 +396,11 @@ This Python conversion maintains the same IERS Conventions Software License as t
|
|
|
387
396
|
## Contact
|
|
388
397
|
|
|
389
398
|
For questions or issues with the Fortran original:
|
|
390
|
-
|
|
391
|
-
-
|
|
399
|
+
|
|
400
|
+
- IERS Conventions Center: <https://www.iers.org/>
|
|
401
|
+
- Email: <gpetit@bipm.org> or <brian.luzum@usno.navy.mil>
|
|
392
402
|
|
|
393
403
|
---
|
|
394
404
|
|
|
395
|
-
*Python conversion completed:
|
|
405
|
+
*Python conversion completed: 2026*
|
|
396
406
|
*Original Fortran: IERS Conventions 2010*
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pyhardisp"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "Ocean loading tidal displacement calculator - Python conversion of IERS HARDISP Fortran program"
|
|
9
9
|
readme = "README_PYTHON_CONVERSION.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|