apsg 1.3.5__py3-none-any.whl → 1.3.6__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.
- apsg/__init__.py +1 -1
- apsg/config.py +0 -1
- apsg/database/_sdbread.py +1 -1
- apsg/feature/_container.py +9 -1
- apsg/plotting/_roseplot.py +36 -35
- {apsg-1.3.5.dist-info → apsg-1.3.6.dist-info}/METADATA +2 -8
- {apsg-1.3.5.dist-info → apsg-1.3.6.dist-info}/RECORD +11 -11
- {apsg-1.3.5.dist-info → apsg-1.3.6.dist-info}/WHEEL +0 -0
- {apsg-1.3.5.dist-info → apsg-1.3.6.dist-info}/entry_points.txt +0 -0
- {apsg-1.3.5.dist-info → apsg-1.3.6.dist-info}/licenses/LICENSE +0 -0
- {apsg-1.3.5.dist-info → apsg-1.3.6.dist-info}/top_level.txt +0 -0
apsg/__init__.py
CHANGED
apsg/config.py
CHANGED
apsg/database/_sdbread.py
CHANGED
apsg/feature/_container.py
CHANGED
|
@@ -142,6 +142,14 @@ class Vector2Set(FeatureSet):
|
|
|
142
142
|
"""Return array of direction angles"""
|
|
143
143
|
return np.asarray([e.direction for e in self]).T
|
|
144
144
|
|
|
145
|
+
def to_vec2(self):
|
|
146
|
+
"""Return ``Vector2Set`` object with all data converted to ``Vector2``."""
|
|
147
|
+
return Vector2Set([Vector2(e) for e in self], name=self.name)
|
|
148
|
+
|
|
149
|
+
def to_dir2(self):
|
|
150
|
+
"""Return ``Direction2Set`` object with all data converted to ``Direction``."""
|
|
151
|
+
return Direction2Set([Direction(e) for e in self], name=self.name)
|
|
152
|
+
|
|
145
153
|
def proj(self, vec):
|
|
146
154
|
"""Return projections of all features in ``Vector2Set`` onto vector."""
|
|
147
155
|
return type(self)([e.project() for e in self], name=self.name)
|
|
@@ -1752,7 +1760,7 @@ class ClusterSet(object):
|
|
|
1752
1760
|
"""
|
|
1753
1761
|
|
|
1754
1762
|
self.method = kwargs.get("method", self.method)
|
|
1755
|
-
if issubclass(self.__feature_class__, (Axial2, Axial3)):
|
|
1763
|
+
if issubclass(self.data.__feature_class__, (Axial2, Axial3)):
|
|
1756
1764
|
self.Z = linkage(self.pdist, method=self.method, metric=angle_metric_axial)
|
|
1757
1765
|
else:
|
|
1758
1766
|
self.Z = linkage(self.pdist, method=self.method, metric=angle_metric)
|
apsg/plotting/_roseplot.py
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import pickle
|
|
2
2
|
|
|
3
|
-
import numpy as np
|
|
4
3
|
import matplotlib.pyplot as plt
|
|
5
|
-
|
|
4
|
+
import numpy as np
|
|
5
|
+
from scipy.stats import circmean, vonmises
|
|
6
6
|
|
|
7
7
|
from apsg.config import apsg_conf
|
|
8
|
-
from apsg.plotting._plot_artists import RosePlotArtistFactory
|
|
9
8
|
from apsg.feature import feature_from_json
|
|
9
|
+
from apsg.math._vector import Axial2, Axial3
|
|
10
|
+
from apsg.plotting._plot_artists import RosePlotArtistFactory
|
|
10
11
|
|
|
11
12
|
__all__ = ["RosePlot"]
|
|
12
13
|
|
|
@@ -20,7 +21,6 @@ class RosePlot(object):
|
|
|
20
21
|
title_kws (dict): dictionary of keyword arguments passed to matplotlib suptitle
|
|
21
22
|
method.
|
|
22
23
|
bins (int): Number of bins. Default 36
|
|
23
|
-
axial (bool): Directional data are axial. Defaut True
|
|
24
24
|
density (bool): Use density instead of counts. Default False
|
|
25
25
|
pdf (bool): Plot Von Mises density function instead histogram. Default False
|
|
26
26
|
pdf_res (int): Resolution of pdf. Default 901
|
|
@@ -245,7 +245,7 @@ class RosePlot(object):
|
|
|
245
245
|
width = 2 * np.pi / self._kwargs["bins"]
|
|
246
246
|
legend = kwargs.pop("legend")
|
|
247
247
|
for arg in args:
|
|
248
|
-
if
|
|
248
|
+
if issubclass(arg.__feature_class__, (Axial2, Axial3)):
|
|
249
249
|
ang = np.concatenate((arg.direction % 360, (arg.direction + 180) % 360))
|
|
250
250
|
weights = np.concatenate((abs(arg), abs(arg)))
|
|
251
251
|
else:
|
|
@@ -279,7 +279,7 @@ class RosePlot(object):
|
|
|
279
279
|
ang = arg.direction % 360
|
|
280
280
|
# weights = abs(arg)
|
|
281
281
|
radii = np.zeros_like(theta)
|
|
282
|
-
if
|
|
282
|
+
if issubclass(arg.__feature_class__, (Axial2, Axial3)):
|
|
283
283
|
for a in ang:
|
|
284
284
|
radii += (
|
|
285
285
|
vonmises.pdf(theta, self._kwargs["kappa"], loc=np.radians(a))
|
|
@@ -308,32 +308,21 @@ class RosePlot(object):
|
|
|
308
308
|
bottom = bottom + radii
|
|
309
309
|
|
|
310
310
|
def _muci(self, *args, **kwargs):
|
|
311
|
-
ang = np.radians(np.concatenate([arg.direction for arg in args]))
|
|
312
311
|
conflevel = kwargs.pop("confidence_level")
|
|
313
312
|
n_resamples = kwargs.pop("n_resamples")
|
|
314
|
-
# calculate mean and CI
|
|
315
|
-
if self._kwargs["axial"]:
|
|
316
|
-
mu = circmean(2 * ang) / 2
|
|
317
|
-
ang_shift = ang + np.pi / 2 - mu
|
|
318
|
-
bsmu = [
|
|
319
|
-
circmean(np.random.choice(2 * ang_shift, size=len(ang_shift)))
|
|
320
|
-
for i in range(n_resamples)
|
|
321
|
-
]
|
|
322
|
-
low = np.percentile(bsmu, 100 - conflevel) / 2 + mu - np.pi / 2
|
|
323
|
-
high = np.percentile(bsmu, conflevel) / 2 + mu - np.pi / 2
|
|
324
|
-
else:
|
|
325
|
-
mu = circmean(ang)
|
|
326
|
-
ang_shift = ang + np.pi - mu
|
|
327
|
-
bsmu = [
|
|
328
|
-
circmean(np.random.choice(ang_shift, size=len(ang_shift)))
|
|
329
|
-
for i in range(n_resamples)
|
|
330
|
-
]
|
|
331
|
-
low = np.percentile(bsmu, (100 - conflevel) / 2) + mu - np.pi
|
|
332
|
-
high = np.percentile(bsmu, 100 - (100 - conflevel) / 2) + mu - np.pi
|
|
333
|
-
radii = []
|
|
334
313
|
for arg in args:
|
|
314
|
+
radii = []
|
|
335
315
|
p = 0
|
|
336
|
-
|
|
316
|
+
ang = np.radians(arg.direction)
|
|
317
|
+
if issubclass(arg.__feature_class__, (Axial2, Axial3)):
|
|
318
|
+
mu = circmean(2 * ang) / 2
|
|
319
|
+
ang_shift = ang + np.pi / 2 - mu
|
|
320
|
+
bsmu = [
|
|
321
|
+
circmean(np.random.choice(2 * ang_shift, size=len(ang_shift)))
|
|
322
|
+
for i in range(n_resamples)
|
|
323
|
+
]
|
|
324
|
+
low = np.percentile(bsmu, 100 - conflevel) / 2 + mu - np.pi / 2
|
|
325
|
+
high = np.percentile(bsmu, conflevel) / 2 + mu - np.pi / 2
|
|
337
326
|
for a in arg.direction:
|
|
338
327
|
p += vonmises.pdf(mu, self._kwargs["kappa"], loc=np.radians(a)) / 2
|
|
339
328
|
p += (
|
|
@@ -341,16 +330,28 @@ class RosePlot(object):
|
|
|
341
330
|
/ 2
|
|
342
331
|
)
|
|
343
332
|
else:
|
|
333
|
+
mu = circmean(ang)
|
|
334
|
+
ang_shift = ang + np.pi - mu
|
|
335
|
+
bsmu = [
|
|
336
|
+
circmean(np.random.choice(ang_shift, size=len(ang_shift)))
|
|
337
|
+
for i in range(n_resamples)
|
|
338
|
+
]
|
|
339
|
+
low = np.percentile(bsmu, (100 - conflevel) / 2) + mu - np.pi
|
|
340
|
+
high = np.percentile(bsmu, 100 - (100 - conflevel) / 2) + mu - np.pi
|
|
344
341
|
for a in arg.direction:
|
|
345
342
|
p += vonmises.pdf(mu, self._kwargs["kappa"], loc=np.radians(a))
|
|
346
343
|
radii.append(p / len(arg))
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
344
|
+
if self._kwargs["scaled"]:
|
|
345
|
+
radii = np.sqrt(radii)
|
|
346
|
+
mur = 1.1 * sum(radii)
|
|
347
|
+
ci_angles = np.linspace(low, high, int(5 * np.degrees(high - low)))
|
|
348
|
+
if issubclass(arg.__feature_class__, (Axial2, Axial3)):
|
|
349
|
+
self.ax.plot([mu, mu + np.pi], [mur, mur], **kwargs)
|
|
350
|
+
self.ax.plot(ci_angles, mur * np.ones_like(ci_angles), **kwargs)
|
|
351
|
+
self.ax.plot(ci_angles + np.pi, mur * np.ones_like(ci_angles), **kwargs)
|
|
352
|
+
else:
|
|
353
|
+
self.ax.plot([0, mu], [0, mur], **kwargs)
|
|
354
|
+
self.ax.plot(ci_angles, mur * np.ones_like(ci_angles), **kwargs)
|
|
354
355
|
|
|
355
356
|
|
|
356
357
|
def roseartist_from_json(obj_json):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apsg
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.6
|
|
4
4
|
Summary: APSG - The package for structural geologists
|
|
5
5
|
Author-email: Ondrej Lexa <lexa.ondrej@gmail.com>
|
|
6
6
|
Maintainer-email: Ondrej Lexa <lexa.ondrej@gmail.com>
|
|
@@ -59,14 +59,8 @@ Requires-Dist: ipykernel; extra == "docs"
|
|
|
59
59
|
Requires-Dist: nbsphinx; extra == "docs"
|
|
60
60
|
Requires-Dist: autodocsumm; extra == "docs"
|
|
61
61
|
Provides-Extra: dev
|
|
62
|
-
Requires-Dist:
|
|
62
|
+
Requires-Dist: apsg[docs,extra,tests]; extra == "dev"
|
|
63
63
|
Requires-Dist: black; extra == "dev"
|
|
64
|
-
Requires-Dist: sphinx; extra == "dev"
|
|
65
|
-
Requires-Dist: sphinx_rtd_theme; extra == "dev"
|
|
66
|
-
Requires-Dist: readthedocs-sphinx-search; extra == "dev"
|
|
67
|
-
Requires-Dist: ipykernel; extra == "dev"
|
|
68
|
-
Requires-Dist: nbsphinx; extra == "dev"
|
|
69
|
-
Requires-Dist: autodocsumm; extra == "dev"
|
|
70
64
|
Dynamic: license-file
|
|
71
65
|
|
|
72
66
|
<img src="https://ondrolexa.github.io/apsg/apsg_banner.svg" alt="APSG logo" width="300px"/>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
apsg/__init__.py,sha256=
|
|
2
|
-
apsg/config.py,sha256=
|
|
1
|
+
apsg/__init__.py,sha256=er5PTmzLPoYoorvyKGhTjeyE6lVsLZr0nB5ariut94o,2849
|
|
2
|
+
apsg/config.py,sha256=vwJZVqWQ2bXe4TNW3hzse-dIam3QBwNeFx5VJUhNjU8,4549
|
|
3
3
|
apsg/shell.py,sha256=1D0PeB7qXzlpiOf2QYGo6OJlEVN1KJPYld1GEREBiFg,707
|
|
4
4
|
apsg/database/__init__.py,sha256=7Rvcf1KBBBNhoM28ZlvQ01CkScQTroFkoS4d1kD55Ws,315
|
|
5
5
|
apsg/database/_alchemy.py,sha256=geV3Q6ZLdGvjzxry7GTHHIQq6t_ccsUxZvuv13CLYFQ,19467
|
|
6
|
-
apsg/database/_sdbread.py,sha256=
|
|
6
|
+
apsg/database/_sdbread.py,sha256=lKvImHCFaxXr0wx5FnogVRp6bAPeaP01MDpUn_rH3Ek,11009
|
|
7
7
|
apsg/decorator/__init__.py,sha256=fZ-dxpldQIk6-2JhVnCj-Tsl8bz2nvoGOyG7uXKvBfg,160
|
|
8
8
|
apsg/decorator/_decorator.py,sha256=8TMSrcVvhU5UCbNMrnyrW3-65qo20_6N2ShtXd3bP-k,1194
|
|
9
9
|
apsg/feature/__init__.py,sha256=XkyS-X8lUaXCVaXgoK0GETmTCCGqB1BmSwZRZG3blZQ,1733
|
|
10
|
-
apsg/feature/_container.py,sha256=
|
|
10
|
+
apsg/feature/_container.py,sha256=7RLkTnEwDDhm6c4jErQOTIPg5KBM46SLpcFlrtyZHvg,60812
|
|
11
11
|
apsg/feature/_geodata.py,sha256=tjgPSKXyEOXiAN3iPeHpm8kpj__jI4ahtTpDuWhQNBE,24008
|
|
12
12
|
apsg/feature/_paleomag.py,sha256=WIICUOEJGGFHbCDF0gbW7lMt10jI0el0UVhkbMH7XAs,14911
|
|
13
13
|
apsg/feature/_statistics.py,sha256=WwBU2D7SyIHMpWnO7WFqbIpSkz6KUCT9xkG8oVzgskQ,13916
|
|
@@ -27,12 +27,12 @@ apsg/plotting/_fabricplot.py,sha256=yjy3DEhIZfq448FYKnQb3EhqLm9-f-EZHJEamG98k9Q,
|
|
|
27
27
|
apsg/plotting/_paleomagplots.py,sha256=Gw-fqYJVjNxTNXLwAiUKnFUBoOTZv2MEd3XACLmQ6AM,2325
|
|
28
28
|
apsg/plotting/_plot_artists.py,sha256=6S0EKCqYU6rlBxcxcXALTk9PaUK6QL-BgUKmZH8tkMc,21059
|
|
29
29
|
apsg/plotting/_projection.py,sha256=ix67PwOU2WGjryEcsHlVIMpcVC9yxy45ycOV9k5x_Q8,11805
|
|
30
|
-
apsg/plotting/_roseplot.py,sha256=
|
|
30
|
+
apsg/plotting/_roseplot.py,sha256=Wq5NBCDZMUQWEioIC6hYAZzjDKZsiDIJtjk_vQzzCd8,13104
|
|
31
31
|
apsg/plotting/_stereogrid.py,sha256=awh7MwN1WgszhOlr6UgR20wHQJ8u778-Tf_w1uflrV4,11869
|
|
32
32
|
apsg/plotting/_stereonet.py,sha256=uHJXluFMkeaI4yzD9pGc4DIlgjZA01INySLKtUHLAlU,36624
|
|
33
|
-
apsg-1.3.
|
|
34
|
-
apsg-1.3.
|
|
35
|
-
apsg-1.3.
|
|
36
|
-
apsg-1.3.
|
|
37
|
-
apsg-1.3.
|
|
38
|
-
apsg-1.3.
|
|
33
|
+
apsg-1.3.6.dist-info/licenses/LICENSE,sha256=lY0kfpVRrzcgVZq7pI6rLK5WYiUMWe0bdKpDelN6hk8,1120
|
|
34
|
+
apsg-1.3.6.dist-info/METADATA,sha256=tD60lfw5Bi1DY0NlsQG6FEnKxv87Bukfz5a-_-jVdks,8047
|
|
35
|
+
apsg-1.3.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
36
|
+
apsg-1.3.6.dist-info/entry_points.txt,sha256=SowP7_uRI0NJuzznKBXyM9BJcSwBxbXo6Iz5LUo9mEQ,42
|
|
37
|
+
apsg-1.3.6.dist-info/top_level.txt,sha256=xWxwi0nqqOyKdmpsszfR-bmqnNpgVbhnLRuIKGJnaUM,5
|
|
38
|
+
apsg-1.3.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|