You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pair distribution function is an integral transform of the intensity distribution over $Q$.
See #65 and the related issue #49 for more context.
The transform is computed by approximating the integral. The approximation errors causes the result to contain nonphysical oscillations. Example:
In the literature here are some different suggestions about how to handle the oscillations. A common approach is to apply a filter to smooth high frequency oscillations in the result. The issue with that approach is that it doesn't deal with the underlying problem: the approximation error. It removes the symptoms but since it doesn't distinguish between the nonphysical and the physical signal it simultaneously smooths both, therefore it might remove real physical oscillations, and it broadens peaks in the signal. If this is desirable is a question for the IDS, but if my understanding is correct it should be understood that no conclusions like "this peak was removed by the smoothing so it was noise" or "this peak was not removed by the smoothing so it is a real signal" can be drawn from the smoothing procedure.
Step 1:
Discuss this with the IDS, ask what kind of smoothing they want.
Step 2:
Maybe implement one or several smoothing procedures typically used in the field.
Alternative: Improve the approximation
An alternative approach is to improve the approximation to remove the nonphysical oscillations without mangling the real signal.
One part of the integration error comes from the fact that we are truncating the integral at $Q_{max}$ because beyond that we don't have data. In the current implementation what we do is equivalent to assuming that the integrand is $0$ when $Q>Q_{max}$. That is a reasonable approximation because the asymptotic value is $0$. But we could probably make some other assumption that better matches reality.
Example / poc
In this example a model is fitted to $S(Q) \quad Q>Q_{max}$ to let us integrate beyond $Q_{max}$. Doing so removes some oscillations. See comparison below:
This is the $S(Q)$ signal, with a fitted extrapolation:
Original result without the extrapolation can be seen in the example figure near the top.
The result using the extrapolation method is displayed below.
It seems like the nonphysical oscillations are reduced and the peaks are sharper, but evaluating this more requires input from the IDS.
The text was updated successfully, but these errors were encountered:
The pair distribution function is an integral transform of the intensity distribution over$Q$ .
See #65 and the related issue #49 for more context.
The transform is computed by approximating the integral. The approximation errors causes the result to contain nonphysical oscillations. Example:
![pdf_without_extrapolated](https://private-user-images.githubusercontent.com/20954731/346505576-f86511b2-0c5d-4af3-90c7-e90d46d92e48.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NTEwNDgsIm5iZiI6MTczODg1MDc0OCwicGF0aCI6Ii8yMDk1NDczMS8zNDY1MDU1NzYtZjg2NTExYjItMGM1ZC00YWYzLTkwYzctZTkwZDQ2ZDkyZTQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE0MDU0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlmOGM4NGI4ZDhkMjVlYTViZTE5OGQ0YjVhZTExYWRlYmZlYjBiODA0ZDYyNTkzMGU0MjM2ODY2MGE2OGEwN2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.66bN9LmrHXbysf2Iax77WEltv1TJ4OhrRwk8BoCZWfg)
In the literature here are some different suggestions about how to handle the oscillations. A common approach is to apply a filter to smooth high frequency oscillations in the result. The issue with that approach is that it doesn't deal with the underlying problem: the approximation error. It removes the symptoms but since it doesn't distinguish between the nonphysical and the physical signal it simultaneously smooths both, therefore it might remove real physical oscillations, and it broadens peaks in the signal. If this is desirable is a question for the IDS, but if my understanding is correct it should be understood that no conclusions like "this peak was removed by the smoothing so it was noise" or "this peak was not removed by the smoothing so it is a real signal" can be drawn from the smoothing procedure.
Step 1:
Step 2:
Alternative: Improve the approximation
An alternative approach is to improve the approximation to remove the nonphysical oscillations without mangling the real signal.$Q_{max}$ because beyond that we don't have data. In the current implementation what we do is equivalent to assuming that the integrand is $0$ when $Q>Q_{max}$ . That is a reasonable approximation because the asymptotic value is $0$ . But we could probably make some other assumption that better matches reality.
One part of the integration error comes from the fact that we are truncating the integral at
Example / poc
In this example a model is fitted to$S(Q) \quad Q>Q_{max}$ to let us integrate beyond $Q_{max}$ . Doing so removes some oscillations. See comparison below:
This is the$S(Q)$ signal, with a fitted extrapolation:
![extrapolated_soq](https://private-user-images.githubusercontent.com/20954731/346505280-1f8c0611-58ae-4c1d-8701-aa847c6a1d15.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NTEwNDgsIm5iZiI6MTczODg1MDc0OCwicGF0aCI6Ii8yMDk1NDczMS8zNDY1MDUyODAtMWY4YzA2MTEtNThhZS00YzFkLTg3MDEtYWE4NDdjNmExZDE1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE0MDU0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk2NjljY2U0MjUxMTFmZTY2YmNiMTQwNGI1MzhmMDFhYzZhMDY0ZDJlOWU5ZDFjZDg5ZjM2NjdlNjY2ZjVkMjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ZxmGGUPzQHIwTeJJh82vPVcOf8aGq3brEbvmsAv7nsU)
Original result without the extrapolation can be seen in the example figure near the top.
![pdf_from_extrapolated](https://private-user-images.githubusercontent.com/20954731/346505971-b2ad6328-9bc7-4c77-a587-867822c29a56.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NTEwNDgsIm5iZiI6MTczODg1MDc0OCwicGF0aCI6Ii8yMDk1NDczMS8zNDY1MDU5NzEtYjJhZDYzMjgtOWJjNy00Yzc3LWE1ODctODY3ODIyYzI5YTU2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE0MDU0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMxOTFiMmIyZWEyMzk3OTNhMDZhYThiM2JhODYwZDJjMGY1YWE1N2ZlODExOGE5ZjQwMmY5NDQ3OWVhOWM1NjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.LMlw1AbFbnZg-El7bn-C4aZe_spNYhqVy4qkfwq14eg)
The result using the extrapolation method is displayed below.
It seems like the nonphysical oscillations are reduced and the peaks are sharper, but evaluating this more requires input from the IDS.
The text was updated successfully, but these errors were encountered: