FourierFilter

This module defines the FourierFilter class that performs the Fourier filter for a given range to exclude.

class pystog.fourier_filter.FourierFilter[source]

The FourierFilter class is used to exlude a given range in the current function by a back Fourier Transform of that section, followed by a difference from the non-excluded function, and then a forward transform of the difference function Can currently do: a real space function -> reciprocal space function -> real space function

Examples:
>>> import numpy
>>> from pystog import FourierFilter
>>> ff = FourierFilter()
>>> r, gr = numpy.loadtxt("my_gofr_file.txt",unpack=True)
>>> q = numpy.linspace(0., 25., 2500)
>>> q, sq = transformer.G_to_S(r, gr, q)
>>> q_ft, sq_ft, q, sq, r, gr = ff.G_using_F(r, gr, q, sq, 1.5)
GK_using_DCS(r, gr, q, dcs, cutoff, dgr=None, ddcs=None, **kwargs)[source]

Fourier filters real space G_{Keen Version}(r) using the reciprocal space \frac{d \sigma}{d \Omega}(Q)

Parameters:
  • r (numpy.array or list) – r-space vector
  • gr (numpy.array or list) – G_{Keen Version}(r) vector
  • q (numpy.array or list) – Q-space vector
  • dcs (numpy.array or list) – \frac{d \sigma}{d \Omega}(Q) vector
  • cutoff (float) – The r_{max} value to filter from 0. to cutoff
Returns:

A tuple of the Q and \frac{d \sigma}{d \Omega}(Q) for the 0. to cutoff transform, the corrected Q and \frac{d \sigma}{d \Omega}(Q), and the filtered r and G_{Keen Version}(r).

Thus, [Q_{FF}, \frac{d \sigma}{d \Omega}(Q)_{FF}, Q, \frac{d \sigma}{d \Omega}(Q), r_{FF}, G_{Keen Version}(r)_{FF}]

Return type:

tuple of numpy.array

GK_using_F(r, gr, q, fq, cutoff, dgr=None, dfq=None, **kwargs)[source]

Fourier filters real space G_{Keen Version}(r) using the reciprocal space Q[S(Q)-1]

Parameters:
  • r (numpy.array or list) – r-space vector
  • gr (numpy.array or list) – G_{Keen Version}(r) vector
  • q (numpy.array or list) – Q-space vector
  • fq (numpy.array or list) – Q[S(Q)-1] vector
  • cutoff (float) – The r_{max} value to filter from 0. to cutoff
Returns:

A tuple of the Q and Q[S(Q)-1]

for the 0. to cutoff transform, the corrected Q and Q[S(Q)-1], and the filtered r and G_{Keen Version}(r).

Thus, [

Q_{FF}, Q[S(Q)-1]_{FF}, Q, Q[S(Q)-1], r_{FF}, G_{Keen Version}(r)_{FF}

]

Return type:

tuple of numpy.array

GK_using_FK(r, gr, q, fq, cutoff, dgr=None, dfq=None, **kwargs)[source]

Fourier filters real space G_{Keen Version}(r) using the reciprocal space F(Q)

Parameters:
  • r (numpy.array or list) – r-space vector
  • gr (numpy.array or list) – G_{Keen Version}(r) vector
  • q (numpy.array or list) – Q-space vector
  • fq (numpy.array or list) – F(Q) vector
  • cutoff (float) – The r_{max} value to filter from 0. to cutoff
Returns:

A tuple of the Q and F(Q)

for the 0. to cutoff transform, the corrected Q and F(Q), and the filtered r and G_{Keen Version}(r).

Thus, [

Q_{FF}, F(Q)_{FF}, Q, F(Q), r_{FF}, G_{Keen Version}(r)_{FF}

]

Return type:

tuple of numpy.array

GK_using_S(r, gr, q, sq, cutoff, dgr=None, dsq=None, **kwargs)[source]

Fourier filters real space G_{Keen Version}(r) using the reciprocal space S(Q)

