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

[BIFT] restrict the q-range for speed and less noisy data #18

Open
kif opened this issue Jun 9, 2020 · 10 comments
Open

[BIFT] restrict the q-range for speed and less noisy data #18

kif opened this issue Jun 9, 2020 · 10 comments

Comments

@kif
Copy link
Member

kif commented Jun 9, 2020

Mark suggests to start at the begining of the guinier region: reasonable

But where to stop ? dq*Dmax<2pi ?

@kif
Copy link
Member Author

kif commented Jun 9, 2020

Mark wants the full noise: great :)

@kif
Copy link
Member Author

kif commented Jun 10, 2020

Bad idea ... High intensity region is mandatory for proper representation of the data.

@maaeli
Copy link
Contributor

maaeli commented Jun 12, 2020

Hi Jérôme,

I am not surprised as the "Dmax" information mostly comes for the small angles.
Do you have test data with low-q artifacts? Because there dropping low q might be the game changer. Looking here https://www.sasbdb.org/browse having no artifact seems to be the exception...

Cheers,
Martha

@kif
Copy link
Member Author

kif commented Jun 12, 2020

Hi Martha,

Nice to read you. How is your new life?

I am also disappointed by those poor results. Here are a couple of images of the same BSA dataset, reconstructed from the (B)IFT transformed data whether the region before Guinier's linerar region was discarded or not. Of course, it is always possible that there was an error in my code.
image
image

It is not really surprising when considering the Dmax is completely wrong after BIFT transformation:
image
image

@maaeli
Copy link
Contributor

maaeli commented Jun 13, 2020

Hi Jérôme,

how do you obtain those plots? Because for me, the bift.py do look like superimposed by a zig-zag...

bsa_005_sub.out.zip

Anyways, the second data above looks a lot like smeared out sphere?

Best,
Martha

@kif
Copy link
Member Author

kif commented Jun 16, 2020

I agree with you, the second solution looks like a sense sphere. This can be understood as the algorithm starts with a sphere and an alpha_max parameter which would make this acceptable.
Then starts the optimization process.
Different scenarii have been investigated. The one currently implemented is:

  • One log scan on alpha (between 1/alpha_max and alpha_max) with Dmax=3Rg
  • One linear scan on Dmax from 2 to 4 Rg
    Of course the Guinier region has better to be acceptable from beginning :(
    The 2D grid scan has been dropped as it was too time consuming.
    Then a steepest descent (Powell) to find the best alpha/Dmax.
    The monte-carlo is at the end, it is just to get some statistics around the best solution.

Are you using the provided test-data ? because I got this:
image
(this is the result of freesas testdata/bsa_005_sub.dat)

@maaeli
Copy link
Contributor

maaeli commented Jun 16, 2020

Yes, I am using the provided test data...
Btw, how do you get the reciprocal space fits?

@kif
Copy link
Member Author

kif commented Jun 16, 2020

IFT is an ill-posed inverse problem. This means the opposite is trivial, trivial like a dot product :)
I wrote plenty of test based on synthetic data, have a look at the test_autorg there is a test_synthetic.
https://github.com/kif/freesas/blob/fit_autorg/freesas/test/test_autorg.py#L68
For example to simulate the SAXS curve for spherical particles:

        R0 = 4
        npt = 1000
        I0 = 1e2
        Dmax = 2 * R0
        size = 5000
        r = numpy.linspace(0, Dmax, npt + 1)
        p = distribution_sphere(I0, Dmax, npt)
        q = numpy.linspace(0, 10, size)
        qr = numpy.outer(q, r / pi)
        T = (4 * pi * (r[-1] - r[0]) / npt) * numpy.sinc(qr)
        I = T.dot(p)
        err = numpy.sqrt(I)
        data = numpy.vstack((q, I, err)).T

@kif kif closed this as completed in 9750872 Jun 17, 2020
@maaeli
Copy link
Contributor

maaeli commented Jul 4, 2020

Hi Jérôme,

for me BIFT works on the BSA test set, even if I crop the pre-Guinier data:
image
Fit for complete data:
image
Fit for cropped data:
image

How exactly did you remove the pre-Guinier region?

@kif
Copy link
Member Author

kif commented Jul 13, 2020

You are right, it looks OK... I don't know what I did implement

@kif kif reopened this Jul 13, 2020
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

2 participants