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

Firefly zscale differs from other implementations

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: Firefly, SUIT
    • Labels:
    • Story Points:
      2
    • Sprint:
      SUIT Sprint 2018-07
    • Team:
      Science User Interface

      Description

      The upper output (z2) of Firefly's zscale implementation is often significantly greater than z2 from other implementations, including those in ds9, astropy and lsst.afw.display.

      Comparison on coadd file calexp-HSC-I-9813-4,4.fits:

      Implementation Contrast (%) Nsamples Samples_per_line z1 z2
      Firefly 25 600 120 -0.0491993 0.409582
      ds9 25 600 120 -0.0491993 0.145803
      lsst.afw.display.displayLib 25 600 N/A -0.0577342 0.155637
      astropy.visualization 25 600 N/A -0.0550090 0.170189
      Firefly 25 1000 120 -0.0487988 0.951774
      ds9 25 1000 120 -0.0487988 0.15138
      lsst.afw.display.displayLib 25 1000 N/A -0.0577120 0.165587
      astropy.visualization 25 1000 N/A -0.0535599 0.171046
      Firefly 80 600 120 -0.0379127 0.132309
      ds9 80 600 120 -0.0373926 0.0524557
      lsst.afw.display.displayLib 80 600 N/A -0.0392628 0.0535469
      astropy.visualization 80 600 N/A -0.0437599 0.0578543

       

        Attachments

          Issue Links

            Activity

            Hide
            shupe David Shupe added a comment - - edited

            The problem with Firefly Zscale is caused by these lines of code at the end of FitLineRetval in Zscale.java:

            if (Math.abs(slope) < 0.001)
               slope = (float) (o_dz * xscale);
            

            The slope for the HSC coadd image is of order 1.e-4 which triggers the if condition.

            Neither the Astropy nor the LSST afw.display implementation of Zscale include such a check. The 0.001 value is data-dependent and I cannot think of a justification for it.

            With these lines commented out, the examples in the Description become much more consistent:

            Implementation Contrast (%) Nsamples Samples_per_line z1 z2
            Firefly 25 600 120 -0.0491993 0.149816
            ds9 25 600 120 -0.0491993 0.145803
            lsst.afw.display.displayLib 25 600 N/A -0.0577342 0.155637
            astropy.visualization 25 600 N/A -0.0550090 0.170189
            Firefly 25 1000 120 -0.0487988 0.156350
            ds9 25 1000 120 -0.0487988 0.15138
            lsst.afw.display.displayLib 25 1000 N/A -0.0577120 0.165587
            astropy.visualization 25 1000 N/A -0.0535599 0.171046
            Firefly 80 600 120 -0.0379127 0.0514039
            ds9 80 600 120 -0.0373926 0.0524557
            lsst.afw.display.displayLib 80 600 N/A -0.0392628 0.0535469
            astropy.visualization 80 600 N/A -0.0437599 0.0578543

             

            Show
            shupe David Shupe added a comment - - edited The problem with Firefly Zscale is caused by these lines of code at the end of FitLineRetval in Zscale.java : if (Math.abs(slope) < 0.001 ) slope = ( float ) (o_dz * xscale); The slope for the HSC coadd image is of order 1.e-4 which triggers the if condition. Neither the Astropy nor the LSST afw.display implementation of Zscale include such a check. The 0.001 value is data-dependent and I cannot think of a justification for it. With these lines commented out, the examples in the Description become much more consistent: Implementation Contrast (%) Nsamples Samples_per_line z1 z2 Firefly 25 600 120 -0.0491993 0.149816 ds9 25 600 120 -0.0491993 0.145803 lsst.afw.display.displayLib 25 600 N/A -0.0577342 0.155637 astropy.visualization 25 600 N/A -0.0550090 0.170189 Firefly 25 1000 120 -0.0487988 0.156350 ds9 25 1000 120 -0.0487988 0.15138 lsst.afw.display.displayLib 25 1000 N/A -0.0577120 0.165587 astropy.visualization 25 1000 N/A -0.0535599 0.171046 Firefly 80 600 120 -0.0379127 0.0514039 ds9 80 600 120 -0.0373926 0.0524557 lsst.afw.display.displayLib 80 600 N/A -0.0392628 0.0535469 astropy.visualization 80 600 N/A -0.0437599 0.0578543  
            Hide
            shupe David Shupe added a comment -

            The fix is applied in DM-14778.

            Show
            shupe David Shupe added a comment - The fix is applied in DM-14778 .

              People

              • Assignee:
                shupe David Shupe
                Reporter:
                shupe David Shupe
                Watchers:
                David Shupe, Tatiana Goldina, Trey Roby, Xiuqin Wu [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: