Giter Site home page Giter Site logo

fatima_152eu_autocal's Introduction

FATIMA_152Eu_autocal

Automatic calibration for LaBr3 energy spectra based on 152Eu source measurements written in python (python3).

Usage:

./FATIMA_152EU_autocal.py <histogram file name> (<detnumber>)

Input:

ASCII format histogram file.

This file has to be in two-column format, first column channel number, second column frequency (counts)

Detector number

Optionally a detector number can be given. This will appear in the first column of the output file.

Output:

The output is a textfile containing the input file name (or detector number if given) and the calibration parameters which were determined in the fit. Additionally a window will open with a plot of the fitted peaks and them residual of the final calibration. This plot will also be saved as a .png file for reference.

Requires:

In particular: matplotlib, numpy, scipy

Working principle:

The code works in several stages. A brief description (omitting many subtleties) is given below:

Preparation:

First the input histogram is prepared for analysis. It is checked if the content is sufficient for calibration. Also the specturm is rebinned and truncated based on some assumptions on the 1408 keV line from the 152Eu decay spectrum.

Peak finding:

The code then searches for peaks and tries to identify them with strong transitions of the 152Eu decay spectrum.

There are parameters which cut peaks of small prominence. These are set to reasonable values, but have to be adjusted potentially for each case. Once the peak list is found another check is done. This tries to identify the peaks with known strong peaks from the 152Eu spectrum, like 121 keV, 779 keV etc. The programme uses approximate relative intensities to do this check. These can vary for different detector types and might have to be adjusted. Currently the values are optimised for use with the FATIMA core LaBr3 detectors.

If the identification fails, the programme will abort.

Fitting procedure:

After the peaks are identified the programme will determine each peak's position using a simple Gauss+BG fit. There are special procedures for peaks that are close together (411,444 and 1089,1112). With the determined values it will first attempt a calibration fit with a 3rd order polynomial. If this doesn't produce a good result it will do another fit with a 4th order polynomial.

The result is then written to a file. The input spectrum will then be plotted, along with markers that indicate the identified peaks and the fits of each peak. Furthermore, the fit residual will be shown in a different panel.

The output can be used to convince yourself that the identification and fitting has been done properly.

fatima_152eu_autocal's People

Contributors

mrudigier avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.