Skip to content

Write proposal and run numbers to virtual CXI files. - #749

Merged
turkot merged 6 commits into
masterfrom
feat/vds-proposal-run
Jun 30, 2026
Merged

Write proposal and run numbers to virtual CXI files.#749
turkot merged 6 commits into
masterfrom
feat/vds-proposal-run

Conversation

@turkot

@turkot turkot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Although proposal and run numbers are not part of the CXI format, I find them useful additional information.

@turkot turkot self-assigned this Jun 22, 2026

@daniloefl daniloefl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Feel free ignore all my comments. They are mostly only ideas for alternative implementations, in case you think it is worth going in those directions.

Comment thread extra_data/write_cxi.py Outdated
# the CXI standard, but it allows extra data.
run_metadata = self.detdata.data.run_metadata()
if 'proposalNumber' in run_metadata and 'runNumber' in run_metadata:
f.create_dataset(f'entry_1/proposalNumber',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see you are just following a previous standard, but is there a reason for entry_1?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to CXI format convention, entry_1 should correspond to the experiment.

Comment thread extra_data/write_cxi.py
Comment thread extra_data/write_cxi.py Outdated
@turkot

turkot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for your comments, Danilo! The are all very good. We should try to follow CXI format guide:
https://raw.githubusercontent.com/cxidb/CXI/master/cxi_file_format.pdf
But since these kind of data is outside of their specification, it is up to us where (and how) to store it.
I like your idea to put proposal and run numbers as attributes, with some default values (e.g. -1?) in case it is unknown. But I'm not yet sure where it belongs - root, /entry_1 or /entry_1/instrument_1...

@daniloefl

daniloefl commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

I also do not have an opinion here. Your usage of entry_1 is fine. I was just asking in case there was a specific reason for that. If the CXI data format allows, I am biased towards using attrs instead, but I am not sure this is a viable option.

@philsmt

philsmt commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

You may want to consider whether attributes are already a concept for metadata in CXI or not, and whether you want this EuXFEL-specific information to be visible or rather hidden (note I do not have answers or opinions on this out of ignorance).

Comment thread extra_data/write_cxi.py
Comment on lines +263 to +264
# Store detector name as an attribute
dgrp.attrs['name'] = self.detdata.detector_name

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding name of the detector as 'detector_1' attribute.

@takluyver

Copy link
Copy Markdown
Member

This broadly LGTM.

One more naming bikeshed question, though: do we want to make it explicit that the proposal number is an EuXFEL proposal number? EuXFEL proposal number 12345 is unique, and you have an immediate hint where to find more context.

@turkot
turkot merged commit ff368ed into master Jun 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants