A guide to operation principles of PSSS and how to align. For more specific PSSS info see the following pages:

- [PSSS device info](Aramis spectral diagnostics/SARFE10%20PSSS059)
- [PSSS-LB device info](Aramis spectral diagnostics/SARFE10%20PSSS059_LB)
- [PSSS data processing](Aramis spectral diagnostics/PSSS%20data)
- [PSSS pulse ID check](Aramis spectral diagnostics/PSSS%20PID%20check)
- [PSSS controls general](Aramis spectral diagnostics/PSSS%20PID%20Controls)

# Introduction

The PSSS can be used either in full beam or with a grating where the 1st order from the grating is incident in the bent crystal. It is recommend only to use the full beam for alignment purposes and not for machine optimization. Use of full beam for optimization is likely to give artificial bandwidths due to saturation of the detection system.

There are different bent crystals suitable for different energy ranges and spectral resolutions. Theses are:

- 4 - 5.5 keV - Si(111) bending radius 155 mm
- 5.5-8 keV - Si(220) bending radius 75 mm
- 8-10.25 keV -Si(220) bending radius 145 mm
- 10.25-13 keV - Si(220) bending radius 200 mm

# Alignment tweaks

[Spectrum not updating? Jump to help](##%20PSSS-spectrum-not-updating) or scroll down to section below

## Photon energy outside window

**Description**\
There can be an offset between reported machine photon energy and actual photon energy

**Solution**

- Run Energy scan on PSSS panel, Alignment tab. PSSS energy will be scanned and for each scan step the average single shot signal for each step recorded. After the scan the optimum position will be automatically set

![](https://docs.google.com/drawings/d/e/2PACX-1vTgqGH0cfCZdF1tNIWeELWJVUKil_bn7xwOEAkgdKG7Xrmh7vytoVzlCsZW_yI8Hz5-zrCOiNboFzL3/pub?w=1307&h=864)

## Weak signal

**Description**\
Spectrum seen, but very weak signal

**Solution**\
The most common reason for a weak signal is the height of the spectrometer crystal.

- Run Crystal height scan on PSSS panel, Alignment tab. Crystal will be scanned in height, after the scan the optimum position will be automatically set

![](https://docs.google.com/drawings/d/e/2PACX-1vTQudIV1-lfgKAqzmeoKBRklZWa1ANKxQ8LNHqpcs5_6VnuN6CY_6pKUIcNU98lZBA51OV3FxSvGk6E/pub?w=1307&h=864)

## PSSS spectrum not updating

### Wrong camera ROI

The most common reason for the PSSS spectrum not to be updating is the processing pipeline is not running as the camera ROI is different to the background image ROI used for background subtraction. This occurs after a camera restart as the camera ROI is not currently in a save and restore. To solve this do the following:

1. Open CamServer Management Console `csm` on console

![](https://docs.google.com/drawings/d/e/2PACX-1vT-WcbBcOYP_ZGQOYerDnRQUPvOvSei0rqRRQNd5ghsmNHH1FIwFGvs1_yqzULUkOHJi2ADv7Sw4Heh/pub?w=664&h=687)

2. Select Pipelines → Config → Filter by `PSSS` → Select `SARFE10-PSSS059_psss`
3. In the open config either set `image_background_enable` to `false` for dirty solution to disable the background or best still to check the background ROI and set the camera ROI to the required value. To do this:

![](https://docs.google.com/drawings/d/e/2PACX-1vSp_wF_Og4F4IDQT9SEQj-jxeCRvkqn90Vkl8xxM2q3akbt4lPiQaiuRNqfF9alVR37Hv8bdFRPuzAz/pub?w=672&h=690)

1. Remember background name used i.e setting of `image_background`
2. Select Background → Filter bu `PSSS` → Select `SARFE10=PSSS059` → Select the Background image ID used in the config and read Background Size in box at the bottom
3. Set the ROI in the camera expert panel for camera `SARFE10-PSSS059` found under the Photonics Aramis tab of `camsf.ui`

Occasionally the background image ID is not listed. If this is the case a new background image should be taken. To do this first set the camera ROI to `2560x1162` (required for 100 Hz operation :disappointed:), then press the capture button in the panel shown above. The generated image ID then needs to be copied and updated in the config as described above.

As the camera chip is read from the center out in the y direction the ROI settings are symmetric around the center. To set an ROI or 2560x1162 first enter 500 in the from y pix box and press Set Parameter. The ROI readback will then show you the applied ROI (hopefully 2560x1162).

### Wrong energy axis

The spectral processing takes the spectrometer energy axis from the combined motion IOC. After a restart of the IOC, this can be incorrect. To reset this simply move the PSSS to a valid position and the energy axis will be set allowing the processing to work.

### Wrong pulse ID

The current camera system does not allow the correct pulseID to be tagged.  This issue is solved by buffering the pulseIDs on the camera IOC and then selecting the buffered pulseID to tag the image.  After a camera server restart this may need to be reset.  

**Procedure**
1. From the SwissFEL camera UI select Photonics Aramis from the BSReadCheck menu (box 1 in figure below)  
2. Select, **and re select if already selected** `#75 +OFFSET`
3. Confirm correct pulseID in the correlation tab of the PSSS panel by starting the correlation tool

<img src="https://docs.google.com/drawings/d/e/2PACX-1vQ1btySB78gc-FnhwwkK9sDheEsxttqGlpYtrviuH4QaZKGtThp9sj_smYALql5bIVVYhjoD-Hle1a5/pub?w=893&amp;h=687">
Still have an issue? Use the contact list for the PSSS here:[contacts](Aramis%20Contacts)

## Controls contacts

If you know there is a particular control issue with the PSSS (i.e. motion) you can directly contact the controls expert listed below. For general issues (alignment etc) please use the following contact list: [contacts](Aramis%20Contacts)

```mermaid
%%{
  init: {
    'theme': 'base',
    'themeVariables': {
      'primaryColor': '#825AA6',
      'primaryTextColor': '#fff',
      'primaryBorderColor': '#825AA6',
      'lineColor': '#000',
      'secondaryColor': '#000',
      'tertiaryColor': '#fff'
    }
  }
}%%

flowchart TD
    A{Type of issue}
    A -->|Motion control| B[Scott Stubbs]
    A -->|Pipeline| C[Alex Gobbo]
    A -->|Data issue| D[Edwin Divall]
```