Parameters:
  • r (numpy.array or list) – r-space vector
  • gr (numpy.array or list) – G_{Keen Version}(r) vector
  • q (numpy.array or list) – Q-space vector
  • fq (numpy.array or list) – S(Q) vector
  • cutoff (float) – The r_{max} value to filter from 0. to cutoff
Returns:

A tuple of the Q and S(Q)

for the 0. to cutoff transform, the corrected Q and S(Q), and the filtered r and G_{Keen Version}(r).

Thus, [

Q_{FF}, S(Q)_{FF}, Q, S(Q), r_{FF}, G_{Keen Version}(r)_{FF}

]

Return type:

tuple of numpy.array

G_using_DCS(r, gr, q, dcs, cutoff, dgr=None, ddcs=None, **kwargs)[source]

Fourier filters real space G_{PDFFIT}(r) using the reciprocal space \frac{d \sigma}{d \Omega}(Q)

Parameters:
  • r (numpy.array or list) – r-space vector
  • gr (numpy.array or list) – G_{PDFFIT}(r) vector
  • q (numpy.array or list) – Q-space vector
  • dcs (numpy.array or list) – \frac{d \sigma}{d \Omega}(Q) vector
  • cutoff (float) – The r_{max} value to filter from 0. to cutoff
Returns:

A tuple of the Q and \frac{d \sigma}{d \Omega}(Q) for the 0. to cutoff transform, the corrected Q and \frac{d \sigma}{d \Omega}(Q), and the filtered r and G_{PDFFIT}(r).

Thus, [Q_{FF}, \frac{d \sigma}{d \Omega}(Q)_{FF}, Q, \frac{d \sigma}{d \Omega}(Q), r_{FF}, G_{PDFFIT}(r)_{FF}]

Return type:

tuple of numpy.array

G_using_F(r, gr, q, fq, cutoff, dgr=None, dfq=None, **kwargs)[source]

Fourier filters real space G_{PDFFIT}(r) using the reciprocal space Q[S(Q)-1]

Parameters:
  • r (numpy.array or list) – r-space vector
  • gr (numpy.array or list) – G_{PDFFIT}(r) vector
  • q (numpy.array or list) – Q-space vector
  • fq (numpy.array or list) – Q[S(Q)-1] vector
  • cutoff (float) – The r_{max} value to filter from 0. to cutoff
Returns:

A tuple of the Q and Q[S(Q)-1]

for the 0. to cutoff transform, the corrected Q and Q[S(Q)-1], and the filtered r and G_{PDFFIT}(r).

Thus, [

Q_{FF}, Q[S(Q)-1]_{FF}, Q, Q[S(Q)-1], r_{FF}, G_{PDFFIT}(r)_{FF}

]

Return type:

tuple of numpy.array

G_using_FK(r, gr, q, fq, cutoff, dgr=None, dfq=None, **kwargs)[source]

Fourier filters real space G_{PDFFIT}(r) using the reciprocal space F(Q)

Parameters:
  • r (numpy.array or list) – r-space vector
  • gr (numpy.array or list) – G_{PDFFIT}(r) vector
  • q (numpy.array or list) – Q-space vector
  • fq (numpy.array or list) – F(Q) vector
  • cutoff (float) – The r_{max} value to filter from 0. to cutoff
Returns:

A tuple of the Q and F(Q)

for the 0. to cutoff transform, the corrected Q and F(Q), and the filtered r and G_{PDFFIT}(r).

Thus, [

Q_{FF}, F(Q)_{FF}, Q, F(Q), r_{FF}, G_{PDFFIT}(r)_{FF}

]

Return type:

tuple of numpy.array

G_using_S(r, gr, q, sq, cutoff, dgr=None, dsq=None, **kwargs)[source]

Fourier filters real space G_{PDFFIT}(r) using the reciprocal space S(Q)

Parameters:
  • r (numpy.array or list) – r-space vector
  • gr (numpy.array or list) – G_{PDFFIT}(r) vector
  • q (numpy.array or list) – Q-space vector
  • fq (numpy.array or list) – S(Q) vector
  • cutoff (float) – The r_{max} value to filter from 0. to cutoff
