|
|
The standard Open GENIE GET procedure has been modified to access IPNS data directly. It allows access to all items stored in IPNS run files that have been allocated a name, including detector angles, time fields, run titles and other header information. Individual subgroups, or arrays of subgroups can be read either into a single GENIE workspace (one- or two-dimensional) or an array of workspaces. This IPNS version works with the same parameters and qualifiers as the regular Open GENIE GET procedure, which is called if the file is not recognized as an IPNS run file.
The IPNS GET procedure is initialized in the generic GENIEINIT.GCL file, available at IPNS_GENIE:GENIEINIT.GCL. Copy IPNS_GENIE:GENIEINIT.GCL to your own directory and define the following logical:
This will be run every time you start Open GENIE, and may be edited to include further initialization. For example, you can define a default directory and instrument name so that the file names for each run can be constructed from the run number alone e.g.$ DEFINE GENIE_GCL_INIT your_own_dir:genieinit.gcl
You can also use the initialization file to load your own Open GENIE procedures or define aliases to commands that you regularly use.set/inst "LRMECS" set/dir "LRMECS_DATA:"
| GET | Read data and parameters from IPNS run file |
| SLICE | Produce one-dimensional slice from two-dimensional workspace |
| D2D | Plot a two-dimensional workspace as a color plot |
This is the standard procedure for accessing an IPNS run file. It will return the value of any named object, numbered subgroup or range of subgroups, or time field values depending on the type of the requested item.
Item whose value is requested. This may be a character string, integer, or integer array.
The value of the named IPNS item is returned as a scalar or array e.g.
>> printn get("NAM",2794)
Iverson/Carpenter
The corresponding subgroup is returned as a workspace. e.g.
>> sample=get(10,2794) >> printn sample.title Methane 30K 500meV E0@270Hz T0@150Hz
The array defines a list of subgroups that are returned as a single two-dimensional workspace (default), an array of one-dimensional workspaces (if the /ARRAY qualifier is given), or a single one-dimensional workspace containing a sum of all the subgroups (if the /SUM qualifier is given). It is also possible to define the array using a standard Open GENIE "Interval" e.g. 1:10 or 3:101@2. If the time field of a subgroup does not match the time field of the first subgroup, it will not be included in the 2D array.
>> sgl=Dimensions(148)
>> fill sgl 3 1
>> printn sgl
[3 4 5 6 7 ...] Array(148 )
>> sam2d=get(sgl,2794)
>> printn sam2d.x
[900.0 901.0 902.0 903.0 904.0 ...] Array(1101 )
>> printn sam2d.y
[2.0 2.0 1.0 0.0 1.0 ...] Array(148 1100 )
>> samtot=get:sum(3:get("NSG"),2794)
>> printn samtot.y
[243.0 229.0 254.0 204.0 220.0 ...] Array(1100 )
Definition of the input source; either the name of the run file or its run number. This parameter may be omitted if the default input file has been defined by the SET/FILE command e.g.
>> set/file "lrmecs_data:lrcs3009.run"
The parameter is the name of the IPNS run file. Sufficient information must be supplied to define the entire directory path.
The parameter is the IPNS run number. The full file name is constructed using the instrument and data directories defined by the SET/INST and SET/DIR commands. e.g.
>> set/inst "LRMECS"
>> set/dir "LRMECS_DATA"
>> printn get("NDE",3009)
150
Number of histogram. If this is omitted, it defaults to 1.
Number of the time field to be returned as a workspace. This is only used if item = "tf" e.g.
>> printn get("tf",2794,tf=1)
Workspace []
(
nch = 502
time_max = 1000.0
ntc = 500
width_range = 32767
time_width = 1.0
emission_delay = "false"
constant_delay = "true"
time_min = 500.0
focussed = "false"
)
If given in conjunction with an "item" of type IntegerArray, this returns an array of one-dimensional workspaces, each containing a subgroup from the item list. e.g.
>> printn sgl [30 31 32 33 34 ...] Array(10 ) >> sample=get:array(sgl,2794) >> printn length(sample) 10 >> printn sample[5].L2 2.5009000301361
If given in conjunction with an "item" of type IntegerArray, this returns a single one-dimensional workspace, containing the sum of all the subgroups from the item list. If the time field of any subgroup does not match the first subgroup, it will not be added to the sum. Note that the instrumental parameters are averaged (including those eliminated from the sum). e.g.
>> sample=get:sum(30:39,2794) >> printn sample.twotheta 17.7000045776367
This is a procedure that will return a one-dimensional workspace containing a slice from a two-dimensional workspace previously read by the GET procedure. The direction of the slice is defined by the qualifiers. The workspace is summed in the orthogonal direction
Two-dimensional workspace from which a slice is to be plotted. The SLICE procedure assumes that this workspace contains the following one-dimensional arrays.
| w2d.y | Two-dimensional array of intensities. The first dimension is a function of subgroup number or two theta; the second dimension is a function of time-of-flight. |
| w2d.x | One-dimensional array containing the time-of-flight. |
| w2d.sg_no | One-dimensional array containing the subgroup numbers. |
| w2d.twotheta | One-dimensional array containing the two-theta or phi values. |
Minimum value of the range from which the slice is to be taken. The units depend on the qualifiers.
Maximum value of the range from which the slice is to be taken. If this is not specified, then the slice is taken at CUT_MIN. The units depend on the qualifiers.
The range parameters, CUT_MIN and CUT_MAX, are in time-of-flight. The resulting workspace has the subgroup numbers as the x-axis e.g.
>> printn w2d.y [0.0 0.0 0.086752651435001 0.0 0.0 ...] Array(148 562 ) >> printn (slice(w2,8000,9000)).y [188.773769522562 195.612792585923 194.921390873317 209.71188583658 243.18835694 4539 ...] Array(148 ) >> printn (slice(w2d,8000,9000)).x [3.0 4.0 5.0 6.0 7.0 ...] Array(148 )
The range parameters, CUT_MIN and CUT_MAX, are in time-of-flight. The resulting workspace has the two-theta or phi values as the x-axis e.g.
>> printn w2d.y [0.0 0.0 0.086752651435001 0.0 0.0 ...] Array(148 562 ) >> printn (slice(w2,8000,9000)).y [188.773769522562 195.612792585923 194.921390873317 209.71188583658 243.18835694 4539 ...] Array(148 ) >> printn (slice(w2d,8000,9000)).x [-7.19999980926513 -6.59999990463256 -6.0 -5.40000009536743 -4.80000019073486 ...] Array(148 )
The range parameters, CUT_MIN and CUT_MAX, are in time-of-flight. The resulting workspace has the Q-values as the x-axis (NOT YET IMPLEMENTED)
The resulting workspace has the time-of-flight as the x-axis. The units of the range parameters, CUT_MIN and CUT_MAX, are subgroup number by default, but may be two-theta (or phi) or Q if this qualifier is given with /PHI or /Q respectively e.g.
>> printn (slice:t(w2,3,10)).x [6500.0 6508.0 6516.0 6524.0 6532.0 ...] Array(563 ) >> printn (slice:t(w2,3,10)).y [0.637061952331769 0.262059276675889 0.637688774353156 0.092270185182039 0.28009 4441410396 ...] Array(562 ) >> printn (slice:t:phi(w2,20.0,40.0)).y [0.77239666272815 0.791326812375383 0.130660857187333 0.522141649762547 0.325480 448311051 ...] Array(562 )
This command will plot a two-dimensional workspace as a color plot on a square root (default), logarithmic or linear scale.
Two-dimensional workspace to be plotted. The D2D procedure assumes that this workspace contains the following one-dimensional arrays.
| w2d.y | Two-dimensional array of intensities. The first dimension is a function of subgroup number or two theta; the second dimension is a function of time-of-flight. |
| w2d.x | One-dimensional array containing the time-of-flight. |
| w2d.sg_no | One-dimensional array containing the subgroup numbers. |
| w2d.xlabel | Character string defining the plot's x-label. |
| w2d.title | Character string defining the plot title. |
Maximum value of the y-values to be plotted. If omitted, the scale is determined automatically.
The colors are selected according to a square root intensity scale. This is the default.
>> w2d = get(3:150,3124) >> d2d/sqrt w2d.y 100.0
The colors are selected according to a square root intensity scale.
The colors are selected according to a square root intensity scale.
Comments to: Ray Osborn <ROsborn@anl.gov>
Revised: Friday, February 19, 1999