diff --git a/apstools/callbacks/nexus_writer.py b/apstools/callbacks/nexus_writer.py index 4273c5860..998f4408c 100644 --- a/apstools/callbacks/nexus_writer.py +++ b/apstools/callbacks/nexus_writer.py @@ -224,10 +224,9 @@ def get_sample_title(self): """ return the title for this sample - default title: {plan_name}-S{scan_id}-{short_uid} + default title: S{scan_id}-{plan_name}-{short_uid} """ - title = self.metadata.get("title") - return title or f"{self.plan_name}-S{self.scan_id:04d}-{self.uid[:7]}" + return f"S{self.scan_id:04d}-{self.plan_name}-{self.uid[:7]}" def get_stream_link(self, signal, stream=None, ref=None): """ @@ -445,7 +444,8 @@ def write_entry(self): if self.warn_on_missing_content: logger.warning("No data for /entry/run_cycle") - nxentry["title"] = self.get_sample_title() + title = self.root.get("/entry/instrument/bluesky/metadata/title") + nxentry["title"] = title or self.get_sample_title() nxentry["plan_name"] = self.root["/entry/instrument/bluesky/metadata/plan_name"] nxentry["entry_identifier"] = self.root["/entry/instrument/bluesky/uid"]