Skip to content

CERNatschool/beta-attenuation

Repository files navigation

CERN@school: Beta Attenuation with Aluminium

This repository contains the code and data you'll need to recreate the analysis carried out for the beta radiation attenuation experiment described in Section 5 of the CERN@school Contemporary Physics paper (Whyntie et al. 2015). The datasets featured in the paper are included with the code, but may also be found on FigShare here.

Disclaimers

  • This code dates from 2014. While every attempt has been made to ensure that it is usable, some work may be required to get it running on your own particular system. We recommend using a GridPP CernVM; please refer to this guide for further instructions. Unfortunately CERN@school cannot guarantee further support for this code. Please proceed at your own risk.
  • This repository is now deprecated, and remains here for legacy purposes. For future work regarding CERN@school, please refer to the Institute for Research in Schools (IRIS) GitHub repository. Please also feel free to fork and modify this code as required for your own research.

The datasets

The code is supplied with the datasets used in (Whyntie et al., 2015), which has the measurements of the radiation detected from a Strontium-90 source attenuated by sheets of aluminium with a variety of different thicknesses. This can be found in the data/sr directory, but also in the FigShare repository here:

http://doi.org/10.6084/m9.figshare.867659.v2

Running the code

Three Python scripts are provided that will process the raw Timepix data from each dataset (which each correspond to a different thickness of aluminium). Try running them with the --help option to find the input arguments required. The scripts are also documented appropriately to help you get started.

Getting the code

To get the code, create a working directory on your CernVM and clone it from GitHub with the following command:

$ git clone https://github.com/CERNatschool/beta-attenuation.git
$ cd beta-attenuation

To prepare for running, run the setup.sh script with the following command:

$ source setup.sh

Note: if you are not using a GridPP CernVM, the setup.sh script will not work as you won't have access to the CERN@school CVMFS repository and will have to source your own version of the Python libraries such as matplotlib via e.g. the Anaconda Python distribution.

The analysis

To get you started quickly, we have provided the results of the data processing (a JSON file) which will produce Figure 8 of (Whyntie et al., 2015) when the perform-analysis.py Python script is run like so:

$ mkdir ../tmp
$ python perform-analysis.py data/sr/ ../tmp
==================================
  CERN@school - Perform Analysis  
==================================
*
* Results JSON        : 'data/sr/beta_results.json'
* Output path         : '../tmp'
*
*
* Sorting complete.
* View your results by opening '../tmp/results/index.html' in a browser, e.g.
* firefox ../tmp/results/index.html &

After creating the output directory, running this script performs the analysis of the data in the data/sr folder, extracting the estimated attenuation coefficient of the material being analysed. You can view the plot and analysis results in a web browser like so:

$ firefox ../tmp/results/index.html &

This is Figure 8 of (Whyntie et al. 2015). The webpage created by the script also displays some of the information and results associated with the analysis. See the comments in the code for more details.

Processing the data

The process-datasets.py Python script processes the raw datasets obtained for each thickness of test material. Use this script to re-run the processing (which also produces frame images) or process your own data. Warning: this could take some time, so be prepared to leave your computer running for a while!

$ python process-datasets.py data/sr ../tmp

Sorting the clusters

The sort-clusters.py Python script sorts the clusters from the processed data into different types based on a user-defined algorithm.

$ python sort-clusters.py ../tmp ../tmp 

Note: you can change the sorting algorithm - i.e. the code that decides what type of particle we think might be associated with a given cluster - in this script.

Once sorted, you can use the JSON file generated by the sorting script with the perform-analysis.py script to re-run the analysis and produce a new set of results.

Acknowledgements

CERN@school was supported by the UK Science and Technology Facilities Council (STFC) via grant numbers ST/J000256/1 and ST/N00101X/1, as well as a Special Award from the Royal Commission for the Exhibition of 1851. A. Coupe's summer placement was kindly supported by SEPnet.

Useful links

About

A CERN@school experiment: analysing the attenuation of beta particles by aluminium with the Timepix detector.

Resources

License

Stars

Watchers

Forks

Packages

No packages published