Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-38582

Spectractor failure with scikit-image 0.20.0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: spectractor
    • Labels:
      None
    • Story Points:
      1
    • Epic Link:
    • Team:
      Commissioning
    • Urgent?:
      No

      Description

      Spectractor fails when using scikit-image 0.20.0 but not 0.19.3.

      [2023-04-05T12:18:20.480940Z]   File "/sdf/data/rubin/user/ktl/lsstsw-dev/build/spectractor/tests/test_extractor.py", line 45, in test_extractor_ctio
      [2023-04-05T12:18:20.481117Z]     spectrum = Spectractor(file_name, output_directory, target_label, [xpos, ypos], disperser_label, config="")
      [2023-04-05T12:18:20.481314Z]   File "/sdf/data/rubin/user/ktl/lsstsw-dev/build/spectractor/spectractor/extractor/extractor.py", line 1233, in Spectractor
      [2023-04-05T12:18:20.481452Z]     spectrum = SpectractorRun(image, guess=guess, output_directory=output_directory)
      [2023-04-05T12:18:20.481653Z]   File "/sdf/data/rubin/user/ktl/lsstsw-dev/build/spectractor/spectractor/extractor/extractor.py", line 1167, in SpectractorRun
      [2023-04-05T12:18:20.481757Z]     spectrum = run_ffm_minimisation(w, method="newton", niter=2)
      [2023-04-05T12:18:20.481966Z]   File "/sdf/data/rubin/user/ktl/lsstsw-dev/build/spectractor/spectractor/extractor/extractor.py", line 824, in run_ffm_minimisation
      [2023-04-05T12:18:20.482144Z]     run_minimisation(w, method=method, fix=w.fixed, xtol=1e-3, ftol=1e-2)  # 1000 / (w.data.size - len(w.mask)))
      [2023-04-05T12:18:20.482335Z]   File "/sdf/data/rubin/user/ktl/lsstsw-dev/build/spectractor/spectractor/fit/fitter.py", line 1407, in run_minimisation
      [2023-04-05T12:18:20.482495Z]     params_table, costs = run_gradient_descent(fit_workspace, guess, epsilon, params_table, costs,
      [2023-04-05T12:18:20.482697Z]   File "/sdf/data/rubin/user/ktl/lsstsw-dev/build/spectractor/spectractor/fit/fitter.py", line 1290, in run_gradient_descent
      [2023-04-05T12:18:20.482809Z]     print_parameter_summary(fit_workspace.p[ipar],
       fit_workspace.cov,
      [2023-04-05T12:18:20.483010Z]   File "/sdf/data/rubin/user/ktl/lsstsw-dev/build/spectractor/spectractor/fit/fitter.py", line 1231, in print_parameter_summary
      [2023-04-05T12:18:20.483182Z]     txt += "%s: %s +%s -%s\n\t" % formatting_numbers(params[ip], np.sqrt(cov[ip, ip]), np.sqrt(cov[ip, ip]),
      [2023-04-05T12:18:20.483367Z]   File "/sdf/data/rubin/user/ktl/lsstsw-dev/build/spectractor/spectractor/tools.py", line 1509, in formatting_numbers
      [2023-04-05T12:18:20.483531Z]     power10 = min(int(floor(np.log10(np.abs(error_high)))), int(floor(np.log10(np.abs(error_low)))))
      [2023-04-05T12:18:20.483612Z] ValueError: cannot convert float NaN to integer
      

        Attachments

          Activity

          Hide
          erykoff Eli Rykoff added a comment -

          As mentioned on slack, it seems that the meaning of 'rc' and 'xy' were wrong before or something, see https://github.com/scikit-image/scikit-image/pull/6624 and then this needs to check for version and sigh. https://github.com/lsst/Spectractor/blob/lsst-dev/spectractor/tools.py#L1405

          Show
          erykoff Eli Rykoff added a comment - As mentioned on slack, it seems that the meaning of 'rc' and 'xy' were wrong before or something, see https://github.com/scikit-image/scikit-image/pull/6624 and then this needs to check for version and sigh. https://github.com/lsst/Spectractor/blob/lsst-dev/spectractor/tools.py#L1405
          Hide
          erykoff Eli Rykoff added a comment -

          PR is here: https://github.com/lsst/Spectractor/pull/30
          Jenkins is here: https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/38398/pipeline

          Jenkins is on scikit-image=0.19.3. Tested locally with scikit-image=0.20.0.

          Show
          erykoff Eli Rykoff added a comment - PR is here: https://github.com/lsst/Spectractor/pull/30 Jenkins is here: https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/38398/pipeline Jenkins is on scikit-image=0.19.3. Tested locally with scikit-image=0.20.0.
          Hide
          tjenness Tim Jenness added a comment -

          Two minor comments on PR. Looks good.

          Show
          tjenness Tim Jenness added a comment - Two minor comments on PR. Looks good.

            People

            Assignee:
            erykoff Eli Rykoff
            Reporter:
            ktl Kian-Tat Lim
            Reviewers:
            Tim Jenness
            Watchers:
            Eli Rykoff, Kian-Tat Lim, Tim Jenness
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.