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

muD as a required input #165

Open
till-schertenleib opened this issue Feb 5, 2025 · 4 comments
Open

muD as a required input #165

till-schertenleib opened this issue Feb 5, 2025 · 4 comments

Comments

@till-schertenleib
Copy link
Collaborator

Problem

Proposed solution

there are two issues:

  1. why am I required to specify muD if I have a zscan file to determine muD experimentally?
  2. I specified a muD of 1.0, why does it tell me that this is outside o fhte acceptable range for muD (0.5 to 6.0)?

I guessed the muD of 1.0, since I don't know the muD of my sample. muD should only be a requirement if I don't provide a zscan file... no?

@till-schertenleib
Copy link
Collaborator Author

Here is the input line and the error I got back.

$ labpdfproc 1.0 ts1000_635um_3_accum_0.xy -w 0.71073 -x tth -z ts1000_635um_zscan_exported.xy
Traceback (most recent call last):
File "C:\Users\tills\miniconda3\envs\labpdfproc\Scripts\labpdfproc-script.py", line 9, in
sys.exit(main())
^^^^^^
File "C:\Users\tills\miniconda3\envs\labpdfproc\Lib\site-packages\diffpy\labpdfproc\labpdfprocapp.py", line 169, in main
absorption_correction = compute_cve(input_pattern, args.mud, args.method)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tills\miniconda3\envs\labpdfproc\Lib\site-packages\diffpy\labpdfproc\functions.py", line 267, in compute_cve
abdo_on_global_tth = cve_function(diffraction_data, mud)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tills\miniconda3\envs\labpdfproc\Lib\site-packages\diffpy\labpdfproc\functions.py", line 213, in _cve_polynomial_interpolation
raise ValueError(
ValueError: mu*D is out of the acceptable range (0.5 to 6) for polynomial interpolation. Please rerun with a value within this range or specifying another method from ('brute_force', 'polynomial_interpolation').

@yucongalicechen
Copy link
Collaborator

Yeah you're right. I'll implement this issue #143 to fix this. Right now if you have a zscan file, muD will be replaced by whatever it fits for the file. So it looks like the zscan muD here is <0.5 or > 6.

@sbillinge
Copy link
Contributor

Thanks for reporting Till. For <0.5 I don't think we want to throw a value error, we can just extrapolate or set to 0.

I guess this is teh second time someone wanted the fast interpolator to work for mud >6. We could offer this in principle. It just means calculating a few more curves, right? @till-schertenleib, how high do you want the MuD to go and still have the fast calculator work?

Another thought, on the error message, it is probably a good idea to print what the value of hte muD is so the user has some idea why it failed.

@till-schertenleib
Copy link
Collaborator Author

till-schertenleib commented Feb 6, 2025 via email

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

3 participants