Ticket #3327 (closed: wontfix)

Opened 9 years ago

Last modified 5 years ago

improve workspace's getDetector method

Reported by: Anders Markvardsen Owned by: Anders Markvardsen
Priority: major Milestone: Release 2.0
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Nick Draper

Description

While helping Matt it was found that running the following script

ws = mtdPEARL00071180? inst = ws.getInstrument()

origin = ws.getInstrument().getSample().getPos()

for i in range(0, ws.getNumberHistograms()):

print i, " ", ws.getDetector(i).getTwoTheta(origin, V3D(0,0,1))*180/math.pi, " ", ws.getDetector(i).isMasked()

mask = [] for i in range(0, ws.getNumberHistograms()):

angle = ws.getDetector(i).getTwoTheta(origin, V3D(0,0,1))*180/math.pi if angle > 97 or angle < 83:

mask.append(i)

MaskDetectors("PEARL00071180",WorkspaceIndexList=mask)

print "after masking" for i in range(0, ws.getNumberHistograms()):

print ws.getDetector(i).getTwoTheta(origin, V3D(0,0,1))*180/math.pi, " ", ws.getDetector(i).isMasked()

generated the following error:

RuntimeError on line 7: "Instrument: Detector with ID 6 not found. search object" in file 'mask_detectors.py' at line 7

The problem is something along the lines of histograms in the workspace exists for which no detector exists

Change History

comment:1 Changed 9 years ago by Andrei Savici

  • Owner changed from Andrei Savici to Anders Markvardsen
  • Status changed from new to assigned

comment:2 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 30 to Iteration 31

Bulk move of tickets to iteration 31 at the iteration 30 code freeze

comment:3 Changed 9 years ago by Anders Markvardsen

  • Status changed from assigned to accepted

comment:4 Changed 9 years ago by Anders Markvardsen

  • Status changed from accepted to verify
  • Resolution set to wontfix

Just discussed this ticket with Martyn and yes, when user see this error they have to use try catch blocks

comment:5 Changed 9 years ago by Nick Draper

  • Status changed from verify to verifying
  • Tester set to Nick Draper

comment:6 Changed 9 years ago by Nick Draper

  • Status changed from verifying to closed

try catch blocks are most helpful, especially in situations like this.

comment:7 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 4174

Note: See TracTickets for help on using tickets.