# Dynamo
## Towards realistic stellar obserables

**Dynamo** is a Python package for simulating stellar light curves and spectra, combining detailed models of stellar evolution, surface activity, planetary transits, and noise. It is based on several exisiting open-source projects that were modified and combined to create stronger link between stellar evolution and stellar observables.
## Features
- **Stellar Surface Simulation**: Models the emergence and evolution of star spots and active regions using configurable activity cycles, latitude distributions, and spot evolution laws. This part is based on the [Butterpy](https://github.com/zclaytor/butterpy) package.
- **Grid-based lightcurve and spectra**: Generates synthetic spectra and light curves, including the effects of limb darkening, rotational broadening and spot evolution. This is done in a grid approach and motivated by the [Starsim](https://github.com/dbarochlopez/starsim) package.
- **Stellar Evolution Parameters**: Interpolates stellar parameters (e.g., mass, radius, temperature, luminosity) from evolutionary models. To get stellar evolution parameters we use [kiauhoku](https://github.com/zclaytor/kiauhoku) package.
Using **Dynamo** we can easily link between stellar evolution parameters (Temperature, mass, logg, etc.) and magnetic-driven spots. Such connection enable the creation of simulated light curve and spectra of the same star, which can serve as a simulated dataset for multi-modal machine learning models for example.
---
## Installation
1. Clone the repository:
```bash
git clone https://github.com/IlayMalinyak/Dynamo.git
cd Dynamo
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
## Usage
### Simulating a Star
You can configure and run a stellar simulation by editing the `starsim.conf` file and using the main classes in the `Dynamo` package. Example:
```python
from Dynamo.star import Star
# Initialize a star from configuration
star = Star(conf_file_path='starsim.conf')
# Set up simulation times and wavelength grid
import numpy as np
times = np.linspace(0, 30, 1000) # 30 days, 1000 points
wavelengths = np.linspace(4000, 9500, 1000) # Angstroms
# generate spots map
sm.generate_spot_map(ndays=1000)
# Run the forward simulation
star.compute_forward(t=times, wv_array=wavelengths)
# Access results (e.g., light curve, spectra)
# star.results, star.spot_map, etc.
```
### Example: Generating a Dataset of Light Curves and Spectra
You can generate a full dataset of physically-consistent light curves and spectra using the script `dataset/create_data.py`. This script samples stellar parameters, simulates surface activity, and produces time series and spectra for each synthetic star.
**Note-in dataset/create_data.py we assume some priors that might be non-trivial (for example age-activity and spot-activity relationships). You might want to edit them for your use case**
### Command-Line Usage
```bash
python dataset/create_data.py \
--models_root /path/to/stellar/models \
--dataset_dir dataset \
--plot_dir images \
--plot_every 100 \
--num_simulations 1000 \
--ndays 1000 \
--n_cpu 4
```
this would create 1000 simulations of 1000 days each. The arguments are:
- `--models_root`: Path to the directory containing stellar evolution models.
- `--dataset_dir`: Output directory for the generated dataset (default: `dataset`).
- `--plot_dir`: Directory to save diagnostic plots (default: `images`).
- `--plot_every`: Save a plot every N simulations (default: 100).
- `--num_simulations`: Number of stars (light curves/spectra) to generate (default: 1000).
- `--ndays`: Number of days to simulate for each light curve (default: 1000).
- `--n_cpu`: Number of CPU cores to use for parallel processing (default: 1).
## Configuration
Simulation parameters are controlled via the `starsim.conf` file, which includes sections for:
- Stellar properties (mass, radius, temperature, rotation, etc.)
- Spot and faculae properties
- Limb darkening
- Planetary parameters
- Noise characteristics
See the comments in `starsim.conf` for detailed descriptions of each parameter.
## License
This project is licensed under the MIT License. See `LICENSE` for details.
## Acknowledgments
- PHOENIX stellar atmosphere models
- [Butterpy](https://github.com/zclaytor/butterpy)
- [Starsim](https://github.com/dbarochlopez/starsim)
- [kiauhoku](https://github.com/zclaytor/kiauhoku)
---
## Contact
ilay.kamai@campus.technion.ac.il
Raw data
{
"_id": null,
"home_page": null,
"name": "dynamo-stellar",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "stellar, photometry, spectroscopy, simulation, astronomy, astrophysics",
"author": null,
"author_email": "Ilay Kamai <ilay.kamai@campus.technion.ac.il>",
"download_url": "https://files.pythonhosted.org/packages/01/8e/d9ccbbc89d4a53e001c37c4cf97a22207aaa67b4166023cfb0d16cb64fd2/dynamo_stellar-0.1.0.tar.gz",
"platform": null,
"description": "# Dynamo\n\n## Towards realistic stellar obserables\n\n\n\n**Dynamo** is a Python package for simulating stellar light curves and spectra, combining detailed models of stellar evolution, surface activity, planetary transits, and noise. It is based on several exisiting open-source projects that were modified and combined to create stronger link between stellar evolution and stellar observables.\n\n## Features\n\n- **Stellar Surface Simulation**: Models the emergence and evolution of star spots and active regions using configurable activity cycles, latitude distributions, and spot evolution laws. This part is based on the [Butterpy](https://github.com/zclaytor/butterpy) package.\n- **Grid-based lightcurve and spectra**: Generates synthetic spectra and light curves, including the effects of limb darkening, rotational broadening and spot evolution. This is done in a grid approach and motivated by the [Starsim](https://github.com/dbarochlopez/starsim) package.\n- **Stellar Evolution Parameters**: Interpolates stellar parameters (e.g., mass, radius, temperature, luminosity) from evolutionary models. To get stellar evolution parameters we use [kiauhoku](https://github.com/zclaytor/kiauhoku) package. \n\nUsing **Dynamo** we can easily link between stellar evolution parameters (Temperature, mass, logg, etc.) and magnetic-driven spots. Such connection enable the creation of simulated light curve and spectra of the same star, which can serve as a simulated dataset for multi-modal machine learning models for example.\n\n---\n\n## Installation\n\n1. Clone the repository:\n ```bash\n git clone https://github.com/IlayMalinyak/Dynamo.git\n cd Dynamo\n ```\n\n2. Install dependencies:\n ```bash\n pip install -r requirements.txt\n ```\n\n## Usage\n\n### Simulating a Star\n\nYou can configure and run a stellar simulation by editing the `starsim.conf` file and using the main classes in the `Dynamo` package. Example:\n\n```python\nfrom Dynamo.star import Star\n\n# Initialize a star from configuration\nstar = Star(conf_file_path='starsim.conf')\n\n# Set up simulation times and wavelength grid\nimport numpy as np\ntimes = np.linspace(0, 30, 1000) # 30 days, 1000 points\nwavelengths = np.linspace(4000, 9500, 1000) # Angstroms\n\n# generate spots map\nsm.generate_spot_map(ndays=1000)\n# Run the forward simulation\nstar.compute_forward(t=times, wv_array=wavelengths)\n\n# Access results (e.g., light curve, spectra)\n# star.results, star.spot_map, etc.\n```\n\n### Example: Generating a Dataset of Light Curves and Spectra\n\nYou can generate a full dataset of physically-consistent light curves and spectra using the script `dataset/create_data.py`. This script samples stellar parameters, simulates surface activity, and produces time series and spectra for each synthetic star.\n**Note-in dataset/create_data.py we assume some priors that might be non-trivial (for example age-activity and spot-activity relationships). You might want to edit them for your use case**\n\n### Command-Line Usage\n\n```bash\npython dataset/create_data.py \\\n --models_root /path/to/stellar/models \\\n --dataset_dir dataset \\\n --plot_dir images \\\n --plot_every 100 \\\n --num_simulations 1000 \\\n --ndays 1000 \\\n --n_cpu 4\n```\nthis would create 1000 simulations of 1000 days each. The arguments are:\n\n- `--models_root`: Path to the directory containing stellar evolution models.\n- `--dataset_dir`: Output directory for the generated dataset (default: `dataset`).\n- `--plot_dir`: Directory to save diagnostic plots (default: `images`).\n- `--plot_every`: Save a plot every N simulations (default: 100).\n- `--num_simulations`: Number of stars (light curves/spectra) to generate (default: 1000).\n- `--ndays`: Number of days to simulate for each light curve (default: 1000).\n- `--n_cpu`: Number of CPU cores to use for parallel processing (default: 1).\n\n## Configuration\n\nSimulation parameters are controlled via the `starsim.conf` file, which includes sections for:\n\n- Stellar properties (mass, radius, temperature, rotation, etc.)\n- Spot and faculae properties\n- Limb darkening\n- Planetary parameters\n- Noise characteristics\n\nSee the comments in `starsim.conf` for detailed descriptions of each parameter.\n\n## License\n\nThis project is licensed under the MIT License. See `LICENSE` for details.\n\n## Acknowledgments\n\n- PHOENIX stellar atmosphere models\n- [Butterpy](https://github.com/zclaytor/butterpy)\n- [Starsim](https://github.com/dbarochlopez/starsim)\n- [kiauhoku](https://github.com/zclaytor/kiauhoku)\n\n---\n\n## Contact\nilay.kamai@campus.technion.ac.il\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Realistic stellar photometry and spectroscopy simulation package",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/IlayMalinyak/Dynamo",
"Issues": "https://github.com/IlayMalinyak/Dynamo/issues",
"Repository": "https://github.com/IlayMalinyak/Dynamo"
},
"split_keywords": [
"stellar",
" photometry",
" spectroscopy",
" simulation",
" astronomy",
" astrophysics"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "63c43f0d10fd9202cb0e40632ae10f78728691edc6ff99421ab69ecc70c55877",
"md5": "7d853deebda8693e1865e7847f0b5d5a",
"sha256": "a99ef5e207b46b890e06c1ae9051b0f9e5ed81dc1cc1eaa75490af7783639e31"
},
"downloads": -1,
"filename": "dynamo_stellar-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7d853deebda8693e1865e7847f0b5d5a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 42679,
"upload_time": "2025-07-20T22:15:45",
"upload_time_iso_8601": "2025-07-20T22:15:45.672082Z",
"url": "https://files.pythonhosted.org/packages/63/c4/3f0d10fd9202cb0e40632ae10f78728691edc6ff99421ab69ecc70c55877/dynamo_stellar-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "018ed9ccbbc89d4a53e001c37c4cf97a22207aaa67b4166023cfb0d16cb64fd2",
"md5": "7c94b1a378e2631ef10a43e2e7c52edf",
"sha256": "2901e31a88b4e9367e6eec141f5bc078fac0e04f4ef9840e990313d1d73dc8df"
},
"downloads": -1,
"filename": "dynamo_stellar-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "7c94b1a378e2631ef10a43e2e7c52edf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 38478,
"upload_time": "2025-07-20T22:15:47",
"upload_time_iso_8601": "2025-07-20T22:15:47.581537Z",
"url": "https://files.pythonhosted.org/packages/01/8e/d9ccbbc89d4a53e001c37c4cf97a22207aaa67b4166023cfb0d16cb64fd2/dynamo_stellar-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-20 22:15:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "IlayMalinyak",
"github_project": "Dynamo",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "astropy",
"specs": [
[
"==",
"6.1.2"
]
]
},
{
"name": "emcee",
"specs": [
[
"==",
"3.0rc2"
]
]
},
{
"name": "kiauhoku",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "matplotlib",
"specs": [
[
"==",
"3.10.1"
]
]
},
{
"name": "numba",
"specs": [
[
"==",
"0.60.0"
]
]
},
{
"name": "numpy",
"specs": [
[
"==",
"2.2.3"
]
]
},
{
"name": "pandas",
"specs": [
[
"==",
"2.2.3"
]
]
},
{
"name": "scipy",
"specs": [
[
"==",
"1.15.2"
]
]
},
{
"name": "seaborn",
"specs": [
[
"==",
"0.13.2"
]
]
},
{
"name": "starsim",
"specs": [
[
"==",
"2.3.1"
]
]
},
{
"name": "tqdm",
"specs": [
[
"==",
"4.66.4"
]
]
}
],
"lcname": "dynamo-stellar"
}