Returns:

A tuple of the Q and S(Q)

for the 0. to cutoff transform, the corrected Q and S(Q), and the filtered r and G_{PDFFIT}(r).

Thus, [

Q_{FF}, S(Q)_{FF}, Q, S(Q), r_{FF}, G_{PDFFIT}(r)_{FF}

]

Return type:

tuple of numpy.array

g_using_DCS(r, gr, q, dcs, cutoff, dgr=None, ddcs=None, **kwargs)[source]

Fourier filters real space g(r) using the reciprocal space \frac{d \sigma}{d \Omega}(Q)

Parameters:
  • r (numpy.array or list) – r-space vector
  • gr (numpy.array or list) – g(r) vector
  • q (numpy.array or list) – Q-space vector
  • dcs (numpy.array or list) – \frac{d \sigma}{d \Omega}(Q) vector
  • cutoff (float) – The r_{max} value to filter from 0. to cutoff
Returns:

A tuple of the Q and \frac{d \sigma}{d \Omega}(Q) for the 0. to cutoff transform, the corrected Q and \frac{d \sigma}{d \Omega}(Q), and the filtered r and g(r).

Thus, [Q_{FF}, \frac{d \sigma}{d \Omega}(Q)_{FF}, Q, \frac{d \sigma}{d \Omega}(Q), r_{FF}, g(r)_{FF}]

Return type:

tuple of numpy.array

g_using_F(r, gr, q, fq, cutoff, dgr=None, dfq=None, **kwargs)[source]

Fourier filters real space g(r) using the reciprocal space Q[S(Q)-1]

Parameters:
  • r (numpy.array or list) – r-space vector
  • gr (numpy.array or list) – g(r) vector
  • q (numpy.array or list) – Q-space vector
  • fq (numpy.array or list) – Q[S(Q)-1] vector
  • cutoff (float) – The r_{max} value to filter from 0. to cutoff
Returns:

A tuple of the Q and Q[S(Q)-1]

for the 0. to cutoff transform, the corrected Q and Q[S(Q)-1], and the filtered r and g(r).

Thus, [

Q_{FF}, Q[S(Q)-1]_{FF}, Q, Q[S(Q)-1], r_{FF}, g(r)_{FF}

]

Return type:

tuple of numpy.array

g_using_FK(r, gr, q, fq, cutoff, dgr=None, dfq=None, **kwargs)[source]

Fourier filters real space g(r) using the reciprocal space F(Q)

Parameters:
  • r (numpy.array or list) – r-space vector
  • gr (numpy.array or list) – g(r) vector
  • q (numpy.array or list) – Q-space vector
  • fq (numpy.array or list) – F(Q) vector
  • cutoff (float) – The r_{max} value to filter from 0. to cutoff
Returns:

A tuple of the Q and F(Q) for the 0. to cutoff transform, the corrected Q and F(Q), and the filtered r and g(r).

Thus, [Q_{FF}, F(Q)_{FF}, Q, F(Q), r_{FF}, g(r)_{FF}]

Return type:

tuple of numpy.array

g_using_S(r, gr, q, sq, cutoff, dgr=None, dsq=None, **kwargs)[source]

Fourier filters real space g(r) using the reciprocal space S(Q)

Parameters:
  • r (numpy.array or list) – r-space vector
  • gr (numpy.array or list) – g(r) vector
  • q (numpy.array or list) – Q-space vector
  • sq (numpy.array or list) – S(Q) vector
  • cutoff (float) – The r_{max} value to filter from 0. to cutoff
Returns:

A tuple of the Q and S(Q) for the 0. to cutoff transform, the corrected Q and S(Q), and the filtered r and g(r).

Thus, [Q_{FF}, S(Q)_{FF}, Q, S(Q), r_{FF}, g(r)_{FF}]

Return type:

tuple of numpy.array