Contents

Overview

docs

Documentation Status

tests

Requirements Status

package

PyPI Package latest release PyPI Wheel Supported versions Supported implementations
Commits since latest release

A program to construct a pseudo-variable count time diffraction pattern from many fixed-time diffraction patterns.

  • Free software: Apache Software License 2.0

Installation

pip install pvct

You can also install the in-development version with:

pip install https://github.com/rowlesmr/pvct/archive/master.zip

Documentation

https://pvct.readthedocs.io/

Development

Ask me, and I can help.

Installation

At the command line:

pip install pvct

Usage

To use pvct in a project:

import pvct

or, more likely, to run as a command-line program with arguments:

pvct lam mono B abs formula min max [-f... | -D]

This program is used to creat a pseudo-variable-count-time (pVCT) diffraction pattern from many fixed-count-time (FCT) diffraction patterns.

To do so, information must be given to the program to calculate the way in which to sum the given diffraction data. Compulsory information is:

  • lam: (float) wavelength in A or energy in keV.

  • mono: (float) monochromator angle in deg 2Th (0 for none, 90 for synchrotron).

  • B: (float) average temperature factor (0.5 is a good start).

  • abs: (float) capillary absorption in mu*R or incident angle for fixed-incident-beam. (0 for no correction).

  • formula: (string) Chemical formula –> "La 1 B 6" of "Fe 1".

  • min: (float) angle of first peak in deg 2Th.

  • max: (float) maximum angle in deg 2Th.

You must also give one of the following options:

  • –filenames: (string) list of file names - XY or XYE format. Wildcards accepted eg *.xy, la?.xy

  • -D: (int) number of diffraction patterns to simulate.

One suggested workflow is to run pvct in simulation mode using the known experimental parameters with \(D\approx\) 20. An FCT diffraction pattern is then collected to assess both the factor, \(D\), by which the intensities at that position must be increased to match the intensities of the low angle peaks, and the required collection time to give adequate intensities for the low angle peaks. \(D\) FCT diffraction patterns are collected, and pvct is then used to create a pVCT diffraction pattern.

Two examples of valid invocations of pvct are

pvct 0.7093 0 0.5 7 "La 1 B 6" 13 -1 -f *.xy
pvct 16.5 90 0.3 0.9 "Mg 1.8 Fe 0.2 Si 1 O 4" 3 165 -D 20

The first will create a pVCT diffraction pattern from all XY files in the directory, using a wavelength of 0.7093 Å, no monochromator correction, an overall thermal parameter of 0.5 Ų, an incident angle of 7°, and a specimen composition of \(\mathrm{LaB}_6\). The pattern summation calculations are taken with respect to the values at 13° 2θ and are carried out to a maximum angle as defined in the input data. The output files are written to the same directory as the source data.

The second will create a pVCT summary simulation using an energy of 16.5 keV, a monochromator angle of 90°, an overall thermal parameter of 0.3 Ų, a capillary absorption of 0.9, and a specimen composition of \(\mathrm{Mg_{1.8}Fe_{0.2}SiO_4}\) over the range 3 – 165° 2θ, assuming 20 diffraction patterns.

If the program is run with no command-line arguments, a minimalist GUI is launched to enable the user to enter the same information.

Reference

pvct

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

Bug reports

When reporting a bug please include:

  • Your operating system name and version.

  • Any details about your local setup that might be helpful in troubleshooting.

  • Detailed steps to reproduce the bug.

Documentation improvements

pvct could always use more documentation, whether as part of the official pvct docs, in docstrings, or even on the web in blog posts, articles, and such.

Feature requests and feedback

The best way to send feedback is to file an issue at https://github.com/rowlesmr/pvct/issues.

If you are proposing a feature:

  • Explain in detail how it would work.

  • Keep the scope as narrow as possible, to make it easier to implement.

  • Remember that this is a volunteer-driven project, and that code contributions are welcome :)

Development

To set up pvct for local development:

  1. Fork pvct (look for the “Fork” button).

  2. Clone your fork locally:

    git clone git@github.com:YOURGITHUBNAME/pvct.git
    
  3. Create a branch for local development:

    git checkout -b name-of-your-bugfix-or-feature
    

    Now you can make your changes locally.

  4. Commit your changes and push your branch to GitHub:

    git add .
    git commit -m "Your detailed description of your changes."
    git push origin name-of-your-bugfix-or-feature
    
  5. Submit a pull request through the GitHub website.

Pull Request Guidelines

If you need some code review or feedback while you’re developing the code just make the pull request.

For merging, you should:

  1. Update documentation when there’s new API, functionality etc.

  2. Add a note to CHANGELOG.rst about the changes.

  3. Add yourself to AUTHORS.rst.

Authors

  • Matthew Rowles - .

Changelog

0.0.0 (2021-11-06)

  • First release on PyPI.

Indices and tables