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

Assertion failure in meas_mosaic diagnostics

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: meas_mosaic
    • Labels:
      None
    • Team:
      External

      Description

      MosaicTask fails with an assertion error while generating diagnostic plots (if configured on the command-line).

      INFO  2018-08-14T01:18:05.005 Mosaic ()(mosaicTask.py:705)- Output WCS Diagnostic Figures...
      QXcbConnection: Could not connect to display localhost:11.0
      Caught signal 6, backtrace follows:
      /software/lsstsw/stack3_20171023/stack/miniconda3-4.3.21-10a4fa6/Linux64/utils/16.0-4-gd6aeece+1/lib/libutils.so(+0x15214) [0x7f5ac20df214]
      /usr/lib64/libc.so.6(+0x362f0) [0x7f5b1f4812f0]
      /usr/lib64/libc.so.6(gsignal+0x37) [0x7f5b1f481277]
      /usr/lib64/libc.so.6(abort+0x148) [0x7f5b1f482968]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/lib/python3.6/site-packages/PyQt5/../../../libQt5Core.so.5(+0x92a8e) [0x7f5b04d61a8e]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/plugins/platforms/../../lib/libQt5XcbQpa.so.5(QXcbConnection::QXcbConnection(QXcbNativeInterface*, bool, unsigned int, char const*)+0x706) [0x7f5ae63a1cc6]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/plugins/platforms/../../lib/libQt5XcbQpa.so.5(QXcbIntegration::QXcbIntegration(QStringList const&, int&, char**)+0x30d) [0x7f5ae63a500d]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/plugins/platforms/libqxcb.so(+0x14db) [0x7f5ae66bc4db]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/lib/python3.6/site-packages/PyQt5/../../../libQt5Gui.so.5(QPlatformIntegrationFactory::create(QString const&, QStringList const&, int&, char**, QString const&)+0x10b) [0x7f5afae92a4b]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/lib/python3.6/site-packages/PyQt5/../../../libQt5Gui.so.5(QGuiApplicationPrivate::createPlatformIntegration()+0x45c) [0x7f5afae9f8fc]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/lib/python3.6/site-packages/PyQt5/../../../libQt5Gui.so.5(QGuiApplicationPrivate::createEventDispatcher()+0x2d) [0x7f5afaea048d]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/lib/python3.6/site-packages/PyQt5/../../../libQt5Core.so.5(QCoreApplicationPrivate::init()+0x818) [0x7f5b04f3bae8]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/lib/python3.6/site-packages/PyQt5/../../../libQt5Gui.so.5(QGuiApplicationPrivate::init()+0x1c) [0x7f5afaea0e3c]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/lib/python3.6/site-packages/PyQt5/../../../libQt5Widgets.so.5(QApplicationPrivate::init()+0x9) [0x7f5ae6c1adb9]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/lib/python3.6/site-packages/PyQt5/QtWidgets.so(+0x353b69) [0x7f5ae771ab69]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/lib/python3.6/site-packages/PyQt5/QtWidgets.so(+0x353c39) [0x7f5ae771ac39]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/lib/python3.6/site-packages/sip.so(+0x7f08) [0x7f5b058d4f08]
      /software/lsstsw/stack3_20171023/python/miniconda3-4.3.21/bin/../lib/libpython3.6m.so.1.0(+0xda2ac) [0x7f5b2041f2ac]
      

      This is due to the removal of the code that sets the matplotlib backend (DM-14159).

        Attachments

          Issue Links

            Activity

            Hide
            price Paul Price added a comment -

            Michael Wood-Vasey, I don't think this is running counter to your change, but would you please confirm I'm not stepping on your toes?

            price@pap-laptop:~/LSST/meas_mosaic (tickets/DM-15429=) $ git sub-patch
            commit 56ca4e1762247b2844bdd834af09d118af76cb29 (HEAD -> tickets/DM-15429, origin/u/price/20180814, origin/tickets/DM-15429, u/price/20180814)
            Author: Paul Price <price@astro.princeton.edu>
            Date:   Tue Aug 14 14:41:11 2018 -0400
             
                MosaicTask: set matplotlib backend
                
                Setting the backend was removed because it was being done at the module
                level. However, it is necessary for MosaicTask when we are using
                diagnostics. Setting it at the top of mosaicTask.py, which isn't
                imported by the module's __init__.py, so should not be visible at the
                module level. This should give us the best of all worlds.
             
            diff --git a/python/lsst/meas/mosaic/checkMosaicTask.py b/python/lsst/meas/mosaic/checkMosaicTask.py
            index 676c3ff..b751c79 100644
            --- a/python/lsst/meas/mosaic/checkMosaicTask.py
            +++ b/python/lsst/meas/mosaic/checkMosaicTask.py
            @@ -3,6 +3,9 @@ import os
             import math
             import numpy
             
            +import matplotlib
            +matplotlib.use('Agg')
            +
             import matplotlib.pyplot as plt
             import matplotlib.mlab as mlab
             
            diff --git a/python/lsst/meas/mosaic/mosaicTask.py b/python/lsst/meas/mosaic/mosaicTask.py
            index 1ab9572..3571d0c 100644
            --- a/python/lsst/meas/mosaic/mosaicTask.py
            +++ b/python/lsst/meas/mosaic/mosaicTask.py
            @@ -20,13 +20,15 @@
             # the GNU General Public License along with this program.  If not,
             # see <https://www.lsstcorp.org/LegalNotices/>.
             #
            -from __future__ import print_function
             import os
             import math
             import numpy
             
             import multiprocessing
             
            +import matplotlib
            +matplotlib.use('Agg')
            +
             import lsst.afw.geom                    as afwGeom
             import lsst.afw.image                   as afwImage
             import lsst.afw.math                    as afwMath
            

            Show
            price Paul Price added a comment - Michael Wood-Vasey , I don't think this is running counter to your change, but would you please confirm I'm not stepping on your toes? price@pap-laptop:~/LSST/meas_mosaic (tickets/DM-15429=) $ git sub-patch commit 56ca4e1762247b2844bdd834af09d118af76cb29 (HEAD -> tickets/DM-15429, origin/u/price/20180814, origin/tickets/DM-15429, u/price/20180814) Author: Paul Price <price@astro.princeton.edu> Date: Tue Aug 14 14:41:11 2018 -0400   MosaicTask: set matplotlib backend Setting the backend was removed because it was being done at the module level. However, it is necessary for MosaicTask when we are using diagnostics. Setting it at the top of mosaicTask.py, which isn't imported by the module's __init__.py, so should not be visible at the module level. This should give us the best of all worlds.   diff --git a/python/lsst/meas/mosaic/checkMosaicTask.py b/python/lsst/meas/mosaic/checkMosaicTask.py index 676c3ff..b751c79 100644 --- a/python/lsst/meas/mosaic/checkMosaicTask.py +++ b/python/lsst/meas/mosaic/checkMosaicTask.py @@ -3,6 +3,9 @@ import os import math import numpy +import matplotlib +matplotlib.use('Agg') + import matplotlib.pyplot as plt import matplotlib.mlab as mlab diff --git a/python/lsst/meas/mosaic/mosaicTask.py b/python/lsst/meas/mosaic/mosaicTask.py index 1ab9572..3571d0c 100644 --- a/python/lsst/meas/mosaic/mosaicTask.py +++ b/python/lsst/meas/mosaic/mosaicTask.py @@ -20,13 +20,15 @@ # the GNU General Public License along with this program. If not, # see <https://www.lsstcorp.org/LegalNotices/>. # -from __future__ import print_function import os import math import numpy import multiprocessing +import matplotlib +matplotlib.use('Agg') + import lsst.afw.geom as afwGeom import lsst.afw.image as afwImage import lsst.afw.math as afwMath
            Hide
            Parejkoj John Parejko added a comment -

            I'm not Michael, but I don't think we want to have any matplotlib imports inside python/. Can you put the import in bin/checkMosaic.py instead?

            Show
            Parejkoj John Parejko added a comment - I'm not Michael, but I don't think we want to have any matplotlib imports inside python/ . Can you put the import in bin/checkMosaic.py instead?
            Hide
            price Paul Price added a comment -

            That's a good idea. New patch:

            price@pap-laptop:~/LSST/meas_mosaic (tickets/DM-15429=) $ git sub-patch
            commit 536438c2854a53bf52475682cacb4448cff8b44e (HEAD -> tickets/DM-15429, origin/tickets/DM-15429)
            Author: Paul Price <price@astro.princeton.edu>
            Date:   Tue Aug 14 14:41:11 2018 -0400
             
                set matplotlib backend
                
                Setting the backend was removed because it was being done at the module
                level. However, it is necessary for MosaicTask/CheckMosaicTask when we
                are using diagnostics. Setting it in the bin scripts so it can be done
                first, and it can't contaminate anything else.
             
            diff --git a/bin.src/checkMosaic.py b/bin.src/checkMosaic.py
            index 98506a4..76eaa14 100755
            --- a/bin.src/checkMosaic.py
            +++ b/bin.src/checkMosaic.py
            @@ -1,5 +1,7 @@
             #!/usr/bin/env python
             
            -from lsst.meas.mosaic.checkMosaicTask import CheckMosaicTask
            +import matplotlib
            +matplotlib.use('Agg')
             
            +from lsst.meas.mosaic.checkMosaicTask import CheckMosaicTask
             CheckMosaicTask.parseAndRun()
            diff --git a/bin.src/mosaic.py b/bin.src/mosaic.py
            index 7b9f63c..28d80ec 100755
            --- a/bin.src/mosaic.py
            +++ b/bin.src/mosaic.py
            @@ -1,5 +1,7 @@
             #!/usr/bin/env python
             
            -from lsst.meas.mosaic.mosaicTask import MosaicTask
            +import matplotlib
            +matplotlib.use('Agg')
             
            +from lsst.meas.mosaic.mosaicTask import MosaicTask
             MosaicTask.parseAndRun()
            

            Show
            price Paul Price added a comment - That's a good idea. New patch: price@pap-laptop:~/LSST/meas_mosaic (tickets/DM-15429=) $ git sub-patch commit 536438c2854a53bf52475682cacb4448cff8b44e (HEAD -> tickets/DM-15429, origin/tickets/DM-15429) Author: Paul Price <price@astro.princeton.edu> Date: Tue Aug 14 14:41:11 2018 -0400   set matplotlib backend Setting the backend was removed because it was being done at the module level. However, it is necessary for MosaicTask/CheckMosaicTask when we are using diagnostics. Setting it in the bin scripts so it can be done first, and it can't contaminate anything else.   diff --git a/bin.src/checkMosaic.py b/bin.src/checkMosaic.py index 98506a4..76eaa14 100755 --- a/bin.src/checkMosaic.py +++ b/bin.src/checkMosaic.py @@ -1,5 +1,7 @@ #!/usr/bin/env python -from lsst.meas.mosaic.checkMosaicTask import CheckMosaicTask +import matplotlib +matplotlib.use('Agg') +from lsst.meas.mosaic.checkMosaicTask import CheckMosaicTask CheckMosaicTask.parseAndRun() diff --git a/bin.src/mosaic.py b/bin.src/mosaic.py index 7b9f63c..28d80ec 100755 --- a/bin.src/mosaic.py +++ b/bin.src/mosaic.py @@ -1,5 +1,7 @@ #!/usr/bin/env python -from lsst.meas.mosaic.mosaicTask import MosaicTask +import matplotlib +matplotlib.use('Agg') +from lsst.meas.mosaic.mosaicTask import MosaicTask MosaicTask.parseAndRun()
            Hide
            wmwood-vasey Michael Wood-Vasey added a comment -

            Yes. This looks right. I exactly agree that putting the import matplotlib in the bin.src invocation of the task is the right approach.

            Show
            wmwood-vasey Michael Wood-Vasey added a comment - Yes. This looks right. I exactly agree that putting the import matplotlib in the bin.src invocation of the task is the right approach.
            Hide
            price Paul Price added a comment -

            Thanks!

            Merged to master.

            Show
            price Paul Price added a comment - Thanks! Merged to master.

              People

              • Assignee:
                price Paul Price
                Reporter:
                price Paul Price
                Reviewers:
                Michael Wood-Vasey
                Watchers:
                John Parejko, Michael Wood-Vasey, Paul Price
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel