Skip to content

Commit

Permalink
Merge pull request #27 from nemocrys:arvedes/issue13
Browse files Browse the repository at this point in the history
Add comment section for all sensors / devices
  • Loading branch information
arvedes authored Nov 16, 2022
2 parents 0ac8a72 + ced0a32 commit 8f9cbd2
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 35 deletions.
53 changes: 39 additions & 14 deletions config_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,42 @@ devices:
unit: mm/min
label: Pulling velocity
# default: 0
# comment: your comment for nomad ELN
T_ctrl:
unit: °C
label: Control temperature
# default: 0
# comment: your comment for nomad ELN
OP:
label: Control operating point
# default: 0
# comment: your comment for nomad ELN
pos_top:
label: Top axis position
# default: 0
# comment: your comment for nomad ELN
rot_crystal:
unit: rpm
label: Crystal rotation
# default: 0
# comment: your comment for nomad ELN
rot_crucible:
unit: rpm
label: Crucible rotation
# default: 0
# comment: your comment for nomad ELN
pressure:
unit: bar
label: Furnace pressure
# default: 1
# comment: your comment for nomad ELN
door:
label: Furnace door
values:
- open
- closed
# default: open
# comment: your comment for nomad ELN
gas:
label: Gas atmosphere
values:
Expand All @@ -52,6 +60,7 @@ devices:
- nitrogen
- vacuum
# default: air
# comment: your comment for nomad ELN
tag:
label: Process status tag
values:
Expand All @@ -60,9 +69,11 @@ devices:
- growing
- cooling down
# default: heating up
# comment: your comment for nomad ELN
comment:
label: Comment
# default: "Multilog measurement"
# comment: your comment for nomad ELN
DAQ-6510:
serial-interface:
port: /dev/ttyr00
Expand All @@ -85,43 +96,43 @@ devices:
type: temperature
sensor-id: TE_1_K
position: air 155 mm over crucible
# comment: your comment for nomad ELN
102:
type: temperature
sensor-id: TE_2_K
position: crucible frontside
# comment: your comment for nomad ELN
120:
type: temperature
sensor-id: TE_2_J
position: outside furnace
201:
type: dcv
tab-name: Current
range: 10 # V (optional)
sensor-id: rogowski_300A
factor: 100 # Ampere / Volt
unit: A
# comment: your comment for nomad ELN
201:
type: dcv
tab-name: Current
range: 10 # V (optional)
sensor-id: rogowski_chauvin_arnoux_300A
factor: 100 # Ampere / Volt
unit: A
# comment: your comment for nomad ELN
# 201:
# type: dcv
# tab-name: Current
# range: 10 # V (optional)
# sensor-id: rogowski_PEM_300A
# factor: 50 # Ampere / Volt
# unit: A
# # comment: your comment for nomad ELN
# 206:
# type: temperature
# sensor-id: Pt-100_1
# position: crucible backside
# # comment: your comment for nomad ELN
# 207:
# type: temperature
# sensor-id: Pt-100_2
# position: crucible rightside
# # comment: your comment for nomad ELN
# 210:
# type: dcv
# tab-name: Heatflux
Expand All @@ -130,6 +141,7 @@ devices:
# factor: 1 # TODO
# unit: W/m^2
# position: bottom
# # comment: your comment for nomad ELN
# 211:
# type: dcv
# tab-name: Heatflux
Expand All @@ -138,23 +150,28 @@ devices:
# factor: 1 # TODO
# unit: W/m^2
# position: left
# # comment: your comment for nomad ELN
# 212:
# type: dcv
# sensor-id: heater-voltage
# range: 1 # V (optional)
# factor: 1 # TODO
# # comment: your comment for nomad ELN
IFM-flowmeter:
IP: 172.18.56.199
ports:
1:
name: RL_Schwingkreis
type: SV-4200
# comment: your comment for nomad ELN
2:
name: RL_Welle
type: SV-4200
# comment: your comment for nomad ELN
3:
name: RL_Rezipient
type: SV-4200
# comment: your comment for nomad ELN
4:
name: RL_Generator
type: SV-4200
Expand All @@ -178,14 +195,16 @@ devices:
- RL_Spule_1
tolerance: 2.5 # l/min
Eurotherm:
serial-interface:
port: /dev/ttyr04
baudrate: 9600
bytesize: 7
stopbits: 1
parity: E
timeout: 0.1
# comment: your comment for nomad ELN
serial-interface:
port: /dev/ttyr04
baudrate: 9600
bytesize: 7
stopbits: 1
parity: E
timeout: 0.1
IGA-6-23-adv: # Pyrometer
# comment: your comment for nomad ELN
serial-interface:
port: /dev/ttyr02
baudrate: 115200
Expand All @@ -208,6 +227,7 @@ devices:
3.0: 8
10.0: 9
IGA-6-23-vis: # Pyrometer
# comment: your comment for nomad ELN
serial-interface:
port: /dev/ttyUSB1
baudrate: 115200
Expand All @@ -230,6 +250,7 @@ devices:
3.0: 8
10.0: 9
IGAR-6-adv: # Ratio pyrometer
# comment: your comment for nomad ELN
serial-interface:
port: /dev/ttyUSB0
baudrate: 115200
Expand Down Expand Up @@ -262,10 +283,12 @@ devices:
# head-number: 1
# emissivity: 1.0 # 0.0 < emissivity <= 1.0
# t90: 0.18 # s, has to be a value out of t90-dict (below)
# # comment: your comment for nomad ELN
# Pyro_h2:
# head-number: 2
# emissivity: 1.0 # 0.0 < emissivity <= 1.0
# t90: 0.18 # s, has to be a value out of t90-dict (below)
# # comment: your comment for nomad ELN
# t90-dict: # according to manual, don't modify that
# 0.18: 1
# 0.5: 2
Expand All @@ -279,6 +302,7 @@ devices:
exposure-time: 10.e+3 # µs
frame-rate: 32 # device-specific, used for configuration of camera only
timeout: 1000 # ms
# comment: your comment for nomad ELN
Optris-IP-640:
serial-number: 20112117
measurement-range: [0, 250] # [-20, 100], [0, 250], [150 900]
Expand All @@ -287,3 +311,4 @@ devices:
emissivity: 0.95
transmissivity: 1.0
T-ambient: -1000 # Ambient temperature, setting invalid values (below -273,15 degrees) forces the library to take its own measurement values. # TODO what does that mean?
# comment: your comment for nomad ELN
2 changes: 2 additions & 0 deletions multilog/devices/basler_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def write_nomad_file(self, directory="./"):
)
with open(f"{self.base_directory}/{self.name}.archive.yaml", "a") as f:
f.write(f" exposure_time: {self.config['exposure-time']}\n")
if "comment" in self.config:
f.write(f" comment: {self.config['comment']}\n")
f.write(f" images_list:\n")

