def make_hyperspy(signal_type="<STR_LIT>"):
tifin = datapath / "<STR_LIT>"<EOL>with tifffile.TiffFile(os.fspath(tifin)) as tf:<EOL><INDENT>data = tf.pages[<NUM_LIT:0>].asarray()<EOL><DEDENT>tdir = pathlib.Path(tempfile.mkdtemp(prefix="<STR_LIT>"))<EOL>hspyf = tdir / "<STR_LIT>"<EOL>with h5py.File(hspyf, mode="<STR_LIT:w>") as h5:<EOL><INDENT>h5.attrs["<STR_LIT>"] = "<STR_LIT>"<EOL>exp = h5.create_group("<STR_LIT>")<EOL>hol = exp.create_group("<STR_LIT>")<EOL>hol.create_dataset(name="<STR_LIT:data>", data=data)<EOL>sig = hol.create_group("<STR_LIT>")<EOL>sig.attrs["<STR_LIT>"] = signal_type<EOL>for name in ["<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>axi = hol.create_group(name)<EOL>axi.attrs["<STR_LIT>"] = <NUM_LIT><EOL>axi.attrs["<STR_LIT>"] = "<STR_LIT>"<EOL><DEDENT><DEDENT>return tdir, hspyf<EOL>
Create a basic hyperspy file