
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
syntheticstellarpopconvolve
Advanced tools
synthetic stellar pop convolve is a python package to convolve output of stellar population synthesis codes with star formation rates.
This repository contains the code and documentation for the synthetic
stellar-population convolution code-base Synthetic Stellar Pop Convolve (SSPC)
. SSPC
is available in a Gitlab
repository as well
as on Pypi.
For detailed tutorials and use-case examples, check out the tutorial notebooks: 📖 Example Notebooks
warning: the code is not fully released yet, some things may not work reliably
SSPC (Synthetic Stellar Pop Convolve) is a Python package designed to convolve stellar population synthesis outputs (binary_c(-python), COMPAS, COSMIC, SEVN) with star formation histories, enabling detailed predictions of astrophysical event rates over cosmic time. By integrating synthetic stellar and binary evolution models with cosmological and observational constraints, SSPC helps generate realistic event distributions.
The code was originally developed by David Hendriks (with invaluable help from Lieke van Son and inspiration from Coen Neijssels convolution code in COMPAS) for the project of Hendriks et al. 2023 (MNRAS). There it was used to convolve gravitational-wave merger events from binary systems as well as supernova events from both binary systems and single stars with a cosmological star-formation rate.
SSPC can be used to convolve the pre-calculated output of stellar population-synthesis codes with (cosmological) starformation rates, as well as on-the-fly population-synthesis simulation and convolution. It can convolve both event-based (line by line) data, as well as ensemble-based (nested histogram/pre-binned) data, either by integration or by generating samples from the convolution results.
The core goal of SSPC is to compute astrophysical event rates (e.g., supernovae, compact object mergers, nucleosynthetic yields) by integrating stellar population synthesis outputs with (cosmological) star formation rate (SFR) models.
SSPC is particularly useful for:
SSPC provides a robust framework for convolving stellar population synthesis data with star formation rates. Its key features include:
Planned features:
Using SSPC is designed to be simple, and only requires the following ingredients:
Here’s a minimal example demonstrating how to use SSPC:
import os, copy, h5py
import astropy.units as u
import numpy as np
import pandas as pd
from syntheticstellarpopconvolve import convolve, default_convolution_config, default_convolution_instruction
from syntheticstellarpopconvolve.general_functions import generate_boilerplate_outputfile, extract_unit_dict, temp_dir
TMP_DIR = temp_dir(
"examples", "minimal_working_example", clean_path=True
)
# Create instance of output
output_hdf5_filename = os.path.join(TMP_DIR, "output_example.h5")
generate_boilerplate_outputfile(output_hdf5_filename)
# SET UP DATA
example_data = {
"delay_time": np.array([0, 1, 2, 3]),
"value": np.array([3, 2, 1, 0]),
"probability": np.array([1, 2, 3, 4]),
}
example_df = pd.DataFrame.from_records(example_data)
example_df.to_hdf(output_hdf5_filename, key="input_data/example")
# Set up global configuration
convolution_config = copy.copy(default_convolution_config)
convolution_config["output_filename"] = output_hdf5_filename
# Set up SFR
convolution_config["SFR_info"] = {
"lookback_time_bin_edges": np.array([0, 1, 2, 3, 4, 5]) * u.yr,
"starformation_rate_array": np.array([1, 2, 3, 4, 5]) * u.Msun / u.yr
}
# set up convolution bin edges
convolution_config["convolution_lookback_time_bin_edges"] = (
np.array([0, 1]) * u.yr
)
# Set up the convolution instructions
convolution_config["convolution_instructions"] = [
{
**default_convolution_instruction,
"input_data_name": "example",
"output_data_name": "example",
"data_column_dict": {
"delay_time": "delay_time",
"normalized_yield": {"column_name": "probability", "unit": 1/u.Msun},
},
}
]
# run convolution
convolve(convolution_config)
# read out results
with h5py.File(
convolution_config["output_filename"], "r"
) as output_hdf5file:
groupname = "output_data/example/example/convolution_results/0.5 yr/"
yield_data = output_hdf5file[groupname + "/yield"][()]
unit_dict = extract_unit_dict(output_hdf5file, groupname)
print(yield_data) # values
print(unit_dict) # units
For more detailed examples, check out the tutorial notebooks: 📖 Example Notebooks
SSPC relies on several Python dependencies, listed in requirements.txt
. These are automatically installed via pip
or setup.py
.
To install the latest release:
pip install syntheticstellarpopconvolve
If you need the development version, clone the repository and run:
git clone https://gitlab.com/dhendriks/syntheticstellarpopconvolve.git
cd syntheticstellarpopconvolve
./install.sh
This ensures all dependencies are installed into your active virtual environment.
Comprehensive documentation is available on ReadTheDocs: 📚 SSPC Documentation, including tutorial and example use-case notebooks
We welcome contributions! If you're interested in contributing:
pip install -r development_requirements.txt
Naming conventions for branches:
development/<SSPC version>
releases/<SSPC version>
Run the following commands from the commands/
directory:
📖 Generate documentation:
./generate_docs.sh
📊 Generate docstring & test coverage reports:
./generate_reports.sh
If you have questions or suggestions, bugfixes, or feature requests, feel free to reach out via:
Please help improve SSPC by reporting issues and suggesting new features!
SSPC is released under the GPL License. See LICENSE for details.
FAQs
synthetic stellar pop convolve is a python package to convolve output of stellar population synthesis codes with star formation rates.
We found that syntheticstellarpopconvolve demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.