Compare commits
2 Commits
3f97ccee25
...
fc150be724
| Author | SHA256 | Date | |
|---|---|---|---|
| fc150be724 | |||
| aa3bf531f9 |
10
src/main.py
10
src/main.py
@@ -1,4 +1,5 @@
|
||||
import os, json, requests, h5py
|
||||
import numpy as np
|
||||
from getpass import getpass
|
||||
from APIHandler import APIHandler
|
||||
from classes import *
|
||||
@@ -301,7 +302,7 @@ def make_nexus_schema_dictionary(substrate_object, layers):
|
||||
}
|
||||
return pld_fabrication
|
||||
|
||||
def build_nexus_file(pld_fabrication, output_path):
|
||||
def build_nexus_file(pld_fabrication, output_path, rheed_osc=None):
|
||||
# NOTE: look at the mail attachment from Emiliano...
|
||||
with h5py.File(output_path, "w") as f:
|
||||
nx_pld_entry = f.create_group("pld_fabrication")
|
||||
@@ -439,6 +440,9 @@ def build_nexus_file(pld_fabrication, output_path):
|
||||
nx_instruments.create_dataset("rheed_system", data = instruments_dict["rheed_system"])
|
||||
except TypeError as te:
|
||||
raise TypeError(te)
|
||||
nx_rheed = nx_pld_entry.create_group("rheed_data")
|
||||
nx_rheed.attrs["NX_class"] = "NXdata"
|
||||
nx_rheed.create_dataset("intensity", data=rheed_osc)
|
||||
return
|
||||
|
||||
if __name__=="__main__":
|
||||
@@ -455,4 +459,6 @@ if __name__=="__main__":
|
||||
# print(make_nexus_schema_dictionary(substrate_object, layers)) # debug
|
||||
with open (f"output/sample-{sample_name}.json", "w") as f:
|
||||
json.dump(result, f, indent=3)
|
||||
build_nexus_file(result, output_path=f"output/sample-{sample_name}-nexus.h5")
|
||||
with open(f"tests/Realtime_Window_Analysis.txt", "r") as o:
|
||||
osc = np.loadtxt(o)
|
||||
build_nexus_file(result, output_path=f"output/sample-{sample_name}-nexus.h5", rheed_osc=osc)
|
||||
|
||||
37931
tests/Realtime_Window_Analysis.txt
Normal file
37931
tests/Realtime_Window_Analysis.txt
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user