[PIPE2D-25] Visualise a FiberTraceSet using LSST's ds9 interface Created: 03/Sep/14  Updated: 30/Sep/16  Resolved: 30/Sep/16

Status: Done
Project: DRP 2-D Pipeline
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Major
Reporter: rhl Assignee: aritter
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Story Points: 2
Epic Link: Initial Fiber Trace pipeline
Sprint: 2014-9, 2014-12, 2014-13, 2014-14, 2014-15, 2014-16
Reviewers: swinbank

 Description   

Display a flat field on ds9 and overlay a FiberTraceSet



 Comments   
Comment by aritter [ 22/Jul/16 ]

So far I have marked the traced center positions in DS9, but I couldn't find a function in display.ds9 to overplot a rectangular area in a DS9 image. I do have a function that reconstructs an image from the extracted spectrum and spatial profile what should fulfill the same purpose as overlaying a FiberTraceSet on a flat field...

Comment by aritter [ 29/Jul/16 ]

Created an ipython notebook in drp_stella/examples/ (tickets/PIPE2D-25). Data are in drp_stella_data data/PFS/postISRCCD/2016-01-12/v0000005/PFFAr2.fits (tickets/PIPE2D-25)

Comment by rhl [ 29/Jul/16 ]
import lsst.afw.display as afwDisplay

disp = afwDisplay.Display(1)

disp.mtv(...)
disp.line([(x0, y0), (x0, y0+10), (x0 + 20, y0 + 10), (x0 + 20, y0), (x0, y0)])

(note: this is the way to use ds9; please don't import lsst.afw.display.ds9 directly)

Comment by swinbank [ 30/Jul/16 ]

The dataID in the notebook is incorrect:

RuntimeError: No unique lookup for ['taiObs', 'dateObs', 'field', 'spectrograph', 'arm'] from {'filter': 'r', 'ccd': 5, 'category': 'A', 'visit': 5, 'site': 'S'}: 0 matches

Using site=F works.

Comment by aritter [ 30/Jul/16 ]

Fixed the site error, sorry about that...

Comment by rhl [ 24/Sep/16 ]

The notebook appears to work, but I have some concerns that need to be addressed:

  1. For the loop marking the centres of the trace there appears to be an off-by-one error in x (the + signs all appear to the right of the trace). The plotting code appears to be correct, so is this a problem in your fiberTrace extraction? Please check.
  2. Why do you set point?
  3. Why is this not encapsulated in a function?
  4. Why did you choose to mark the centre with a set of crosses rather than drawing the ridgeline?
  5. You need to use

    with display.Buffering():

    whenever using display writes.

For markFiberTraceInMask:

  1. Did this have to be written in C++?
  2. The value of the masked image plane is hard coded to 1
  3. The code that sets the mask calls getArray; there is no need to go through the numpy interface
  4. The object passed in is a MaskedImage, not a Mask but only the Mask is modified
  5. The inner loop does the entire traversal

    maskedImage->getMask()->getArray()[ y + iY ][ x ] = 1;

    that should be outside the loop

In the notebook,

  1. what is

    display0.setMaskPlaneColor("CROSSTALK", "orange")

    supposed to do? There is no such mask plane in the data, and it'd be unrelated to fibre traces if there was.

  2. Why do you say

    afwDisplay.setDefaultBackend("ds9" if True else "virtualDevice")

    Isn't that the default it display_ds9 is setup?

Also (and out of scope for this ticket but worrying)

  1. The routine calcMinCenMax() appears very inefficient, making copies of many ndarrays. Also, why is it a free function not part of a FiberTrace (given that when used you have to unpack the FiberTrace)
  2. The indentation in Math.cc is incorrect
  3. The lines in FiberTraces.cc exceed the permitted length of 110 characters
Comment by aritter [ 30/Sep/16 ]

Merged into master

Generated at Sat Feb 10 15:47:28 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.