<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?action=history&amp;feed=atom&amp;title=Cctbx.xfel_GUI%2FEnergy_tab</id>
	<title>Cctbx.xfel GUI/Energy tab - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?action=history&amp;feed=atom&amp;title=Cctbx.xfel_GUI%2FEnergy_tab"/>
	<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.xfel_GUI/Energy_tab&amp;action=history"/>
	<updated>2026-10-10T21:41:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.15</generator>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.xfel_GUI/Energy_tab&amp;diff=1794&amp;oldid=prev</id>
		<title>Aaron: Created page with &quot;{{DISPLAYTITLE:cctbx.xfel GUI/Energy tab}} The &#039;&#039;&#039;Energy tab&#039;&#039;&#039; calibrates the per-shot photon energy at LCLS. It is shown only when the facility is LCLS and the GUI is not in monitoring mode. The tab runs its calculations in the &#039;&#039;Calib Worker&#039;&#039; thread, whose light turns yellow while a calibration is running and green when it is idle.  Back to cctbx.xfel GUI.  == Background == At LCLS each shot&#039;s photon energy can be measured two ways: from the electron beam energy...&quot;</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Cctbx.xfel_GUI/Energy_tab&amp;diff=1794&amp;oldid=prev"/>
		<updated>2026-10-09T21:04:38Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{DISPLAYTITLE:cctbx.xfel GUI/Energy tab}} The &amp;#039;&amp;#039;&amp;#039;Energy tab&amp;#039;&amp;#039;&amp;#039; calibrates the per-shot photon energy at LCLS. It is shown only when the facility is LCLS and the GUI is not in monitoring mode. The tab runs its calculations in the &amp;#039;&amp;#039;Calib Worker&amp;#039;&amp;#039; thread, whose light turns yellow while a calibration is running and green when it is idle.  Back to &lt;a href=&quot;/cctbx.xfel/index.php/Cctbx.xfel_GUI&quot; title=&quot;Cctbx.xfel GUI&quot;&gt;cctbx.xfel GUI&lt;/a&gt;.  == Background == At LCLS each shot&amp;#039;s photon energy can be measured two ways: from the electron beam energy...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DISPLAYTITLE:cctbx.xfel GUI/Energy tab}}&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Energy tab&amp;#039;&amp;#039;&amp;#039; calibrates the per-shot photon energy at LCLS. It is shown only when the facility is LCLS and the GUI is not in monitoring mode. The tab runs its calculations in the &amp;#039;&amp;#039;Calib Worker&amp;#039;&amp;#039; thread, whose light turns yellow while a calibration is running and green when it is idle.&lt;br /&gt;
