This program regroups data for the D4 instrument (version D4c). Each numor file for D4c corresponds to one counting acquisition (usually defined by a monitor preset) and one angular position for the 9-detector ensemble. The counts in a numor file are identified by detector and detector cell number. After reading in one or several numor files, d4creg regroups or rebins the counts of all the 9*64 detector cells so as to produce one diffractogramme file (*.reg) giving counts as a function of the scattering angle 2theta.
d4creg is written in C, uses a command-line input syntax, and runs on most Linux (SuSE or Ubuntu) workstations at the ILL, including d4lnx of course. The program can be run by anyone logging in as "d4", even for remote logins across the ILL/ESRF firewall.
prompt> d4creg [-h(elp) -b -u -t -o file.out -e file.eff -d file.dec -i file.ign -a anglebeg anglefin anglestep -w wavelength -q qbeg qfin qstep
-z zeroangle -x minangle maxangle -9 -C -Q -n normflag -V] numorbeg [numorfin dets disk instr]
where [args] are optional and the defaults are:
-o numorfin.reg - e effd4c.eff -d dec.dec -i ign.ign
-z 0.0 -n 1000000 numorfin=numorbeg dets=9
disk=/net/serdon/illdata/data/d4 instr=.null.
prompt> d4creg -o sample.reg 175568 175579
This command produces a three-column output file (sample.reg), with 2theta, intensity and error, after regrouping numors from 175568 to 175579.
prompt> d4creg -z 0.5 -o sample.reg 175568 175579
This command produces a diffractogramme where the 2theta values are corrected by the zero angle, i.e. 2theta= 2theta_read - 0.5
prompt> d4creg -z 0.5 -w 0.495 -o sample.qreg 175568 175579
This command produces a diffractogramme as a function of Q. Data are corrected by zero angle and then converted into Q using the Bragg law and the neutron wavelength (0.495 A).
prompt> d4creg -help
This command lists the help file.
prompt> d4creg 141414
This command regroups the single numor file "141414" using the default efficiency file "eff.eff", the default ignore file "ign.ign", and the default output filename "141414.reg".
prompt> d4creg -e efftest.eff -o sample1.reg 141414 141455
This command regroups a range of numor files using a particular efficiency file and a particular output filename.
prompt> d4creg -b -o alldata.reg 141414 141465 < extra.numors
This command regroups 4 separate ranges of numors files together. The file "extra.numors" contains the 4 following ASCII lines:
142233 142266
142297
147822 147855
.
Note the dot at the end of the file.
prompt> d4creg -u -o samp1.reg 79411 79450
Execution: prompt> d4creg (+ command-line options)
Input: command-line options
D4c ASCII numor files
Output: 3-column ASCII output file of the "regfile" format:
scattering_angle counts sigma
taking into account the detector efficiencies and possible bad cells, and optionally taking into account the zeroangle of the detectors. The counts and sigma columns are normalized to either monitor counts or time. The sigma column is calculated by first taking the square root of the detector-efficiency-corrected counts, and then applying any normalization factors in parallel with the counts column -- i.e. sigma always remains the true counting statistics standard deviation.
By default, d4creg produces one output file having ".reg" as a suffix and which is a concatenation of 9 output files, one for each detector. Specifying the -9 option of d4creg will produce all 10 output files:
"outfile.reg1" (regrouped data of detector 1)
"outfile.reg2" (regrouped data of detector 2)
"outfile.reg3" (regrouped data of detector 3)
"outfile.reg4" (regrouped data of detector 4)
"outfile.reg5" (regrouped data of detector 5)
"outfile.reg6" (regrouped data of detector 6)
"outfile.reg7" (regrouped data of detector 7)
"outfile.reg8" (regrouped data of detector 8)
"outfile.reg9" (regrouped data of detector 9)
"outfile.reg" (simple concatenation of the above 9 files)
Comments are included at the top of the output files (comment char = #) which describe how, when and by whom the file was produced. The regfile format is completely compatible with the "gnuplot" plotting program and with any of the "hfit" fitting programs like "polyfit" and "d4nifit".
The user of d4creg does not have to worry about where his ASCII numor files are -- d4creg automatically searches the data disks of the present and previous reactor cycles, trying both to uncompress numor.Z files and not to uncompress numor files, since either one might be the case for data of previous reactor cycles.
Numor files which are older than the previous reactor cycle (i.e. < data-1) must be regrouped using the "-u" option described below. The numor numbers have been increasing monotonically since D4c came on line in May/June 2000, so there is no problem with duplicate numor filenames. When the -u option is used, d4creg will automatically search all the directories containing compressed or uncompressed data from all previous reactor cycles.
Bad numor files (e.g. due to erroneous detector positioning) can be listed in the ignore file (default: "ign.ign") and will be consequently skipped over by d4creg.
Bad cells can be identified in the efficiency file (default "effd4c.eff") by giving them an efficiency of -1, or in fact any negative efficiency.
The comand-line syntax of d4creg can be displayed by typing only "d4creg" without arguments. The only non-optional argument on the command line is the beginning numor (i.e. a single numor can be regrouped). Note that the hyphen-containing command-line options must come before the numor numbers.
Command line options
- To display the help file:
-help (or simply -h) - To select a particular output filename (default: numorfin.reg):
-o filename
which produces the output file "filename", and also the files "filename1" ... "filename9" when the -9 option is used. - To output not only the concatenated file for 9 detectors, but alsoa separate file for each detector:
-9 - To select a particular efficiency file (default: "effd4c.eff"):
-e efffilename - To select a particular decalage file (default: "dec.dec"):
-d file.dec
The decalage file contains the rangle (relative angle shift) values for each of the 9 D4c detectors. - To set the zeroangle (i.e. direct beam angle) of the 9-detector ensemble:
-z zeroangle - To regroup a discontinous list of numor files (see examples below):
-b (for "broken" input) - To regroup older-than-previous-reactor-cycle numor files:
-u (for "uncompress")
although d4creg tries both uncompressing and not uncompressing. - To select a particular ignore file (default: "ign.ign"):
-i file.ign - To force normalisation:
-n 0 (by 1e6 monitor counts)
-n 1 (by 100 seconds monitor time)
-n <>0,1 (default --> normalisation by acquisition mode per usual) - To NOT do the detector cell deadtime correction:
-t - To specify the incident wavelength (necessary for converting to Q):
-w wavelength (default is 0.0 A) - To convert to Q = 4pi/lambda * sin(2theta/2) WITHOUT binning (default suffix is *.Qreg)
-Q - To truncate data above and below (after zeroangle, rangle, of course): (defaults are -150 deg and +150 deg)
-x minangle maxangle - To bin data by angle (selective binning, no interpolation): (default suffix is *.abin)
-a anglebeg anglefin anglestep - To bin data by Q (selective binning, no interpolation): (default suffix is *.qbin)
-q qbeg qfin qstep - To produce an output file in the (old) FULLPROF format for D4: (default suffix is *.ca)
-f - To produce an output file suitable for input to CORRECT (D4c format): (default suffix is *.adat or *.qdat depending on mandatory binning)
-C
If only -C is specified, the default binning is by angle:
abeg=0.0, afin=140.0, astep=0.01 (deg)
NB: If one specifies both -C and -Q, the output will be in CORRECT format but using a default binning corresponding to the wavelength specified:
0.7 A defaults of qbeg=0.0, qfin=17.0, qstep=0.001 (A^-1)
0.5 A defaults of qbeg=0.0, qfin=24.0, qstep=0.001 (A^-1)
0.35 A defaults of qbeg=0.0, qfin=34.0, qstep=0.002 (A^-1) - To bin with proportional division of a neutron count between neighboring bins, use the program "d4rebin", since d4creg performs only a "selective" binning whereby each neutron count goes into the closest bin, without being divided into two weighted counts.
- To get verbose output (i.e. the output before I abbreviated it):
-V - To produce a monitor time output file (basically obsolete due to the program "d4cget"):
-m
The "dets", "disk" and "instr" options are mostly superfluous and can generally be ignored by the user. The "dets" option can be used when only one detector is taking data, and the "disk" option can be used when the numor files are not located in the usual place. At present, the "instr" option should always be set to a null string (the default) for D4c.
In general, it is advantageous to use particular output filenames, and to put the d4creg commands (along with other commands for processing D4c data) in a Linux/UNIX script file (by convention at D4c, the filenames of these scripts begin with "do_" and they are called "dofiles"). In this way, the user doesn't need to keep typing the 6-digit numors nor continue to remember the numor range for each scan.