Closed kujaku11 closed 3 months ago
@kkappler This PR will address your tipper only data. I fixed plot_mt_response
(I think), when you have time check it out. Think about other ways you might want to plot tipper if you don't like the induction vectors.
Attention: Patch coverage is 65.54622%
with 41 lines
in your changes missing coverage. Please review.
Project coverage is 27.73%. Comparing base (
bc74ec8
) to head (cc73324
).
Files | Patch % | Lines |
---|---|---|
mtpy/imaging/plot_mt_response.py | 73.26% | 27 Missing :warning: |
mtpy/utils/filehandling.py | 22.22% | 7 Missing :warning: |
mtpy/modeling/mesh_tools.py | 16.66% | 5 Missing :warning: |
mtpy/modeling/modem/data.py | 0.00% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
plot_mt_response now creates a plot (before it did not at all) so there is progress, but the plotting does not complete. From the Traceback, it looks like self._plot_pt() is called and that is where error occurs.
TypeError: 'NoneType' object is not subscriptable
Here is the full traceback
File [~/anaconda3/envs/mt_env/lib/python3.10/site-packages/mtpy/imaging/plot_mt_response.py:114](http://localhost:8888/lab/tree/software/dias/scratch/anaconda3/envs/mt_env/lib/python3.10/site-packages/mtpy/imaging/plot_mt_response.py#line=113), in PlotMTResponse.__init__(self, z_object, t_object, pt_obj, station, **kwargs)
112 # plot on initializing
113 if self.show_plot:
--> 114 self.plot()
File [~/anaconda3/envs/mt_env/lib/python3.10/site-packages/mtpy/imaging/plot_mt_response.py:502](http://localhost:8888/lab/tree/software/dias/scratch/anaconda3/envs/mt_env/lib/python3.10/site-packages/mtpy/imaging/plot_mt_response.py#line=501), in PlotMTResponse.plot(self)
500 self._plot_phase(self.axp, self.period, self.Z, mode="od")
501 self._plot_tipper()
--> 502 self._plot_pt()
504 # ===Plot the xx, yy components if desired==============================
505 if self.plot_num == 2:
File [~/anaconda3/envs/mt_env/lib/python3.10/site-packages/mtpy/imaging/plot_mt_response.py:427](http://localhost:8888/lab/tree/software/dias/scratch/anaconda3/envs/mt_env/lib/python3.10/site-packages/mtpy/imaging/plot_mt_response.py#line=426), in PlotMTResponse._plot_pt(self)
424 color_array = self.get_pt_color_array(self.pt)
426 # -------------plot ellipses-----------------------------------
--> 427 self.cbax, self.cbpt, = plot_pt_lateral(
428 self.axpt,
429 self.pt,
430 color_array,
431 self.ellipse_properties,
432 fig=self.fig,
433 )
435 # ----set axes properties-----------------------------------------------
436 # --> set tick labels and limits
437 self.axpt.set_xlim(
438 np.log10(self.x_limits[0]), np.log10(self.x_limits[1])
439 )
File [~/anaconda3/envs/mt_env/lib/python3.10/site-packages/mtpy/imaging/mtplot_tools/plotters.py:238](http://localhost:8888/lab/tree/software/dias/scratch/anaconda3/envs/mt_env/lib/python3.10/site-packages/mtpy/imaging/mtplot_tools/plotters.py#line=237), in plot_pt_lateral(ax, pt_obj, color_array, ellipse_properties, y_shift, fig, edge_color, n_index)
235 # -------------plot ellipses-----------------------------------
236 for ii, ff in enumerate(1.0 [/](http://localhost:8888/) pt_obj.frequency):
237 # make sure the ellipses will be visable
--> 238 if pt_obj.phimax[ii] == 0:
239 continue
240 eheight = (
241 pt_obj.phimin[ii] [/](http://localhost:8888/) pt_obj.phimax[ii] * ellipse_properties["size"]
242 )
TypeError: 'NoneType' object is not subscriptable
Fix Issue #34 for plotting when only tipper data are available as the transfer function
plot_mt_response
plot_mt_responses