Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2: plotting strike with no tipper #175

Open
kujaku11 opened this issue Oct 20, 2022 · 0 comments
Open

V2: plotting strike with no tipper #175

kujaku11 opened this issue Oct 20, 2022 · 0 comments
Assignees
Labels
version 2 Issues for MTpy version 2

Comments

@kujaku11
Copy link
Collaborator

If tipper is empty, when using plot_strike get an error:

File ~\.conda\envs\em\lib\site-packages\mtpy-2.0.0-py3.10.egg\mtpy\imaging\plot_strike.py:905, in PlotStrike.plot(self, show)
    900 """
    901 plot Strike angles as rose plots
    902 
    903 """
    904 if self.strike_df is None:
--> 905     self.make_strike_df()
    907 # -----Plot Histograms of the strike angles-----------------------------
    908 
    909 # ------------------plot indivdual decades------------------------------
    910 if self.plot_type == 1:

File ~\.conda\envs\em\lib\site-packages\mtpy-2.0.0-py3.10.egg\mtpy\imaging\plot_strike.py:266, in PlotStrike.make_strike_df(self)
    264 else:
    265     if tip is None:
--> 266         tip = Tipper(
    267             np.zeros((len(mt.period), 1, 2), dtype="complex"),
    268             frequency=[1],
    269         )
    270         tip.compute_mag_direction()
    271         tip.compute_amp_phase()

File ~\.conda\envs\em\lib\site-packages\mtpy-2.0.0-py3.10.egg\mtpy\core\tipper.py:89, in Tipper.__init__(self, tipper_array, tipper_err_array, frequency, tipper_model_err_array)
     87 self.tipper = tipper_array
     88 self.tipper_err = tipper_err_array
---> 89 self.frequency = frequency
     90 self.tipper_model_err = tipper_model_err_array
     92 self._amplitude = None

File ~\.conda\envs\em\lib\site-packages\mtpy-2.0.0-py3.10.egg\mtpy\core\tipper.py:202, in Tipper.frequency(self, frequency_arr)
    197         msg = (
    198             "New frequency array is not correct shape for existing z"
    199             + "new: {self._frequency.size} != old: {self.tipper.shape[0]}"
    200         )
    201         self.logger.error(msg)
--> 202         raise MTpyError_Tipper
    203 # for consistency recalculate amplitude and phase
    204 self.compute_amp_phase()

MTpyError_Tipper: 
@kujaku11 kujaku11 added the version 2 Issues for MTpy version 2 label Oct 20, 2022
@kujaku11 kujaku11 self-assigned this Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version 2 Issues for MTpy version 2
Projects
None yet
Development

No branches or pull requests

1 participant