Focusing GEM data

Hi,
I am new to Mantid and have a problem focusing raw data collected at GEM. The script I used in the past was something like:

from SET_env_scripts2_gem import *
expt=CRY_ini.files(“GEM”,RawDir=“x:/cycle_/”)
CRY_focus.FocusAll(expt, “78000”)

This used to work ok at ISIS but never worked on my MAC. Could you please let me know what I need to do. The information on the Mantid website are overwhelming and it would be greatly appreciated if you assume no background in this area.

Just wish to add that the Module script2 cannot be found anywhere which I think is needed to run the python code above, at least as per the earlier versions of Mantid!

Kind Regards

Dear totscat,

That script seems to use the old versions of the powder diffraction scripts. These used to work only
at ISIS because they import some files directly from the ISIS network drives. They haven’t been supported in recent versions of Mantid for several years, so they can be used only on some machines that still use fairly old Mantid versions. Also, you need a “.pref” file to set up a number of parameters.

In the latest release the scripts are included with Mantid, and in principle they should work anywhere. With Mantid 3.6 the way you use the powder diffraction scripts has changed slightly. You need to do something like:
import cry_ini import cry_focus DIR = "C:\MantidPowder" # here you'd put your "X:/cycle_/", etc. expt = cry_ini.Files('GEM', RawDir=DIR, inputInstDir=DIR) expt.initialize('Cycle_15_2', user='Mantid_tester', prefFile='UserPrefFile_15_2.pref') cry_focus.focus_all(expt, "79514")

You can find detailed documentation here: http://docs.mantidproject.org/nightly/api/python/techniques/PowderDiffractionISIS-v1.html. That document is a bit lenghty and intimidating at first, though. If you give us your details (@shahroz , @FedeMPouzols ) we can send you a couple of short documents with simpler, more end-user oriented explanations on how to define your pref file, etc. which are usually given to users of POLARIS.
Please feel free to contact us directly via this Forum or in the Mantid office.

With the latest version of Mantid 3.6, you would no longer required to import anything else other than import cry_ini and import cry_focus.

The script which could be passed to Mantid python script window, would look something along the lines of this:

import cry_ini
import cry_focus

Dir = "Enter your directory to raw files here"
InstDir = "Enter your instrument directory here"

expt = cry_ini.Files("GEM", RawDir=Dir, inputInstDir = InstDir)

expt.initialize("Enter cycle folder name", user="Enter user folder name ", PrefFile= "Enter pref file name")

expt.tell()

cry_focus.focus_all(expt, "78000")

However some of the parameters are optional depending on the structure of your folders, which you should understand by going over the ISIS Powder Diffraction documentation.