# Migrate meas_algorithms to modern afwDisplay

XMLWordPrintable

#### Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
None
• Story Points:
1
• Team:
Data Release Production

#### Description

meas_algorithms contains several (e.g. #1, #2, there are more) explicit uses of lsst.afw.display.ds9. These should be replaced by calls to the generic (backend-independent) lsst.afw.display system.

#### Activity

Hide
Perry Gee added a comment -

Robert Lupton Robert, are you the expert on display?

There is a "global fig" followed by a line "if not fig" in objectSizeStarSelector.py, but fig is not defined prior to this line, so an exception occurs. I can use a "try/except NameError" to test that fig is defined, or I could define "fig = None" outside local scope, unless you can suggest another solution which you like better.

Also, the name "fig" is used locally in another routine. I assume this is really a separate usage?

Show
Perry Gee added a comment - Robert Lupton Robert, are you the expert on display? There is a "global fig" followed by a line "if not fig" in objectSizeStarSelector.py, but fig is not defined prior to this line, so an exception occurs. I can use a "try/except NameError" to test that fig is defined, or I could define "fig = None" outside local scope, unless you can suggest another solution which you like better. Also, the name "fig" is used locally in another routine. I assume this is really a separate usage?
Hide
Robert Lupton added a comment -

Merlin just ran into something similar. I think someone probably removed a block at global scope:

 try:  fig except NameError:  fig = None 

Show
Robert Lupton added a comment - Merlin just ran into something similar. I think someone probably removed a block at global scope: try: fig except NameError: fig = None
Hide
Perry Gee added a comment -

Yes, that is how I solved it. I just wanted to be sure that there wasn't some other intention to share this global with other routines outside of plot().

Show
Perry Gee added a comment - Yes, that is how I solved it. I just wanted to be sure that there wasn't some other intention to share this global with other routines outside of plot().
Hide
Perry Gee added a comment -

Note the changes required to https://developer.lsst.io/coding/debug.html. If you run from a cmdLineTask, there is no -d option, and debug.py must be in your PYTHONPATH.

Show
Perry Gee added a comment - Note the changes required to https://developer.lsst.io/coding/debug.html . If you run from a cmdLineTask, there is no -d option, and debug.py must be in your PYTHONPATH.
Hide
Michael Wood-Vasey [X] (Inactive) added a comment -

The code changes look fine.
Rebase to current master (sorry for the extensive delay in reviewing this).

I've spent 3 hours trying to get the display itself tested, but have been unable to do so. DM-11125 is just one symptom.

I suggest the best way forward at this point is to merge this.

Show
Michael Wood-Vasey [X] (Inactive) added a comment - The code changes look fine. Rebase to current master (sorry for the extensive delay in reviewing this). I've spent 3 hours trying to get the display itself tested, but have been unable to do so. DM-11125 is just one symptom. I suggest the best way forward at this point is to merge this.
Hide
John Swinbank added a comment -

Done on DM-13432.

Show
John Swinbank added a comment - Done on DM-13432 .

#### People

Assignee:
Perry Gee
Reporter:
John Swinbank
Reviewers:
Michael Wood-Vasey [X] (Inactive)
Watchers:
John Swinbank, Michael Wood-Vasey [X] (Inactive), Perry Gee, Robert Lupton