@@ -418,12 +418,33 @@ def _get_original_array(self):
418
418
return self .on_d (), "d"
419
419
420
420
def on_q (self ):
421
+ """Return the tuple of two 1D numpy arrays containing q and y data.
422
+
423
+ Returns
424
+ -------
425
+ (xarray, yarray) : tuple of ndarray
426
+ The tuple containing two 1D numpy arrays with q and y data
427
+ """
421
428
return [self .all_arrays [:, 1 ], self .all_arrays [:, 0 ]]
422
429
423
430
def on_tth (self ):
431
+ """Return the tuple of two 1D numpy arrays containing tth and y data.
432
+
433
+ Returns
434
+ -------
435
+ (xarray, yarray) : tuple of ndarray
436
+ The tuple containing two 1D numpy arrays with tth and y data
437
+ """
424
438
return [self .all_arrays [:, 2 ], self .all_arrays [:, 0 ]]
425
439
426
440
def on_d (self ):
441
+ """Return the tuple of two 1D numpy arrays containing d and y data.
442
+
443
+ Returns
444
+ -------
445
+ (xarray, yarray) : tuple of ndarray
446
+ The tuple containing two 1D numpy arrays with d and y data
447
+ """
427
448
return [self .all_arrays [:, 3 ], self .all_arrays [:, 0 ]]
428
449
429
450
def scale_to (self , target_diff_object , q = None , tth = None , d = None , offset = None ):
@@ -507,6 +528,16 @@ def on_xtype(self, xtype):
507
528
raise ValueError (_xtype_wmsg (xtype ))
508
529
509
530
def dump (self , filepath , xtype = None ):
531
+ """Dump the xarray and yarray of the diffraction object to a two-column
532
+ file, with the associated information included in the header.
533
+
534
+ Parameters
535
+ ----------
536
+ filepath : str
537
+ The filepath where the diffraction object will be dumped
538
+ xtype : str, optional, default is q
539
+ The type of quantity for the independent variable chosen from {*XQUANTITIES, }
540
+ """
510
541
if xtype is None :
511
542
xtype = "q"
512
543
if xtype in QQUANTITIES :
0 commit comments