Closed hepesu closed 5 years ago
Hi Hepesu,
Thanks for your message, apologies for taking so long to get back to you!
Yes you are correct that when the lattice parameters are large and you want to calculate the whole pattern this may eventually run into the memory size limit for arrays, and cause errors or very slow behaviour. I haven't had this problem yet but it's certainly possible.
Your solution is perfect - I hadn't actually seen np.array_split before and this appears to behave in the desired way.
I will include this functionality in the next version I upload!
For now, you can always reduce the size of the arrays significantly by reducing the max_twotheta argument, which is usually 180 but in reality most measurements don't go this high, probably 100 or 120 degrees may be fine - it depends on your use case.
Thank you!
Hi Hepesu, the latest version now has your idea implemented in the function Crystal.Scatter.intensity. This is the umbrella function for all intensity calculations so should mean memory errors no longer come up. Thanks again for your great suggestion!
That is great!:tada:
Thank you!
When deal with CIF with large HKL range(or just large HKL list), calculate all intensities may use huge amount of mermory. This could be solved by splitting the HKL array into parts, calculating for each parts then merging back.
I use code below to solve the memory problem.