&lt;br /&gt;
Back to [[cctbx.xfel GUI]].&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
At LCLS each shot&amp;#039;s photon energy can be measured two ways: from the electron beam energy reported by the accelerator (the &amp;#039;&amp;#039;ebeam&amp;#039;&amp;#039;), and from the &amp;#039;&amp;#039;FEE spectrometer&amp;#039;&amp;#039;, which records the spectrum of every pulse on a one-dimensional detector. The spectrometer gives the better value, but its pixel axis must be calibrated into eV. This tab does that in two steps:&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;FEE calibration&amp;#039;&amp;#039;&amp;#039;: several short runs are collected with the beam energy stepped through a notch of known energy. Fitting the notch position in each run&amp;#039;s average spectrum against the known energies gives the spectrometer&amp;#039;s &amp;#039;&amp;#039;&amp;#039;eV per pixel&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;eV offset&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Ebeam calibration&amp;#039;&amp;#039;&amp;#039;: with the spectrometer calibrated, its per-shot energies are compared with the ebeam energies over a set of ordinary runs to find the constant &amp;#039;&amp;#039;&amp;#039;ebeam offset&amp;#039;&amp;#039;&amp;#039; (and the equivalent wavelength offset), so that the ebeam value can be corrected on shots where the spectrometer is unusable.&lt;br /&gt;
&lt;br /&gt;
The results are entered into [[cctbx.xfel GUI/Trials tab#Run block settings|run block settings]] (&amp;lt;code&amp;gt;spectrum_eV_per_pixel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;spectrum_eV_offset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wavelength_offset&amp;lt;/code&amp;gt;) so that processing jobs use the calibrated energies.&lt;br /&gt;
&lt;br /&gt;
== FEE Energy Scan Description ==&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Experiment&amp;#039;&amp;#039;&amp;#039;: the LCLS experiment the scan runs belong to. Defaults to the experiment in Settings; change it if the scan was collected under a different experiment.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Max events&amp;#039;&amp;#039;&amp;#039;: how many shots of each run to average (200 by default). More shots give a cleaner spectrum but take longer.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Run / Notch Energy (eV)&amp;#039;&amp;#039;&amp;#039; table: one row per calibration run. Click a cell to edit it. &amp;#039;&amp;#039;&amp;#039;Add Row&amp;#039;&amp;#039;&amp;#039; appends a row and &amp;#039;&amp;#039;&amp;#039;Clear All&amp;#039;&amp;#039;&amp;#039; empties the table.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Run Calibration&amp;#039;&amp;#039;&amp;#039;: checks that each run exists and each energy is a number, then runs the calibration in the background. Two plots fill in when it finishes: the &amp;#039;&amp;#039;&amp;#039;trendline&amp;#039;&amp;#039;&amp;#039; (notch position against energy, with the fitted line) and the &amp;#039;&amp;#039;&amp;#039;spectra&amp;#039;&amp;#039;&amp;#039; (each run&amp;#039;s averaged spectrum with its detected notch). Each plot has a matplotlib toolbar for zooming and saving.&lt;br /&gt;
&lt;br /&gt;
== Runs for Ebeam Calibration ==&lt;br /&gt;
* The checklist shows every run in the database; &amp;#039;&amp;#039;&amp;#039;Refresh&amp;#039;&amp;#039;&amp;#039; picks up runs that arrived since the tab was opened and &amp;#039;&amp;#039;&amp;#039;Clear&amp;#039;&amp;#039;&amp;#039; unticks everything and clears the plot.&lt;br /&gt;
* Tick the runs to compare and press &amp;#039;&amp;#039;&amp;#039;Run Calibration&amp;#039;&amp;#039;&amp;#039;. The FEE calibration must have been run first, and each run must belong to a run block (the detector address is taken from it). Runs that are in no run block are skipped with a message in the terminal.&lt;br /&gt;
* The plot overlays the ebeam energies with the calibrated spectrometer energies for the selected runs. The worker writes a small locator file per run to an &amp;lt;code&amp;gt;energy&amp;lt;/code&amp;gt; folder next to the output folder.&lt;br /&gt;
&lt;br /&gt;
== Calibration Results ==&lt;br /&gt;
The box shows &amp;#039;&amp;#039;&amp;#039;FEE eV per pixel&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;FEE eV offset&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Ebeam offset&amp;#039;&amp;#039;&amp;#039; (in eV, with the equivalent wavelength offset in Å). &amp;#039;&amp;#039;&amp;#039;Save calibration&amp;#039;&amp;#039;&amp;#039; writes them as a PHIL file (default &amp;lt;code&amp;gt;fee/fee_calib.phil&amp;lt;/code&amp;gt; next to the output folder):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;spectrum_eV_per_pixel=...&lt;br /&gt;
spectrum_eV_offset=...&lt;br /&gt;
ebeam_eV_offset=...&lt;br /&gt;
wavelength_offset=...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first two go into the &amp;#039;&amp;#039;spectrum_eV_per_pixel&amp;#039;&amp;#039; and &amp;#039;&amp;#039;spectrum_eV_offset&amp;#039;&amp;#039; fields of a run block and the wavelength offset into its &amp;#039;&amp;#039;wavelength_offset&amp;#039;&amp;#039; field. Since changing those fields creates a new run block, do the calibration before starting the main processing where possible, or create a new trial with the calibrated run block afterwards.&lt;/div&gt;</summary>
		<author><name>Aaron</name></author>
	</entry>
</feed>