diff --git a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb index 8d4b605c01a3d87cbc9439918c53eb630b5cc26a..2a93c3520afa45a42bed6e441232aa30f447dbb3 100644 --- a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb +++ b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb @@ -21,13 +21,14 @@ "source": [ "in_folder = \"/gpfs/exfel/exp/FXE/201802/p002271/ra\" # the folder to read data from, required\n", "run = 132 # runs to process, required\n", - "out_folder = \"/gpfs/exfel/data/scratch/xcal/test/\" # the folder to output to, required\n", + "# out_folder = \"/gpfs/exfel/data/scratch/haufs/test/\" # the folder to output to, required\n", + "out_folder = \"/gpfs/exfel/data/scratch/xcal/test/\"\n", "calfile = \"\" # path to calibration file. Leave empty if all data should come from DB, not actually used, makes automode happy\n", "sequences = [-1] # sequences to correct, set to -1 for all, range allowed\n", "mem_cells = 1 # memory cells in data, not actually used, makes automode happy\n", "overwrite = True # set to True if existing data should be overwritten\n", "no_relative_gain = False # do not do relative gain correction\n", - "cluster_profile = \"noDB\" # cluster profile to use\n", + "cluster_profile = \"noDB\"\n", "bias_voltage = 90 # will be overwritten by value in file\n", "cal_db_interface = \"tcp://max-exfl016:8016\" #\"tcp://max-exfl016:8015#8025\" # the database interface to use\n", "use_dir_creation_date = True # use the creation data of the input dir for database queries\n", @@ -40,13 +41,14 @@ "integration_time = 1000 # integration time in us, will be overwritten by value in file\n", "h5path = '/INSTRUMENT/{}/DET/{}:daqOutput/data' # path in H5 file under which images are located\n", "gmapfile = \"/gpfs/exfel/data/scratch/xcal/jfgain/gainMaps_M233.h5\" #temporary gain calibration file, not in the DB; leave empty if using DB\n", - "memcells = 1 # number of memory cells\n", - "karabo_id = \"FXE_XAD_JF1M\" # karabo prefix of Jungfrau devices\n", - "receiver_id = \"RECEIVER\" # inset for receiver devices\n", - "control_id = \"CONTROL\" # inset for control devices\n", - "db_module = \"Jungfrau_M233\" # ID of module in calibration database\n", - "path_inset = \"JNGFR02\" # file inset for image data\n", - "path_inset_control = \"JNGFR01\" # file inset for control data\n", + "memcells = 1 \n", + "karabo_id = \"FXE_XAD_JF1M\"\n", + "receiver_id = \"RECEIVER\"\n", + "control_id = \"CONTROL\"\n", + "db_module = \"Jungfrau_M233\"\n", + "path_inset = \"JNGFR02\"\n", + "path_inset_control = \"JNGFR01\"\n", + "manual_slow_data = False # set this flag to not use slow control data from file, but manual entries\n", "\n", "def balance_sequences(in_folder, run, sequences, sequences_per_node):\n", " import glob\n", @@ -169,11 +171,12 @@ "outputs": [], "source": [ "import h5py\n", - "with h5py.File(fp_path_contr.format(0), 'r') as f:\n", - " integration_time = int(f['/RUN/{}/DET/{}/exposureTime/value'.format(karabo_id, control_id)][()]*1e6)\n", - " bias_voltage = int(np.squeeze(f['/RUN/{}/DET/{}/vHighVoltage/value'.format(karabo_id, control_id)])[0])\n", - " print(\"Integration time is {} us\".format(integration_time))\n", - " print(\"Bias voltage is {} V\".format(bias_voltage))" + "if not manual_slow_data:\n", + " with h5py.File(fp_path_contr.format(0), 'r') as f:\n", + " integration_time = int(f['/RUN/{}/DET/{}/exposureTime/value'.format(karabo_id, control_id)][()]*1e6)\n", + " bias_voltage = int(np.squeeze(f['/RUN/{}/DET/{}/vHighVoltage/value'.format(karabo_id, control_id)])[0])\n", + "print(\"Integration time is {} us\".format(integration_time))\n", + "print(\"Bias voltage is {} V\".format(bias_voltage))" ] }, { diff --git a/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_NBC.ipynb index 988f254de445d561d7def3b4c13dbd61642110e4..c4e3aebc38fa61ff86c8c6ad6af0babd3ba1af39 100644 --- a/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_NBC.ipynb +++ b/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_NBC.ipynb @@ -23,8 +23,8 @@ "out_folder = '' # path to place reports at, required\n", "sequences = 1 # number of sequence files in that run\n", "path_template = 'RAW-R{:04d}-{}-S{{:05d}}.h5' # template to use for file name, double escape sequence number\n", - "path_inset = \"DA06\" # file inset for image data\n", - "path_inset_control = \"DA06\" # file inset for control data\n", + "path_inset = \"DA06\"\n", + "path_inset_control = \"DA06\"\n", "cluster_profile = 'noDB' # the ipcluster profile name\n", "cal_db_interface = 'tcp://max-exfl016:8016' # calibrate db interface to connect to\n", "integration_time = 1000 # integration time in us, will be overwritten by value in file\n", @@ -39,11 +39,12 @@ "run_high = 0 # run number for G0 dark run, required\n", "run_med = 0 # run number for G1 dark run, required\n", "run_low = 0 # run number for G2 dark run, required\n", - "karabo_id = \"FXE_XAD_JF500K\" # karabo prefix of Jungfrau devices\n", - "receiver_id = \"RECEIVER\" # inset for receiver devices\n", - "control_id = \"CONTROL\" # inset for control devices\n", - "db_module = \"Jungfrau_M233\" # ID of module in calibration database\n", - "use_dir_creation_date = True # use dir creation date" + "karabo_id = \"FXE_XAD_JF500K\"\n", + "receiver_id = \"RECEIVER\"\n", + "control_id = \"CONTROL\"\n", + "db_module = \"Jungfrau_M233\"\n", + "use_dir_creation_date = True\n", + "manual_slow_data = False # set this flag to not use slow control data from file, but manual entries" ] }, { @@ -123,11 +124,12 @@ " fp_name = path_template.format(run, path_inset_control)\n", " fp_path = '{}/{}'.format(ped_dir, fp_name)\n", "\n", - " with h5py.File(fp_path.format(0), 'r') as f:\n", - " integration_time = int(f['/RUN/{}/DET/{}/exposureTime/value'.format(karabo_id, control_id)][()]*1e6)\n", - " bias_voltage = int(np.squeeze(f['/RUN/{}/DET/{}/vHighVoltage/value'.format(karabo_id, control_id)])[0])\n", - " print(\"Integration time is {} us\".format(integration_time))\n", - " print(\"Bias voltage is {} V\".format(bias_voltage))\n", + " if not manual_slow_data:\n", + " with h5py.File(fp_path.format(0), 'r') as f:\n", + " integration_time = int(f['/RUN/{}/DET/{}/exposureTime/value'.format(karabo_id, control_id)][()]*1e6)\n", + " bias_voltage = int(np.squeeze(f['/RUN/{}/DET/{}/vHighVoltage/value'.format(karabo_id, control_id)])[0])\n", + " print(\"Integration time is {} us\".format(integration_time))\n", + " print(\"Bias voltage is {} V\".format(bias_voltage))\n", "\n", " fp_name = path_template.format(run, path_inset)\n", " fp_path = '{}/{}'.format(ped_dir, fp_name)\n",