Read MIB file into memory without writing to disk
For diagnostic purposes while working at the microscope, it is sometimes useful to me to read a file into memory that I can then process in various ways. In these cases, saving to disk is not necessary and only takes additional time to perform. A function such as "binary_to_memory" or "binary_to_numpy" which was able to parse the MIB file header, extract relevant metadata, and read the binary data would be useful.
metadata , data = binary_to_numpy(binfn,hdrfname,scanXaLu=None,scanYalu=None)
If scanXaLu and scanYalu were None, the function would simply read the entire dataset into a single array that was [N, detX, detY] in size.