Skip to content
Snippets Groups Projects

Feat/dss cimprove master rebasing

Closed Andrey Samartsev requested to merge feat/DSSCimproveMasterRebasing into feat/DSSCdarksImprove
2 files
+ 247
65
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -27,40 +27,40 @@
"source": [
"cluster_profile = \"noDB\" # The ipcluster profile to use\n",
"in_folder = \"/gpfs/exfel/exp/SCS/202030/p900125/raw\" # path to input data, required\n",
"<<<<<<< HEAD",
"<<<<<<< HEAD\n",
"out_folder = \"/gpfs/exfel/data/scratch/ahmedk/test/DSSC\" # path to output to, required\n",
"=======",
"=======\n",
"out_folder = \"/gpfs/exfel/data/scratch/samartse/test/\" # path to output to, required\n",
">>>>>>> modified notebook for DSSC specifics",
">>>>>>> modified notebook for DSSC specifics\n",
"sequences = [0] # sequence files to evaluate.\n",
"modules = [-1] # modules to run for\n",
"run = 222 # run numbr in which data was recorded, required\n",
"\n",
"<<<<<<< HEAD",
"<<<<<<< HEAD\n",
"karabo_id = \"SCS_DET_DSSC1M-1\" # karabo karabo_id\n",
"karabo_da = ['-1'] # a list of data aggregators names, Default [-1] for selecting all data aggregators\n",
"receiver_id = \"{}CH0\" # inset for receiver devices\n",
"path_template = 'RAW-R{:04d}-{}-S{:05d}.h5' # the template to use to access data\n",
"h5path = '/INSTRUMENT/{}/DET/{}:xtdf/image' # path in the HDF5 file to images\n",
"h5path_idx = '/INDEX/{}/DET/{}:xtdf/image' # path in the HDF5 file to images\n",
"=======",
"=======\n",
"run = 203 # run number in which data was recorded, required\n",
">>>>>>> modified notebook for DSSC specifics",
">>>>>>> modified notebook for DSSC specifics\n",
"\n",
"use_dir_creation_date = True # use the dir creation date for determining the creation time\n",
"cal_db_interface = \"tcp://max-exfl016:8020\" # the database interface to use\n",
"cal_db_timeout = 3000000 # timeout on caldb requests\"\n",
"local_output = True # output constants locally\n",
"<<<<<<< HEAD",
"<<<<<<< HEAD\n",
"db_output = False # output constants to database\n",
"\n",
"mem_cells = 0 # number of memory cells used, set to 0 to automatically infer\n",
"bias_voltage = 300 # detector bias voltage\n",
"=======",
"=======\n",
"db_output = True # output constants to database\n",
"bias_voltage = 100 # detector bias voltage\n",
"cal_db_interface = \"tcp://max-exfl016:8020\" # the database interface to use\n",
">>>>>>> modified notebook for DSSC specifics",
">>>>>>> modified notebook for DSSC specifics\n",
"rawversion = 2 # RAW file format version\n",
"\n",
"thresholds_offset_sigma = 3. # thresholds in terms of n sigma noise for offset deduced bad pixels\n",
@@ -71,14 +71,14 @@
"offset_numpy_algorithm = \"mean\"\n",
"\n",
"instrument = \"SCS\" # the instrument\n",
"<<<<<<< HEAD",
"<<<<<<< HEAD\n",
"high_res_badpix_3d = False # set this to True if you need high-resolution 3d bad pixel plots. Runtime: ~ 1h",
"=======",
"=======\n",
"high_res_badpix_3d = False # set this to True if you need high-resolution 3d bad pixel plots. Runtime: ~ 1h\n",
"modules = [i for i in range(16)] # modules to run for\n",
"slow_data_pattern = 'RAW-R{}-DA{}-S[0-9]+\\.h5'\n",
"slow_data_aggregators = {1:1,2:2,3:3,4:4} #quadrant/aggregator",
">>>>>>> modified notebook for DSSC specifics"
">>>>>>> modified notebook for DSSC specifics\n"
]
},
{
@@ -108,13 +108,13 @@
"import re\n",
"from os import listdir\n",
"\n",
"<<<<<<< HEAD",
"<<<<<<< HEAD\n",
"from cal_tools.tools import (map_gain_stages, parse_runs, run_prop_seq_from_path, \n",
" get_notebook_name, get_dir_creation_date,\n",
" get_random_db_interface, get_from_db, save_const_to_h5)\n",
"=======",
"=======\n",
"from cal_tools.tools import gain_map_files, parse_runs, run_prop_seq_from_path, get_notebook_name, get_dir_creation_date\n",
">>>>>>> modified notebook for DSSC specifics",
">>>>>>> modified notebook for DSSC specifics\n",
"from cal_tools.influx import InfluxLogger\n",
"from cal_tools.enums import BadPixels\n",
"from cal_tools.plotting import (show_overview, plot_badpix_3d,\n",
@@ -151,24 +151,24 @@
"creation_time=None\n",
"if use_dir_creation_date:\n",
" creation_time = get_dir_creation_date(in_folder, run)\n",
"<<<<<<< HEAD",
"<<<<<<< HEAD\n",
" print(f\"Using {creation_time} as creation time of constant.\")\n",
"\n",
"=======",
"=======\n",
"\n",
"run_number = run\n",
">>>>>>> modified notebook for DSSC specifics",
">>>>>>> modified notebook for DSSC specifics\n",
"run, prop, seq = run_prop_seq_from_path(in_folder)\n",
"logger = InfluxLogger(detector=\"DSSC\", instrument=instrument, mem_cells=mem_cells,\n",
" notebook=get_notebook_name(), proposal=prop)\n",
"\n",
"dinstance = \"DSSC1M1\"\n",
"\n",
"<<<<<<< HEAD",
"<<<<<<< HEAD\n",
"print(f\"Detector in use is {karabo_id}\") \n",
"\n",
"cal_db_interface = get_random_db_interface(cal_db_interface)",
"=======",
"=======\n",
"loc = None\n",
"ctrlloc = None\n",
"if instrument == \"SCS\":\n",
@@ -176,7 +176,7 @@
" dinstance = \"DSSC1M1\"\n",
"\n",
"print(\"Detector in use is {}\".format(loc))",
">>>>>>> modified notebook for DSSC specifics"
">>>>>>> modified notebook for DSSC specifics\n"
]
},
{
@@ -341,13 +341,13 @@
" if cells == 0:\n",
" cells = get_num_cells(filename, h5path)\n",
"\n",
"<<<<<<< HEAD",
"<<<<<<< HEAD\n",
" print(f\"Using {cells} memory cells\")\n",
" \n",
" pulseid_checksum = None\n",
"=======",
"=======\n",
" pulseid_checksum = None \n",
">>>>>>> modified notebook for DSSC specifics",
">>>>>>> modified notebook for DSSC specifics\n",
"\n",
" thresholds_offset_hard, thresholds_offset_sigma, thresholds_noise_hard, thresholds_noise_sigma = bp_thresh \n",
"\n",
@@ -549,7 +549,7 @@
},
"outputs": [],
"source": [
"<<<<<<< HEAD",
"<<<<<<< HEAD\n",
"# Push the same constant two different times.\n",
"# One with the generated pulseID check sum setting for the offline calibration.\n",
"# And another for the online calibration as it doesn't have this pulseID checksum, yet.\n",
@@ -595,7 +595,7 @@
" print(\"Generated constants with conditions:\\n\")\n",
" print(f\"• memory_cells: {max_cells}\\n• bias_voltage: {bias_voltage}\\n\"\n",
" f\"• pulseid_checksum: {pidsum}\\n• creation_time: {creation_time}\\n\")",
"=======",
"=======\n",
"if db_output:\n",
" for dont_use_pulseIds in [True, False]:\n",
" for qm in offset_g.keys():\n",
@@ -664,7 +664,7 @@
" metadata.send(cal_db_interface, timeout=3000000)\n",
" except Exception as e:\n",
" print(e)",
">>>>>>> modified notebook for DSSC specifics"
">>>>>>> modified notebook for DSSC specifics\n"
]
},
{
Loading