@@ -160,6 +160,8 @@ def _recreate_cryspy_dict(
160160 cryspy_model_id = f'crystal_{ sample_model .name } '
161161 cryspy_model_dict = cryspy_dict [cryspy_model_id ]
162162
163+ # Update sample model parameters
164+
163165 # Cell
164166 cryspy_cell = cryspy_model_dict ['unit_cell_parameters' ]
165167 cryspy_cell [0 ] = sample_model .cell .length_a .value
@@ -186,15 +188,18 @@ def _recreate_cryspy_dict(
186188 for idx , atom_site in enumerate (sample_model .atom_sites ):
187189 cryspy_biso [idx ] = atom_site .b_iso .value
188190
189- # ---------- Update experiment parameters ----------
191+ # Update experiment parameters
192+
190193 if experiment .type .beam_mode .value == BeamModeEnum .CONSTANT_WAVELENGTH :
191194 cryspy_expt_name = f'pd_{ experiment .name } '
192195 cryspy_expt_dict = cryspy_dict [cryspy_expt_name ]
196+
193197 # Instrument
194198 cryspy_expt_dict ['offset_ttheta' ][0 ] = np .deg2rad (
195199 experiment .instrument .calib_twotheta_offset .value
196200 )
197201 cryspy_expt_dict ['wavelength' ][0 ] = experiment .instrument .setup_wavelength .value
202+
198203 # Peak
199204 cryspy_resolution = cryspy_expt_dict ['resolution_parameters' ]
200205 cryspy_resolution [0 ] = experiment .peak .broad_gauss_u .value
@@ -206,13 +211,15 @@ def _recreate_cryspy_dict(
206211 elif experiment .type .beam_mode .value == BeamModeEnum .TIME_OF_FLIGHT :
207212 cryspy_expt_name = f'tof_{ experiment .name } '
208213 cryspy_expt_dict = cryspy_dict [cryspy_expt_name ]
214+
209215 # Instrument
210216 cryspy_expt_dict ['zero' ][0 ] = experiment .instrument .calib_d_to_tof_offset .value
211217 cryspy_expt_dict ['dtt1' ][0 ] = experiment .instrument .calib_d_to_tof_linear .value
212218 cryspy_expt_dict ['dtt2' ][0 ] = experiment .instrument .calib_d_to_tof_quad .value
213219 cryspy_expt_dict ['ttheta_bank' ] = np .deg2rad (
214220 experiment .instrument .setup_twotheta_bank .value
215221 )
222+
216223 # Peak
217224 cryspy_sigma = cryspy_expt_dict ['profile_sigmas' ]
218225 cryspy_sigma [0 ] = experiment .peak .broad_gauss_sigma_0 .value
0 commit comments