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

SAS processing is unaware of measuring units #55

Open
aozalevsky opened this issue May 24, 2022 · 3 comments
Open

SAS processing is unaware of measuring units #55

aozalevsky opened this issue May 24, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@aozalevsky
Copy link
Contributor

It looks like the code is hardcoded for the 1/A units, thus it is failing on files with 1/nm units (related to #53)

There are multiple places using a hardcoded A to nm conversion:

I_df['Q'] = I_df['Q']*10

I_df['Q'] = I_df['Q']*10

pdf_re['Q'] = pdf_re['Q']*10

G_df_range['Q'] = G_df['Q']*10

G_df_range['Q2A'] = G_df_range['Q2']*100

The information about units is stored in the sascif file:

SASDC29

_sas_scan.unit                      1/A

SASDDD6

_sas_scan.unit                      1/nm
@aozalevsky aozalevsky added the bug Something isn't working label May 24, 2022
@aozalevsky
Copy link
Contributor Author

SASDDD6 is the only one affected at the moment

SASDBV9.sascif:_sas_scan.unit                      1/A
SASDBW9.sascif:_sas_scan.unit                      1/A
SASDBX9.sascif:_sas_scan.unit                      1/A
SASDBY9.sascif:_sas_scan.unit                      1/A
SASDBZ9.sascif:_sas_scan.unit                      1/A
SASDC29.sascif:_sas_scan.unit                      1/A
SASDCG7.sascif:_sas_scan.unit                      1/A
SASDDD6.sascif:_sas_scan.unit                      1/nm
SASDEE2.sascif:_sas_scan.unit                      1/A
SASDG85.sascif:_sas_scan.unit                      1/A

@benmwebb
Copy link
Member

IIRC, Sai had a few entries that didn't have corresponding data in SASBDB, so she couldn't reliably determine the units. But agreed, if we know the units are 1/nm (or you can use a heuristic to figure it out) then we should not hardcode 1/A.

@aozalevsky
Copy link
Contributor Author

this is addressed in the dev_2.0 branch with a complete rewrite of sas code.

def get_scan_unit_mult(unit) -> int:
return {'1/A': 10.0, '1/nm': 1.0}[unit]

I'll keep the issue open until the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants