11. DSSC Configuraiton Files Generation

11.1. Environment Setup

Create a folder in your office PC mkdir dsscConfigFileGenerator go into the folder cd dsscConfigFileGenerator and clone the following libraries:

git clone https://git.xfel.eu/samartse/dsscdetlib

git clone https://git.xfel.eu/samartse/dssccaldata

git clone https://git.xfel.eu/samartse/dssccalibratio

go to the dsscdetlib and run

pip install . --upgrade -r requirements.txt

once the installation is done, go back to the head folder (dssfConfigGenerator) and launch jupyter by:

jupyter notebook

in case if you work remotely open ssh tunnel from your home office pc to your office pc to access jupyter:

ssh -L XXXX:localhost:XXXX exflqr****

where exflqr*** hostname of your office PC.

now on your office pc run jupyer with port forwarding:
jupyter notebook --port=XXXX
Open this file by the jupyter notebook:
dssccalibration/notebooks/GeneratePixelGainConfiguration.ipynb

In the first cell, the main input parameters are defined, inline comments are explaining the meaninng of the variables:

PhotonEnergy = 2200.0  # this is photon energy in electron volts

photons_per_bin = (1.0/5.0) # this is gain constant, 1/5 means that a single \
                            # photon with 2200 electron volt energy will produce 5 bins.

op_frequency = 2.25 # options 2.25 or 1.125 (MHz)

integration_time = 105  # Integration time in terms 700 MHz clock ticks,
                        # i.e. price of one thick is by 1.44 ns
                            # options at 4.5   MHz: 35
                            # options at 2.25  MHz: 35, 70, 80, 105
                            # options at 1.125 MHz: 35, 70, 105, 140, 210

Trimmed = True   # All pixels will be trimmed according to the gain obtained by Pulxar
                 # callibration data. In case of False flat gain, configuration will be
         # produced, i.e. setting of all pixels will be equal.

fine_trim_targ = 12  # Iramp parameter, possible range is (0-63), but should not exceed 20 due to ADC limits

RmpCurrDouble_settings = [0] # current dounle parameteres, possible lalues are 0 or 1.
                             # 1 works for low gain and 0 for high gain

CSA_Resistor_settings = [3,5] #[6] # all settings: [1,2,3,4,5,6,7]

# Rest of the variables bellow should not be changed:
proc_channels = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]

FCF_EnCap_settings = [1,2,3,4,5,6,7,8,9,11,15] # all settings: [1,2,3,4,5,6,7,8,9,11,15]

CSA_FbCap_settings = [0,1,4,5,6,7] # all settings: [0,1,4,5,6,7]

bins_dynamic_range = {4.5:250, 2.25:500, 1.125:500} #required for CSA max charge estimation

default_integr_time = {4.5: 35, 2.25:80, 1.125:80}

CSA_Vlim = 0.3

FCF_Vlim = 1.6

11.2. Config file generation

After adopting the above parameters, run the notebook. It takes up to 2 minutes. A new folder will be created pyGenConfigData/ under the main folder dsscConfigFileGenerator.

The pyGenConfigData/ will contain any newly generated configuration file under a specific folder. These specific folder names contain photon energy, gain contact and integration time. For example: GenConf_TG2.2727_nG29_trimm_f2.25_intgr150/. Under the gain folder, pixel registry and sequencer files are organized by quadrants. The folder now can be copied on the instrument Karabo server and deployed for every PPT device.