Skip to content

Commit 19bb3c3

Browse files
authored
refactor: SLR, plm and time series functions (#98)
* test: single implicit import of gravity toolkit * chore: increase version number
1 parent 095a7ad commit 19bb3c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3627
-1865
lines changed

doc/source/_static/style.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@
1414
visibility: visible;
1515
margin-right: -0.7em;
1616
}
17+
/* fix for property line spacing
18+
* https://github.com/rtfd/sphinx_rtd_theme/issues/1301
19+
*/
20+
.property {
21+
display: block !important;
22+
padding-right: 8px;
23+
max-width: 100%;
24+
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
============
2-
read_SLR_C20
3-
============
1+
=======
2+
SLR.C20
3+
=======
44

55
- Reads monthly oblateness (degree 2 zonal) spherical harmonic data files from satellite laser ranging (SLR)
66

@@ -15,11 +15,11 @@ Calling Sequence
1515

1616
.. code-block:: python
1717
18-
from gravity_toolkit.read_SLR_C20 import read_SLR_C20
19-
SLR_C20 = read_SLR_C20(SLR_file)
18+
import gravity_toolkit.SLR
19+
SLR_C20 = gravity_toolkit.SLR.C20(SLR_file)
2020
2121
`Source code`__
2222

23-
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/read_SLR_C20.py
23+
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/SLR/C20.py
2424

25-
.. autofunction:: gravity_toolkit.read_SLR_C20
25+
.. autofunction:: gravity_toolkit.SLR.C20
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
============
2-
read_SLR_C30
3-
============
1+
=======
2+
SLR.C30
3+
=======
44

55
- Reads monthly degree 3 zonal spherical harmonic data files from satellite laser ranging (SLR)
66

@@ -14,12 +14,11 @@ Calling Sequence
1414

1515
.. code-block:: python
1616
17-
from gravity_toolkit.read_SLR_C30 import read_SLR_C30
18-
SLR_C30 = read_SLR_C30(SLR_file)
17+
import gravity_toolkit.SLR
18+
SLR_C30 = gravity_toolkit.SLR.C30(SLR_file)
1919
2020
`Source code`__
2121

22-
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/read_SLR_C30.py
22+
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/SLR/C30.py
2323

24-
25-
.. autofunction:: gravity_toolkit.read_SLR_C30
24+
.. autofunction:: gravity_toolkit.SLR.C30
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
============
2-
read_SLR_C40
3-
============
1+
=======
2+
SLR.C40
3+
=======
44

55
- Reads monthly degree 4 zonal spherical harmonic data files from satellite laser ranging (SLR)
66

@@ -13,11 +13,11 @@ Calling Sequence
1313

1414
.. code-block:: python
1515
16-
from gravity_toolkit.read_SLR_C40 import read_SLR_C40
17-
SLR_C40 = read_SLR_C40(SLR_file)
16+
import gravity_toolkit.SLR
17+
SLR_C40 = gravity_toolkit.SLR.C40(SLR_file)
1818
1919
`Source code`__
2020

21-
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/read_SLR_C40.py
21+
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/SLR/C40.py
2222

23-
.. autofunction:: gravity_toolkit.read_SLR_C40
23+
.. autofunction:: gravity_toolkit.SLR.C40
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
============
2-
read_SLR_C50
3-
============
1+
=======
2+
SLR.C50
3+
=======
44

55
- Reads monthly degree 5 zonal spherical harmonic data files from satellite laser ranging (SLR)
66

@@ -13,11 +13,11 @@ Calling Sequence
1313

1414
.. code-block:: python
1515
16-
from gravity_toolkit.read_SLR_C50 import read_SLR_C50
17-
SLR_C50 = read_SLR_C50(SLR_file)
16+
import gravity_toolkit.SLR
17+
SLR_C50 = gravity_toolkit.SLR.C50(SLR_file)
1818
1919
`Source code`__
2020

21-
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/read_SLR_C50.py
21+
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/SLR/C50.py
2222

23-
.. autofunction:: gravity_toolkit.read_SLR_C50
23+
.. autofunction:: gravity_toolkit.SLR.C50
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
============
2-
read_SLR_CS2
3-
============
1+
=======
2+
SLR.CS2
3+
=======
44

55
- Reads monthly degree 2,m (figure axis and azimuthal dependence) spherical harmonic data files from satellite laser ranging (SLR)
66

@@ -14,11 +14,11 @@ Calling Sequence
1414

1515
.. code-block:: python
1616
17-
from gravity_toolkit.read_SLR_CS2 import read_SLR_CS2
18-
SLR_CS2 = read_SLR_CS2(SLR_file)
17+
import gravity_toolkit.SLR
18+
SLR_CS2 = gravity_toolkit.SLR.CS2(SLR_file)
1919
2020
`Source code`__
2121

22-
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/read_SLR_CS2.py
22+
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/SLR/CS2.py
2323

24-
.. autofunction:: gravity_toolkit.read_SLR_CS2
24+
.. autofunction:: gravity_toolkit.SLR.CS2
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
===================
2+
associated_legendre
3+
===================
4+
5+
- Computes fully-normalized associated Legendre Polynomials and their first derivative for a vector of ``x`` values
6+
7+
Calling Sequence
8+
################
9+
10+
.. code-block:: python
11+
12+
import gravity_toolkit.associated_legendre
13+
PLM, dPLM = gravtk.associated_legendre.polynomials(LMAX, x, method='holmes')
14+
15+
`Source code`__
16+
17+
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/associated_legendre.py
18+
19+
.. autofunction:: gravity_toolkit.associated_legendre
20+
21+
.. autofunction:: gravity_toolkit.plm_colombo
22+
23+
.. autofunction:: gravity_toolkit.plm_holmes
24+
25+
.. autofunction:: gravity_toolkit.plm_mohlenkamp

doc/source/api_reference/gen_disc_load.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Calling Sequence
1010
.. code-block:: python
1111
1212
from gravity_toolkit.gen_disc_load import gen_disc_load
13-
from gravity_toolkit.plm_holmes import plm_holmes
13+
from gravity_toolkit.associated_legendre import plm_holmes
1414
PLM, dPLM = plm_holmes(LMAX, np.cos(th))
1515
Ylms = gen_disc_load(data, lon, lat, area, LMAX=LMAX, PLM=PLM, LOVE=(hl,kl,ll))
1616

doc/source/api_reference/gen_harmonics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Calling Sequence
1111
.. code-block:: python
1212
1313
from gravity_toolkit.gen_harmonics import gen_harmonics
14-
from gravity_toolkit.plm_holmes import plm_holmes
14+
from gravity_toolkit.associated_legendre import plm_holmes
1515
PLM, dPLM = plm_holmes(LMAX, np.cos(th))
1616
Ylms = gen_harmonics(data, lon, lat, LMAX=LMAX, PLM=PLM)
1717

doc/source/api_reference/gen_spherical_cap.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Calling Sequence
1010
.. code-block:: python
1111
1212
from gravity_toolkit.gen_spherical_cap import gen_spherical_cap
13-
from gravity_toolkit.plm_holmes import plm_holmes
13+
from gravity_toolkit.associated_legendre import plm_holmes
1414
PLM, dPLM = plm_holmes(LMAX, np.cos(th))
1515
Ylms = gen_spherical_cap(data, lon, lat, UNITS=1, LMAX=LMAX, PLM=PLM, LOVE=(hl,kl,ll))
1616

doc/source/api_reference/gen_stokes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Calling Sequence
1010
.. code-block:: python
1111
1212
from gravity_toolkit.gen_stokes import gen_stokes
13-
from gravity_toolkit.plm_holmes import plm_holmes
13+
from gravity_toolkit.associated_legendre import plm_holmes
1414
PLM, dPLM = plm_holmes(LMAX, np.cos(th))
1515
Ylms = gen_stokes(data, lon, lat, UNITS=1, LMAX=LMAX, PLM=PLM, LOVE=(hl,kl,ll))
1616

doc/source/api_reference/harmonic_summation.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ Calling Sequence
1717
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/harmonic_summation.py
1818

1919
.. autofunction:: gravity_toolkit.harmonic_summation
20+
21+
.. autofunction:: gravity_toolkit.harmonic_transform

doc/source/api_reference/piecewise_regress.rst

Lines changed: 0 additions & 19 deletions
This file was deleted.

doc/source/api_reference/plm_colombo.rst

Lines changed: 0 additions & 19 deletions
This file was deleted.

doc/source/api_reference/plm_holmes.rst

Lines changed: 0 additions & 20 deletions
This file was deleted.

doc/source/api_reference/plm_mohlenkamp.rst

Lines changed: 0 additions & 19 deletions
This file was deleted.

doc/source/api_reference/sea_level_equation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Calling Sequence
99

1010
.. code-block:: python
1111
12-
from gravity_toolkit.plm_holmes import plm_holmes
12+
from gravity_toolkit.associated_legendre import plm_holmes
1313
from gravity_toolkit.sea_level_equation import sea_level_equation
1414
PLM, dPLM = plm_holmes(LMAX, np.cos(th))
1515
Ylms = sea_level_equation(loadClm, loadSlm, lon, lat, land_function,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=====================
2+
time_series.amplitude
3+
=====================
4+
5+
- Calculate the amplitude and phase of a harmonic function from calculated sine and cosine of a series of measurements
6+
7+
Calling Sequence
8+
################
9+
10+
.. code-block:: python
11+
12+
import gravity_toolkit.time_series
13+
ampl,ph = gravity_toolkit.time_series.amplitude(bsin,bcos)
14+
15+
`Source code`__
16+
17+
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/time_series/amplitude.py
18+
19+
.. autofunction:: gravity_toolkit.time_series.amplitude
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=====================
2+
time_series.piecewise
3+
=====================
4+
5+
- Fits a synthetic signal to data over a time period by ordinary or weighted least-squares for breakpoint analysis
6+
7+
Calling Sequence
8+
################
9+
10+
.. code-block:: python
11+
12+
import gravity_toolkit.time_series
13+
tsbeta = gravity_toolkit.time_series.piecewise(t_in, d_in, BREAKPOINT=len(t_in)//2, CYCLES=[0.5,1.0])
14+
15+
`Source code`__
16+
17+
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/time_series/piecewise.py
18+
19+
.. autofunction:: gravity_toolkit.time_series.piecewise
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
===================
2+
time_series.regress
3+
===================
4+
5+
- Fits a synthetic signal to data over a time period by ordinary or weighted least-squares
6+
7+
Calling Sequence
8+
################
9+
10+
.. code-block:: python
11+
12+
import gravity_toolkit.time_series
13+
tsbeta = gravity_toolkit.time_series.regress(t_in, d_in, ORDER=1, CYCLES=[0.5,1.0], CONF=0.95)
14+
15+
`Source code`__
16+
17+
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/time_series/regress.py
18+
19+
.. autofunction:: gravity_toolkit.time_series.regress
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
==============
2-
savitzky_golay
3-
==============
1+
==========================
2+
time_series.savitzky_golay
3+
==========================
44

55
- Smooth and optionally differentiate data of non-uniform sampling with a Savitzky-Golay filter
66
- A type of low-pass filter, particularly suited for smoothing noisy data
@@ -11,11 +11,11 @@ Calling Sequence
1111

1212
.. code-block:: python
1313
14-
from gravity_toolkit.savitzky_golay import savitzky_golay
15-
sg = savitzky_golay(t_in, d_in, WINDOW=13, ORDER=2)
14+
import gravity_toolkit.time_series
15+
sg = gravity_toolkit.time_series.savitzky_golay(t_in, d_in, WINDOW=13, ORDER=2)
1616
1717
`Source code`__
1818

19-
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/savitzky_golay.py
19+
.. __: https://github.com/tsutterley/read-GRACE-harmonics/blob/main/gravity_toolkit/time_series/savitzky_golay.py
2020

21-
.. autofunction:: gravity_toolkit.savitzky_golay
21+
.. autofunction:: gravity_toolkit.time_series.savitzky_golay

0 commit comments

Comments
 (0)