Skip to content

locate.pyx: scipy.optimize: invalid value encountered in subtract #55

Description

@filefolder

I have been getting this warning quite a bit when relocating very large catalogs. I think it is harmless but it can be a bit distracting.

../scipy/optimize/_numdiff.py:686: RuntimeWarning: invalid value encountered in subtract
  df = [f_eval - f0 for f_eval in f_evals]

I think I finally traced it back to rms in locate.pyx

        if valid_measurements == 0:
            return np.inf

it seems optimize prefers that to just return a "very large RMS" if there are no valid arrivals so it is working with small but still non-zero numbers. I just changed it to return 1e6 and all the warnings went away. For the little it's worth!

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