extends pld_fabrication dictionary with UoM's

now keys with numeric values are sub-dictionaries with a "value" and a
"units" key - unitS not unit to comply directly with NeXus format, which
turned out to be a good idea to avoid confusion since eLabFTW uses the
word "units" for the list of accepted units and "unit" for the selected
one...

NOTE: UoM = Unit of Measurement
This commit is contained in:
2026-02-16 15:39:32 +01:00
parent 1b1834d4e6
commit 74b8c9cfae

View File

@@ -135,9 +135,15 @@ def make_nexus_schema_dictionary(substrate_object, layers):
"name": substrate_object.name,
"chemical_formula" : substrate_object.get_compound_formula(apikey),
"orientation" : substrate_object.orientation,
"miscut_angle" : substrate_object.miscut_angle,
"miscut_angle" : {
"value": substrate_object.miscut_angle,
"units": substrate_object.miscut_angle_unit
},
"miscut_direction" : substrate_object.miscut_direction,
"thickness" : substrate_object.thickness,
"thickness" : {
"value": substrate_object.thickness,
"units": substrate_object.thickness_unit,
},
"dimensions" : substrate_object.dimensions,
"surface_treatment" : substrate_object.surface_treatment,
"manufacturer" : substrate_object.manufacturer,
@@ -157,11 +163,14 @@ def make_nexus_schema_dictionary(substrate_object, layers):
"description" : target_object.description,
"shape" : target_object.shape,
"dimensions" : target_object.dimensions,
"thickness" : target_object.thickness,
"thickness" : {
"value": target_object.thickness,
"units": target_object.thickness_unit,
},
"solid_form" : target_object.solid_form,
"manufacturer" : target_object.manufacturer,
"batch_id" : target_object.name,
# TO-DO: currently not available:
# "batch_id" : target_object.batch_id,
}
multilayer[name] = {
"target": target_dict,
@@ -169,17 +178,44 @@ def make_nexus_schema_dictionary(substrate_object, layers):
"operator": layer.operator,
"description": layer.description,
"number_of_pulses": layer.number_of_pulses,
"deposition_time": layer.deposition_time,
"temperature": layer.temperature,
"deposition_time": {
"value": layer.deposition_time,
"units": layer.deposition_time_unit,
},
"temperature": {
"value": layer.temperature,
"units": layer.temperature_unit,
},
"heating_method": layer.heating_method,
"layer_thickness": layer.layer_thickness,
"layer_thickness": {
"value": layer.layer_thickness,
"units": layer.layer_thickness_unit,
},
"buffer_gas": layer.buffer_gas,
"process_pressure": layer.process_pressure,
"heater_target_distance": layer.heater_target_distance,
"repetition_rate": layer.repetition_rate,
"laser_fluence": layer.laser_fluence,
"laser_spot_area": layer.laser_spot_area,
"laser_energy": layer.laser_energy,
"process_pressure": {
"value": layer.process_pressure,
"units": layer.process_pressure_unit,
},
"heater_target_distance": {
"value": layer.heater_target_distance,
"units": layer.heater_target_distance_unit,
},
"repetition_rate": {
"value": layer.repetition_rate,
"units": layer.repetition_rate_unit,
},
"laser_fluence": {
"value": layer.laser_fluence,
"units": layer.laser_fluence_unit,
},
"laser_spot_area": {
"value": layer.laser_spot_area,
"units": layer.laser_spot_area_unit,
},
"laser_energy": {
"value": layer.laser_energy,
"units": layer.laser_energy_unit,
},
"laser_rastering": {
"geometry": layer.laser_rastering_geometry,
"positions": layer.laser_rastering_positions,
@@ -187,15 +223,33 @@ def make_nexus_schema_dictionary(substrate_object, layers):
},
"pre_annealing": {
"ambient_gas": layer.pre_annealing_ambient_gas,
"pressure": layer.pre_annealing_pressure,
"temperature": layer.pre_annealing_temperature,
"duration": layer.pre_annealing_duration,
"pressure": {
"value": layer.pre_annealing_pressure,
"units": layer.pre_annealing_pressure_unit,
},
"temperature": {
"value": layer.pre_annealing_temperature,
"units": layer.pre_annealing_temperature_unit,
},
"duration": {
"value": layer.pre_annealing_duration,
"units": layer.pre_annealing_duration_unit,
},
},
"post_annealing": {
"ambient_gas": layer.post_annealing_ambient_gas,
"pressure": layer.post_annealing_pressure,
"temperature": layer.post_annealing_temperature,
"duration": layer.post_annealing_duration,
"pressure": {
"value": layer.post_annealing_pressure,
"units": layer.post_annealing_pressure_unit,
},
"temperature": {
"value": layer.post_annealing_temperature,
"units": layer.post_annealing_temperature_unit,
},
"duration": {
"value": layer.post_annealing_duration,
"units": layer.post_annealing_duration_unit,
},
},
}
return pld_fabrication