Note: This is essentially a copy of the "Feb beamtime instructions" page, but using/testing scripts in beamtime_september_1_2024 git branch.
Anything struck-through has not been tested.
Noise, bad pedestal
To assess noise in keV:
python CalcNoiseAndMean.py -r 91 -e rixx1005922 --special regionCommonMode,slice --label common_testforSept
This calculation needs to be multiplied by 2 to handle the bit shift.
To make a fake pedestal: python CalcNoiseAndMean.py -r 91. If 'CommonMode' is not in special it reverts to raw.
Tested python CalcNoiseAndMean.py -r 91 -e rixx1005922 --label testforSept and it was successful.
More fakePedestal info at Procedure for cluster-based gain analysis while the calib db is down or pedestals are bad
Standard pedestal
(No evskip 6000 and events 100k unless we're taking 6k + 2k events)
epix10ka_pedestals_calibration -k exp=rixx1003721,run=407 -d epixhr --evskip 6000 --events 100000
epix10ka_deploy_constants -k exp=rixx1003721,run=407 -d epixhr -D
Check for deployed pedestal:
python nonBasicScript.py rixx1003721 407
This prints out various sorts of information.
Timing scan
sbatch -p milano --nodes 10 --ntasks-per-node 10 --account lcls:rixx1005922 --wrap="mpirun python -u -m mpi4py.run TimeScanParallelSlice.py -r 82"
python MapCompEnOn.py -f $OUTPUT_ROOT/scan/TimeScanParallel__c0_r82_n666_part0.h5 → "OSError: Unable to open file (truncated file: eof = 96, sblock->base_addr = 0, stored_eof = 2048)"
which computes the Onset, the Onset of CompEnOn and the length of a transfer function for each pixel. The first figure displays the map of these 3 parameters and this map is clickable in order to see each pixel's transfer function in a separate window. Close the figures to stop the program. The picture of the maps is saved here: /sdf/data/lcls/ds/rix/rixx1003721/results/scan/ (.png format)
→ and click on the maps in order to plot the transfer function of pixel selected
SinglePhotons
To estimate the occupancy, do e.g.
python simplePhotonCounter.py -r 101 -e rixx1005922 --fakePedestalFile $OUTPUT_ROOT/dark/CalcNoiseAndMean_mean_common_testforSept_r91_step0.npy
If you have a sensible pedestal, no need to use fakePedestalFile flag. Else use flag after doing CalcNoiseandMean
sbatch -p milano --nodes 10 --ntasks-per-node 10 --account lcls:rixx1005922 --wrap="mpirun python -u -m mpi4py.run SimpleClustersParallelSlice.py -r 123 --fakePedestalFile $OUTPUT_ROOT/dark/CalcNoiseAndMean_mean_common_testforSept_r91_step0.npy"
Eventually we'll want to have specialized cluster cuts for all modes, but for now check that the seedCut in SimpleClustersParallelSlice.py is about 0.5 photons.
When all the runs are done, you can go to the rix directory and run e.g.
python AnalyzeH5.py -r 123 -f $OUTPUT_ROOT/lowFlux/SimpleClusters__c0_r123_n666.h5
python runAnalyzeH5.py /sdf/data/lcls/ds/rix/rixx1003721/results/lowFlux 384 SimpleClusters 384,385,386,387,388,389This makes plots and .npy labelled run 384 using the SimpleClusters analysis for the listed runs.Let me know if this makes sense and works for you. At the end you can do e.g.display ../lowFlux/*384*285*62*pngdisplay ../lowFlux/*384*gain*png
LinearityScans
python LinearityPlotsParallelSlice.py -r 84 -e rixx1005922 --label testforSept
python LinearityPlotsParallelSlice.py -r 84 -e rixx1005922 --label testforSept -f $OUTPUT_ROOT/scan/LinearityPlotsParallel_testforSept_c0_r84_n1.h5
Currently configuring some behavior using
self.saturated = [True, False][0]
self.residuals = [True, False][0]
self.profiles = [True, False][0] ## to get unbinned plots, turn this off
self.seabornProfiles = [True, False][1]
To analyze the .npy file and make maps of slopes, fit r**2, ..., and slope ratios:
python analyze_npy.py $OUTPUT_ROOT/scan/LinearityPlotsParallel_r84_sliceFits_testforSept_raw.npy → "TypeError: Invalid shape (3, 192, 13) for image data"
display ../scan/LinearityPlotsParallel_r325_sliceFits_residualTest2_raw_g1slope_g0slope_ratio_map_and_histo.png
Examples of commands that we are running:
Analysis of a TimeScan:
sbatch -p milano --nodes 10 --ntasks-per-node 10 --wrap="mpirun python -u -m mpi4py.run TimeScanParallelSlice.py -r 444 -t 100" OR python TimeScanParallelSlice.py -r 444 --threshold 0
python MapCompEnOn.py -f ../scan/TimeScanParallel_c0_r444_n1.h5
Pedestals:
epix10ka_pedestals_calibration -k exp=rixx1003721,run=448 -d epixhr --evskip 2000 --events 100000
Deploy the pedestals:
epix10ka_deploy_constants -k exp=rixx1003721,run=448 -d epixhr -D
Check that they are deployed (the mean is):
python nonBasicScript.py rixx1003721 448
(Mean should be around 700 or 800)
For linearity scan:
python LinearityPlotsParallelSlice.py -r 453
python LinearityPlotsParallelSlice.py -r 453 -f ../scan/LinearityPlotsParallel_c0_r453_n1.h5 --label fooBar
python analyze_npy.py ../scan/LinearityPlotsParallel_r454_sliceFits_fooBar_raw.npy
To check the occupancy rate:
python simplePhotonCounter.py -r463 --special slice
To plot stuff vs time:
python EventScanParallel.py -r 457
Single photon:
python runAnalyzeH5.py /sdf/data/lcls/ds/rix/rixx1003721/results/lowFlux 470 SimpleClusters 468,469,470
python AnalyzeH5.py -r 470 -f /sdf/data/lcls/ds/rix/rixx1003721/results/lowFlux/SimpleClusters_c0_r468_n1.h5,/sdf/data/lcls/ds/rix/rixx1003721/results/lowFlux/SimpleClusters_c0_r469_n1.h5,/sdf/data/lcls/ds/rix/rixx1003721/results/lowFlux/SimpleClusters_c0_r470_n1.h5