Skip to content

In-Memory Data for Powder Histogram Import #181

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

Open
Mattpal00 opened this issue May 6, 2025 · 2 comments
Open

In-Memory Data for Powder Histogram Import #181

Mattpal00 opened this issue May 6, 2025 · 2 comments
Assignees
Labels
Done? Probably complete, but not yet closed enhancement New feature or request Scripting enhancement/bug for GSASIIscriptable

Comments

@Mattpal00
Copy link

I'm currently using GSASIIscriptable as part of an automated XRD analysis workflow and have encountered a limitation with the add_powder_histogram() method, which appears to accept only file paths for importing data. Since my data is already held in memory (as NumPy arrays), I’m required to write temporary files to disk solely for the purpose of importing them into a GSAS-II project.

Is there currently a supported way to import powder data directly from memory (e.g., as a NumPy array, string, or file-like object) without having to create temporary files?

Any guidance would be greatly appreciated.

@Mattpal00 Mattpal00 reopened this May 6, 2025
@Mattpal00 Mattpal00 changed the title Feature Request: Support In-Memory Data for Powder Histogram Import In-Memory Data for Powder Histogram Import May 6, 2025
@briantoby
Copy link
Collaborator

briantoby commented May 6, 2025

@Mattpal00 I can't see any way to do this with the existing code, but the importers are pretty easy to code so if you write your own importer (see https://gsas-ii.readthedocs.io/en/latest/imports.html), it should be pretty easy to work with in-memory information. The code that calls the importers probably needs to get a valid file name, but the importer does not need to read from it.

@briantoby briantoby self-assigned this May 6, 2025
@briantoby briantoby added enhancement New feature or request Done? Probably complete, but not yet closed Scripting enhancement/bug for GSASIIscriptable labels May 6, 2025
@briantoby
Copy link
Collaborator

following up: is this resolved or do you need some help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Done? Probably complete, but not yet closed enhancement New feature or request Scripting enhancement/bug for GSASIIscriptable
Projects
None yet
Development

No branches or pull requests

2 participants