Skip to content

nf679/avant

Repository files navigation

avant

Create informed priors for reflectometry analysis

PyPI version Coverage Status python-ci Build status Documentation Status

avant is a python package to extract values from refl_database to create informed or uniform priors to be used in reflectometry analysis.

The aim of avant is to improve reflectometry analysis by applying Bayesian Statistics and creating 'informed priors' which take into account literature values in the prior probability distributions of the parameters. The priors are created in a way where they can be directly implemented in Refnx to perform reflectometry analysis. Plus, the package has plotting functionalities so you can see what the prior probability distributions look like.

Features

Currently, avant only contains priors for the following five parameters for DMPC: head volume, tail volume, head thickness, tail thickness and roughness. It can create an informed prior, Gauss, with the following methods:

  • pdf : probability distribution function
  • logpdf : natural log of the probability distribution function
  • cdf : cumulative distribution function
  • ppf : percentile point function (quantile function / inverse cdf)
  • rvs : random variate sampling

It can also create a uniform prior which is an upper and lower bound for the prior range. The following plotting functionalities are available:

  • plotGauss(name='DMPC'): Plot a 'Gauss' prior probability distribution.
  • plotUniform(name='DMPC'): Plot a uniform prior probability distribution.

Examples

  1. Plotting the informed prior for head volume for DMPC:

    import avant.parameter.vh as vh
    vh.plotGauss('DMPC') 
    

dmpc_vh

  1. Plotting the uniform prior for the head volume for DMPC:

    import avant.parameter.vh as vh
    vh.plotUniform('DMPC')
    

dmpc_vh_u

  1. Set a parameter equal to the Gauss object (can be used in Refnx)

    import avant.parameter.vh as vh
    x = vh.Gauss('DMPC')
    

Problems

If you discover any issues with avant feel free to either submit the issue to our issue tracker on Github, or fix the issue yourself and make a pull request to the main branch.

Installation

avant is available on PyPI so can be installed using pip, otherwise this repository can be cloned and the latest build can be installed using the following:

pip install -r requirements.txt
python setup.py build
python setup.py install
pytest

Contributors

License

The project is licensed under the MIT license.

About

A Python package to open the refl_database and create priors.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages