There is a understandably a certain amount of confusion as to what constitutes Open GENIE itself and what is effectively provided for users of the ISIS facility who are upgrading from the GENIE-V2 program. This section of the reference manual documents routines and facilities which have been added to Open GENIE for users of GENIE-V2, they are in general not essential to using Open GENIE but may be a convenient starting point for accessing single spectra/scan data. Several of the standard Open GENIE commands commands also work in concert with these commands to aid compatiblity. For example, the Get() command will still take notice of a default input file selected using the GENIE-V2 disk, directory, instrument and extension defaults.
The Genie I/O system maintains several internal variables that control:
![]() | The current input file |
![]() | The current output file |
![]() | The current disk |
![]() | The current directory |
![]() | The current instrument |
![]() | The current file extension |
Current values may be viewed by using Show() commands, and changed by using the Set() commands.
The GENIE-V2 compatibility commands are listed below.
Assign | Select a run for input by giving the ISIS run number |
Cfn | Construct the full filename from run number and defaults |
Groupbins | Groups histogram bins by averaging contents |
Jump | Similar to the System() command. |
Keep | Similar to the Hardcopy() command. |
S | Identical to the Get() command. |
Scatmode | Return GENIE-V2 Energy mode description |
Set | Set user defined defaults |
Setpar | GENIE-V2 style parameter setting for the Units() command |
Show | Show user defined defaults and system variables |
Select a run for input by giving the ISIS run number
ASSIGN | p1=Integer | Selects the default run for input with the S() command. |
example:
# Select run 2004 and read in a spectrum >> Assign 2004 >> w=s(2) # 2nd Spectrum
Note: Assign nnn is equivalent to Set/File/Input Cfn(nnn)
The assign command is designed to allow a shorthand of specifying the ISIS run number to select the input file to read from. Essentially it concatenates the defaults for disk, directory, instrument and extension and then makes the resultant file the default file. It is based on the Cfn() command.
P1 (Integer)
An existing ISIS run number. Before this can make sense, the disk, directory, instrument and extension defaults must have been set up with the appropriate Set() commands.
Construct the full filename from run number and defaults
CFN | [number=Integer] [name=String] | Construct a full path name for the given run or file number. |
example:
>> Set/Disk "IRIS$DISK0:" >> Set/Dir "[IRSMGR.DATA]" >> Set/Inst "IRS" >> Set/Ext ".RAW" >> printn Cfn(345) IRIS$DISK0:[IRSMGR.DATA]IRS00345.RAW >> printn Cfn("special.dat") IRIS$DISK0:[IRSMGR.DATA]SPECIAL.DAT
Note: Cfn() adds the appropriate number of 0s for ISIS raw file names.
The Cfn() function provides the formatting necessary to convert between integer run numbers and full file names by making use of previously set defaults. The run number conversion is ISIS file name specific however using Cfn() with a file name is general (note that on Unix systems, there is no need to specify the Disk default).
Number (Integer)
Integer run number which is automatically converted to a zero padded string before concatenation into a file name.
Name (String)
A complete filename but without any path (ie Disk/Directory) specification.
RESULT = (String)
A fully constructed file name which be used to access the data.
Groups histogram bins by averaging the bin contents.
GROUPBINS | wksp=Workspace nbin=Integer [undef=Real] | Group bins in a GENIE-V2 format workspace. |
GROUPBINS() | xarray=Realarray yarray=Realarray earray=Realarray nbin=Integer [undef=Real] | Group bins in a spectrum given X, X, and E arrays. |
example:
# Group the bins in a workspace by tens. >> work = s(1) >> Groupbins work 10 undef=0.0
Note: Undef gives a value to assume when undefined elements are met during the averaging process.
The Groupbins() function provides a way of reducing (in a fairly simple manner) a spectrum with large number of bins. The process is a simple and averages every "nbin" bins by replacing the group of bins with a single new bin. The process is less sophisticated than the Rebin() command and is usually used before displaying a large spectrum graphically to achieve a degree of smoothing.
The first form of the command takes a workspace and modifies the binning to return a re-binned result or to change the original workspace.
The second form of the command takes X, Y, and E data arrays where the E and Y arrays are of the same length and the X array is one element longer (for the extra bin boundary). The result is a workspace containing just the rebinned X, Y and E arrays. The original arrays are unaffected.
Wksp (Workspace)
Any workspace W containing a histogram stored in arrays in W.X, W.Y and W.E. Bin grouping does not work on a two dimensional workspace.
Nbin (Integer)
Number of bins to group together.
Undef (Real) [ default = 0.0 ]
Because Open GENIE allows arrays to contain undefined elements, it is possible that the user may wish to set any undefined elements to a specific value before the bin grouping is carried out (usually zero).
Xarray, Yarray, Earray (Realarray)
These are the three arrays representing the histogram to be grouped. The Xarray parameter specifies the histogram bin boundaries, the Yarray parameter the data values and the E array parameter the Error values for the Y array.
RESULT = (Workspace)
Either the bin-grouped input workspace or a new workspace created to hold just the histogram arrays. Which ever form of the command is used, the resultant workspace will have X, Y and E fields.
Similar to the System() command.
JUMP/S | acommand=String | Execute one operating system command |
JUMP/P | Create an operating system session within Open GENIE |
example:
# Use Jump/s to print a file >> Jump/S "print/q=sys$lsr0 genie.ps"
Note: For new programs use the System() command.
This executes a single operating system command (eg "print") from within Open GENIE. Jump does not return a status so it is preferable to use the System() command.
Acommand (String)
The command and parameters (if any) to execute.
Jumps of of Open GENIE into a terminal session but keeps Open GENIE running in the background. To return to Open GENIE type "exit" on Unix or "logout" on VMS.
The keep command is no longer supported. Use Hardcopy() for saving graphics and the Getcursor() and Asciifile() commands for retrieving and storing peak location data.
The Keep/Hardcopy command has been superceeded by the Hardcopy() command for saving graphics.
The other keep commands (originally used for storing peak information) can now be specified as simple procedures using the Getcursor() command to get the co-ordinate data and the Asciifile() command to write the data in any format into an ASCII formatted file.
Get data, now identical to the Get() command. See Get/Help
The S() command now behaves identially to the Get() command but it is kept as an alias for consistency.
Return GENIE-V2 Energy mode description
SCATMODE | [emode=Integer] | Returns a string giving the meaning of the emode value. |
example:
# Get a description from an emode value of 1 >> printn Scatmode(1) inelastic (direct geometry)
Simply provides a textual description to translate the numeric value of this parameter.
Emode (Integer)
Emode value (0, 1 or 2)
RESULT = (String)
String description of the instrument energy mode.
Set user defined defaults.
SET/DISK | value=String | Select the default disk |
SET/DIR | value=String | Select the default directory |
SET/INST | value=String | Select the default instrument short name |
SET/EXT | value=String | Select the default file extension |
SET/FILE [/INPUT] [/OUTPUT] |
value=String | Set the default input or output files |
example:
# Change the file for saving data to >> Set/file/output "Mydat.in3"
Note: Set/File/Input is the default for Set/File
Allows selection of the default file for input or ouput. This new Open GENIE command overrides the older commands listed below which set parts of the path individually. The full pathname for the file must be supplied when Set/File is being used but once set, both the Get() and Put() commands will accept the Input/Output files as defaults.
/Input
Sets the default file for input
/Output
Sets the default file for output
Value (String)
The full pathname for the default input or output file.
Sets the default disk for the input file. This is not needed on Unix systems but can be useful on VMS or Wiindows/NT.
Value (String)
The full disk name (or disk logical name on VMS - eg "USER$DISK:" )
Sets the default directory for the input file.
Value (String)
The full directory path for the file. (e.g. [TFXA.DATA] on VMS or /home/user/bob/ on Unix)
Sets the default instrument short name. This is an ISIS specific three letter abbreviation for the instrument name which constitutes part of the file name.
Value (String)
The instrument short name (e.g. IRS)
Sets the default file extension for the input file. This is not needed on Unix systems but needs specifying on VMS.
Value (String)
The full file extension (e.g. ".RAW")
GENIE-V2 style T-O-F parameter setting for the Units() command.
SETPAR | wksp=Workspace [l1=Real] [l2=Real] [tt=Real] [em=Integer] [ef=Real] [d=Real] [t=String] | Set time of flight parameters |
[/R] | Take angles to be values in radians |
example:
# Set a value of two-theta that was not in the raw data file >> w = s(1) >> Setpar w tt=50.0 >> wd = Units:d(w)
Note: Could probably be done more easily by assignment (i.e. w.twotheta = 50.0)
The Setpar() command emulates the GENIE-V2 command which set Time-of-Flight parameters for a workspace so that the Units() command could be used. Open GENIE behaves differently, in that it will read the parameters from a data file automatically when reading spectra. Setpar() can be used however to fix parameters which had an incorrect or default value in the raw file. Note that the problem is trivial in Open GENIE anyway because the correct values can simply be assigned to the appropriate workspace field by using GCL (as in the note above).
/R
Interpret the two theta angle as a value given in radians.
L1 (Real)
Primary flight path (m)
L2 (Real)
Secondary flight path (m)
Tt (Real)
Two theta angle in degrees by default.
Em (Integer)
Selects the energy mode of the instrument affects how the "Ef" fixed energy parameter is interpreted by the Units() command.
0 = Elastic
1 = Inelastic (Direct geometry)
2 = Inelastic (Indirect geometry)Ef (Real)
Fixed energy value (meV)
D (Real)
The hold off time (delta) in microseconds.
T (String)
Workspace title string.
Set user defined defaults and system variables.
SHOW/DEFAULTS | Show all I/O defaults | |
SHOW/PAR | wksp=Workspace | Show parameters set by Setpar() |
SHOW/DATA | wksp=Workspace | Emulate GENIE-V2 show data command |
SHOW/CONST | Show all the constants in Open GENIE | |
SHOW/PROC | Show all the procedures in Open GENIE | |
SHOW/TYPE | Show all the types in Open GENIE | |
SHOW/VAR | Show all the variables in Open GENIE | |
[/SYS] | Show system variables as well |
example:
# Check the I/O defaults >> Show/defaults Current default disk = EVS$DISK0: Current default directory = [EVSDATA] Current default instrument = EVS Current default extension = .RAW Current default input = EVS$DISK0:[EVSDATA]EVS00456.RAW Current default output =
Note: The current default input file can be altered by Assign() or Set/File/Input
Shows all the current I/O defaults. Note that the GENIE-V2 disk, directory, instrument and extension defaults will only change the default input file when the Assign() command is used. The Get() and S() commands both use whatever the default input file specifies.
Prints the values set in a workspace by the Setpar() command. This is only kept for compatibility with GENIE-V2, in Open GENIE all values can be printed directly out of the workspace (eg printn work.twotheta).
Wksp (Workspace)
The workspace being inspected.
Emulates the GENIE-V2 "show data" command by printing all the data from the workspace to the terminal screen. If a long workspace is printed to the screen by mistake Control-C can be used to stop the printout! If similar data is required in a file, use the Open GENIE Asciifile/Writefree command.
Wksp (Workspace)
The workspace being inspected.
Display all the constants currently defined within the Open GENIE session (including pre-defined constants such as colours).
/Sys
Show system constants as well (all these begin with an "_")
Display all the procedures currently defined within the Open GENIE session (including their help text)
/Sys
Show system procedures as well (all these begin with an "_")
Display all the workspace types currently defined within the Open GENIE session.
/Sys
Show system types as well (all these begin with an "_")
Display all the variables currently defined within the Open GENIE session.
/Sys
Show system variables as well (all these begin with an "_")