HRPT useful commands stacked in approximately chronological order ==================================================================================== 14/May/2015 09:40 `hsics_help' help for HRPT control commands under perl-library Hrpt::. `hxbu' run the commands from provided buffer or stop current execution ------------------------------------------------ Use: hxbu -s or hxbu -k or hxbu buffername -k to kill the execution and stop sics -s to stop sics. If some xbu is still runing the run will continue use this command only if you are sure you want it... `hix' Yet another interactive SICS client that uses perl-library $ENV{'HOME'}/perl/lib/Hrpt:: if used with arg search for library in arg first hix . will look in ./Hrpt/'; ------------------------------------------------ `hwatch' watch any sics motor ------------------------------------------------ Use: hwatch [-r] space delimited list of motors e.g hwatch chpos a4 a3 or even this hwatch 'el737 values' or that hwatch temperature `sinq' prints the SINQ current each 10 seconds ------------------------------------------------ the command is just a perl oneliner that uses `hwatch'. To see how it works: cat `which sinq` ====================================== SICS tcl-clients http://lns00/sinqwiki/Wiki.jsp?page=Main (M. Koennecke, M. Zolliker) `sea` X-window client of the SeaServer (temperature and not only). `six' command line client to SICS-server ====================================== Data reduction, etc... `hmake': automatic generation of the data files from the raw HRPT data `hmake' creates data files from raw HRPT data performing calibration and spikes correction similar as `hfc' script does. The title strings supplied by the user and the sample temperature for the runs are used as the unique identifiers of the measurement conditions. So in case if you like to identify your measurement condition better you should put all relevant information in the title. For example, wavelength, resolution, pressure, etc. The run numbers with the same experimental conditions can be noncontinuous. The script will find all matching titles and add the runs together. ------------------------------------------------ Usage: hmake [-c] to make datafiles from to last number in automatic update mode. This is a recommended option. Default is 'hrpt_' or hmake makes data in the of numbers, e.g 2014:100-200, and exits. or hmake - makes data out of the last of numbers, e.g -50, and exits. The data reduction includes also additional correction on semishadow from beam reduction at 2theta 160-165 degees. If -c option is specified no 2theta correction is done (not recommended). Examples: hmake 1000 from number 1000 to last measured and updating each 600 seconds. File names begin with 'hrpt_' hmake 1000 ori4_ from number 1000 to last measured and updating each 600 seconds. File names begin with 'ori4_' `killhmake': kills the hmake process(es) running on the same computer ------------------------------------------------- Usage: killhmake will show the running process(es), but will not kill them. Just proposes the command(s) to use for the killing. killhmake -a will try to kill all hmake process(es) automatically. `hstat.pl' returns the statistics for the given dat-file that includes neutron monitor (NM), estimated acquisition time, total number of counts (Sum). ------------------------------------------------ Usage: hstat.pl filename To look at all *.dat files in the current directory use: perl -e 'print "$_ ",`hstat.pl $_` for (<*.dat>)' `hlog' prints the list of measurements in the `hmake' spirit ------------------------------------------------ Usage: 'hlog ' to get log from to last number or 'hlog ' to get log in the , e.g 2014:100-200 or 'hlog -' to get log of the last of numbers, e.g -50 Example: hlog -50 takes last 50 numbers hlog 1000 from number 1000 to last measured `add.pl' generation of data files from range of numbers ------------------------------------------------ Usage: add.pl instrument/year numor1 numor2 Examples: add.pl 2011/hrpt 46691 46727 add.pl 2011/hrpt 46691 46727 2 0.2 10000000 `hrpt2xy.pl' converts all dat-files in HRPT/DMC format in current directoryto xysigma type with themperature inside for funs of winplotr. The xysigma file names are xxx1.dat xxx2.dat ... `hrpt2xy.pl' converts hrpt data files into x_y_sigma-format with correct header, also with temperatures inside, so it can be read by winplotr. The xy-file names are xxx1.dat, xxx2.dat, ... ------------------------------------------------ Usage: hrpt2xy.pl Examples: hrpt2xy All *.dat in current directory will be converted hrpt2xy *.txt Files with given mask will be converted `hradial' status or start stop radial collimator (RC) ------------------------------------------------ Usage: hradial [-t] start/stop Examples: hradial -t 600 start will start RC if it is stopped each 600 seconds hradial will just give the status of RC `hsave_data_hdf' saves HRPT hdf-data file on the fly without stopping the current data acquisition. Use this command only in you exactly know what you are going to do. ------------------------------------------------ Usage: hsave_data_hdf If the second optional argument <title> is provided its will be prepended to the existent title if no <title> is given a default string will be added: on_fly_[timestamp] e.g. on_fly_Wed_Nov_25_13:23:29_2015_ Examples: hsave_data_hdf SAVE_NEW_DATA_ON_FLY first_cycle_ the string first_cycle_ will be prepended to the existent title `hplot.pl' continuously plot the points from hrpt_mot.log or any file given as argument ------------------------------------------------ #=====================================================================================# #30/Apr/2015 11:56 # #The help below is mainly related to the utilities for the instrument scientists, but # #of course these utilities can be used by anyone if needed. # #=====================================================================================# March 11, 2016 `make_cals.pl' takes the argument, which is string of numbers in spirit of `fit' by Markus and add an explicit calibration file according to proper `calist.dat' For example: 'hrpt:2016:1-4,2000:dmc:1-10,hrpt:2010:1-10' is modified to 'hrpt:2016:1[unity.txt],2-4[cal_june1_refined.txt],dmc:2000:1-10[deteff.dat],hrpt:2010:1-10[deteff_rc2_b=0p5_6may10_p.txt]' ===================================== `iofch' <file of range of numbers> prints counts an a function of channel Usage: iofch [-m15] [-o] <file or numbs> [output file] -o prints only ch.no and counts -m specifies number of channels with max intensities to be printed at the end Examples: iofch -m 3 '5424[cal=0]' ===================================== `1hrpt' prints counts for the given channels and summary statistics usage: 1hrpt [-t] [-m] firstN-lastN chan1,chan2,chan3 or 1hrpt -t 'regexp' firstN-lastN,yet_another_number chanM-chanN [print field length] -t filters only the records which title matches regexp -m N merges the number by N -s V print only summary for the noisy channels which sigma is V-times larger than sqrt(I). e.g. 1.1, by 10% Examples: 1hrpt -s 2 -m 3 5424-5438,5446-`lastnum` 1-1600 1hrpt -m 3 5424-5438,5446-5448 1-10 ===================================== `hphs' creates Pulsed Hight Spectrum from HRPT datanumbers measured with different threshold values. -------------------------------------------------- Usage: hphs [-c 20] [-b0.1] [-m 1800] <range of data numbers in sumvar spirit> [prefix] where -b specifies optional binning in Volts, -c 20, e.g. means no spikes correction, but disregards channels with counts more then 20. Usefull if there are some channels with 0 counts... Note that the patterns are normalized to monitor 36000/1000000 for counning by time/NM -m 1800 will override the above default monitor value ===================================== Making data files with `hmake': technical info 31/Mar/2016, 14:46: All redone. The previous versions as explained between ############ are git'ed at dab7f01 (HEAD, refs/heads/new_hmake) before modifications in hfind etc, to unify hf and hfc... Now everything w and w/ 2theta correctionis in hfind -> hfind_.pl ############################# hmake -> /afs/psi.ch/user/p/pomjakushin/bin/upd.pl -> hfindc_.pl -> 9 Jul 2014 ahnc_.pl -> 12 Nov 11:35 ahc -> ahc.pl finally ahc_.pl uses the calibration named as `calib_c.txt' and then performs correction with brcorr.pl Making data files with `hf'. Added Jan'15 binwidth as the last param. But ahn_.pl that does the sum job should be modified, as shown below. `hf' is simply `hfind -100 $@', which in turn is /afs/psi.ch/user/p/pomjakushin/bin/hfind -> hfind_.pl `ah_ $toadd $ARGV[2] $ARGV[4]`; print "done."; # to get merging option. Not always work due to limitations #print "============ah2_ $toadd $ARGV[2] $ARGV[4] $binwidth ========\n"; # `ah2_ $toadd $ARGV[2] $ARGV[4] $binwidth`; print "done."; ############################# ===================================== Makes the calibration data file from raw V- and BG-data numbers or datafiles Usage: makecalib.pl V-numbs/V-filename BG-numbs/BG-filename [muR] [Vradius] [fwhm of RC] defaults for optional parameters are 0.31 4 7 Example: makecalib.pl V.dat BG.dat ====================================== make calibration file. Only the name should be modified in /afs/psi.ch/project/hrpt_data/hrptdoc/calibrations/2014/makecalib.m For example effname0 = ... '/afs/psi.ch/user/p/pomjakushin/fits/hrpt/2014/oct31/cal_38341-38548-38549-38612_mur0p31'; Two calibrations are created: *.txt and *_corr.txt ====================================== 05/Mar/2014 10:38 `xynac' script determines the position of NAC in detector coordinate system from fullprof fit of sysin and sycos from data @1.9A. Then the values of stx and sty corresponding to the position of the sample in the rotation center O_S are calculated as one can see in '/afs/psi.ch/user/p/pomjakushin/bin/nac_off/tomatlab.pl'. If pcr-file is given, no fullprof fit is performed. Just sy[sin,cos] are taken from .out-file, and stx,sty from .dat-file that should be in current directory. --------------------------- Our xy detector coordinate axes -------------- ^ y_D | | x_D ________|_________> <<=========incoming beam \ // 2theta\// // to detector Usage: xynac numors/filename [2theta zero] [1/0 var flag] [1/0 vary a flag] Examples: xynac hrpt:2012:25457-25472 -0.1 1 1 xynac filename.dat -0.1 1 xynac filename.dat xynac filename.pcr ---------------------------------- 10/May/2013 12:47 /afs/psi.ch/user/p/pomjakushin/fits/hrpt/2012/fitfit/plot_sysincos.m latest m-file to plot the stx,sty(xy_D) xynac updated with varriables $O_Sx, $O_Sy ---------------------------------- 09/May/2013 11:03 from now on the latest news are on the top with the time stamp ---------------------------------- `hf': automatic generation of the data files from the raw HRPT data. It is a successor of `ah'. `hf' creates data files from raw HRPT data performing calibration and spikes correction similar as `ah' script does. The title strings supplied by the user and the sample temperature for the runs are used as the unique identifiers of the measurement conditions. So in case if you like to identify your measurement condition better you should put all relevant information in the title. For example, wavelength, resolution, pressure, etc. The run numbers with the same experimantal conditions can be noncontinuous. The script will find all matching titles and add the runs together. Usage: hf NumbersForSumvar <filename_template> <neutron_monitor> where NumbersForSumvar: numers' list acceptable by `sumvar', e.g. 1-10 or 1-100,200,202-300 filename_template: optional filename to be used as a prefix for the datafile names. If empty, no datafiles are produced, but script shows what has been found. neutron_monitor: optional parameter. If present, all data files will be normalized by the same neutron_monitor. It is useful if the data are later used by the software that does not recognize the monitor to compare, e.g., different patterns collected at different temperatures with different monitors. Examples: hf hrpt:2008:131067-132115 hf hrpt:2008:131067-132115 set1_ hf hrpt:2008:131067-132115 set1_ 10000000 ======================================================= ======================================================= 'statmon.pl' print daq threshold, total counts from files with prefix statmon.pl cosmic ---------------- find_chmot.pl a3 1-100 Find changing motor in the sequence of measured numors. Usage: find_chmot.pl 1-100 a3 ----------------- `henfill.pl' shows he or n2 refills in current year henfill.pl 2012 henfill.pl 2012 n2 --------------- ah, ad: scripts for adding HRPT, DMC files ah2: additional 3rd argument is the binning step --------------- statch: Calculate average, dispersion and expected dispersion for all 1600 wires over the given datafile numbers --------------- lastnum, lastnumd: last written file number for HRPT and DMC --------------- hlast, dlast: last <argument> numbers table with `sumvar' --------------- ahs: to subtract an sdditional pattern with the spike background with time-calibration --------------- deteff2dat: deteff.dat to .dat-file for fit --------------- fl: first and last field --------------- fcomma: all spaces to commas --------------- hrpt_det_p.pl, hrpt_det_t.pl: make a table(time) with HRPT detector normalized gas pressure, temperature of electronics `hrpt_det_t2alarm.pl' prints alarms `hrpt_det_t2.pl' time in string format `hrpt_det_t2_watch.pl' same as above but continuously monitors --------------- makesplist.pl: table of file no. and channel no. with spikes. To change something edit the file --------------- makehist_spikes.pl: creates the histogram of spiky channels from the output of `makesplist.pl'. --------------- To get softlimits from the previous year. copy/paste to six: [hrpt@hrpt ~/hrpt_sics]$ cat hrptdf.log | perl -lane 'if (/d1./ && /soft/) {s/^.+://; print}' ==================================================== Obsolete stuff, but still possible to use... ---------------------------- Procedure of determining sysin and sycos (since 2011 we use fullprof to determine them): Latest dir: /afs/psi.ch/user/p/pomjakushin/fits/hrpt/2009/dec_nac_rc/fitfit /afs/psi.ch/user/p/pomjakushin/fits/hrpt/2010/ori4_sch/fitfit pomjakusx5: work/HRPT_RandD/summary_sycosis_pot_smpch_etc_2009/nac_oct/fp_fits/ * nac 6mm powder is collected at several a3-positions with 1.9A. * There is global fit when all peak shifts for all a3-values are fitted together to the formula y(2t)= y0+y1*cos(2t)+y2*sin(2t). ** step 1. nac.perl (DOIT_g subroutine, file doit_pos_g.pm) script fits all the patterns indicated in the nac.perl to extract 51 nac diffraction peak positions. The initial values are taken from the '.fit3' files with the names 1.fit3, 2.fit3, ...51.fit3. Redirect output to file 'out_g.txt'. ** step 2. The output is plugged in the matlab script 'main_g.m' that gives the values of shift along the beam (x) and perpendicular to the beam (y) function y = t2_scs_g(a3,p) lambda=1.886; global dc0; %% t2tr=2*asin(lambda./(2*dc0*p(4))); p(3)=p(3)*pi/180; %y = p(1)+p(2)*cos(t2tr)+p(3)*sin(t2tr) + t2tr*180/pi; y = p(1)-p(2)*sin(p(3)+a3-t2tr) + t2tr*180/pi; * non-global fit. ** nac.perl (DOIT subroutine, file doit_pos.pm) script fits every pattern indicated in the nac.perl to extract 51 nac diffraction peak positions. Then the matlab script ('main.m') is called (from inside doit_pos.pm) that fits the peak positions to the sysin-sycos and outputs "sys=sprintf('%f %f %f %f %f %f %f %f %f \n',chi2,ss,sc,sse,sce,2t0,err,a0,err" function y = t2_scs(dc0,p) lambda=1.886; %% t2tr=2*asin(lambda./(2*dc0*p(4))); y = p(1)+p(2)*cos(t2tr)+p(3)*sin(t2tr) + t2tr*180/pi; example: hrpt/2009/42342-42361 0.008 8.278814 2.110925 0.466268 0.090452 0.078391 -0.030100 0.000000 10.253187 0.000222 ** The output is processed ("manually") by fitsys.m script that shows also the graphic result ====================================================== Fullprof fits to determine sysin, sycos, etc. are in, e.g., /afs/psi.ch/user/p/pomjakushin/fits/hrpt/2009/nac_air_october+lsch/fp_fits/doit.perl -------------- V. Pomjakushin, 2016