Skip to content

Ajuradoi1/pyxspec_modelizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyxspec_modelizer

License: MIT Python Version Jupyter Notebook Status


Overview

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.


Features

  • 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.

Repository Structure

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


Requirements

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

Environment Setup

To ensure reproducibility, this project uses a conda environment defined in environment.yml.

1. Create the environment

conda env create -f environment.yml

2. Activate the environment

conda activate pyxspec_modelizer

Acknowledgements

This 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.


License

This project is licensed under the MIT License © 2025 Álex Jurado i López.

About

Python tool to automate the modeling of multiple X-ray observations with PyXspec and Jupyter Notebooks. Ideal for reproducible spectral fitting of X-ray binaries.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors