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

Bug: get_energies does not always produce intended energy list #37

Open
PriyankaKetkarBNL opened this issue Sep 6, 2024 · 1 comment
Assignees

Comments

@PriyankaKetkarBNL
Copy link
Contributor

PriyankaKetkarBNL commented Sep 6, 2024

In rsoxs_scans/constructor.py, the get_energies function does not consistently produce the desired energy list. Below are some examples of what is entered and outputs

energies = get_energies(edge=[260, 270, 280, 290, 293, 296, 300, 340], frames=1, ratios=[1, 1, 1, 1, 1, 1, 1]) 

## This works.  
## Output: [260. 270. 280. 290. 293. 296. 300. 340.]
energies = get_energies(edge=[282, 283, 286, 286.5, 287, 287.5, 288, 288.5, 289], frames=1, ratios=[1, 1, 1, 1, 1, 1, 1, 1]) 
## This works.  
## Output: [282.  283.  286.  286.5 287.  287.5 288.  288.5 289. ]
energies = get_energies(edge=[284, 284.5, 284.75, 285, 285.5], frames=1, ratios=[1, 1, 1, 1])  

## This doesn't work.  
####
Output: [284.   284.   284.   284.05 284.05 284.05 284.05 284.05 284.1  284.1
 284.1  284.1  284.1  284.15 284.15 284.15 284.15 284.15 284.2  284.2
 284.2  284.2  284.2  284.25 284.25 284.25 284.25 284.25 284.3  284.3
 284.3  284.3  284.3  284.35 284.35 284.35 284.35 284.35 284.4  284.4
 284.4  284.4  284.4  284.45 284.45 284.45 284.45 284.45 284.5  284.5
 284.5  284.5  284.5  284.55 284.55 284.55 284.55 284.55 284.6  284.6
 284.6  284.6  284.6  284.65 284.65 284.65 284.65 284.65 284.7  284.7
 284.7  284.7  284.7  284.75 284.75 284.75 284.75 284.75 284.8  284.8
 284.8  284.8  284.8  284.85 284.85 284.85 284.85 284.85 284.9  284.9
 284.9  284.9  284.9  284.95 284.95 284.95 284.95 284.95 285.   285.
 285.   285.   285.   285.05 285.05 285.05 285.05 285.05 285.1  285.1
 285.1  285.1  285.1  285.15 285.15 285.15 285.15 285.15 285.2  285.2
 285.2  285.2  285.2  285.25 285.25 285.25 285.25 285.25 285.3  285.3
 285.3  285.3  285.3  285.35 285.35 285.35 285.35 285.35 285.4  285.4
 285.4  285.4  285.4  285.45 285.45 285.45 285.45 285.45 285.5  285.5
 285.5 ]
###
energies = get_energies(edge=[284.01, 284.51, 284.75, 285.01, 285.51], frames=1, ratios=[1, 1, 1, 1])  

## This doesn't work 
#### 
Output: [284.   284.   284.05 284.05 284.05 284.05 284.05 284.1  284.1  284.1
 284.1  284.1  284.15 284.15 284.15 284.15 284.15 284.2  284.2  284.2
 284.2  284.2  284.25 284.25 284.25 284.25 284.25 284.3  284.3  284.3
 284.3  284.3  284.35 284.35 284.35 284.35 284.35 284.4  284.4  284.4
 284.4  284.4  284.45 284.45 284.45 284.45 284.45 284.5  284.5  284.5
 284.5  284.5  284.55 284.55 284.55 284.55 284.55 284.6  284.6  284.6
 284.6  284.6  284.65 284.65 284.65 284.65 284.65 284.7  284.7  284.7
 284.7  284.7  284.75 284.75 284.75 284.75 284.75 284.8  284.8  284.8
 284.8  284.8  284.85 284.85 284.85 284.85 284.85 284.9  284.9  284.9
 284.9  284.9  284.95 284.95 284.95 284.95 284.95 285.   285.   285.
 285.   285.   285.05 285.05 285.05 285.05 285.05 285.1  285.1  285.1
 285.1  285.1  285.15 285.15 285.15 285.15 285.15 285.2  285.2  285.2
 285.2  285.2  285.25 285.25 285.25 285.25 285.25 285.3  285.3  285.3
 285.3  285.3  285.35 285.35 285.35 285.35 285.35 285.4  285.4  285.4
 285.4  285.4  285.45 285.45 285.45 285.45 285.45 285.5  285.5  285.5
 285.5 ]
####
energies = get_energies(edge=[284, 284.5, 284.75, 285, 285.5], frames=1) 
## This works
## Output: [284.   284.5  284.75 285.   285.5 ]
@delongchamp delongchamp self-assigned this Sep 6, 2024
@delongchamp
Copy link
Collaborator

@PriyankaKetkarBNL I've been working on this and I think it would benefit from a complete refactor. We should decide how to best frame the custom energy scans to meet user needs.

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