|
20 | 20 | class DiffractionObject: |
21 | 21 | """ |
22 | 22 | A class to manipulate diffraction data, supporting basic arithmetic operations and |
23 | | - conversions between different diffraction data metrics such as Q, two-theta, and d-spacing. |
| 23 | + conversions between independent variables such as Q, two-theta, |
| 24 | + and d-spacing. |
24 | 25 |
|
25 | 26 | Parameters |
26 | 27 | ---------- |
27 | 28 | name : str, optional |
28 | | - Identifier for the diffraction object. Defaults to an empty string. |
| 29 | + The name or identifier for the diffraction experiment. |
29 | 30 | wavelength : float, optional |
30 | | - Wavelength of the radiation used in the diffraction experiment. Defaults to None. |
| 31 | + The wavelength of the radiation used in the diffraction experiment. Defaults to None. |
31 | 32 |
|
32 | 33 | Attributes |
33 | 34 | ---------- |
34 | 35 | name : str |
35 | | - Name or identifier for the diffraction experiment. |
| 36 | + The name or identifier for the diffraction experiment. |
36 | 37 | wavelength : float |
37 | | - Wavelength of the incoming x-rays. |
| 38 | + The wavelength of the incoming x-rays. |
38 | 39 | scat_quantity : str |
39 | | - Description of the type of scattering data stored. |
| 40 | + The description of the type of scattering data stored. |
40 | 41 | on_q : list of numpy.ndarray |
41 | | - A list containing two numpy arrays: [Q values, Intensities]. |
| 42 | + The list containing two numpy arrays: [Q values, Intensities]. |
42 | 43 | on_tth : list of numpy.ndarray |
43 | | - A list containing two numpy arrays: [two-theta angles, Intensities]. |
| 44 | + The list containing two numpy arrays: [two-theta angles, Intensities]. |
44 | 45 | on_d : list of numpy.ndarray |
45 | | - A list containing two numpy arrays: [d-spacing values, Intensities]. |
| 46 | + The list containing two numpy arrays: [d-spacing values, Intensities]. |
46 | 47 | metadata : dict |
47 | | - Dictionary containing additional metadata about the diffraction data. |
| 48 | + The dictionary containing additional metadata about the diffraction data. |
48 | 49 | """ |
49 | 50 |
|
50 | 51 | def __init__(self, name="", wavelength=None): |
@@ -284,13 +285,13 @@ def insert_scattering_quantity( |
284 | 285 | Parameters |
285 | 286 | ---------- |
286 | 287 | xarray array-like of floats |
287 | | - the independent variable array |
| 288 | + The independent variable array |
288 | 289 | yarray array-like of floats |
289 | | - the dependent variable array |
| 290 | + The dependent variable array |
290 | 291 | xtype string |
291 | | - the type of quantity for the independent variable from {*XQUANTITIES, } |
| 292 | + The type of quantity for the independent variable from {*XQUANTITIES, } |
292 | 293 | metadata: dict |
293 | | - the metadata in the form of a dictionary of user-supplied key:value pairs |
| 294 | + The metadata in the form of a dictionary of user-supplied key:value pairs |
294 | 295 |
|
295 | 296 | Returns |
296 | 297 | ------- |
@@ -334,10 +335,10 @@ def q_to_tth(self): |
334 | 335 | Parameters |
335 | 336 | ---------- |
336 | 337 | q : array |
337 | | - An array of :math:`q` values |
| 338 | + The array of :math:`q` values |
338 | 339 |
|
339 | 340 | wavelength : float |
340 | | - Wavelength of the incoming x-rays |
| 341 | + The Wavelength of the incoming x-rays |
341 | 342 |
|
342 | 343 | Function adapted from scikit-beam. Thanks to those developers |
343 | 344 |
|
@@ -373,17 +374,17 @@ def tth_to_q(self): |
373 | 374 | Parameters |
374 | 375 | ---------- |
375 | 376 | two_theta : array |
376 | | - An array of :math:`2\theta` values in units of degrees |
| 377 | + The array of :math:`2\theta` values in units of degrees |
377 | 378 |
|
378 | 379 | wavelength : float |
379 | | - Wavelength of the incoming x-rays |
| 380 | + The wavelength of the incoming x-rays |
380 | 381 |
|
381 | 382 | Function adapted from scikit-beam. Thanks to those developers. |
382 | 383 |
|
383 | 384 | Returns |
384 | 385 | ------- |
385 | 386 | q : array |
386 | | - An array of :math:`q` values in the inverse of the units |
| 387 | + The array of :math:`q` values in the inverse of the units |
387 | 388 | of ``wavelength`` |
388 | 389 | """ |
389 | 390 | two_theta = np.asarray(np.deg2rad(self.on_tth[0])) |
@@ -419,11 +420,11 @@ def scale_to(self, target_diff_object, xtype=None, xvalue=None): |
419 | 420 | Parameters |
420 | 421 | ---------- |
421 | 422 | target_diff_object: DiffractionObject |
422 | | - the diffractoin object you want to scale the current one on to |
| 423 | + The diffractoin object you want to scale the current one on to |
423 | 424 | xtype: string, optional. Default is Q |
424 | | - the xtype, from {XQUANTITIES}, that you will specify a point from to scale to |
| 425 | + The xtype, from {XQUANTITIES}, that you will specify a point from to scale to |
425 | 426 | xvalue: float. Default is the midpoint of the array |
426 | | - the y-value in the target at this x-value will be used as the factor to scale to. |
| 427 | + The y-value in the target at this x-value will be used as the factor to scale to. |
427 | 428 | The entire array is scaled be the factor that places on on top of the other at that point. |
428 | 429 | xvalue does not have to be in the x-array, the point closest to this point will be used for the scaling. |
429 | 430 |
|
|
0 commit comments