Git Product home page Git Product logo

pyrex's Introduction

Introduction to PyREx

PyREx (Python package for an IceCube Radio Extension) is, as its name suggests, a Python package designed to simulate the measurement of Askaryan pulses via a radio antenna array around the IceCube South Pole Neutrino Observatory. The code is designed to be modular so that it can also be applied to other askaryan radio antennas (e.g. the ARA and ARIANA collaborations).

Installation

The easiest way to get the PyREx package is using pip as follows:

pip install git+https://github.com/bhokansonfasig/pyrex#egg=pyrex

Alternatively, you can download the code from https://github.com/bhokansonfasig/pyrex and then either include the pyrex directory (the one containing the python modules) in your PYTHON_PATH, or just copy the pyrex directory into your working directory. PyREx is not currently available on PyPI, so a simple pip install pyrex will not have the intended effect.

Code Example

The most basic simulation can be produced as follows:

First, import the package:

import pryex

Then, create a particle generator object that will produce random particles in a cube of 1 km on each side with a fixed energy of 100 PeV:

particle_generator = pyrex.ShadowGenerator(dx=1000, dy=1000, dz=1000,
                                           energy_generator=lambda: 1e8)

An array of antennas that represent the detector is also needed. The base Antenna class provides a basic antenna with a flat frequency response and no trigger condition. Here we make a single vertical "string" of four antennas with no noise:

antenna_array = []
for z in [-100, -150, -200, -250]:
    antenna_array.append(
        pyrex.Antenna(position=(0,0,z), noisy=False)
    )

Finally, we want to pass these into the EventKernel and produce an event:

kernel = pyrex.EventKernel(generator=particle_generator,
                           ice_model=pyrex.IceModel, antennas=antenna_array)
kernel.event()

Now the signals received by each antenna can be accessed by their waveforms parameter:

import matplotlib.pyplot as plt
for ant in kernel.ant_array:
    for wave in ant.waveforms:
        plt.figure()
        plt.plot(wave.times, wave.values)
        plt.show()

Units

For ease of use, PyREx tries to use consistent units in all classes and functions. The units used are mostly SI with a few exceptions listed in bold below:

Metric Unit
time seconds (s)
frequency hertz (Hz)
distance meters (m)
density grams per cubic centimeter (g/cm^3)
material thickness grams per square centimeter (g/cm^2)
temperature kelvin (K)
energy gigaelectronvolts (GeV)
resistance ohms (Ω)
voltage volts (V)
electric field volts per meter (V/m)

pyrex's People

Contributors

bhokansonfasig avatar hskarlupka avatar

Watchers

 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.