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

Generate Q-vector file for Schultz #6966

Closed
peterfpeterson opened this issue Nov 14, 2012 · 1 comment
Closed

Generate Q-vector file for Schultz #6966

peterfpeterson opened this issue Nov 14, 2012 · 1 comment
Assignees
Milestone

Comments

@peterfpeterson
Copy link
Member

Here is the email he sent with the request:

Just to follow up, I would like to have a Mantid algorithm that produces an event file list of Qx,Qy,Qz for each event. The Q coordinates are not pixels or voxels, but just calculated coordinates. In ISAW, this is accomplished with the EventToEventQ operator created by Dennis.

Below is a portion of a Python script which reads the binary file.

     # Read the events from binary file----------------------------- - - - 
     events_fname = events_directory + 'TOPAZ_' + srun + '_EventsToQ.bin'
     input = open(events_fname, 'rb')
     print 'The EventsToQ.bin file is ' + events_fname
     print ''
     numberOfEvents = 0
     while True:
         # if numberOfEvents == 1e05: break

         lineString = input.read(12)
         if lineString == "": break
         Qx, Qy, Qz = struct.unpack('fff', lineString)  # unpack binary data
         numberOfEvents = numberOfEvents + 1
         if (numberOfEvents % 100000) == 0: print '\rEvent %.3e'  % numberOfEvents,
@peterfpeterson peterfpeterson self-assigned this Jun 3, 2015
@peterfpeterson peterfpeterson added this to the Release 2.4 milestone Jun 3, 2015
@peterfpeterson
Copy link
Member Author

This issue was originally trac ticket 6120

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