Skip to content

Getting ZeroDivisionError: float division by zero when using pypret_retriever.py on custom data #1

Description

@gamenerd457

Hey, I am getting the following error when running pypret_retriever.py on 2d trace data,
/content/pypret/pypret/retrieval/retriever.py:203: RuntimeWarning: invalid value encountered in scalar divide
w2 = self._weights * self._weights
Started retriever 'copra'
Options:
namespace(alpha=0.25, maxiter=300, maxfev=None)
Initial trace error R = nan
Starting retrieval...


ZeroDivisionError Traceback (most recent call last)
in <cell line: 0>()
134
135 # Retrieve from the measured data
--> 136 ret.retrieve(measured_data, pulse.spectrum)
137
138 # and print the retrieval results

2 frames
/content/pypret/pypret/retrieval/step_retriever.py in _retrieve_step(self, iteration, En)
131 if gradient_norm > rs.current_max_gradient:
132 rs.current_max_gradient = gradient_norm
--> 133 gamma = Zm / max(rs.current_max_gradient,
134 rs.previous_max_gradient)
135 # update the spectrum

ZeroDivisionError: float division by zero

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions