completes the dataset with instruments_used (in a way...)
only lacks units of measurement, then I'll be ready for conversion
This commit is contained in:
25
src/main.py
25
src/main.py
@@ -98,6 +98,30 @@ def chain_layer_to_target(layer_object):
|
||||
material_object = call_material_from_elabid(target_elabid)
|
||||
return material_object
|
||||
|
||||
def deduplicate_instruments_from_layers(layers):
|
||||
lasers = []
|
||||
chambers = []
|
||||
rheeds = []
|
||||
for lyr in layers:
|
||||
instruments = lyr.get_instruments(apikey)
|
||||
lasers.append(instruments["laser_system"])
|
||||
chambers.append(instruments["deposition_chamber"])
|
||||
rheeds.append(instruments["rheed_system"])
|
||||
instruments_used_dict = {
|
||||
"laser_system": list( set( lasers ) ),
|
||||
"deposition_chamber": list( set( chambers ) ),
|
||||
"rheed_system" : list( set( rheeds ) ),
|
||||
}
|
||||
# lasers = { f"layer_{lyr.layer_number}": lyr.laser_system for lyr in layers }
|
||||
# chambers = { f"layer_{lyr.layer_number}": lyr.deposition_chamber for lyr in layers }
|
||||
# rheeds = { f"layer_{lyr.layer_number}": lyr.rheed_system for lyr in layers }
|
||||
# instruments_used_dict = {
|
||||
# "laser_system": lasers,
|
||||
# "deposition_chamber": chambers,
|
||||
# "rheed_system": rheeds,
|
||||
# }
|
||||
return instruments_used_dict
|
||||
|
||||
def make_nexus_schema_dictionary(substrate_object, layers):
|
||||
pld_fabrication = {
|
||||
"sample": {
|
||||
@@ -115,6 +139,7 @@ def make_nexus_schema_dictionary(substrate_object, layers):
|
||||
},
|
||||
"multilayer": {},
|
||||
},
|
||||
"instruments_used": deduplicate_instruments_from_layers(layers),
|
||||
}
|
||||
multilayer = pld_fabrication["sample"]["multilayer"]
|
||||
for layer in layers:
|
||||
|
||||
Reference in New Issue
Block a user