Giter Club home page Giter Club logo

pyadfit's Introduction

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

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:

  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 # 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()

pyadfit's People

Contributors

fabiorigamonti avatar

Stargazers

tyjd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.