pyADfit
A nested sampling approach to quasi-stellar object (QSO) accretion disc fitting.
This repository contains a Python module for modelling accretion discs around astrophysical objects. The module provides functions to calculate physical quantities related to accretion disks and perform parameter estimation using observational data. The accretion disc model is the alpha-disc model (see Shakura & Sunyaev 1976), while the parameter estimation can be performed either with Nessai, Raynest or CPnest.
Dependencies
- numpy
- scipy
- matplotlib
- raynest
- CPNest
- nessai
- h5py
- pandas
Installation
Clone this repository to your local machine:
git clone https://github.com/FabioRigamonti/pyADfit.git
Move into the directory where you have downloaded the repository and install the required dependencies using pip:
pip install -r requirements.txt
Start your fitting process by importing the proper libraries (see the example below or run the provided test)
Or install it directly with pip:
pip install pyADfit
Usage
To fit quasar accretion disc data, follow these steps:
- Define your input data in a text file with three columns: x-data [nu, i.e. frequency], y-data [log10 nu*Lnu], and y-errors.
- Create a YAML configuration file specifying the hyperparameters, see "config.yaml" in the example directory, fitting parameters, and other settings.
- Define your own "read_data" function to read and the path to the configuration file
- Import the "read_config_and_launch" function from "disc_launch"
- Run the parameter estimation by calling the "read_config_and_launch"
Example
#from disc_launch import read_config_and_launch # if installed via github
from pyADfit.disc_launch import read_config_and_launch # if installed via pip
import matplotlib.pyplot as plt
def read_data(file_path):
your function here
return xdata,ydata,yerr
if __name__=='__main__':
config_path = './config.yaml'
post_df,best = read_config_and_launch(config_path,read_data)
plt.show()
To run a test check also the tests directory in pyADfit_github
Metadata
Release files for pyADfit 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyADfit-0.0.2.tar.gz | 10.7 kB | Without provenance | Details for pyADfit-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyADfit-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for pyADfit-0.0.2-py3-none-any.whl |
Total release size: 21.1 kB
Release files / pyADfit-0.0.2.tar.gz
| Download URL | pyADfit-0.0.2.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
256ba07e637ec946192c646843f83629226faa6b2864337e516a629439839b80
|
|
BLAKE2b-256 checksum How to use checksums |
7d117ad758c886a7d9c52359999d87a54bfa48bcec791999e16e56c1507b8005
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.5
|
Release files / pyADfit-0.0.2-py3-none-any.whl
| Download URL | pyADfit-0.0.2-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddd525d4e28efdd52c43f5f8ecc0778e004842ad537837d67a441ecc6519ae23
|
|
BLAKE2b-256 checksum How to use checksums |
8506d16a35d3b9731bd03cd1856f48823254cc98896e2a745784257a0ff93564
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.5
|
Security for pyADfit 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.