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

Calcualte static structure factor from freud diffraction pattern results #4

Open
chrisjonesBSU opened this issue Oct 22, 2020 · 1 comment
Assignees

Comments

@chrisjonesBSU
Copy link
Member

Now that freud can give us a diffraction pattern, lets work on creating a tool that can generate the structure factor from the raw data of these patterns.

The cmeutils repo has the code that does this, we just need to go pick it out and implement it with the output of freud's diffract module.

The freud repo does have an open issue for this, but who knows when or if that will be merged in. Until then, this is something we should be able to do ourselves and is an important next step in the ptb7 and itic analysis.

Ultimately, I think this work flow would be very similar to what needs to be done for #3

@chrisjonesBSU
Copy link
Member Author

It looks like the relevant bit of code from the cme_utils repo is in the file diffractometer.py on line 191

    def structure_factor(self, p): 
        a_sort = p.flat[self.idx]
        cs = numpy.cumsum(a_sort,dtype=float)
        cs = cs[self.jumps]
        cs = cs[1:] - cs[:-1]
        cs /= self.nb
        cs = numpy.insert(cs,0,numpy.log10(self.top)) #if we're not taking log of dp, insert a 1.0 instead of 0
        self.asq+=cs
        return cs

So, I think the next steps are the following:

  1. Dig around diffractometer.py a little bit more so we understand what some of these variables are. This includes p, jumps, nb top

  2. Look at the freud diffractometer docs and code and see exactly what of the above variables is accessible through their diffractometer module.

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

No branches or pull requests

4 participants