This window displays the photon energy spectrum (gamma and X-rays) accumulated by the device over a certain period. When the device is connected to the program, it reads the spectrum data from the device. The spectrum graph can then be updated either automatically at the set intervals or manually. Additionally, a background spectrum graph can be overlaid onto the main spectrum graph. To quickly switch to the spectrum window, click its button on the control panel of the main RadiaCode window: ![ImagesPC/OpenSpectrum.png|400](ImagesPC/OpenSpectrum.png|) The graph is drawn as a series of touching rectangles (a histogram), with each rectangle's height corresponding to the number of pulses in the channel. The last channel includes not only its own data but also all data beyond the graph's displayed section. The upper-right corner of the graph shows the time for which the spectrum data was accumulated, in the format HH:MM:SS. Below this, the average count rate is displayed, i.e., the total number of pulses in all channels divided by the accumulation time. Further below, the method of graph update is displayed. Depending on the settings, the X-axis can show either the channel numbers or photon energy. The Y-axis can show either the number of pulses or the count rate. The Y-axis scale can be linear or logarithmic. When the cursor moves over the graph, marker lines with numbers corresponding to the axis values appear. In the image below, channel 57 corresponds to a pulse count of 19. ![[EN/Windows APP/ImagesPC/winspectrum.png|400]] Several settings control the graph display. The most commonly used settings are located on the control panel. The **Linear** and **Logarithmic** buttons switch the Y-axis display scale between linear and logarithmic. The **Settings** button or the "Window Display Options..." command in the local menu opens the spectrum window [[Spectrum Window#Dialog "Spectrum Window Settings"|settings dialog]]. The **Restart** button or the local menu command "Restart Accumulation..." resets the accumulated data upon confirmation, and the accumulation process starts anew. The **Refresh** button or the local menu command "Refresh Spectrum Data" reads the spectrum data from the device and updates the window. This button can also be used in automatic spectrum data update mode for immediate refresh. The **XML** button or the local menu command "Export Spectrum Data to .xml File..." allows you to save the spectrum, possibly with background data, in an XML format file for subsequent viewing in programs such as Becquerel Monitor. You will be prompted to choose the file save location. The **CSV** button or the local menu command "Export Spectrum Data to .csv File..." allows you to save the spectrum in a simple text format (CSV). The file name is generated by the program in the format **"YYYY-MM-DD hh-mm-ss_Ns.csv"**, where "YYYY-MM-DD hh-mm-ss" is the current date and time, and "N" is the accumulation time in seconds at the moment of saving the file. You will be prompted to choose the folder for saving the file. The **Save** button or the local menu command "Save Spectrum to Library..." saves the spectrum to the database. The spectrum can later be used as background, exported, viewed, etc. If the option "Set as Current Background" is left enabled in the spectrum save dialog, the saved spectrum is selected as the background to display along with the spectrum. The background name will be shown at the top of the graph. The **Library** button or the local menu command "Open Spectrum Library" opens the [[Spectrum Window#Using Background and Spectrum Library|spectrum library]]. ---- **Amplification and Filtering** At the bottom of the spectrum window, there is a slider that controls the **"enhancemen"** of the histogram. A curve of the following type is applied to the graph: ![[EN/Android APP/Images/sp_amplifier.png]] This allows for "highlighting" faint peaks on the graph. For each channel, the value is calculated using the formula: Vn = Vn · An · F + 1, where: - _n_ - channel number - _Vn_ - spectrum value (number of pulses or count rate) in channel _n_ - _An_ - value at the corresponding point on the amplification curve - _F_ - amplification factor, which is set by the slider and ranges from 0 to 5. In amplification mode, when _F_ ≥ 1, the Y-axis scaling is not displayed. The "Filter" slider applies a smoothing algorithm to the spectrum graph. The higher the filter value, the more the graph is smoothed. ## Dialog "Spectrum Window Settings" In this dialog, you can select various display options for the [[Spectrum Window|spectrum window]] | Dialog Element | Description | | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Y-Axis Scale | Select either a linear or logarithmic scale for the Y-axis. | | Y-Axis Units | Choose either the number of pulses or the count rate (i.e., the number of pulses divided by the accumulation time of the spectrum data) as the Y-axis units. | | X-Axis Units | Choose either the spectrum channel number or the energy of the channel as the X-axis units. | | Spectrum and Background Overlay | Display only the spectrum or both the spectrum and the background. See the [[Spectrum Window#Spectrum Library\|spectrum library]] section for more information about backgrounds. | | Spectrum/Background Drawing | Choose how to render the graph: with both color fill and line outline, with just color fill, or with only the outline. | | Graph Update | Choose how to update the graph: either automatically at a specified interval (in seconds) or manually using the "Refresh" button on the window control bar. | | Spectrum Calibration by Radiation Energy | Here, you can specify the coefficients a0, a1, and a2 for spectrum calibration by radiation energy. When the dialog opens, the coefficients read from the device are displayed. Spectrum calibration is performed to convert the spectrum channel number into an energy value in keV using a second-degree polynomial: E = a0 + a1·x + a2·x², where x is the channel number, and a0, a1, a2 are the calibration coefficients. | | Reset to Factory Defaults | Set the calibration coefficients to their default values. | | Isotope Library | If "Built-in" is selected, the built-in [[Spectrum Window#Displaying Information About Isotopes\|isotope library]] from the RadiaCode program will be used for display in the "Spectrum" and "Spectrum View" windows. If "Custom" is selected, the isotope information will be taken from the specified file. | | Draw Isotope Lines | Draw pink energy lines of isotopes on the graph. Disabling this option does not turn off the isotope information displayed at the top of the window. | | Draw a Polyline Instead of a Histogram | Instead of rectangular bars (histogram), draw a polyline connecting the tops of the bars. This graph might not be fully accurate since the spectrum accumulation still occurs discretely for each channel. | Using the local menu command "Properties" -> "Colors," you can set the colors for the graphs and window panels. ![[EN/Windows APP/ImagesPC/spectrum_colors.png|500]] ## Using Background and Spectrum Library The RadiaCode application allows you to not only display the spectrum of accumulated radiation but also compare it with a previously measured background spectrum. You can simultaneously display both the spectrum and the background graphs in overlay mode. To use a background spectrum, you first need to measure this background using the device for a specified period. Then, save the resulting spectrum to the [[Spectrum Window#Spectrum Library|spectrum library]] using the "Save" button on the window control bar or the local menu command "Save Spectrum to Library." When saving the spectrum, you will be prompted to assign a name to it. This name will appear in the library list. If you leave the "Set as Current Background" option enabled, the spectrum will be displayed as the background on the graph after saving. Later, you can also select a background from the [[Spectrum Window#Spectrum Library|spectrum library]]. >[!warning] >>If you use a spectrum and background from different RadiaCode devices for overlay, keep in mind that different devices have different calibration coefficients. When overlaying spectrum graphs, the program aligns them by channel (first channel with first, second with second, and so on). Since different devices assign different radiation energies to the same spectral channels, differences in the positions of peaks corresponding to the same energy will appear when overlaying graphs from different devices. >If the program detects such a situation, a corresponding warning will be displayed at the bottom of the window, in the slider panel. The RadiaCode device is identified by its serial number. ---- ### Spectrum Library The spectrum library can be accessed via the "Spectrum Library" option in the local menu of the "Spectrum" window, the "Spectrum View" window, or through the "Spectrum Library" command in the "Tools" menu of the application's main window. A list of saved spectra will be displayed. ![[EN/Windows APP/ImagesPC/spectrumlib.png|500]] The spectrum graph selected for display is shown in green. For each saved spectrum, its graph is displayed in logarithmic scale along with information about its parameters. The dialog buttons perform actions on the selected spectrum or spectra from the list: - **Set as Current Background**: Select the spectrum to be displayed as the background in the "Spectrum" and "Spectrum View" windows. - **Load for Viewing**: Load the spectrum for viewing in the "Spectrum View" window. - **Rename Spectrum**: Assign a new name to the spectrum. - **Delete**: Delete the data of the selected spectrum or multiple spectra from the library. - **Edit Calibration Coefficients**: Opens a dialog where you can set the calibration coefficients a0, a1, and a2 for the selected spectrum or spectra. This may be useful if the device used to record the spectrum(s) has been recalibrated. The calibration of the spectrum is performed to convert the spectrum channel number into a radiation energy value in keV using a second-degree polynomial: E = a0 + a1·x + a2·x², where _x_ is the channel number; and _a0_, _a1_, and _a2_ are the calibration coefficients. - **Export CSV**: [[Spectrum Window#Spectrum Export and Import|Save the spectrum]] in a CSV text file. - **Export XML**: [[Spectrum Window#Spectrum Export and Import|Save the spectrum]] in an XML text file. - **Import XML**: Load a spectrum/background into the library from an XML file that was previously exported from the RadiaCode application or from the RadiaCode mobile app. See also: [[Spectrum Window#Spectrum Export and Import|Spectrum Export and Import]] ## Displaying Information About Isotopes When moving the cursor over the graph, information about the radioactive isotope whose energy corresponds to the cursor's position is displayed at the top of the graph: ![[EN/Windows APP/ImagesPC/isotope_title.png|500]] The name of the isotope is shown, along with the corresponding energy. In square brackets, the energy corresponding to the cursor's position on the spectrum graph is displayed, followed by the name of the isotope's decay chain. A thick pink line on the spectrum graph marks the position of the isotope's energy line. If the isotope has additional energy lines, they are displayed as thin pink lines. If there are several isotopes with close energy values, information is displayed about the isotope whose energy line is closest to the energy value under the cursor. In the spectrum settings, the display of isotope information can be disabled. The RadiaCode application has a built-in isotope library. In the spectrum settings, you can also select a custom isotope library file. ---- **Connecting an External Isotope Library** To use an external isotope library instead of the built-in one, you need to create a text file with information about isotopes and select it in the spectrum settings. Each time the RadiaCode application starts, it copies its internal isotope table to a file called **AppIsotopes.csv** in the same folder where the program's executable file is located. The **AppIsotopes.csv** file can be used as a template to add your own isotopes. The isotope library file is in a text format. Each line in the file describes one isotope. Fields in the line are separated by semicolons. Example: **U-235;U-238;750,1001;190** **Lu-176;;55,307;202** In Microsoft Excel, these lines look like this: | Isotope | Decay Chain | Energy Lines | Main Line | | ------- | ----------- | ------------ | --------- | | U-235 | U-238 | 750,1001 | 190 | | Lu-176 | | 53,307 | 202 | · Field 1: Isotope name (required) · Field 2: Decay chain name (optional) · Field 3: Associated energy lines (optional) · Field 4: Main line energy (required) When loading the file, the application checks the information for accuracy and displays error messages if necessary. Note that even empty fields must end with a semicolon to maintain four fields. ## Spectrum Export and Import Exporting a spectrum saves its data in a CSV or XML text file. The export commands are available in the local menus of the "Spectrum" and "Spectrum View" windows and in the "Spectrum Library" dialog. Two formats are supported: XML and CSV. Both formats are compatible with the popular Becquerel Monitor software. An XML file can contain both the spectrum and background data and includes all relevant information, such as names, number of channels, accumulation time, calibration coefficients, and the serial number of the device. This format is self-contained and requires no additional steps during import. A CSV file is a text file with the .csv extension, which can be used not only with Becquerel Monitor but also with other software due to its simple format. The file records only pairs of values (channel number, pulse count). The file name is formatted as **"Spectrum_<current date/time>_<accumulation time in seconds>s.csv", for example, Spectrum_2021-05-12 13-53-55_1426s.csv.** **Importing a Spectrum into the Library** You can import a spectrum into the library from an XML file that was previously saved using the export function from RadiaCode on a computer or smartphone.