HEXRD / hexrd

A cross-platform, open-source library for the analysis of X-ray diffraction data.
Other
56 stars 25 forks source link

Cannot fit a single grain #677

Closed gustafsonsven closed 3 months ago

gustafsonsven commented 3 months ago

Hello all,

Title says it all. If you have a single grain in a grains.out and want to fit it we run into array shape issues. I think this is something I saw even back in the early versions as well so a longer problem that may have a ticket already created (I didn't see one). While it may not be something we do often, we should be able to fit a single grain at need. Thoughts?

Thanks - Sven

kevindlewis23 commented 3 months ago

Can likely be fixed by adding grains_table = np.atleast_2d(grains_table) to the fit_grains method in hexrd/fitgrains.py. I could be wrong so I won't make this change, someone else can confirm. In the meantime, you do that yourself before calling fit_grains or using np.loadtxt(filename, ndmin=2)