def save_measurement(self, time_abs, time_rel, sampling):
Expand Down
17 changes: 8 additions & 9 deletions multilog/devices/daq6510.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,20 +289,19 @@ def write_nomad_file(self, directory="./"):
data.update(
{
sensor_name_nomad: {
# "model": "your_field_here",
"name": sensor_name_nomad,
"sensor_id": sensor_name.split(" ")[0],
"attached_to": " ".join(sensor_name.split(" ")[1:]),
"measured_property": self.config["channels"][channel]["type"],
"type": sensor_name.split("_")[0].split(" ")[0],
# "notes": "TE_1_K air 155 mm over crucible",
# "unit": self.unit[sensor_name], # TODO
# "channel": channel, # TODO
# "model": "your_field_here", currently not in nomad schema
# "name": sensor_name_nomad, currently not in nomad schema
# "sensor_id": sensor_name.split(" ")[0], currently not in nomad schema
# "attached_to": " ".join(sensor_name.split(" ")[1:]), currently not in nomad schema
# "measured_property": self.config["channels"][channel]["type"], currently not in nomad schema
# "type": sensor_name.split("_")[0].split(" ")[0], currently not in nomad schema
"value_timestamp_rel": "#/data/value_timestamp_rel",
"value_timestamp_abs": "#/data/value_timestamp_abs",
}
}
)
if "comment" in self.config["channels"][channel]:
data[sensor_name_nomad].update({"comment": self.config["channels"][channel]["comment"]})
sensor_schema = deepcopy(sensor_schema_template)
sensor_schema["section"]["quantities"]["value_log"]["m_annotations"][
"tabular"
Expand Down
4 changes: 3 additions & 1 deletion multilog/devices/eurotherm.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def write_nomad_file(self, directory="./"):
{
sensor_name_nomad: {
# "model": "your_field_here",
"name": sensor_name_nomad,
# "name": sensor_name_nomad,
# "sensor_id": sensor_name.split(" ")[0],
# "attached_to": sensor_name, # TODO this information is important!
# "measured_property": ,
Expand All @@ -127,6 +127,8 @@ def write_nomad_file(self, directory="./"):
}
}
)
if "comment" in self.config:
data[sensor_name_nomad].update({"comment": self.config["comment"]})
sensor_schema = deepcopy(sensor_schema_template)
sensor_schema["section"]["quantities"]["value_log"]["m_annotations"][
"tabular"
Expand Down
10 changes: 6 additions & 4 deletions multilog/devices/ifm_flowmeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ def write_nomad_file(self, directory="./"):
{
sensor_name_nomad: {
# "model": "your_field_here",
"name": sensor_name_nomad,
# "name": sensor_name_nomad,
# "sensor_id": sensor_name.split(" ")[0],
"attached_to": sensor_name,
"measured_property": property,
"type": sensor_type,
# "attached_to": sensor_name,
# "measured_property": property,
# "type": sensor_type,
# "notes": "TE_1_K air 155 mm over crucible",
# "unit": self.unit[sensor_name], # TODO
# "channel": channel, # TODO
Expand All @@ -209,6 +209,8 @@ def write_nomad_file(self, directory="./"):
}
}
)
if "comment" in self.config["ports"][port]:
data[sensor_name_nomad].update({"comment": self.config["ports"][port]["comment"]})
sensor_schema = deepcopy(sensor_schema_template)
sensor_schema["section"]["quantities"]["value_log"]["m_annotations"][
"tabular"
Expand Down
2 changes: 2 additions & 0 deletions multilog/devices/optris_ip640.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def write_nomad_file(self, directory="./"):
f.write(f" ambient_temperature: {self.t_ambient}\n")
f.write(f" measurement_range: '{self.config['measurement-range']}'\n")
f.write(f" extended_temperature_range: {self.config['extended-T-range']}\n")
if "comment" in self.config:
f.write(f" comment: {self.config['comment']}\n")
f.write(f" ir_images_list:\n")

def save_measurement(self, time_abs, time_rel, sampling):
Expand Down
4 changes: 3 additions & 1 deletion multilog/devices/process_condition_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def write_nomad_file(self, directory="./"):
{
sensor_name_nomad: {
# "model": "your_field_here",
"name": sensor_name_nomad,
# "name": sensor_name_nomad,
# "sensor_id": sensor_name.split(" ")[0],
# "attached_to": sensor_name, # TODO this information is important!
# "measured_property": ,
Expand All @@ -109,6 +109,8 @@ def write_nomad_file(self, directory="./"):
}
}
)
if "comment" in self.config[sensor_name]:
data[sensor_name_nomad].update({"comment": self.config[sensor_name]["comment"]})
sensor_schema = deepcopy(sensor_schema_template)
sensor_schema["section"]["quantities"]["value_log"]["m_annotations"][
"tabular"
Expand Down
8 changes: 6 additions & 2 deletions multilog/devices/pyrometer_array_lumasense.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(self, config, name="PyrometerArrayLumasense"):
name (str, optional): Device name.
"""
logger.info(f"Initializing PyrometerArrayLumasense device '{name}'")
self.config = config
self.device_id = config["device-id"]
self.name = name
try:
Expand Down Expand Up @@ -154,20 +155,23 @@ def write_nomad_file(self, directory="./"):
{
sensor_name_nomad: {
# "model": "your_field_here",
"name": sensor_name_nomad,
# "name": sensor_name_nomad,
# "sensor_id": sensor_name.split(" ")[0],
# "attached_to": sensor_name, # TODO this information is important!
# "measured_property": ,
# "type": sensor_type,
# "notes": "TE_1_K air 155 mm over crucible",
# "unit": self.unit[sensor_name], # TODO
"emissivity": self.emissivities[sensor_name],
"head_id": self.head_numbering[sensor_name],
# "head_id": self.head_numbering[sensor_name],
"t90": self.t90_dict[self.head_numbering[sensor_name]],
"value_timestamp_rel": "#/data/value_timestamp_rel",
"value_timestamp_abs": "#/data/value_timestamp_abs",
}
}
)
if "comment" in self.config["sensors"][sensor_name]:
data[sensor_name_nomad].update({"comment": self.config["sensors"][sensor_name]["comment"]})
sensor_schema = deepcopy(sensor_schema_template)
sensor_schema["section"]["quantities"]["value_log"]["m_annotations"][
"tabular"
Expand Down
5 changes: 4 additions & 1 deletion multilog/devices/pyrometer_lumasense.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(self, config, name="PyrometerLumasense"):
name (str, optional): Device name.
"""
logger.info(f"Initializing PyrometerLumasense device '{name}'")
self.config = config
self.device_id = config["device-id"]
self.name = name
self.t90_dict = config["t90-dict"]
Expand Down Expand Up @@ -172,7 +173,7 @@ def write_nomad_file(self, directory="./"):
{
sensor_name_nomad: {
# "model": "your_field_here",
"name": sensor_name_nomad,
# "name": sensor_name_nomad,
# "sensor_id": sensor_name.split(" ")[0],
# "attached_to": sensor_name, # TODO this information is important!
# "measured_property": ,
Expand All @@ -187,6 +188,8 @@ def write_nomad_file(self, directory="./"):
}
}
)
if "comment" in self.config:
data[sensor_name_nomad].update({"comment": self.config["comment"]})
sensor_schema = deepcopy(sensor_schema_template)
sensor_schema["section"]["quantities"]["value_log"]["m_annotations"]["tabular"][
"name"
Expand Down
6 changes: 6 additions & 0 deletions multilog/nomad/archive_template_Camera.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ definitions:
exposure_time:
type: np.float64
description: Exposure time in micro seconds
comment:
type: str
m_annotations:
eln:
component: StringEditQuantity
description: "Comment, e.g. sensor position"
data:
m_def: camera
# exposure_time: 10.e+3
Expand Down
Loading

0 comments on commit 8f9cbd2

Please sign in to comment.