Skip to content

Estimate transmission wrapper#365

Open
pjnaughton wants to merge 8 commits into
mainfrom
estimate_transmission_wrapper
Open

Estimate transmission wrapper#365
pjnaughton wants to merge 8 commits into
mainfrom
estimate_transmission_wrapper

Conversation

@pjnaughton
Copy link
Copy Markdown
Collaborator

Wrapper to estimate the max recommended transmission from dials.find_spots.

@pjnaughton pjnaughton self-assigned this May 12, 2026
@pjnaughton pjnaughton requested a review from pblowey May 12, 2026 14:15
Comment on lines +203 to 211
transmission_limits = (get_beamline_param(
beamline_config, ("gda.mx.udc.minTransmission",), 0.0),
min(
get_beamline_param(
beamline_config, ("gda.mx.udc.maxTransmission",), 1.0
),
recommended_max_transmission
),
)
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.

Discussed on slack that rather than using the recommended_max transmission to set the transmission limits, the recommended transmission should be used in place of recipe_step.transmission (i.e. instead of the transmission value from the Agamemnon recipe). This means that the recommended transmission will be scaled appropriately for wavelength and resolution.

for command, script, output_file in commands:
result = subprocess.run(script, cwd=working_directory, check=True)

while not os.path.exists(output_file):
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.

Is this step necessary? Have you found that the dials.import subprocess returns without the output files existing?


reflection_file = results_directory / "strong.refl"
reflections = flex.reflection_table.from_file(reflection_file)
num_counts, _ = self.build_hist_from_reflections(reflections)
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.

As you've gone to the trouble of constructing a histogram, it would be good to plot this and have it as an output file. Additionally, you could output the histogram similarly to how xia2.overload does, so that the data is available as a result file. If this takes a some time to process, you could always run this after the wrapper sends the scaled_transmission off to the next recipe step, so that the pipeline is not slowed down.

return False

results_directory.mkdir(parents=True, exist_ok=True)
output_files = ["dials.find_spots.log", "strong.refl", "imported.expt"]
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.

The strong.refl and imported.expt are probably not too useful to have as results files so I would omit them from here. I think it would be useful to construct a log file for this wrapper, that gives a simple overview of the running of the dials commands as well as the analysis of the spots afterwards.

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.

2 participants