Open JoernSeltmann opened 1 month ago
Without looking at your particular numbers, I can give you some pointers:
The conversion code is in the source of the widget: https://github.com/oasys-kit/ShadowOui/blob/master/orangecontrib/shadow/widgets/preprocessor/vls_pgm_coefficients_calculator.py
It has always been different conventions for the definition of the coefficients. An interesting discussion is in https://github.com/srio/shadow3-docs/blob/master/doc/VLS_sign_conventions.pdf
Hope this helps.
best regards, Manuel
In the source, the bx coefficients are calculated first and I thought those were developed with Mr Reininger since I read this issue post where his help was requested: https://github.com/oasys-kit/ShadowOui/issues/6
afterwards the Shadow coefficients are derived from them. My problem is that one convention (Shadow) seems to point to an increasing line density along the y-axis, while the other (bx) seems to give a decreasing line density on the same coordinate system. This is kind of mentioned in the "VLS_sign_conventions" document below formula (4):
...reversing signs of the odd power coefficients... is equivalent to ... turning it [the grating] around.
However the bx convention isn't given there and isn't used by Shadow as far as I know. It only appears in this ShadowOui widget.
The VLS widget was created with the aim of helping in the definition of the coefficients that SHADOW needs. It is not coupled with SHADOW, it only calculates the SHADOW parameters. It used the formulas of R. Reininger. It demonstrated its utility. If you are not happy with it, you can always calculate the coefficients you need by hand. Indeed, you can always play with the signs to adjust to your geometry.
I just found this confusing and was asking for the used convention. Thank you for clarification.
I had a look at the VLS coefficients from the output tab of the "VLS PGM Coefficients Calculator". For me these values were given:
For the Shadow coefficients the convention is given in "Shadow - Trace": page 8: Y-axis on surface away from source page 48: R(y) = a0 + a1y + a2y^2 + a3+y^3 (+ a4*y^4), with a0 being the ruling density at the origin.
When I try to use the bx coefficients though, I'm having problems using those in the Shadow coordinate system. I found this formula in a paper by Reininger (https://doi.org/10.1016/j.nima.2010.12.162):
However with b2 and b4 being negative, this results in a mirrored image to the Shadow formula which gives increasing line densities along y, while the Reininger formula gives a decreasing result. Which could either be a result of me using the wrong formula or a different orientation of y-axis, I guess?!
Could you please give me a reference to the bx convention used here?