Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update input config file documentation #10

Open
jmborr opened this issue Apr 6, 2017 · 4 comments
Open

Update input config file documentation #10

jmborr opened this issue Apr 6, 2017 · 4 comments
Assignees
Milestone

Comments

@jmborr
Copy link

jmborr commented Apr 6, 2017

Include in the LYX file the changes to section <background><factor> to allow that scattering length density from an atom selection (see issue #4)

@jmborr jmborr added this to the v1.5.0 milestone Apr 6, 2017
@jmborr jmborr self-assigned this Apr 6, 2017
@thamnos
Copy link
Collaborator

thamnos commented Aug 22, 2017

Hello!
Could you please give me a quick pointer on how to use this? I have a box of pure water and calculate the static structure factor -- as well as the coh & inc intermediate scattering functions. In the static structure factor I get this behaviour at low Q, i.e. spurious peaks below Q \sim 0.5\AA^{-1}:
fq
Could I get these to go away by setting something like <background>all</background>? Would I do that for the intermediate scattering functions, too?
Thanks!
Sebastian.

@jmborr
Copy link
Author

jmborr commented Aug 22, 2017 via email

@thamnos
Copy link
Collaborator

thamnos commented Sep 1, 2017

Right, that's indeed not the kind of background correction I was looking for...
I think you are right that these spurious peaks are due to the finite box. I've played a bit with Fourier transforms. I took the same "signal" (a 1D representation of scattering lengths) and displaced it on the y-axis: oscillating around 0, 1, or 2. As soon as the values don't oscillate around 0, we get the artefacts at low Q; basically the FT of the box.
fft_exercise_001
(code below)

So I'm thinking maybe we should subtract the average scattering length from all scattering lengths so that they oscillate around 0? What would that do to the units of the resulting scattering function? How would one do this in the case of x-rays where the scattering lengths are Q-dependent?

from matplotlib.pyplot import *
from scipy import *

a0 = zeros(1024)
a1 = zeros(1024)
a2 = zeros(1024)
num = 128 # length of the box
rnd = random.random(num) # between 0 and 1, mean is 0.5
a0[:num] = rnd - 0.5
b0 = fft(a0)
a1[:num] = rnd + 0.5
b1 = fft(a1)
a2[:num] = rnd + 1.5
b2 = fft(a2)

f, (ax1, ax2) = subplots(2,1)
ax1.plot(a0, 'r-', label='0')
ax1.plot(a1, 'g-', label='1')
ax1.plot(a2, 'b-', label='2')
ax1.legend()
ax1.set_xlim(0,1024)
ax2.plot(abs(b0[:512]), 'r-', label='abs(FFT(0))')
ax2.plot(abs(b1[:512]), 'g-', label='abs(FFT(1))')
ax2.plot(abs(b2[:512]), 'b-', label='abs(FFT(2))')
ax2.set_yscale('log')
ax2.set_xlim(0,512)
ax2.legend()
show()

@jmborr
Copy link
Author

jmborr commented Sep 1, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants