Artful Computing

 Here is some general science relating to Cosmic Rays:

The Universe is Mostly Plasma

The forth state of matter is the dominant form of visible material in the universe. (We don't known anything about dark matter, of which there is about five times as much as in visible material.) The way plasma behaves is fundamental to understanding the way many astrophysics objects work.
Generation of Cosmic Rays Although this brief was aimed at students doing the HiSPARC experiments, the generation of high energy particles in astrophysical situations is important to all branches of modern astrophysics (for example, in understanding why supernova remnants emit radio waves).
What Is The Time  Astronomy started long, long ago as a way of time keeping. It is still an important part of astronomy, and in order to make observations and relate them to astronomical coordinate systems. There are more types of time that you probably imagine!
Statistics or How Not To Fool Yourself Analysis of almost any type of scientific data involves using statistics, because it is all too easy to see what you want to see in the data. The only way to avoid misinterpretation is the use of statistics. 
Relativity for Cosmic Rays This was a brief aimed to explaining why mesons reach the ground when their decay half lives are very short. However, some knowledge of relativity is important for all of modern astrophysics.
Big Questions for Cosmic Ray Scientists The main scientific questions faced by cosmic ray scientists.  

 

We also need some more specific information relevant to the HiSPARC experiment.

Coordinate Conversion

It is often convenient to calculate the arrival direction of cosmic ray showers with respect to the geographical orientation of the detector stations (e.g. angle with the zenith direction, and angle with respect to N/S direction. However for astrophysical purposes we need to know the direction with respect to the standard astronomical Right Ascension/Declination coordinate system. We therefore need to convert between the two systems easily - the fact that the Earth is rotating makes it all the more interesting!

Understanding coordinate conversion is much easier if you have done A-level maths, because you will have studied "Matrix Algebra" which, if you have understood it, make all the conversion equations look very straightforward. With GCSE maths, the trigonometry is pretty tricky to get right - though it can be done.) Fortunately, we do not really need to work through this maths every time: you just need the final equations, which are not too difficult to understand. Furthermore, in practice when we are doing computer calculations most of the time we would just call on a standard library routine that was probably written and debugged by someone else. (There is one as part of the HiSPARC Python "Sapphire" framework, and you will find them on-line in other astronomical Python libraries. One of the great things about using Python for scientific programming is finding that other expert programmers have already done a good deal of the difficult, detailed and tedious work for us.)

Cosmic Shower Front Angle - Revision 1

The HiSPARC website give guidance and calculation the arrival direction of cosmic ray showers with respect to the geographical coordinates. In our project at Marling school we attempted to calculate the arrival direction directly in terms of astronomical coordinates. This is more complex than the original HiSPARC methods, but we do not then need to do the coordinate conversion as a second, also fairly complex, step. 

Note that this solution scheme is only applicable when we have data from exactly three detectors. If a shower triggers more than three detectors, in this scheme we have to solve for all detector triplets separately. See below for a better method of solving with more than three detectors.

Cosmic Shower Front Angle - Revision 2

This is a revised set of equations for the direct calculation method, which avoids situations where the trigonometry gives ambiguous answers (because inverse tangent function can have two valid outputs) or there are "divide-by-zero" problems. (In fact, these difficult cases mostly turn up when we test the program with extreme and special cases, such as showers coming directly down the Earth rotation axis, or perhaps directly and exactly perpendicular to the plane of three detectors. Real data tends not to be so special.)

Note well: as a result of previous investigation of direction solutions, we became suspicious that some of the data in the HiSPARC database is not quite what it claims to be. See the "Investigation of HiSPARC time anomalies" project below. Until we are able to derive appropriate detector calibrations we do not believe that it is worth pursuing multi-station direction solutions.

Cosmic Shower Front Angle - more than 3 detectors

Updated 10th January 2018

All the previous methods are applicable only to showers where we use data from three detectors only. If we wish to analyse showers that trigger more than three detectors and we wish to use all the data to get more accurate answers, it is necessary to do a statistical fit for the best shower directions. This explains how it can be done by modelling the extended air shower front as a plane arriving from a certain direction and then predicting the time at which it will arrive at each of the triggered detectors. We then adjust the assumed direction iteratively (using a "least squares" minimisation procedure) until the different between our predicted arrival times and the actual arrival times is as small as possible. This allows for inevitable minor errors in the recorded arrival times which mean that it is usually impossible to find a solution that exactly predicts all the measured detector arrival times.

Investigation of HiSPARC timing anomalies.

Analysis of the result coming from the direction solution project discussed above produced some odd results (distribution of tracks on the sky that are unlikely to be real). This suggested project aims to track down the source of this issue by investigating whether there are relative timing errors in the HiSPACE data from different detector stations.

I suggest that this would be a feasible project for Yr 12s with a strong interest in space science and programming. 

Pressure Dependence of Extended Air Shower Event Rate

Updated 17th November 2019

This describes a project that uses downloaded HiSPARC data to derive a correlation between the EAS event rate and the air mass along a cosmic ray shower track. (Note that this is an extension project that goes beyond just attempting to correlate the logged EAS event rate against logged barometric pressure. Here we the arrival direction of EAS events at stations where this is available, which allows us to consider separately tracks at low and high angles with the zenith direction, corresponding to tracks that have shorter and longer lengths through the atmosphere.)

Note the revision with a correction to the geometric scaling factor for inferring the expected density of EAS events/steradian in the absence of additional absorption at higher zenith angle tracks.

This project involves a certain amount of programming to handle a relatively large amount of data, but this proved to be within the capabilities of a strongly motivated group of Yr 11s. Nevertheless, this is probably more appropriately pursued for a Gold CREST award for Yr 12s.

 

The HiSPARC Website contains some useful information for more advanced projects - particularly those that aim to use large amounts of HiSPARC data. I have found that the following lines are extremely useful:

The HiSPARC Experiment This is a PhD thesis by David Fokkema which gives an overview of the HiSPARC experiment and methods of data analysis. It does, of course, assume some knowledge of university level physics, but on the whole is it well authored and there is much useful background that is accessible to A level students.
SAPPHIRE SAPPHIRE is a Python "framework" (that is, a library of subroutines intended to be used together) which provides a direct form of access to the HiSPARC database. This is much more efficient in computing resources than the other methods of extracting data (the access is faster and the files moved across the Internet are raw binary and therefore smaller). Furthermore, a wider range of data queries becomes possible. It does, however, required the use of additional Python modules, such as HDF (the hierarchical data framework, PANDAS (Python data analysis library) and NUMPY (the Python numerical analysis library).  These modules can make the analysis of data 
Javascript API Other work by students in Stroud has used a web-based interface to obtain HiSPARC data, knowns as the Javascript APIThis may well be more convenient than SAPPHIRE for those who already know Javascript. It does, however, lack the flexibility of SAPPHIRE.

 

These code files are used to download data from the HiSparc database using the Sapphire framework. N.B. this is work in progress, and provided to illustrate techniques to students involved in the project. It does not necessarily do everything that is needed or work completely correctly 'out of the box'.

The code below is intended to demonstrate the use of the Sapphire framework, which allows more data to be obtained more easily and downloaded data to be saved more easily for later processing in a 'hierarchical data framework'  (HDF) file. 

The following files were last updated on Wednesday 12th June 2019.

 download.py

A Python file that downloads a month's worth of coincidence data for a specified cluster. Note that this is in development and one has to modify the dates within the code in order to specify the dates covered by the download. It can be trivially modified with an iteration loop to download many months (or years) worth of data - providing your Internet connection will stand the data load.

The output goes to a HDF (hierarchical data format) file stored in the current directory, with a ".hd" extension. This can be read by later analysis programs multiple times without having to repeat the data download every time.

 processCoincidences.py

A Python program that reads a downloaded data file and calculates the shower arrival directions.

Note that as the program is still in development it is necessary to write the year for analysis into the main program.

The code now has the first prototypes of a multi station solution scheme. 

 solveSky.py

A Python library used by processCoincidences.py - this does the actual work!
 utilities.py Miscellaneous utilities.
 eventsVsWeather.py Takes two files from the HiSPARC Public database, downloaded as tab-separated-columns data (one containing weather data and one containing events logged in the same period) and generated one output table of containing hourly averages of weather and the corresponding number of events logged in that hour. See this description for a discussion of the program design. (Added 12/06/2019.)

 

Breadcrumbs