empa-scientific-it / cleedpy

MIT License
1 stars 0 forks source link

Print cleed output using only Python functions #47

Closed yakutovicha closed 3 months ago

yakutovicha commented 3 months ago

I started to observe certain stochasticity in the results of the CLEED simulation. Running the same input several times might lead to different results. At first, I thought the problem came from those lines I changed in the PR:

From this:

            if( ((beams_all+i_beams_all)->ind_1 == (beams_now+i_beams_now)->ind_1) && ((beams_all+i_beams_all)->ind_2 == (beams_now+i_beams_now)->ind_2)  )
            {
                if ((beams_now+i_beams_now)->k_par <= k_r)
                {
                    if(Int->rel[i_beams_now + 1] > INT_TOLERANCE)
                        beam_intensities[i_beams_all] = Int->rel[i_beams_now + 1];
                    else
                        beam_intensities[i_beams_all] = 0.;
                }
                else
                    beam_intensities[i_beams_all] = 0.;
                break;
            } /* if index = index */

To this:

            if( ((beams_all+i_beams_all)->ind_1 == (beams_now+i_beams_now)->ind_1) && ((beams_all+i_beams_all)->ind_2 == (beams_now+i_beams_now)->ind_2)  )
            {
                if (((beams_now+i_beams_now)->k_par <= k_r) && (Int->rel[i_beams_now + 1] > INT_TOLERANCE))
                    beam_intensities[i_beams_all] = Int->rel[i_beams_now + 1];
                else
                    beam_intensities[i_beams_all] = 0.;
                break;
            }

Unfortunately, this is not the case. After reverting the change the issue persists. The next thing is to try to understand whether the problem was present before this PR.

GeorgHeld commented 3 months ago

Sorry,

I didn't have time all day. I just approved but it would be good if we could have a quick discussion at some point tomorrow.

Best wishes Georg

From: Aliaksandr Yakutovich @.> Sent: Tuesday, August 6, 2024 10:29 AM To: empa-scientific-it/cleedpy @.> Cc: Held, Georg (DLSLtd,RAL,SCI) @.>; Review requested @.> Subject: Re: [empa-scientific-it/cleedpy] Print cleed output using only Python functions (PR #47)

@yakutovichahttps://github.com/yakutovicha requested your review on: #47https://github.com/empa-scientific-it/cleedpy/pull/47 Print cleed output using only Python functions.

- Reply to this email directly, view it on GitHubhttps://github.com/empa-scientific-it/cleedpy/pull/47#event-13775677095, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BDNIDB6HG5E3E4FGDOKKUBLZQCJPNAVCNFSM6AAAAABLUQ5KTSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTG43TKNRXG4YDSNI. You are receiving this because your review was requested.Message ID: @.***>

This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom.