oasys-elettra-kit / OASYS1-Wiser

The implementation of WISER into OASYS
MIT License
0 stars 1 forks source link

Joint test session: OASYS vs LibWiser #52

Closed capitanevs closed 3 years ago

capitanevs commented 3 years ago

Here I test the following beamline.

immagine

The first results I get are:

LibWiser: immagine

Oasys: immagine

So, there is a problem in positioning.

Let's have a look at the widget settings.... (next)

capitanevs commented 3 years ago

I found one mistake I did in the focussing mirror: immagine

If I manually set the distance, I get an "almost right result" LibWiser: immagine

Oasys: immagine

QUITE good, but... LibWiser has a wrong scale?

capitanevs commented 3 years ago

fm_h.PlotIntensity() return the right plot

immagine

Beamline.PlotIntensity() does not

immagine

I'll fix this...

capitanevs commented 3 years ago

Plot bug corrected . immagine immagine

immagine

capitanevs commented 3 years ago

Also the focusing on the detector now is correct:

immagine

capitanevs commented 3 years ago

I close, update and save.

I get errors at the detector: immagine

immagine

On problem is the mu character of enf formatting (omg). I fix this immagine

However there must be another problem somewhere else. Look at the intensity on the KB.

I see that the distances of slits and KB are WRONG:

immagine immagine

ARE WE SURE THAT UPDATING DOES NOT AFFECT SAVED PARAMETERS? (old question)

capitanevs commented 3 years ago

The widget of KB has been defaulted! immagine

before F1 and F2 were 99 and 1.4 and distance was 99.

investigate

capitanevs commented 3 years ago

also the names have been changed immagine

capitanevs commented 3 years ago

I do "save", close Oasys, open test_wiser_margot_correct3.ows and see that the new name is correctly stored immagine

Conclusion: Some kind of updates do generate problems.

capitanevs commented 3 years ago

Conclusions

capitanevs commented 3 years ago

test_wiser_margot_correct3.zip just rename zip into ows

capitanevs commented 3 years ago

Now, together wi Aljosa

file: margot3, before update immagine

capitanevs commented 3 years ago

immagine

capitanevs commented 3 years ago

About Numba: immagine

aljosahafner commented 3 years ago
capitanevs commented 3 years ago

Intermediate Conclusions

capitanevs commented 3 years ago
* Please push the fixed version of Units

* Does this help, after Numba update (seems to be the source of previous errors) I am getting this error with FigureError
  ![image](https://user-images.githubusercontent.com/51963146/123240881-ff8b1580-d4e0-11eb-9d61-ef2acdcfaa6d.png)

Interesting and curious.

I obviously conceived the message because it often happened that one of the two arrays was 0 length (itis what it is written). But even more obviously this is not what is happening: they are 5000 and 5016 long. np.linspace seems to be a good candidate

I will check.

Can you share the very same file?

aljosahafner commented 3 years ago

Definitely the source of the "data not plottable" is Units package! If I remove the usage of GetAxisSI out, then the error dissapears!

capitanevs commented 3 years ago

Definitely the source of the "data not plottable" is Units package! If I remove the usage of GetAxisSI out, then the error dissapears!

Yes, but how? GetAxisSI is returning two values: an array (which does no contain strings) and a character, which we hardcoded to "K". There must be another link to Units.py.....

aljosahafner commented 3 years ago

I sent you an E-mail, maybe this helps with debugging... image

capitanevs commented 3 years ago

I am confused... this is what I get now with the same lines... immagine

aljosahafner commented 3 years ago

image

capitanevs commented 3 years ago

When you have time, let's try to run this test code

#%%
from LibWiser import Units
import numpy as np
Units.PrefixLookup['u']
Units.PrefixLookup['μ']

x = 2e-6
xx = np.array([x, 2*x])
Units.GetEngFormatWithPrefix(x)
#Units.GetEngFormatWithExponential(x)
Units.GetEngArgument(x)
Units.GetEngPrefix(x)
Units.GetEngInfo(xx)
Units.GetEngAxis(xx)
Units.GetAxisSI(xx)

there's my output immagine

aljosahafner commented 3 years ago

image

capitanevs commented 3 years ago

Ok, that IS really funny...

immagine

Going to lunch now, back on it late....

capitanevs commented 3 years ago

I have pushed my latest version of units

aljosahafner commented 3 years ago

Yes, it's the character, somehow you can't pass it around, probably some encoding problem... Let's try to avoid this character entirely

capitanevs commented 3 years ago

This is even more funny

immagine

capitanevs commented 3 years ago

Ok, the mu is now totally disappeared.

aljosahafner commented 3 years ago

Excellent! Plotting works, starting from v0.2.29!

aljosahafner commented 3 years ago

What remains to be solved from this test session is the FigureError.

capitanevs commented 3 years ago

This was a long thread. We found&fixed a lot of things.

I think that the only still open question is whether "save&restore" is really stable.

We do not have a procedure for re-creating the save&restore errors, and I have not found any in the last updates.

I'll close this issue.