Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve workspace's getDetector method #4174

Closed
Anders-Markvardsen opened this issue Jul 9, 2011 · 1 comment
Closed

improve workspace's getDetector method #4174

Anders-Markvardsen opened this issue Jul 9, 2011 · 1 comment
Assignees
Milestone

Comments

@Anders-Markvardsen
Copy link
Member

While helping Matt it was found that running the following script

ws = mtd["PEARL00071180"]
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

@Anders-Markvardsen
Copy link
Member Author

This issue was originally trac ticket 3327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant