A Python package focused on the simulation of radio observation, e.g. for radio astronomy. Originally, it is a Julia package created by Dr. Samuel Thé (https://github.com/SJJThe). Modified version of the Julia codes are found at Julia/
directory.
- Python: 3.9 or later
- Dependencies: numpy, scipy, pandas, pyarrow, numba
It's recommended to create a virtual environment before installing the package:
# Create a virtual environment
python -m venv radiomdlpy_env
# Activate the virtual environment
# On Windows:
radiomdlpy_env\Scripts\activate
# On macOS/Linux:
source radiomdlpy_env/bin/activate
# Install the package
pip install RadioMdlPy
# When you're done, deactivate the virtual environment
deactivate
If the package has been released on GitHub, you can install it directly:
# Install from GitHub releases (if available)
pip install https://github.com/spectrumx/RadioMdlPy/releases/latest/download/radiomdlpy-1.0.0-py3-none-any.whl
To install the latest development version directly from GitHub:
# Install directly from GitHub repository
pip install git+https://github.com/spectrumx/RadioMdlPy.git
To install from the source repository for development:
# Clone the repository
git clone https://github.com/spectrumx/RadioMdlPy.git
cd RadioMdlPy
# Create and activate virtual environment (recommended)
python -m venv radiomdlpy_env
# On Windows:
radiomdlpy_env\Scripts\activate
# On macOS/Linux:
source radiomdlpy_env/bin/activate
# Install in development mode (editable install)
pip install -e .
Benefits of development mode:
- Changes to source code are immediately available without reinstalling
- Perfect for development, testing, and contributing
- Installs all dependencies automatically
The package automatically installs the following dependencies:
numpy>=1.21.0
- Numerical computingscipy>=1.7.0
- Scientific computingpandas>=1.3.0
- Data manipulationpyarrow>=6.0.0
- Data serializationnumba>=0.56.0
- JIT compilation for performance
When you install RadioMdlPy from a wheel, use it like this:
# Import specific modules
from RadioMdlPy import obs_mdl, radio_types, astro_mdl
# Import specific functions
from RadioMdlPy.obs_mdl import model_observed_temp
from RadioMdlPy.radio_types import Antenna, Instrument, Observation
# Use functions
result = model_observed_temp(observation, sky_model, constellation)
When working with the source code directly:
import sys
import os
# Add the src directory to the Python path
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'src'))
# Import modules directly
from radio_types import Antenna, Instrument, Observation
from obs_mdl import model_observed_temp
from astro_mdl import estim_casA_flux, power_to_temperature
# Use functions
result = model_observed_temp(observation, sky_model, constellation)
RadioMdl
: Core constants and utilitiesantenna_pattern
: Antenna pattern calculationsastro_mdl
: Astronomical modelingcoord_frames
: Coordinate frame transformationsobs_mdl
: Observation modelingradio_io
: Radio I/O operationsradio_types
: Radio data typessat_mdl
: Satellite modeling
- Create and activate a virtual environment:
# Create a virtual environment
python -m venv radiomdlpy_dev
# Activate the virtual environment
# On Windows:
radiomdlpy_dev\Scripts\activate
# On macOS/Linux:
source radiomdlpy_dev/bin/activate
- Install in Development Mode
To install the package in development mode (editable install):
pip install -e .
To install with development tools (pytest, black, flake8):
pip install -e ".[dev]"
To build a wheel distribution, navigate to the project root directory (where pyproject.toml
is located) and run:
# Make sure you're in the RadioMdlPy directory
cd /path/to/RadioMdlPy
# Build the package
python -m build
This will create both a wheel (.whl
) and source distribution (.tar.gz
) in the dist/
directory.
Make sure you have the build tools installed:
pip install build
MIT License