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 in function srwl_opt_setup_surf_height_2d() #15

Open
SergioLordano opened this issue Jan 29, 2018 · 0 comments
Open

Bug in function srwl_opt_setup_surf_height_2d() #15

SergioLordano opened this issue Jan 29, 2018 · 0 comments

Comments

@SergioLordano
Copy link

Hello,

I believe there are two issues in the function that creates a 2D height error transmission object. I only would like to make sure I am using the correct matrix format. Thank you very much!

  1. In the documentation, it states that in variable _height_prof_data, the first column should be longitudinal points and first row transverse points. However, as the code is written, it seems to me that first row is for the longitudinal coordinates and first column to transverse coordinates, if longitudinal refers to the length of the mirror, which is the direction to be inclined to the incidence angle. In line 3379 of srwlib.py v0.14, it is possible to see that variable sizeLong is given by _height_prof_data[0], which is the first row:
    sizeLong = _height_prof_data[0][npData - 1] - _height_prof_data[0][1]
    Could you check if the documentation needs to be changed?

  2. In lines 3379 and 3388, variables sizeLong and sizeTr are incorrectly calculated, because the last element of first row is simply _height_prof_data[0][npData] instead of _height_prof_data[0][npData - 1]. In these lines, the last element index is different from 3382 (and 3391) because in the latter, the array _ar_arg_long does not include the extra column. The error is only significant if the number of points in length or width is small, though.

Thanks again,
Sergio Lordano.

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

1 participant