xfel.metrology package¶
Subpackages¶
Submodules¶
xfel.metrology.flatfile module¶
For Mikhail:
Quad 3, pair 0 should have S2 20907 (not 20904).
Quad 3, pair 4 should have L2 43477 (not 43476), but that may be rounding error.
Quad 3, pair 0 has L2 43857 which is 300 um longer than others
XXX Really need to be able to visualise this in 3D!
Other open issues:
Possible to participate in next optical measurement?
Is the center of the rectangle the center of the pixel arrays?
- class xfel.metrology.flatfile.optimise_rectangle(vertices, weights, c, u, v, l)¶
Bases:
object
Misnomer, optimises everything.
- compute_functional_and_gradients()¶
Compute sum of squared residual, and derivatives of theta, slow, and fast. XXX THIS IS ALL DIFFERENT FROM MY PEN-AND-PAPER WORK
- class xfel.metrology.flatfile.optimise_rectangle_2(vertices, weights, c, u, v, l)¶
Bases:
object
Misnomer, optimises everything.
- compute_functional_and_gradients()¶
Compute sum of squared residual, and derivatives of theta, slow, and fast. XXX THIS IS ALL DIFFERENT FROM MY PEN-AND-PAPER WORK
- class xfel.metrology.flatfile.optimise_rectangle_3(vertices, weights, u, v, side_long, side_short)¶
Bases:
object
- compute_functional_and_gradients()¶
- while True:
t = self.x[0]**2 + self.x[1]**2 + self.x[2]**2 + self.x[3]**2
# print “Got weights”, self.x[0]**2 / t, self.x[1]**2 / t, self.x[2]**2 / t, self.x[3]**2 / t
- for i in range(4):
w = self.x[i]**2 / t
ok = True self.x[i] = math.sqrt(w) if w > 0.35:
self.x[i] = 0.3 / w * math.sqrt(w) ok = False
- if ok:
break
- xfel.metrology.flatfile.parse_metrology(path, detector='CxiDs1', plot=True, do_diffs=True, old_style_diff_path=None)¶
Measurement file has all units in micrometers. The coordinate system is right-handed XXX verify this. The origin is at the lower, left corner of sensor 1. XXX Are quadrants still 0, 1, 2, 3 in counter-clockwise order beginning at top left corner?
xfel.metrology.mark0 module¶
- Main idea: having already done
indexing & integration –> allresults
metrology assessment –> mysql store tag_spotfinder
cxi.merge –> mysql store tag_frame
…now do a detailed metrology refinement to simultaneously optimize metrology and crystal orientation.
- xfel.metrology.mark0.consistency_controls(DATA, params, annotate=False)¶
- class xfel.metrology.mark0.correction_vectors¶
Bases:
correction_vector_store
- DETECTOR_NORMAL = (0.0, 0.0, -1.0)¶
- INCIDENT_BEAM = (0.0, 0.0, -1.0)¶
- delrsq_functional(calcx, calcy)¶
- get_frames_from_mysql(params)¶
- get_obs_from_mysql(params)¶
- print_table()¶
- read_data(params)¶
- static standalone_check(self, setting_id, entry, d, cutoff)¶
- tile_weight(idx)¶
- xfel.metrology.mark0.get_phil(args)¶
- xfel.metrology.mark0.run(args)¶
xfel.metrology.mark1 module¶
- class xfel.metrology.mark1.fit_translation(params)¶
Bases:
correction_vectors
,lbfgs_with_curvatures_mix_in
- compute_functional_and_gradients()¶
- curvatures()¶
- post_min_recalc()¶
- print_table()¶
- xfel.metrology.mark1.run(args)¶
xfel.metrology.mark10 module¶
- class xfel.metrology.mark10.fit_translation4(params)¶
Bases:
mark5_iteration
,fit_translation2
- compute_finite_difference_gradients_if_requested()¶
- compute_functional_and_gradients()¶
- detector_origin_analysis()¶
- jacobian_frame_rotx¶
Read in only 500 frames, refine only 20
Define the new parameter here.
Define its new behavior in parameter_based_function()
set use_curvatures=False
- implement refinement with finite differences:
include the array name in setting compute_finite_difference_gradients_if_requested() fix the requirement for “zip” verify fd_gradients go to zero upon convergence verify parameter vector has reasonable values
implement analytic gradients, list out comparison columns
document the gradients in a tex file
implement curvatures & flag them in here
- parameter_based_model(params)¶
- parameter_based_model_one_frame_detail(frame_id, iframe, all_model)¶
- print_table()¶
- print_table_2()¶
- static print_unit_translations(data, params, optional)¶
- radial_transverse_analysis()¶
- run_cycle_a()¶
- run_cycle_b(iteration)¶
- same_sensor_table(verbose=True)¶
xfel.metrology.mark3 module¶
- class xfel.metrology.mark3.fit_translation2(params)¶
Bases:
fit_translation
- compute_functional_and_gradients()¶
- curvatures()¶
- nominal_tile_centers(corners)¶
- parameter_based_model(params)¶
- post_min_recalc()¶
- print_table()¶
- same_sensor_table(verbose=True)¶
- xfel.metrology.mark3.run(args)¶