Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A python library that serves two purposes:
A number of libraries exist for the first purpose. However, most either launch the RADEX compiled binary as a subprocess or wrap the original code. In the former case, the creating of subprocesses can interfere with many Python multiprocessing methods. In the latter, running multiple models simultanously can be problematic due to the use of F77 common blocks in RADEX.
SpectralRadex uses F2PY to compile a version of RADEX written in modern Fortran, most importantly dropping the use of common blocks. As a result, running a RADEX model creates no subprocesses and can be parallelized.
Please check the documentation on our readthedocs page for installation instructions, detailed documentation of the library and usage examples.
We recommend the simple approach of using pypi:
pip install spectralradex
However, if you wish to install manually, clone the repo and from the main directory run the following
python3 setup.py install
optionally, specify a path for the installation using
python3 setup.py install --prefix=/path/to/my/install
making sure that the install path is part of your PYTHONPATH environmental variable. You'll need to add the .egg directory eg. path/to/my/install/lib/python3.7/site-packages/spectralradex-0.0.2-py3.7-linux-x86_64.egg
The library also includes functions for producing model spectra from the RADEX results. RADEX provides the optical depth at line centre and the excitation temperature of each molecular transition and these are used to calculate the line profile assuming gaussian line profiles in velocity. This has been benchmarked against CASSIS and provides a useful way to perform this modelling through python.
Radex solves the radiative transfer problem without assuming LTE and then provides various line properties. Two of those properties are key: 1. The excitation temperature of each line 2. The optical depth at line centre
The first is the excitation temperature of an LTE model that would give the same amount of emission. Which means we can use it and the optical depth to get the brightness temperature as a function of velocity.
The brightness temperature is:
Where $T_{ex}$ is the excitation temperature and $T_{BG}$ is the background temperature, likely 2.73 K. So RADEX provides the value of $T_{ex}$ such that this equation gives the same value as the RADEX model. It also provides us with the optical depth at line centre, $\tau_0$ so we simply need to calculate $tau_v$ assuming a gaussian line profile:
Finally, we need to consider what to do with overlapping lines. We follow Hsieh et al 2015 and use an opacity weighted radiation temperature:
We can multiply $T_B$ by the filling factor to get the main beam temperature.
FAQs
A package for RADEX and spectral modelling
We found that spectralradex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.