Skip to main content

Creates ISR Spectrums

Project description

ISRSpectrum

GitHub version Coverage Status Conda image Documentation Status

by John Swoboda

alt text

Overview

This is a Python module to calculate an incoherent scatter spectrum based off of Kudeki and Milla's 2011 IEEE Geophysics paper.

Kudeki, E.; Milla, M.A., "Incoherent Scatter Spectral Theories—Part I: A General Framework and Results for Small Magnetic Aspect Angles," Geoscience and Remote Sensing, IEEE Transactions on , vol.49, no.1, pp.315,328, Jan. 2011

Like the model covered in the paper the software can calculate a spectra given, any magnetic aspect angle not perpendicular to B, any number of ion species, and the collision frequencies associated with those ion species. As the magnetic aspect angles get closer to perpendicular to B, usually < 1 degree perp to B, more and more calculations are needed for the Gordeyev to converge.

Installation

The package can be installed through anaconda through the following command

conda install -c swoboj isrspectrum

The user can also download the software and install it through pip or set up tools. It is suggested the software be installed locally as it can be updated.

git clone https://github.com/jswoboda/ISRSpectrum.git

cd ISRSpectrum

pip install -e .

Code Examples

In order to create the spectrums, assuming the user installed the code, first import the ISRSpectrum class and create an instance of the class.

import numpy as np
from ISRSpectrum import Specinit
import scipy.constants as spconsts

spfreq = 50e3
nspec = 512
ISS2 = Specinit(centerFrequency = 440.2*1e6, bMag = 0.4e-4, nspec=nspec, sampfreq=spfreq,dFlag=True)


ti = 1e3
te = 1e3
Ne = 1e11
Ni = 1e11
mi = 16
Ce = np.sqrt(spconst.Boltzmann*te/spconst.m_e)
Ci = np.sqrt(spconst.Boltzmann*ti/(spconst.m_p*mi))

datablock90 = np.array([[Ni,ti,0,1,mi,0],[Ne,te,0,1,1,0]])
(omega,specorig,rcs) = ISS2.getspec(datablock90, rcsflag = True)

Where each colum of the data block is represented as a the information for a ion/electron species. The list is in this order:

  1. density(m^-3)
  2. temperature(K)
  3. Doppler velocity (m/s)
  4. charge in elementary charges
  5. mass of the species in AMU
  6. collision frequency in s^-1.

The info for the electron species must be the last row also !

Alternatively, if you are only using the following species: O+,NO+,N2+,O2+,N+, H+, e-, a simpler interface is available. Using this interface quasi-neutrality is assumed so the number of positive ions and electrons are the same. The user can get spectrum in the following way.

from ISRSpectrum import Specinit
import numpy as np

spfreq = 50e3
nspec = 512
ISS2 = Specinit(centerFrequency = 440.2*1e6, bMag = 0.4e-4, nspec=nspec, sampfreq=spfreq,dFlag=True)

ti = 1e3
te = 1e3
Ne = 1e11
Ni = 1e11
vi = 0
species = ['O+','e-']
datablock = np.array([[Ni,ti],[Ne,te]])
(omega,specorig,rcs) = ISS2.getspecsep(datablock,species,vi,90,rcsflag = True)

Further examples can be found in Examples/examplespectrums.py

Note

I switch the default branch to main. If you have a local copy of the software you can run the following commands to deal with the renaming

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

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

isrspectrum-4.0.6.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

ISRSpectrum-4.0.6-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file isrspectrum-4.0.6.tar.gz.

File metadata

  • Download URL: isrspectrum-4.0.6.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for isrspectrum-4.0.6.tar.gz
Algorithm Hash digest
SHA256 ac956098661d28daa2f58e85a18ac33dbee1fd2f72305e1fc2a30e8aa7742015
MD5 a8df7e798297b48bf6a417a9e48d2b5a
BLAKE2b-256 4da759978a55e2e00080086b9f2846752b8ca0d64307be611cd1ee6d44cdffea

See more details on using hashes here.

File details

Details for the file ISRSpectrum-4.0.6-py3-none-any.whl.

File metadata

  • Download URL: ISRSpectrum-4.0.6-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ISRSpectrum-4.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 38603340d108873d6d0a1785958d7de9d63ade7aa8f7461fd3409ea5b436672c
MD5 362417161a5a5c0abf553fbf9aeafffd
BLAKE2b-256 e6f6ec11ab12f08821f69cdb66b2a9c0c5a37b5a352ec28f74de94faa9893bf2

See more details on using hashes here.

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