Ticket #5384: DetectorMove.py

File DetectorMove.py, 647 bytes (added by Karl Palmen, 8 years ago)

Python script loads a MERLIN file and moves one of its detectors.

Line 
1rawMapWS = Load(r'\\isis\inst$\NDXMERLIN\Instrument\data\cycle_11_5\MER12024.raw') 
2
3deti = rawMapWS.getDetector( 204801 )
4detiID = deti.getID()
5detiPositionX = deti.getPos().X()
6detiPositionY = deti.getPos().Y() 
7detiPositionZ = deti.getPos().Z()
8yNew = -0.05
9print "About to move detector from", detiPositionY
10MoveInstrumentComponent( rawMapWS, DetectorID=detiID, Y=yNew )
11print "Moved detector. About get its new position."
12newDetiPositionY = deti.getPos().Y()  #MANTID CRASHES HERE
13print "Got new position. About to print old position, then new position."
14print "Old position", detiPositionY
15print "New position", newDetiPositionY
16
17   
18