Code Monkey home page Code Monkey logo

magneto-code's Introduction

The Magnetar Activity GeNEraTOr (MAGNETO) Code

DOI License: MIT

An astrophysics based Python code to simulate flaring activity of a magnetar using the Monte Carlo statistical technique. The MAGNETO code generates a sequence of flares from a single magnetar over its lifetime to determine how the time between two flares and flare energies evolve over the magnetar's age.

Installation

To install the MAGNETO code, run the following commands in a terminal:

> git clone https://github.com/Kushaalkumar-pothula/MAGNETO-Code.git
> cd MAGNETO-Code

Now you should have the MAGNETO code successfully installed on your computer. Now you can proceed to run the code.

Usage

Dependencies: Python 3, NumPy and Matplotlib. There are two ways to run MAGNETO: By following the default method or the custom method. The custom method gives more freedom over physical parameters.

Default Configuration

  1. Open MAGNETO-Code directory in your terminal.
  2. Run the following command:
> bash run.sh

This will run the simulation with some default values of the magnetar's magntic field energy and power-law index.

Custom Configuration

In this method of running MAGNETO, you will have control over the physical aspects of the magnetar. You can specify the values of the respective parameters using options while running scripts. To get help with them, you can use the -h flag while running the script:

> python energy_evol_modular.py -h
  usage: energy_evol_modular.py [-h] E [E ...] a [a ...]

Simulate flaring activity of a magnetar using the Monte Carlo method.

positional arguments:
  E           Total magetic energy of the magnetar
  a           Power of time in energy-time relation, known as alpha

optional arguments:
  -h, --help  show this help message and exit

Similarly, you can run the interval evolution simulation:

> python interval_evol_modular.py

Author

Kushaal Kumar Pothula (https://kushaalkumarpothula.wordpress.com/). Initially written in 2020, when I was 15.

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.