Commit 7c2c6d7c authored by Damien Naudet's avatar Damien Naudet

Renamed get_peak to peak_fit.

Doc.
parent 8dcdb91f
......@@ -12,10 +12,10 @@ qspace_f = '/path/to/qspace.h5'
# result file
result_file = os.path.join(workdir, 'results.txt')
results, success = peak_fit.get_peaks(qspace_f,
indices=range(10),
fit_type=peak_fit.FitTypes.LEASTSQ,
n_proc=None)
results, success = peak_fit.peak_fit(qspace_f,
indices=range(10),
fit_type=peak_fit.FitTypes.LEASTSQ,
n_proc=None)
with open(result_file, 'w+') as res_f:
res_f.write('# X Y qx qy qz q I valid\n')
......
......@@ -74,10 +74,26 @@ def _qspace_centroid(x, y, v0):
return [y[idx], com, np.nan]
def get_peaks(qspace_f,
def peak_fit(qspace_f,
fit_type=FitTypes.LEASTSQ,
indices=None,
n_proc=None):
"""
:param qspace_f: path to the HDF5 file containing the qspace cubes
:type data_h5f: `str`
:param fit_type:
:type img_indices: *optional*
:param indices: indices of the cubes (in the input HDF5 dataset) for which
the qx/qy/qz peaks coordinates will be computed. E.g : if the array
[1, 2, 3] is provided, only those cubes will be fitted.
:type img_indices: *optional* `array_like`
:param n_proc: number of process to use. If None, the number of process
used will be the one returned by multiprocessing.cpu_count().
:type n_proc: `int`
"""
t_total = time.time()
......
......@@ -97,10 +97,9 @@ def img_2_qspace(data_h5f,
the images (TODO : rephrase)
:type nav: *optional* `array_like`
:param img_indices: indices of the images for which the qx/qy/qz peaks
coordinates will be computed. E.g : if the array [1, 2, 3] is provided,
only the first 3 acquisitions of each scans will be used.
(TODO : give example)
:param img_indices: indices of the positions (on the sample) that have
to be converted to qspace. E.g : if the array [1, 2, 3] is provided,
only the first 3 sample scans positions will be converted to qspace.
:type img_indices: *optional* `array_like`
:param n_proc: number of process to use. If None, the number of process
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment