Skip to content

Commit

Permalink
Added one more notebook for HEXTOF - energy calibration using SB
Browse files Browse the repository at this point in the history
  • Loading branch information
kutnyakhov committed Nov 18, 2024
1 parent db06d22 commit 6df5423
Show file tree
Hide file tree
Showing 2 changed files with 2,015 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
"source": [
"## Get data paths\n",
"\n",
"If it is your beamtime, you can access both read the raw data and write to processed directory. For the public data, you can not write to processed directory.\n",
"If it is your beamtime, you can read the raw data and write to the processed directory. For the public data, you can not write to the processed directory.\n",
"\n",
"The paths are such that if you are on Maxwell, it uses those. Otherwise data is downloaded in current directory from Zenodo:\n",
"The paths are such that if you are on Maxwell, it uses those. Otherwise, data is downloaded in the current directory from Zenodo:\n",
"https://zenodo.org/records/12609441"
]
},
Expand Down Expand Up @@ -93,7 +93,7 @@
"metadata": {},
"source": [
"### Config setup\n",
"Here we get the path to the config file and setup the relevant directories. This can also be done directly in the config file."
"Here, we get the path to the config file and set up the relevant directories. This can also be done directly in the config file."
]
},
{
Expand Down Expand Up @@ -131,21 +131,13 @@
"}"
]
},
{
"cell_type": "markdown",
"id": "ea77465a",
"metadata": {},
"source": [
"If it is your beamtime, you can access both read the raw data and write to processed directory. For the public data, you can not write to processed directory."
]
},
{
"cell_type": "markdown",
"id": "0c09dacf",
"metadata": {},
"source": [
"### Add SciCat token information manualy\n",
"In order to read metadata from SciCat you need to have Scientific User Account at DESY and acsess to SciCat metadata catalog. To get your personal SciCat Token login to SciCat, go to User/Settings and under User Information copy SciCat token. Now you can add/update in the config file under metadata: section as scicat_token: or overrride it here"
"### Add SciCat token information manually\n",
"In order to read metadata from SciCat you need to have a Scientific User Account at DESY and access to SciCat metadata catalog. To get your personal SciCat Token login to SciCat, go to User/Settings and under User Information copy SciCat token. Now you can add/update in the config file under metadata: section as scicat_token: or override it here"
]
},
{
Expand All @@ -168,9 +160,9 @@
"id": "b8783114",
"metadata": {},
"source": [
"### Prepapre missing/additional metadata\n",
"### Prepare missing/additional metadata\n",
"\n",
"Adding missing user contact metadata information, which is available from beamtime_metadata.json file inside of beamtime folder. For this we are going to read /asap3/flash/gpfs/pg2//2023/data/11019101/beamtime-metadata-11019101.json file and prepare required info for use as an extra metadata input."
"Adding missing user contact metadata information, which is available from the beamtime_metadata.json file inside the beamtime folder. For this, we are going to read /asap3/flash/gpfs/pg2//2023/data/11019101/beamtime-metadata-11019101.json file and prepare the required info for use as an extra metadata input."
]
},
{
Expand Down Expand Up @@ -201,8 +193,8 @@
"metadata": {},
"source": [
"## Prepare Energy Calibration\n",
"We now load a bias series, where the sample bias was varied, effectively shifting the energy spectra. This allows us to calibrate the conversion between the digital values of the dld and the energy.\n",
"For this measurements we were using momentum settings:\n",
"We now load a bias series, where the sample bias was varied, effectively shifting the energy spectra. This allows us to calibrate the conversion between the digital values of the DLD and the energy.\n",
"For these measurements we use momentum settings:\n",
"* 20181114_KPEEM_M_-2.5_FoV6.2_rezAA_20ToF_FMCP20.sav"
]
},
Expand Down Expand Up @@ -1596,7 +1588,7 @@
"metadata": {},
"source": [
"## sector alignment\n",
"as usual first we jitter, but here we also align in time the 8 sectors of the dld. This is done by finding the time of the maximum of the signal in each sector, and then shifting the signal in each sector by the difference between the maximum time and the time of the maximum in each sector.\n",
"as usual, first, we jitter, but here we also align in time the 8 sectors of the DLD. This is done by finding the time of the maximum of the signal in each sector, and then shifting the signal in each sector by the difference between the maximum time and the time of the maximum in each sector.\n",
"\n",
"For better precision, the photon peak can be used to track the energy shift."
]
Expand Down Expand Up @@ -3053,7 +3045,7 @@
"metadata": {},
"source": [
"### correct offsets\n",
"The energy axis is now correct, but still the curves do not stack on eachother as we are not compensating for the `sampleBias`. In the same way, we can compensate the photon energy (`monocrhomatorPhotonEnergy`) and the `tofVoltage` "
"The energy axis is now correct, but still, the curves do not stack on each other as we are not compensating for the `sampleBias`. In the same way, we can compensate the photon energy (`monocrhomatorPhotonEnergy`) and the `tofVoltage` "
]
},
{
Expand Down Expand Up @@ -3540,8 +3532,8 @@
"id": "08018e04",
"metadata": {},
"source": [
"### save the calibration parameters\n",
"The parameters we have found can be saved to a file, so that we can use them later. This means the calibrtion can be used for different runs measured with the same settings of the momentum microscope."
"### Save the calibration parameters\n",
"The parameters we have found can be saved to a file so that we can use them later. This means the calibration can be used for different runs measured with the same settings of the momentum microscope."
]
},
{
Expand Down Expand Up @@ -3570,10 +3562,10 @@
"metadata": {},
"source": [
"### Now we can use those energy calibration parameters and load trXPS data set to define:\n",
"* t$_0$ position in respect to delay stage values;\n",
"* t$_0$ position with respect to delay stage values;\n",
"* correct accordingly delay stage offset\n",
"* fit cross-correlation \n",
"* apply BAM correction and see it effect on cross-correlation"
"* apply BAM correction and see its effect on cross-correlation"
]
},
{
Expand Down Expand Up @@ -4480,7 +4472,7 @@
"id": "1349568e",
"metadata": {},
"source": [
"First we take a look at our sideband measurement before any corrections.\n",
"First, we take a look at our sideband measurement before any corrections.\n",
"The sidebands on the W4f core levels can be used as a measure of the pump and probe cross-correlation,\n",
"and hence our temporal resolution.\n",
"We plot the data delay stage position vs Energy data, normalized by acquisition time."
Expand Down Expand Up @@ -4698,9 +4690,7 @@
"cell_type": "code",
"execution_count": 38,
"id": "4de472b3",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -4884,7 +4874,7 @@
"id": "f6a20bf2",
"metadata": {},
"source": [
"As we see the side-bands are quite broad and one of the possible reason for this could be long or short term drifts (jitter) of the FEL arrival time in respect to e.g. optical laser or differences in the intrabunch arrival time. To check and correct for this we can look at beam arrival monitor (BAM). The BAM gives a pulse resolved measure of the FEL arrival time with respect to a masterclock."
"As we see the sidebands are quite broad and one of the possible reasons for this could be long or short-term drifts (jitter) of the FEL arrival time with respect to e.g. optical laser or differences in the intrabunch arrival time. To check and correct for this we can look at beam arrival monitor (BAM). The BAM gives a pulse-resolved measure of the FEL arrival time with respect to a master clock."
]
},
{
Expand All @@ -4899,9 +4889,7 @@
"cell_type": "code",
"execution_count": 41,
"id": "8feb38c7",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -4971,7 +4959,7 @@
"id": "b0c70ad0",
"metadata": {},
"source": [
"To correct the SASE jitter, using information from the bam column and to calibrate the pump-probe delay axis, we need to shift the delay stage values to center the pump-probe-time overlap time zero."
"To correct the SASE jitter, using information from the bam column and to calibrate the pump-probe delay axis, we need to shift the delay stage values to centre the pump-probe-time overlap time zero."
]
},
{
Expand Down Expand Up @@ -5114,9 +5102,7 @@
"cell_type": "code",
"execution_count": 45,
"id": "3257d2bb",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -5409,9 +5395,9 @@
"id": "3ea45cf6",
"metadata": {},
"source": [
"Also you can save your results in NeXuS foramt with full metadata inforamtion using NXmpes application definition.\n",
"For this you need to have Scientific User Account at DESY and acsess to SciCat metadata catalog in order to get your personal `SciCat Token` from `Settings` and add/update it into your config file under `metadata:` section as `scicat_token:`.\n",
"Also you will need to define in your configuration file proper path to the NeXuS parser file under `nexus:` section as `input_files:[...]`."
"Also, you can save your results in NeXuS format with full metadata information using the NXmpes application definition.\n",
"For this, you need to have a Scientific User Account at DESY and access to the SciCat metadata catalogue in order to get your personal `SciCat Token` from `Settings` and add/update it into your config file under `metadata:` section as `scicat_token:`.\n",
"Also, you will need to define in your configuration file the proper path to the NeXuS parser file under the `nexus:` section as `input_files:[...]`."
]
},
{
Expand Down
Loading

0 comments on commit 6df5423

Please sign in to comment.