Skip to content

These C# codes take image with Pilatus detector. The programs have simple GUI created in Windows Forms app and UI XAML.

Notifications You must be signed in to change notification settings

karolvegso/Pilatus_snap_C_sharp

Repository files navigation

Pilatus_snap

These C# codes take image with Pilatus detector. The programs have simple GUI created in Windows Forms app and UI XAML.

These C# codes take images with Pilatus detector. They also set energy threshold of Pilatus detector. The C# codes have GUI in Windows Forms application and UI XAML. One C# code works as console application.

The application asks for the IP addres of the Pilatus detector, for example 147.213.112.19. It asks for the port of the camserver of the Pilatus detector, for example 41234. Finally, the application allows you to set number of images you want to take, exposure time of the Pilatus detector (for example 60 seconds), exposure period of the Pilatus detector (for example 61 seconds, expsoure time + extra time 1 second) and image name (for example image). The exposure period must be value always bigger than exposure time. The image name is without extension, tif extension is added automatically. The session with Pilatus detector is opened on the IP address and port using TCPClient. The network stream with the Pilatus detector is opened using command stream = session_Pilatus.GetStream();. The commands for setting number of images, exposure time, exposure period, image exposure are written into the stream of the Pilatus detector. The responses of the Pilatus detector are printed into the Response text window. Finally, the network stream with the Pilatus detector is flushed and closed. The session with the Pilatus detector is also closed.

The energy thershold of Pilatus detector is set by sending command setthreshold midg 5000 into the Pilatus detector. The setthreshold command sets energy threshold. The midg means mid gain amplification. It can be also lowg (low gain) or highg (high gain). The value 5000 means 5000 eV. In our experiment we used CuKalpha radiation with energy of X-rays 8040 eV or 8.04 keV. The energy threshold of Pilatus detector is usually set to the half of the full intensity of X-ray photons, which means it should be 4020 eV. The value of 5000 eV is close value to the 4020 eV.

About

These C# codes take image with Pilatus detector. The programs have simple GUI created in Windows Forms app and UI XAML.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages