@@ -47,19 +47,15 @@ def clear(self):
4747 def run (self ):
4848 self .clear ()
4949 self .pre_validate ()
50- self .synchronize_omega_period ()
5150
5251 # Create the grains table
53- shape = (self .num_active_overlays , 21 )
54- self .grains_table = np .empty (shape , dtype = np .float64 )
55-
56- gw = instrument .GrainDataWriter (array = self .grains_table )
57- for i , overlay in enumerate (self .active_overlays ):
58- gw .dump_grain (i , 1 , 0 , overlay .crystal_params )
52+ if self .num_active_overlays > 0 :
53+ material = self .material
54+ else :
55+ material = HexrdConfig ().active_material
5956
6057 kwargs = {
61- 'material' : self .material ,
62- 'grains_table' : self .grains_table ,
58+ 'material' : material ,
6359 'parent' : self .parent ,
6460 }
6561 dialog = HEDMCalibrationOptionsDialog (** kwargs )
@@ -70,13 +66,16 @@ def run(self):
7066 def on_options_dialog_accepted (self ):
7167 dialog = self .options_dialog
7268
69+ shape = (self .num_active_overlays , 21 )
70+ self .grains_table = np .empty (shape , dtype = np .float64 )
71+ gw = instrument .GrainDataWriter (array = self .grains_table )
72+ for i , overlay in enumerate (self .active_overlays ):
73+ gw .dump_grain (i , 1 , 0 , overlay .crystal_params )
74+
75+ self .synchronize_omega_period ()
76+
7377 # Grab some selections from the dialog
7478 self .do_refit = dialog .do_refit
75- self .clobber_strain = dialog .clobber_strain
76- self .clobber_centroid = dialog .clobber_centroid
77- self .clobber_grain_Y = dialog .clobber_grain_Y
78-
79- self .clobber_refinements ()
8079 self .run_calibration ()
8180
8281 def run_calibration (self ):
@@ -99,9 +98,6 @@ def on_pull_spots_finished(self, spots_data_dict):
9998
10099 # User selected these from the dialog
101100 do_refit = self .do_refit
102- clobber_strain = self .clobber_strain
103- clobber_centroid = self .clobber_centroid
104- clobber_grain_Y = self .clobber_grain_Y
105101
106102 # Our grains table only contains the grains that the user
107103 # selected.
@@ -118,15 +114,6 @@ def on_pull_spots_finished(self, spots_data_dict):
118114 ome_period = self .ome_period
119115
120116 grain_parameters = grain_parameters .copy ()
121- if clobber_strain :
122- for grain in grain_parameters :
123- grain [6 :] = cnst .identity_6x1
124- if clobber_centroid :
125- for grain in grain_parameters :
126- grain [3 :6 ] = cnst .zeros_3
127- if clobber_grain_Y :
128- for grain in grain_parameters :
129- grain [4 ] = 0.
130117 ngrains = len (grain_parameters )
131118
132119 # The styles we will use for plotting points
@@ -472,28 +459,6 @@ def material(self):
472459 def active_overlay_refinements (self ):
473460 return [x .refinements for x in self .active_overlays ]
474461
475- def clobber_refinements (self ):
476- any_clobbering = (
477- self .clobber_strain or
478- self .clobber_centroid or
479- self .clobber_grain_Y
480- )
481- if not any_clobbering :
482- return
483-
484- for overlay in self .active_overlays :
485- refinements = overlay .refinements
486- if self .clobber_strain :
487- for i in range (6 , len (refinements )):
488- refinements [i ] = False
489- if self .clobber_centroid :
490- for i in range (3 , 6 ):
491- refinements [i ] = False
492- if self .clobber_grain_Y :
493- refinements [4 ] = False
494-
495- HexrdConfig ().update_overlay_editor .emit ()
496-
497462 def synchronize_material (self ):
498463 # This material is used for creating the indexing config.
499464 # Make sure it matches the material we are using.
@@ -509,8 +474,8 @@ def synchronize_omega_period(self):
509474 def pre_validate (self ):
510475 # Validation to perform before we do anything else
511476 if not self .active_overlays :
512- msg = 'There must be at least one visible rotation series overlay'
513- raise Exception ( msg )
477+ # No more validation needed.
478+ return
514479
515480 ome_periods = []
516481 for overlay in self .active_overlays :
@@ -539,10 +504,6 @@ def pre_validate(self):
539504 )
540505 raise Exception (msg )
541506
542- if not np .any (self .all_flags ):
543- msg = 'There are no refinable parameters'
544- raise Exception (msg )
545-
546507 # Make sure the material is updated in the indexing config
547508 self .synchronize_material ()
548509
0 commit comments