pyxspec_modelizer is a Python-based tool designed to automatize the modelization of multiple X-ray observations using a predefined sample model.
It streamlines the process of applying the same XSPEC model to N different observations, reducing manual intervention and ensuring consistency across spectral fits.
This project was developed as part of a Bachelor Thesis in astrophysics, focusing on the analysis of X-ray binary data with PyXspec and Jupyter Notebooks.
- Automatically fits multiple observations using a base model configuration.
- Supports batch analysis and consistent parameter linking across datasets.
- Generates reproducible results and output logs for each observation.
- Designed for integration with PyXspec and NICER data workflows.
pyxspec_modelizer/
│
├── software/
│ ├── parameter_data.ipynb
│ ├── plot_data.ipynb
│
├── data/
│ ├── setup/
│ ├── database/
│ │ ├── {ObsID}/
│ │ │ ├── xti/
│ │ │ │ ├── event_cl/
│ │ │
│ │ └── ...
│ └── ...
│
├── models/
│ ├── ...
│
├── output/
│ ├── spectra_evolution/
│ │ ├── frames/
│ │ ├── ...
│ ├── ...
│
├── README.md
└── requirements.yml
software/: Python notebooks and scripts
parameter_data.ipynb: Main notebook for automated model fitting
plot_data.ipynb: Visualization of parameters
data/setup/: Configuration scripts, environment setup
data/database/{ObsID}/xti/event_cl/: Observation files (.pha, .arf, .rmf, etc.)
models/: Sample model definitions or scripts
output/spectra_evolution/frames/: Plots for spectral evolution animations
Before running the notebooks, make sure you have the following installed:
- Python ≥ 3.8
- XSPEC and PyXspec
- Jupyter Notebook
- NumPy, Matplotlib, and other standard scientific libraries
To ensure reproducibility, this project uses a conda environment defined in environment.yml.
conda env create -f environment.ymlconda activate pyxspec_modelizerThis project was developed as part of a Bachelor Thesis at UNED, in collaboration with ICE-CSIC. Special thanks to Alessio Marino and Francesco Coti Zelati for their guidance and support throughout the project.
This project is licensed under the MIT License © 2025 Álex Jurado i López.