Define an experiment¶
This example shows how to define experimental parameters and load measured data in EasyDiffraction.
Import EasyDiffraction¶
In [2]:
Copied!
import easydiffraction as ed
import easydiffraction as ed
Define an experiment¶
pd-neut-cwl¶
Load from CIF¶
Download the data file from the EasyDiffraction repository on GitHub
In [3]:
Copied!
ed.download_from_repository('d1a.cif', destination='data')
ed.download_from_repository('d1a.cif', destination='data')
Show content of the downloaded file (first 45 lines)
In [4]:
Copied!
with open('data/d1a.cif') as f:
print(''.join(f.readlines()[:45]))
with open('data/d1a.cif') as f:
print(''.join(f.readlines()[:45]))
data_d1a _diffrn_radiation.probe neutron _diffrn_radiation_wavelength.wavelength 1.91 _pd_calib.2theta_offset -0.1406(1) _pd_instr.resolution_u 0.139 _pd_instr.resolution_v -0.4124 _pd_instr.resolution_w 0.386 _pd_instr.resolution_x 0 _pd_instr.resolution_y 0.0878 _pd_instr.reflex_asymmetry_p1 0 _pd_instr.reflex_asymmetry_p2 0 _pd_instr.reflex_asymmetry_p3 0 _pd_instr.reflex_asymmetry_p4 0 loop_ _pd_phase_block.id _pd_phase_block.scale pbso4 1.4597(21) loop_ _pd_background.line_segment_X _pd_background.line_segment_intensity _pd_background.X_coordinate 11 206.1624 2theta 15 194.75 2theta 20 194.505 2theta 30 188.4375 2theta 50 207.7633 2theta 70 201.7002 2theta 120 244.4525 2theta 153 226.0595 2theta loop_ _pd_meas.2theta_scan _pd_meas.intensity_total _pd_meas.intensity_total_su 10 220 14.8324 10.05 214 14.6287 10.1 219 14.7986 10.15 224 14.9666 10.2 198 14.0712
Load the data from the file and show the chart
In [5]:
Copied!
job = ed.Job(type='pd-neut-cwl')
job.add_experiment_from_file('data/d1a.cif')
job.show_experiment_chart()
job = ed.Job(type='pd-neut-cwl')
job.add_experiment_from_file('data/d1a.cif')
job.show_experiment_chart()