From 76d19ca01deb99c8cc4174e925c4401bfaf099b0 Mon Sep 17 00:00:00 2001 From: mauroalberti Date: Sat, 2 May 2020 11:33:15 +0200 Subject: [PATCH] Fixed apsg-related and line-normal plane bugs --- StereoplotWidget.py | 4 ++-- about_dialog.py | 2 +- metadata.txt | 3 ++- pygsf/orientations/orientations.py | 7 +++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/StereoplotWidget.py b/StereoplotWidget.py index 815af71..4fdb2b0 100644 --- a/StereoplotWidget.py +++ b/StereoplotWidget.py @@ -31,7 +31,7 @@ from .apsg import StereoNet, Lin as aLin, Fol as aFol, Fault as aFault from .auxiliary_windows import * -from .pygsf.orientations.orientations import Plane as GPlane, Axis as GAxis +from .pygsf.orientations.orientations import Plane as GPlane, Axis as GAxis, Azim, Plunge from .qgis_utils.qgs import pt_geoms_attrs from .mpl_utils.save_figure import FigureExportDlg from .fault_utils.utils import rake_to_apsg_movsense, movsense_to_apsg_movsense @@ -610,7 +610,7 @@ def get_fault_slikenline_data(struct_vals): color=marker_color, alpha=marker_transp) elif plot_setts["tPlotAxesFormat"] == "perpendicular planes": - plane = GAxis(*line_rec).normal_gplane.dda + plane = GAxis(Azim(line_rec[0]), Plunge(line_rec[1])).asDirect().normPlane().dda p = aFol(*plane) self.stereonet.plane(p, linestyle=line_style, diff --git a/about_dialog.py b/about_dialog.py index 3922705..baa8551 100644 --- a/about_dialog.py +++ b/about_dialog.py @@ -17,7 +17,7 @@ def setup_gui(self): dialog_layout = QVBoxLayout() htmlText = """ -

geocouche - release 2.0.1

+

geocouche - release 2.0.2

Created by M. Alberti (alberti.m65@gmail.com).

https://github.com/mauroalberti/geocouche

Stereonet plotting and processing of geological structures. diff --git a/metadata.txt b/metadata.txt index 15f7ed9..c1a56d9 100644 --- a/metadata.txt +++ b/metadata.txt @@ -3,7 +3,7 @@ name=geocouche description=Processes geological meso-structures about=geocouche is a GGIS plugin for processing the orientations of geological structures, based on the module apsg by Ondrej Lexa. Currently, it can: a) calculate the angles between planes stored in a layer and a reference plane, and b) create stereonets from plane/pole data stored in a point layer or directly as texts. category=Geology -version=2.0.1 +version=2.0.2 experimental=False qgisMinimumVersion=3.0 author=Martin Laloux, Mauro Alberti @@ -14,6 +14,7 @@ icon=./icons/stereoplot.png ; start of optional metadata changelog= + 2.0.2 : - apsg-related and line-normal plane plot bugfixes 2.0.1 : - help and about sections modified 2.0.0 : - porting to QGIS 3 and integration of pygsf and other minor modules 1.1.0 : - integration of module "gsf" (vers. 0.1.0) and related restructuration of "geosurf" in independent modules diff --git a/pygsf/orientations/orientations.py b/pygsf/orientations/orientations.py index 015706e..9da60ea 100644 --- a/pygsf/orientations/orientations.py +++ b/pygsf/orientations/orientations.py @@ -12,7 +12,10 @@ class Azim(object): Azim class """ - def __init__(self, val: [int, float], unit: str='d'): + def __init__(self, + val: [int, float], + unit: str = 'd' + ): """ Creates an azimuth instance. @@ -38,7 +41,7 @@ def __init__(self, val: [int, float], unit: str='d'): # unit check if unit not in ("d", "r"): - raise OrienInputException("Unit input must be 'd' or 'r'") + raise OrienInputException(f"Unit input must be 'd' or 'r', got {type(unit)} with value {unit}") if not (isinstance(val, (int, float))): raise OrienInputException("Input azimuth value must be int/float")