34
34
class PlotMTResponse (PlotBase ):
35
35
"""Plots Resistivity and phase for the different modes of the MT response.
36
36
37
- At
38
- the moment it supports the input of an .edi file. Other formats that will
39
- be supported are the impedance tensor and errors with an array of periods
40
- and .j format.
41
-
42
- The normal use is to input an .edi file, however it would seem that not
43
- everyone uses this format, so you can input the data and put it into
44
- arrays or objects like class mtpy.core.z.Z. Or if the data is in
45
- resistivity and phase format they can be input as arrays or a class
46
- mtpy.imaging.mtplot.ResPhase. Or you can put it into a class
47
- mtpy.imaging.mtplot.MTplot.
48
-
49
- The plot places the apparent resistivity in log scale in the top panel(s),
50
- depending on the plot_num. The phase is below this, note that 180 degrees
51
- has been added to the yx phase so the xy and yx phases plot in the same
52
- quadrant. Both the resistivity and phase share the same x-axis which is in
53
- log period, short periods on the left to long periods on the right. So
54
- if you zoom in on the plot both plots will zoom in to the same
55
- x-coordinates. If there is tipper information, you can plot the tipper
56
- as a third panel at the bottom, and also shares the x-axis. The arrows are
57
- in the convention of pointing towards a conductor. The xx and yy
58
- components can be plotted as well, this adds two panels on the right.
59
- Here the phase is left unwrapped. Other parameters can be added as
60
- subplots such as strike, skew and phase tensor ellipses.
61
-
62
- To manipulate the plot you can change any of the attributes listed below
63
- and call redraw_plot(). If you know more aout matplotlib and want to
64
- change axes parameters, that can be done by changing the parameters in the
65
- axes attributes and then call update_plot(), note the plot must be open.
37
+ At
38
+ the moment it supports the input of an .edi file. Other formats that will
39
+ be supported are the impedance tensor and errors with an array of periods
40
+ and .j format.
41
+
42
+ The normal use is to input an .edi file, however it would seem that not
43
+ everyone uses this format, so you can input the data and put it into
44
+ arrays or objects like class mtpy.core.z.Z. Or if the data is in
45
+ resistivity and phase format they can be input as arrays or a class
46
+ mtpy.imaging.mtplot.ResPhase. Or you can put it into a class
47
+ mtpy.imaging.mtplot.MTplot.
48
+
49
+ The plot places the apparent resistivity in log scale in the top panel(s),
50
+ depending on the plot_num. The phase is below this, note that 180 degrees
51
+ has been added to the yx phase so the xy and yx phases plot in the same
52
+ quadrant. Both the resistivity and phase share the same x-axis which is in
53
+ log period, short periods on the left to long periods on the right. So
54
+ if you zoom in on the plot both plots will zoom in to the same
55
+ x-coordinates. If there is tipper information, you can plot the tipper
56
+ as a third panel at the bottom, and also shares the x-axis. The arrows are
57
+ in the convention of pointing towards a conductor. The xx and yy
58
+ components can be plotted as well, this adds two panels on the right.
59
+ Here the phase is left unwrapped. Other parameters can be added as
60
+ subplots such as strike, skew and phase tensor ellipses.
61
+
62
+ To manipulate the plot you can change any of the attributes listed below
63
+ and call redraw_plot(). If you know more aout matplotlib and want to
64
+ change axes parameters, that can be done by changing the parameters in the
65
+ axes attributes and then call update_plot(), note the plot must be open.
66
66
"""
67
67
68
68
def __init__ (
@@ -152,9 +152,9 @@ def rotation_angle(self):
152
152
def rotation_angle (self , theta_r ):
153
153
"""Only a single value is allowed."""
154
154
if not theta_r == 0 :
155
- self .Z .rotate (theta_r )
156
- self .Tipper .rotate (theta_r )
157
- self .pt .rotate (theta_r )
155
+ self .Z .rotate (theta_r , inplace = True )
156
+ self .Tipper .rotate (theta_r , inplace = True )
157
+ self .pt .rotate (theta_r , inplace = True )
158
158
159
159
self ._rotation_angle += theta_r
160
160
else :
@@ -163,7 +163,11 @@ def rotation_angle(self, theta_r):
163
163
def _has_z (self ):
164
164
"""Has z."""
165
165
if self .plot_z :
166
- if self .Z is None or self .Z .z is None or (self .Z .z == 0 + 0j ).all ():
166
+ if (
167
+ self .Z is None
168
+ or self .Z .z is None
169
+ or (self .Z .z == 0 + 0j ).all ()
170
+ ):
167
171
self .logger .info (f"No Z data for station { self .station } " )
168
172
return False
169
173
return self .plot_z
@@ -598,7 +602,9 @@ def plot(self):
598
602
599
603
# ===Plot the xx, yy components if desired==========================
600
604
if self .plot_num == 2 :
601
- self ._plot_resistivity (self .axr2 , self .period , self .Z , mode = "d" )
605
+ self ._plot_resistivity (
606
+ self .axr2 , self .period , self .Z , mode = "d"
607
+ )
602
608
self ._plot_phase (self .axp2 , self .period , self .Z , mode = "d" )
603
609
604
610
# ===Plot the Determinant if desired================================
0 commit comments