orix icon indicating copy to clipboard operation
orix copied to clipboard

Add a CrystalMap.info string or similar where the user can put whatever they want

Open hakonanes opened this issue 4 years ago • 3 comments

Problem

We store dictionary indexing and orientation refinement results from kikuchipy in CrystalMap, typically in orix' HDF5 format. It would be good if kikuchipy could return the crystal map with the indexing/refinement parameters used, like whether a detector mask was used.

Solution

We could support something as simple as a string with this information, like CrystalMap.info. This could then be written to and read from the HDF5 format, .ang files and all other IO formats supporting metadata.

We should take care to not start supporting custom attributes like used_detector_mask in CrystalMap, because this will become impossible to maintain for many reasons.

Alternatives

CrystalMap.info could be a dictionary with keys and values instead, like CrystalMap.info["used_detector_mask"] = True, but then we would need to handle values of various types. This requires more maintenance.

hakonanes avatar Nov 12 '21 13:11 hakonanes

My preference would be to call it metadata and make it a string field.

pc494 avatar Nov 18 '21 20:11 pc494

Agree. Will go with that when I get to this. Thanks.

hakonanes avatar Nov 19 '21 08:11 hakonanes

This would be the best choice for #197.

hakonanes avatar Feb 14 '22 16:02 hakonanes