Skip to main content

Calculate an incoherent scatter spectrum with arbitrary isotropic electron velocity distributions and radar pointing at oblique angles to the magnetic field

Project description

INcoherent SCAtter Radar spectrum

PyPI PyPI Downloads Status Python Version License Read the documentation at https://ncdump-rich.readthedocs.io/ Tests Codecov pre-commit pre-commit Black

./img/normal_is_spectra.png

Info

Calculates an incoherent scatter radar spectrum based on the theory presented in Hagfors (1961) and Mace (2003).

Installing

You can install inscar via pip from PyPI:

$ pip install inscar

Usage

Please see the Modules Reference for details.

Physical environment

The plasma parameters that are supported natively by the program are

  • Radar frequency [Hz]

    • This will also set the radar wave number (= -4pi(radar frequency)/(speed of light))

  • Magnetic field strength [T]

  • Aspect angle [1]

  • Electron temperature [K]

  • Ion temperature [K]

  • Electron collision frequency [Hz]

  • Ion collision frequency [Hz]

  • Electron mass in atomic mass units [u]

  • Ion mass in atomic mass units [u]

  • Electron number density [m^(-3)]

  • Ion number density [m^(-3)]

  • Kappa value for the kappa velocity distribution function [1]

Custom simulation set-ups can be made by inheriting from the different classes. Say you want a Particle class that also carries information about the temperature of a collection of super thermal electrons as well as some height information. You then inherit from Particle and decorate it with the @attr.s object:

@attr.s
class RealDataParticle(isr.Particle):
    """Create a particle object with extra attributes."""

    superthermal_temperature: float = attr.ib(
        default=90000,
        validator=is_positive,
        on_setattr=attr.setters.validate,
    )
    z: int = attr.ib(default=300)

For more examples, see the assets directory.

Calculation method

The program support different methods of calculating the spectrum, based on how you assume the particles to be distributed. This includes a Maxwellian distribution (IntMaxwell class) and a kappa distribution (IntKappa class), in addition to any arbitrary isotropic distribution (IntLong class) which can take any Vdf as particle velocity distribution (default is VdfMaxwell). An example showing how a new Vdf class can be made is given in assets (VdfRealData).

Aside

This program was developed during my master thesis. For a more detailed explanation of the mathematical derivations and an analysis of the numerical precision of the program, please refer to the thesis found at munin.uit.no.

Contributing

To contribute to the project, clone and install the full development version (uses poetry for dependencies). There is also a .rtx.toml file that installs and sets up an appropriate virtual environment if rtx is available on your system (it’s really good, check it out!).

$ git clone https://github.com/engeir/inscar.git
$ cd inscar
$ # Set up a virtual environment, for example with rtx
$ rtx i
$ poetry install
$ pre-commit install

Before committing new changes to a branch you may run command

$ nox

to run the full test suite. You will need Poetry, nox and nox-poetry installed for this.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inscar-3.2.1.tar.gz (41.4 MB view hashes)

Uploaded Source

Built Distribution

inscar-3.2.1-py3-none-any.whl (15.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page