Skip to main content

A nested sampling approach to quasi-stellar object (QSO) accretion disc fitting.

Project description

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

Install the required dependencies using pip:

pip install -r requirements.txt

Or install it directly with pip:

pip install pyADfit

Usage

To fit quasar accretion disc data, follow these steps:

  1. 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.
  2. Create a YAML configuration file specifying the hyperparameters, see "config.yaml" in the example directory, fitting parameters, and other settings.
  3. Define your own "read_data" function to read and the path to the configuration file
  4. Import the "read_config_and_launch" function from "disc_launch"
  5. Run the parameter estimation by calling the "read_config_and_launch"

Example

from disc_launch import read_config_and_launch
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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyADfit-0.0.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

pyADfit-0.0.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file pyADfit-0.0.1.tar.gz.

File metadata

  • Download URL: pyADfit-0.0.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.5

File hashes

Hashes for pyADfit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b344fdf03629cad4fc67286b77b5d22334aa1c0fd8485bc86f421ca3cdda96a2
MD5 dcbdf0a271fff67f13b18ecca7529e61
BLAKE2b-256 4b1afc5ee39675d3d2f312fe3f05441e84ca2a7bbfa678b2b670a11d28cbfe98

See more details on using hashes here.

File details

Details for the file pyADfit-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyADfit-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.5

File hashes

Hashes for pyADfit-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c96d21982de2be539dd65b8000eb7639ea052424b83d924448717212b13a22d
MD5 433e731a7e1e9aae534c43e17eda29b2
BLAKE2b-256 f6403307a0cd5c1ddb4fed0dab529f33ee87c1ee4e8c986a76950f338d91c24b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page