darfix 4.0.3__py3-none-any.whl → 4.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- darfix/_config.py +4 -1
- darfix/core/data_selection.py +11 -2
- darfix/core/dataset.py +92 -194
- darfix/core/dimension.py +8 -0
- darfix/core/grainplot.py +162 -129
- darfix/core/{imageRegistration.py → image_registration.py} +5 -4
- darfix/core/{imageStack.py → image_stack.py} +16 -14
- darfix/core/mapping.py +3 -3
- darfix/core/moment_types.py +16 -0
- darfix/core/{noiseremoval.py → noise_removal.py} +45 -39
- darfix/core/noise_removal_type.py +14 -0
- darfix/core/positioners.py +13 -1
- darfix/core/rocking_curves.py +75 -182
- darfix/core/rocking_curves_map.py +45 -0
- darfix/core/{shiftcorrection.py → shift_correction.py} +1 -2
- darfix/core/state_of_operation.py +7 -46
- darfix/core/utils.py +2 -35
- darfix/dtypes.py +1 -9
- darfix/gui/{binningWidget.py → binning_widget.py} +5 -33
- darfix/gui/{blindSourceSeparationWidget.py → blind_source_separation_widget.py} +11 -21
- darfix/gui/{chooseDimensions.py → choose_dimensions.py} +1 -1
- darfix/gui/concatenate_scans.py +33 -5
- darfix/gui/configuration/level.py +1 -1
- darfix/gui/data_selection/{hdf5_data_selection_widgets.py → hdf5_dataset_selection_widget.py} +3 -56
- darfix/gui/data_selection/line_edits.py +54 -8
- darfix/gui/data_selection/scan_selection_widgets.py +24 -11
- darfix/gui/data_selection/utils.py +11 -0
- darfix/gui/data_selection/{WorkingDirSelectionWidget.py → working_dir_selection_widget.py} +15 -14
- darfix/gui/{dimensionsWidget.py → dimensions_widget.py} +1 -1
- darfix/gui/{displayComponentsWidget.py → display_components_widget.py} +1 -1
- darfix/gui/{filterByDimension.py → filter_by_dimension.py} +1 -1
- darfix/gui/grain_plot/_oridist_toolbar_buttons.py +128 -0
- darfix/gui/grain_plot/dimension_range_slider_2d.py +105 -0
- darfix/gui/grain_plot/flashlight.py +211 -0
- darfix/gui/grain_plot/flashlight_mode_action.py +35 -0
- darfix/gui/{grainplot/grainPlotWidget.py → grain_plot/grain_plot_widget.py} +25 -56
- darfix/gui/grain_plot/mosaicity_widget.py +380 -0
- darfix/gui/grain_plot/oridist_toolbar.py +87 -0
- darfix/gui/{grainplot → grain_plot}/utils.py +3 -2
- darfix/gui/{magnificationWidget.py → magnification_widget.py} +4 -3
- darfix/gui/noise_removal/noise_removal_widget.py +346 -0
- darfix/gui/noise_removal/operation_list_widget.py +73 -0
- darfix/gui/{noiseremoval/parametersWidget.py → noise_removal/parameters_widget.py} +17 -16
- darfix/gui/{PCAWidget.py → pca_widget.py} +4 -4
- darfix/gui/{projectionWidget.py → projection_widget.py} +1 -1
- darfix/gui/rocking_curves/{fitComboBox.py → fit_combobox.py} +1 -1
- darfix/gui/rocking_curves/{rockingCurvesPlot.py → rocking_curves_plot.py} +39 -34
- darfix/gui/rocking_curves/{rockingCurvesWidget.py → rocking_curves_widget.py} +17 -21
- darfix/gui/{roiSelectionWidget.py → roi_selection_widget.py} +9 -101
- darfix/gui/{rsmHistogramWidget.py → rsm_histogram_widget.py} +15 -25
- darfix/gui/{rsmWidget.py → rsm_widget.py} +1 -1
- darfix/gui/{shiftcorrection/shiftCorrectionWidget.py → shift_correction/shift_correction_widget.py} +10 -13
- darfix/gui/{shiftcorrection/shiftInput.py → shift_correction/shift_input.py} +13 -15
- darfix/gui/utils/custom_doublespinbox.py +19 -0
- darfix/gui/utils/data_path_completer.py +7 -7
- darfix/gui/utils/data_path_selection.py +4 -4
- darfix/gui/utils/range_slider.py +93 -0
- darfix/gui/utils/{standardButtonBox.py → standard_buttonbox.py} +7 -0
- darfix/gui/weak_beam_widget.py +73 -0
- darfix/gui/{zSumWidget.py → zsum_widget.py} +1 -2
- darfix/main.py +41 -5
- darfix/math.py +53 -20
- darfix/pixel_sizes.py +1 -1
- darfix/processing/{imageOperations.py → image_operations.py} +29 -5
- darfix/processing/rocking_curves.py +300 -197
- darfix/resources/gui/icons/contour.svg +39 -0
- darfix/resources/gui/icons/flashlight.svg +14 -0
- darfix/resources/gui/icons/hsv.svg +303 -0
- darfix/resources/gui/icons/median-filter.png +0 -0
- darfix/resources/gui/icons/median-filter.svg +8 -0
- darfix/tasks/binning.py +6 -17
- darfix/tasks/blind_source_separation.py +121 -0
- darfix/tasks/blindsourceseparation.py +8 -140
- darfix/tasks/copy.py +0 -2
- darfix/tasks/data_partition.py +39 -0
- darfix/tasks/datapartition.py +8 -50
- darfix/tasks/dimension_definition.py +197 -0
- darfix/tasks/dimensiondefinition.py +8 -196
- darfix/tasks/grain_plot.py +93 -0
- darfix/tasks/grainplot.py +8 -96
- darfix/tasks/hdf5_data_selection.py +5 -11
- darfix/tasks/hdf5_scans_concatenation.py +73 -32
- darfix/tasks/noise_removal.py +88 -0
- darfix/tasks/noiseremoval.py +8 -90
- darfix/tasks/pca.py +1 -3
- darfix/tasks/projection.py +1 -6
- darfix/tasks/rocking_curves.py +10 -5
- darfix/tasks/roi.py +0 -2
- darfix/tasks/shift_correction.py +45 -0
- darfix/tasks/shiftcorrection.py +8 -35
- darfix/tasks/transformation.py +0 -2
- darfix/tasks/weak_beam.py +71 -0
- darfix/tasks/weakbeam.py +8 -67
- darfix/tasks/zsum.py +1 -1
- darfix/tests/conftest.py +1 -1
- darfix/tests/gui/test_data_path_completer.py +4 -4
- darfix/tests/gui/test_dimension_range_slider_2d.py +70 -0
- darfix/tests/gui/test_range_slider_with_spinboxes.py +133 -0
- darfix/tests/orange/test_ewoks.py +23 -17
- darfix/tests/orange/widgets/test_concatenate_hdf5_scans.py +2 -1
- darfix/tests/orange/widgets/test_hdf5_data_selection.py +93 -0
- darfix/tests/tasks/test_data_copy.py +0 -2
- darfix/tests/tasks/{test_dimensiondefinition.py → test_dimension_definition.py} +1 -1
- darfix/tests/tasks/test_hdf5_scans_concatenation.py +18 -1
- darfix/tests/tasks/test_rocking_curves.py +3 -3
- darfix/tests/tasks/test_weak_beam.py +9 -0
- darfix/tests/test_components_matching.py +2 -2
- darfix/tests/test_dataset.py +2 -28
- darfix/tests/test_dimension.py +5 -5
- darfix/tests/test_generate_grain_maps_nxdict.py +60 -0
- darfix/tests/test_image_operations.py +4 -4
- darfix/tests/test_image_registration.py +17 -17
- darfix/tests/test_image_stack.py +2 -13
- darfix/tests/test_mask.py +1 -1
- darfix/tests/test_math.py +48 -4
- darfix/tests/test_moments.py +5 -4
- darfix/tests/test_rocking_curves.py +9 -19
- darfix/tests/test_save_dataset.py +4 -3
- darfix/tests/test_shift.py +7 -7
- darfix/tests/test_workflow.py +4 -4
- darfix/tests/test_zsum.py +3 -6
- darfix/tests/utils.py +1 -1
- {darfix-4.0.3.dist-info → darfix-4.3.0.dist-info}/METADATA +12 -3
- darfix-4.3.0.dist-info/RECORD +287 -0
- {darfix-4.0.3.dist-info → darfix-4.3.0.dist-info}/licenses/LICENSE +3 -1
- orangecontrib/darfix/widgets/__init__.py +10 -1
- orangecontrib/darfix/widgets/binning.py +3 -3
- orangecontrib/darfix/widgets/blindsourceseparation.py +5 -7
- orangecontrib/darfix/widgets/concatenateHDF5.py +14 -1
- orangecontrib/darfix/widgets/datacopy.py +1 -1
- orangecontrib/darfix/widgets/datapartition.py +7 -102
- orangecontrib/darfix/widgets/dataset_widget_base.py +88 -0
- orangecontrib/darfix/widgets/dimensions.py +10 -27
- orangecontrib/darfix/widgets/grainplot.py +9 -19
- orangecontrib/darfix/widgets/hdf5dataselection.py +34 -14
- orangecontrib/darfix/widgets/metadata.py +2 -2
- orangecontrib/darfix/widgets/noiseremoval.py +12 -95
- orangecontrib/darfix/widgets/operation_widget_base.py +156 -0
- orangecontrib/darfix/widgets/pca.py +2 -2
- orangecontrib/darfix/widgets/projection.py +2 -2
- orangecontrib/darfix/widgets/rockingcurves.py +8 -15
- orangecontrib/darfix/widgets/roiselection.py +25 -110
- orangecontrib/darfix/widgets/rsmhistogram.py +2 -2
- orangecontrib/darfix/widgets/shiftcorrection.py +11 -27
- orangecontrib/darfix/widgets/transformation.py +4 -4
- orangecontrib/darfix/widgets/weakbeam.py +20 -103
- orangecontrib/darfix/widgets/zsum.py +8 -16
- darfix/gui/dataPartitionWidget.py +0 -163
- darfix/gui/data_selection/DataSelectionBase.py +0 -59
- darfix/gui/grainplot/mosaicityWidget.py +0 -248
- darfix/gui/noiseremoval/noiseRemovalWidget.py +0 -296
- darfix/gui/noiseremoval/operationHistory.py +0 -59
- darfix/gui/weakBeamWidget.py +0 -95
- darfix/tests/tasks/test_datapartition.py +0 -52
- darfix-4.0.3.dist-info/RECORD +0 -263
- orangecontrib/darfix/widgets/operationBase.py +0 -108
- /darfix/core/{componentsMatching.py → components_matching.py} +0 -0
- /darfix/core/{datapathfinder.py → data_path_finder.py} +0 -0
- /darfix/gui/{grainplot → grain_plot}/__init__.py +0 -0
- /darfix/gui/{metadataWidget.py → metadata_widget.py} +0 -0
- /darfix/gui/{operationProcess.py → parallel/operation_process.py} +0 -0
- /darfix/gui/{operationThread.py → parallel/operation_thread.py} +0 -0
- /darfix/gui/{roiLimitsToolbar.py → roi_limits_toolbar.py} +0 -0
- /darfix/gui/{shiftcorrection → shift_correction}/__init__.py +0 -0
- /darfix/tests/{test_datapathfinder.py → test_data_path_finder.py} +0 -0
- {darfix-4.0.3.dist-info → darfix-4.3.0.dist-info}/WHEEL +0 -0
- {darfix-4.0.3.dist-info → darfix-4.3.0.dist-info}/entry_points.txt +0 -0
- {darfix-4.0.3.dist-info → darfix-4.3.0.dist-info}/top_level.txt +0 -0
darfix/_config.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
FWHM_VAL = 2.35482 # For numba
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
class Config:
|
|
2
5
|
"""
|
|
3
6
|
Class containing shared global configuration for the darfix project.
|
|
@@ -15,7 +18,7 @@ class Config:
|
|
|
15
18
|
.. versionadded:: 0.3
|
|
16
19
|
"""
|
|
17
20
|
|
|
18
|
-
FWHM_VAL =
|
|
21
|
+
FWHM_VAL = FWHM_VAL
|
|
19
22
|
|
|
20
23
|
"""Magic value that returns FWHM when multiplied by the standard deviation.
|
|
21
24
|
|
darfix/core/data_selection.py
CHANGED
|
@@ -4,6 +4,7 @@ import urllib.request
|
|
|
4
4
|
from typing import Optional
|
|
5
5
|
from typing import Union
|
|
6
6
|
|
|
7
|
+
from esrf_pathlib import ESRFPath
|
|
7
8
|
from silx.io.url import DataUrl
|
|
8
9
|
|
|
9
10
|
from darfix.core.dataset import ImageDataset
|
|
@@ -26,7 +27,6 @@ def load_process_data(
|
|
|
26
27
|
:param detector_url: detector_url to be loaded.
|
|
27
28
|
:param metadata_url: path to the scan metadata for HDF5 containing positioner information in order to load metadata for non-edf files
|
|
28
29
|
"""
|
|
29
|
-
indices = li_indices = None
|
|
30
30
|
root_dir_specified = bool(root_dir)
|
|
31
31
|
|
|
32
32
|
if isinstance(detector_url, DataUrl):
|
|
@@ -87,9 +87,18 @@ def load_process_data(
|
|
|
87
87
|
|
|
88
88
|
assert dataset.data is not None and dataset.data.size > 0, "No data was loaded!"
|
|
89
89
|
|
|
90
|
-
return dataset,
|
|
90
|
+
return dataset, bg_dataset
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
def _get_root_dir(filename: str) -> str:
|
|
94
94
|
url = urllib.parse.urlparse(filename, scheme="file")
|
|
95
95
|
return os.path.dirname(urllib.request.url2pathname(url.path))
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def get_default_output_directory(raw_data_file: str) -> str:
|
|
99
|
+
esrf_raw_data_file = ESRFPath(raw_data_file)
|
|
100
|
+
try:
|
|
101
|
+
return str(esrf_raw_data_file.processed_dataset_path)
|
|
102
|
+
except AttributeError:
|
|
103
|
+
# Not an ESRF path : Default directory is cwd.
|
|
104
|
+
return os.getcwd()
|