Metadata-Version: 2.4
Name: NebulaPy
Version: 1.0.4b0
Home-page: 
Author: Arun Mathew
Author-email: arun@cp.dias.ie
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Physics
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: requests
Requires-Dist: matplotlib
Requires-Dist: ipyparallel
Requires-Dist: ChiantiPy
Requires-Dist: pypion
Requires-Dist: pandas
Requires-Dist: h5py
Requires-Dist: astropy
Requires-Dist: PyNeb
Requires-Dist: tqdm
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file
Dynamic: requires-dist

# NebulaPy

[![PyPI version](https://badge.fury.io/py/NebulaPy.svg)](https://pypi.org/project/NebulaPy/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Python version](https://img.shields.io/badge/python-3.7%2B-blue.svg)](https://www.python.org/downloads/)

NebulaPy is a Python library for post-processing [PION](https://www.pion.ie/) simulation data.

## Features

- **Spectral Energy Distribution (SED) Binning**: Energy binning of ATLAS and
  Potsdam stellar-atmosphere models, and blackbodies, across a wide range of
  metal abundances.
- **Line Luminosity Calculations**:
  - Computes line luminosities for spherical geometry (1D nested and uniform grid).
  - Computes line luminosities for cylindrical geometry (2D nested and uniform grid).
  - Computes line luminosities for cylindrical geometry via MultiProcessing.
- **Cooling Function Maps for 2D simulations**
- **Identifies the dominant spectral lines** for ions in 1D and 2D simulation snapshots by
calculating the line luminosity for all lines based on grid-level data. It then outputs
the dominant lines for a specified list of ions.
- **Emissivity Map Generator for 2D simulation snapshot**:
  - Generates emrissivity maps for single ion multi-line emissions from a 2D simulation snapshot.
  - Generates emissivity maps for multiple ions, multi-line emissions from a 2D simulation snapshot.
  

## Installation

```bash
pip install NebulaPy
# This will also install dependencies

# Download and set up the CHIANTI database (require ~1 GB disk space)
wget https://download.chiantidatabase.org/CHIANTI_10.1_database.tar.gz

# Extract it to a directory (~5 GB disk space required)
tar -xzf CHIANTI_10.1_database.tar.gz -C CHIANTI-DATABASE-DIRECTORY

# Add the following environmental variable to your .bashrc
echo "export XUVTOP=CHIANTI-DATABASE-DIRECTORY" >> ~/.bashrc

# Reload your .bashrc
source ~/.bashrc

# Install the Python-SILO interface:
# Execute the following command from the NebulaPy root directory.
install-silo

# Fix the SILO library path in your local distribution:
# Open the file:
#   ${HOME}/.local/venv/lib/python3.11/site-packages/pypion/SiloHeader_data.py
# Modify line 18 to append /lib to the path

# Install the NebulaPy database
nebulapy database install --destination "$HOME/.nebulapy"

# Configure the database path
echo 'export NEBULAPY_DB="$HOME/.nebulapy/nebulapy-db-1.0.0"' >> "$HOME/.bashrc"
source "$HOME/.bashrc"
```

## Usage

For detailed usage instructions, examples, and features, please 
visit [NebulaPy Wiki](https://github.com/arunmathewofficial/NebulaPy/wiki). 
Sample scripts demonstrating NebulaPy functionalities can be found
in the `NebulaPy/Research` directory.


## Documentation

Check the full API documentation at [nebulapy.github.io/NebulaPy](https://nebulapy.github.io/NebulaPy/),
rebuilt automatically from the source on every commit to `main`.

## Support

For bug reports and feature requests, visit the
[issues section](https://github.com/arunmathewofficial/NebulaPy/issues) of the repository:

## Changelog
- **Version 1.0.0-beta** – March 5, 2025: Beta release
- **Version 1.0.1-beta** – March 6, 2025: Minor bug fixes
- **Version 1.0.2-beta** – March 6, 2025: Include silo installation script
- **Version 1.0.3-beta** – March 6, 2025: Fixed bugs in spectral line emissivity map script

## Licence

NebulaPy source code is licensed under the MIT License.

NebulaPy-authored database tables are licensed separately under the
Creative Commons Attribution 4.0 International (CC BY 4.0) License.

Third-party datasets, including ATLAS and PoWR stellar-atmosphere data,
are not covered by either licence and remain subject to the terms of
their respective providers.

## Author
Arun Mathew  
Astronomy & Astrophysics  
Computational and High Energy Astrophysics  
Dublin Institute for Advanced Studies (DIAS), Ireland  
