tomwer 1.2.1__py3-none-any.whl → 1.3.12__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.
- orangecontrib/tomwer/tutorials/icat_publication.ows +58 -0
- orangecontrib/tomwer/widgets/__init__.py +11 -11
- orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +2 -2
- orangecontrib/tomwer/widgets/control/DataListOW.py +9 -7
- orangecontrib/tomwer/widgets/control/DataListenerOW.py +6 -6
- orangecontrib/tomwer/widgets/control/DataSelectorOW.py +21 -10
- orangecontrib/tomwer/widgets/control/DataValidatorOW.py +6 -6
- orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +24 -7
- orangecontrib/tomwer/widgets/control/EmailOW.py +4 -4
- orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +3 -3
- orangecontrib/tomwer/widgets/control/NXTomomillOW.py +64 -23
- orangecontrib/tomwer/widgets/control/NXtomoConcatenate.py +20 -8
- orangecontrib/tomwer/widgets/control/NotifierOW.py +1 -0
- orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +6 -6
- orangecontrib/tomwer/widgets/control/VolumeSelector.py +7 -4
- orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +182 -182
- orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +5 -5
- orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +4 -4
- orangecontrib/tomwer/widgets/edit/ImageKeyEditorOW.py +3 -3
- orangecontrib/tomwer/widgets/edit/ImageKeyUpgraderOW.py +8 -1
- orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +3 -3
- orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +3 -3
- orangecontrib/tomwer/widgets/icat/PublishProcessedDataOW.py +115 -0
- orangecontrib/tomwer/widgets/icat/RawDataScreenshotCreatorOW.py +98 -0
- orangecontrib/tomwer/widgets/icat/SaveToGalleryAndPublishOW.py +129 -0
- orangecontrib/tomwer/widgets/icat/__init__.py +13 -0
- orangecontrib/tomwer/widgets/icat/icons/add_gallery.png +0 -0
- orangecontrib/tomwer/widgets/icat/icons/add_gallery.svg +82 -0
- orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.png +0 -0
- orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.svg +95 -0
- orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.png +0 -0
- orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.svg +143 -0
- orangecontrib/tomwer/widgets/icons/tomwer_data_portal.png +0 -0
- orangecontrib/tomwer/widgets/icons/tomwer_data_portal.svg +76 -0
- orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +22 -20
- orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +19 -3
- orangecontrib/tomwer/widgets/reconstruction/NabuHelicalPrepareWeightsDoubleOW.py +184 -169
- orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +23 -0
- orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +39 -5
- orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +18 -22
- orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +18 -26
- orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +15 -19
- orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +9 -9
- orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
- orangecontrib/tomwer/widgets/visualization/LivesliceOW.py +1 -1
- orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +3 -3
- orangecontrib/tomwer/widgets/visualization/SinogramViewerOW.py +0 -1
- orangecontrib/tomwer/widgets/visualization/VolumeViewerOW.py +3 -29
- tomwer/__main__.py +7 -64
- tomwer/app/axis.py +3 -3
- tomwer/app/canvas.py +8 -0
- tomwer/app/canvas_launcher/config.py +16 -14
- tomwer/app/canvas_launcher/environ.py +1 -0
- tomwer/app/canvas_launcher/mainwindow.py +4 -1
- tomwer/app/darkref.py +1 -1
- tomwer/app/darkrefpatch.py +1 -1
- tomwer/app/diffframe.py +3 -3
- tomwer/app/imagekeyeditor.py +5 -5
- tomwer/app/imagekeyupgrader.py +5 -5
- tomwer/app/intensitynormalization.py +14 -13
- tomwer/app/{saaxis.py → multicor.py} +3 -3
- tomwer/app/{sadeltabeta.py → multipag.py} +3 -3
- tomwer/app/nabuapp.py +0 -11
- tomwer/app/radiostack.py +6 -4
- tomwer/app/samplemoved.py +3 -2
- tomwer/app/scanviewer.py +4 -2
- tomwer/app/sinogramviewer.py +3 -2
- tomwer/app/slicestack.py +3 -2
- tomwer/app/zstitching.py +88 -6
- tomwer/core/cluster/cluster.py +26 -0
- tomwer/core/log/logger.py +7 -5
- tomwer/core/process/conditions/filters.py +1 -1
- tomwer/core/process/control/datalistener/datalistener.py +19 -14
- tomwer/core/process/control/datawatcher/edfdwprocess.py +0 -9
- tomwer/core/process/control/nxtomoconcatenate.py +13 -13
- tomwer/core/process/control/nxtomomill.py +92 -34
- tomwer/core/process/control/scantransfer.py +20 -43
- tomwer/core/process/control/scanvalidator.py +3 -2
- tomwer/core/process/control/test/test_concatenate_nxtomos.py +9 -9
- tomwer/core/process/control/test/test_email.py +4 -4
- tomwer/core/process/control/test/test_h52nx_process.py +59 -7
- tomwer/core/process/control/test/test_volume_link.py +64 -64
- tomwer/core/process/control/timer.py +1 -1
- tomwer/core/process/control/volumesymlink.py +200 -200
- tomwer/core/process/edit/darkflatpatch.py +14 -15
- tomwer/core/process/edit/imagekeyeditor.py +41 -39
- tomwer/core/process/icat/__init__.py +0 -0
- tomwer/core/process/icat/createscreenshots.py +100 -0
- tomwer/core/process/icat/gallery.py +377 -0
- tomwer/core/process/icat/icatbase.py +36 -0
- tomwer/core/process/icat/publish.py +228 -0
- tomwer/core/process/icat/screenshots.py +27 -0
- tomwer/core/process/output.py +52 -0
- tomwer/core/process/reconstruction/axis/axis.py +280 -69
- tomwer/core/process/reconstruction/axis/mode.py +163 -48
- tomwer/core/process/reconstruction/axis/params.py +29 -21
- tomwer/core/process/reconstruction/darkref/darkrefs.py +41 -127
- tomwer/core/process/reconstruction/darkref/darkrefscopy.py +4 -3
- tomwer/core/process/reconstruction/darkref/params.py +1 -1
- tomwer/core/process/reconstruction/nabu/castvolume.py +4 -4
- tomwer/core/process/reconstruction/nabu/helical.py +9 -5
- tomwer/core/process/reconstruction/nabu/nabucommon.py +71 -78
- tomwer/core/process/reconstruction/nabu/nabuscores.py +425 -53
- tomwer/core/process/reconstruction/nabu/nabuslices.py +114 -93
- tomwer/core/process/reconstruction/nabu/nabuvolume.py +54 -27
- tomwer/core/process/reconstruction/nabu/plane.py +9 -0
- tomwer/core/process/reconstruction/nabu/settings.py +2 -2
- tomwer/core/process/reconstruction/nabu/utils.py +164 -26
- tomwer/core/process/reconstruction/output.py +108 -0
- tomwer/core/process/reconstruction/saaxis/saaxis.py +238 -264
- tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +151 -87
- tomwer/core/process/reconstruction/scores/params.py +7 -4
- tomwer/core/process/reconstruction/scores/scores.py +13 -0
- tomwer/core/process/reconstruction/test/test_axis_params.py +2 -2
- tomwer/core/process/reconstruction/test/test_darkref.py +3 -3
- tomwer/core/process/reconstruction/test/test_darkref_copy.py +7 -7
- tomwer/core/process/reconstruction/test/test_saaxis.py +3 -4
- tomwer/core/process/reconstruction/test/test_sadeltabeta.py +2 -2
- tomwer/core/process/stitching/nabustitcher.py +13 -12
- tomwer/core/process/task.py +34 -26
- tomwer/core/process/test/test_axis.py +13 -12
- tomwer/core/process/test/test_dark_and_flat.py +10 -7
- tomwer/core/process/test/test_data_transfer.py +10 -8
- tomwer/core/process/test/test_nabu.py +14 -6
- tomwer/core/process/test/test_normalization.py +4 -4
- tomwer/core/scan/blissscan.py +3 -3
- tomwer/core/scan/edfscan.py +13 -10
- tomwer/core/scan/hdf5scan.py +19 -530
- tomwer/core/scan/nxtomoscan.py +534 -0
- tomwer/core/scan/scanbase.py +72 -44
- tomwer/core/scan/scanfactory.py +13 -13
- tomwer/core/scan/test/test_edf.py +2 -2
- tomwer/core/scan/test/test_future_scan.py +3 -3
- tomwer/core/scan/test/test_h5.py +18 -16
- tomwer/core/scan/test/test_process_registration.py +4 -40
- tomwer/core/scan/test/test_scan.py +5 -78
- tomwer/core/settings.py +22 -2
- tomwer/core/test/test_scanutils.py +8 -7
- tomwer/core/test/test_utils.py +35 -28
- tomwer/core/tomwer_object.py +1 -1
- tomwer/core/utils/__init__.py +0 -466
- tomwer/core/utils/deprecation.py +1 -1
- tomwer/core/utils/dictutils.py +14 -0
- tomwer/core/utils/lbsram.py +35 -0
- tomwer/core/utils/nxtomoutils.py +1 -1
- tomwer/core/utils/scanutils.py +6 -6
- tomwer/core/utils/spec.py +263 -0
- tomwer/core/volume/edfvolume.py +6 -6
- tomwer/core/volume/hdf5volume.py +6 -6
- tomwer/core/volume/jp2kvolume.py +6 -6
- tomwer/core/volume/rawvolume.py +6 -6
- tomwer/core/volume/tiffvolume.py +12 -12
- tomwer/core/volume/volumefactory.py +2 -2
- tomwer/gui/cluster/slurm.py +274 -65
- tomwer/gui/cluster/supervisor.py +12 -0
- tomwer/gui/cluster/test/test_cluster.py +14 -2
- tomwer/gui/cluster/test/test_supervisor.py +3 -3
- tomwer/gui/configuration/__init__.py +0 -0
- tomwer/gui/{reconstruction/nabu → configuration}/action.py +1 -32
- tomwer/gui/configuration/level.py +22 -0
- tomwer/gui/control/actions.py +54 -0
- tomwer/gui/control/datalist.py +83 -16
- tomwer/gui/control/datalistener.py +4 -16
- tomwer/gui/control/datawatcher/controlwidget.py +2 -4
- tomwer/gui/control/datawatcher/datawatcher.py +1 -24
- tomwer/gui/control/{email.py → emailnotifier.py} +9 -18
- tomwer/gui/control/history.py +2 -2
- tomwer/gui/control/observations.py +2 -2
- tomwer/gui/control/reducedarkflatselector.py +9 -9
- tomwer/gui/control/selectorwidgetbase.py +36 -9
- tomwer/gui/control/serie/seriecreator.py +5 -22
- tomwer/gui/control/test/test_email.py +1 -1
- tomwer/gui/control/test/test_scanvalidator.py +6 -5
- tomwer/gui/control/test/test_single_tomo_obj.py +3 -3
- tomwer/gui/control/tomoobjdisplaymode.py +8 -0
- tomwer/gui/debugtools/datasetgenerator.py +3 -3
- tomwer/gui/edit/dkrfpatch.py +20 -26
- tomwer/gui/edit/imagekeyeditor.py +11 -12
- tomwer/gui/edit/nxtomoeditor.py +111 -44
- tomwer/gui/edit/nxtomowarmer.py +7 -6
- tomwer/gui/edit/test/test_dkrf_patch.py +13 -13
- tomwer/gui/edit/test/test_image_key_editor.py +3 -3
- tomwer/gui/edit/test/test_nx_editor.py +40 -16
- tomwer/gui/icat/__init__.py +0 -0
- tomwer/gui/icat/createscreenshots.py +80 -0
- tomwer/gui/icat/gallery.py +214 -0
- tomwer/gui/icat/publish.py +187 -0
- tomwer/gui/imagefromfile.py +2 -2
- tomwer/gui/qfolderdialog.py +24 -1
- tomwer/gui/reconstruction/axis/CompareImages.py +88 -168
- tomwer/gui/reconstruction/axis/axis.py +171 -57
- tomwer/gui/reconstruction/axis/radioaxis.py +122 -257
- tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +3 -2
- tomwer/gui/reconstruction/darkref/darkrefwidget.py +2 -1
- tomwer/gui/reconstruction/nabu/castvolume.py +14 -3
- tomwer/gui/reconstruction/nabu/check.py +9 -9
- tomwer/gui/reconstruction/nabu/helical.py +29 -12
- tomwer/gui/reconstruction/nabu/nabuconfig/base.py +2 -4
- tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +2 -1
- tomwer/gui/reconstruction/nabu/nabuconfig/output.py +126 -35
- tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +39 -32
- tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +222 -31
- tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +57 -27
- tomwer/gui/reconstruction/nabu/nabuflow.py +12 -20
- tomwer/gui/reconstruction/nabu/slices.py +10 -11
- tomwer/gui/reconstruction/nabu/volume.py +22 -10
- tomwer/gui/reconstruction/normalization/intensity.py +18 -48
- tomwer/gui/reconstruction/saaxis/corrangeselector.py +8 -24
- tomwer/gui/reconstruction/saaxis/dimensionwidget.py +1 -1
- tomwer/gui/reconstruction/saaxis/saaxis.py +9 -21
- tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +45 -12
- tomwer/gui/reconstruction/scores/control.py +2 -9
- tomwer/gui/reconstruction/scores/scoreplot.py +13 -11
- tomwer/gui/reconstruction/test/test_axis.py +41 -16
- tomwer/gui/reconstruction/test/test_nabu.py +31 -9
- tomwer/gui/reconstruction/test/test_saaxis.py +3 -3
- tomwer/gui/reconstruction/test/test_sadeltabeta.py +12 -2
- tomwer/gui/settings.py +5 -28
- tomwer/gui/stackplot.py +2 -5
- tomwer/gui/stitching/action.py +49 -0
- tomwer/gui/stitching/config/axisparams.py +7 -24
- tomwer/gui/stitching/config/output.py +10 -8
- tomwer/gui/stitching/config/positionoveraxis.py +22 -23
- tomwer/gui/stitching/normalization.py +117 -0
- tomwer/gui/stitching/stitchandbackground.py +4 -6
- tomwer/gui/stitching/stitching.py +267 -45
- tomwer/gui/stitching/stitching_preview.py +62 -55
- tomwer/gui/stitching/stitching_raw.py +13 -12
- tomwer/gui/stitching/z_stitching/fineestimation.py +0 -60
- tomwer/gui/utils/buttons.py +112 -29
- tomwer/gui/utils/inputwidget.py +43 -25
- tomwer/gui/utils/lineselector/lineselector.py +1 -1
- tomwer/gui/utils/scandescription.py +4 -0
- tomwer/gui/utils/step.py +144 -0
- tomwer/gui/utils/unitsystem.py +2 -5
- tomwer/gui/utils/vignettes.py +176 -15
- tomwer/gui/visualization/dataviewer.py +48 -35
- tomwer/gui/visualization/diffviewer/diffviewer.py +7 -16
- tomwer/gui/visualization/diffviewer/shiftwidget.py +2 -5
- tomwer/gui/visualization/scanoverview.py +1 -1
- tomwer/gui/visualization/sinogramviewer.py +20 -36
- tomwer/gui/visualization/test/test_diffviewer.py +3 -3
- tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +4 -4
- tomwer/gui/visualization/test/test_sinogramviewer.py +2 -2
- tomwer/gui/visualization/test/test_stacks.py +3 -3
- tomwer/gui/visualization/test/test_volumeviewer.py +65 -67
- tomwer/gui/visualization/volumeviewer.py +114 -113
- tomwer/io/utils/h5pyutils.py +3 -3
- tomwer/io/utils/raw_and_processed_data.py +84 -0
- tomwer/io/utils/tomoobj.py +4 -6
- tomwer/io/utils/utils.py +7 -7
- tomwer/resources/gui/icons/parameters.svg +1 -1
- tomwer/resources/gui/icons/ruler.png +0 -0
- tomwer/resources/gui/icons/ruler.svg +273 -0
- tomwer/resources/gui/icons/short_description.png +0 -0
- tomwer/resources/gui/icons/short_description.svg +58 -0
- tomwer/resources/gui/icons/url.png +0 -0
- tomwer/resources/gui/icons/url.svg +58 -0
- tomwer/resources/gui/illustrations/no_rot.svg +1 -1
- tomwer/synctools/stacks/edit/darkflatpatch.py +19 -14
- tomwer/synctools/stacks/edit/imagekeyeditor.py +2 -2
- tomwer/synctools/stacks/reconstruction/axis.py +4 -4
- tomwer/synctools/stacks/reconstruction/castvolume.py +22 -7
- tomwer/synctools/stacks/reconstruction/dkrefcopy.py +25 -20
- tomwer/synctools/stacks/reconstruction/nabu.py +2 -2
- tomwer/synctools/stacks/reconstruction/normalization.py +2 -2
- tomwer/synctools/stacks/reconstruction/saaxis.py +2 -2
- tomwer/synctools/stacks/reconstruction/sadeltabeta.py +2 -2
- tomwer/synctools/test/test_darkRefs.py +7 -58
- tomwer/synctools/test/test_foldertransfer.py +6 -6
- tomwer/synctools/utils/scanstages.py +6 -6
- tomwer/tests/conftest.py +34 -0
- tomwer/tests/datasets.py +13 -0
- tomwer/tests/test_scripts.py +91 -41
- tomwer/tests/utils.py +5 -0
- tomwer/third_part/WaitingOverlay.py +110 -0
- tomwer/third_part/__init__.py +0 -0
- tomwer/version.py +2 -2
- tomwer-1.3.12-py3.11-nspkg.pth +1 -0
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/METADATA +73 -58
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/RECORD +287 -286
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/WHEEL +1 -1
- orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +0 -197
- orangecontrib/tomwer/widgets/reconstruction/icons/XY_lamino.svg +0 -168
- orangecontrib/tomwer/widgets/reconstruction/icons/XZ_lamino.svg +0 -275
- orangecontrib/tomwer/widgets/reconstruction/icons/YZ_lamino.svg +0 -182
- tomwer/app/lamino.py +0 -143
- tomwer/core/process/reconstruction/lamino/__init__.py +0 -1
- tomwer/core/process/reconstruction/lamino/tofu.py +0 -1000
- tomwer/core/process/test/test_lamino.py +0 -76
- tomwer/core/test/test_lamino.py +0 -92
- tomwer/gui/reconstruction/lamino/__init__.py +0 -31
- tomwer/gui/reconstruction/lamino/tofu/TofuOptionLoader.py +0 -107
- tomwer/gui/reconstruction/lamino/tofu/__init__.py +0 -1
- tomwer/gui/reconstruction/lamino/tofu/misc.py +0 -148
- tomwer/gui/reconstruction/lamino/tofu/projections.py +0 -896
- tomwer/gui/reconstruction/lamino/tofu/settings.py +0 -75
- tomwer/gui/reconstruction/lamino/tofu/tofu.py +0 -432
- tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +0 -567
- tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +0 -760
- tomwer/gui/reconstruction/test/test_lamino.py +0 -189
- tomwer/resources/gui/icons/esrf_1.svg +0 -307
- tomwer/resources/gui/icons/lamino_parameters.svg +0 -70
- tomwer/resources/gui/icons/triangle.svg +0 -80
- tomwer/resources/gui/illustrations/lamino_angle.png +0 -0
- tomwer/resources/gui/illustrations/lamino_angle.svg +0 -509
- tomwer/resources/gui/illustrations/lamino_beta_angle.png +0 -0
- tomwer/resources/gui/illustrations/lamino_beta_angle.svg +0 -97
- tomwer/resources/gui/illustrations/lamino_theta_angle.png +0 -0
- tomwer/resources/gui/illustrations/lamino_theta_angle.svg +0 -368
- tomwer/resources/gui/illustrations/manual_slice.png +0 -0
- tomwer/resources/gui/illustrations/manual_slice.svg +0 -221
- tomwer/resources/gui/illustrations/psi_angle.png +0 -0
- tomwer/resources/gui/illustrations/psi_angle.svg +0 -479
- tomwer/resources/gui/illustrations/rotation_center.png +0 -0
- tomwer/resources/gui/illustrations/rotation_center.svg +0 -276
- tomwer/resources/gui/illustrations/slice_stack.png +0 -0
- tomwer/resources/gui/illustrations/slice_stack.svg +0 -266
- tomwer/resources/gui/illustrations/xy_slice.png +0 -0
- tomwer/resources/gui/illustrations/xy_slice.svg +0 -269
- tomwer/resources/gui/illustrations/xz_slice.png +0 -0
- tomwer/resources/gui/illustrations/xz_slice.svg +0 -270
- tomwer/resources/gui/illustrations/yz_slice.png +0 -0
- tomwer/resources/gui/illustrations/yz_slice.svg +0 -270
- tomwer/synctools/stacks/reconstruction/lamino.py +0 -233
- tomwer/synctools/test/test_scanstages.py +0 -162
- tomwer/tests/utils/__init__.py +0 -247
- tomwer/tests/utils/utilstest.py +0 -220
- tomwer-1.2.1-py3.11-nspkg.pth +0 -1
- /tomwer/core/process/control/{email.py → emailnotifier.py} +0 -0
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/LICENSE +0 -0
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/entry_points.txt +0 -0
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/namespace_packages.txt +0 -0
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/top_level.txt +0 -0
@@ -8,6 +8,7 @@ import sys
|
|
8
8
|
import time
|
9
9
|
from typing import Union
|
10
10
|
|
11
|
+
import silx
|
11
12
|
from silx.gui import qt
|
12
13
|
from silx.io.utils import h5py_read_dataset
|
13
14
|
|
@@ -120,7 +121,6 @@ class SAAxisWindow(_SAAxisWindow):
|
|
120
121
|
|
121
122
|
def stop(self):
|
122
123
|
self._stopProcessingThread()
|
123
|
-
super().stop()
|
124
124
|
|
125
125
|
def _computeEstimatedCor(self) -> Union[float, None]:
|
126
126
|
scan = self.getScan()
|
@@ -234,9 +234,9 @@ def main(argv):
|
|
234
234
|
requires_reduced_dark_and_flat(scan=scan, logger_=_logger)
|
235
235
|
|
236
236
|
if options.use_opengl_plot:
|
237
|
-
import silx
|
238
|
-
|
239
237
|
silx.config.DEFAULT_PLOT_BACKEND = "gl"
|
238
|
+
else:
|
239
|
+
silx.config.DEFAULT_PLOT_BACKEND = "matplotlib"
|
240
240
|
|
241
241
|
window = SAAxisWindow(dump_roi=options.dump_roi)
|
242
242
|
window.setWindowTitle("saaxis")
|
@@ -8,6 +8,7 @@ import sys
|
|
8
8
|
import time
|
9
9
|
from typing import Union
|
10
10
|
|
11
|
+
import silx
|
11
12
|
from silx.gui import qt
|
12
13
|
from silx.io.utils import h5py_read_dataset
|
13
14
|
|
@@ -198,7 +199,6 @@ class SADeltaBetaWindow(_SADeltaBetaWindow):
|
|
198
199
|
|
199
200
|
def stop(self):
|
200
201
|
self._stopProcessingThread()
|
201
|
-
super().stop()
|
202
202
|
|
203
203
|
def _computeEstimatedCor(self) -> Union[float, None]:
|
204
204
|
scan = self.getScan()
|
@@ -283,9 +283,9 @@ def main(argv):
|
|
283
283
|
logging.root.setLevel(logging.DEBUG)
|
284
284
|
|
285
285
|
if options.use_opengl_plot:
|
286
|
-
import silx
|
287
|
-
|
288
286
|
silx.config.DEFAULT_PLOT_BACKEND = "gl"
|
287
|
+
else:
|
288
|
+
silx.config.DEFAULT_PLOT_BACKEND = "matplotlib"
|
289
289
|
|
290
290
|
increase_max_number_file()
|
291
291
|
scan = ScanFactory.create_scan_object(
|
tomwer/app/nabuapp.py
CHANGED
@@ -44,12 +44,6 @@ class DataViewer(_DataViewer):
|
|
44
44
|
if event.key() is qt.Qt.Key_F5:
|
45
45
|
self._updateDisplay()
|
46
46
|
|
47
|
-
def event(self, event) -> bool:
|
48
|
-
if event.type() == qt.QEvent.DeferredDelete:
|
49
|
-
self.cleanBeforeQuit()
|
50
|
-
self.closed.emit()
|
51
|
-
return super().event(event)
|
52
|
-
|
53
47
|
|
54
48
|
class NabuProcessingThread(qt.QThread):
|
55
49
|
def init(self, data, config, dry_run=False):
|
@@ -185,10 +179,6 @@ class NabuWindow(NabuDialog):
|
|
185
179
|
self._dataViewer.close()
|
186
180
|
self._dataViewer = None
|
187
181
|
|
188
|
-
def _aboutToQuit(self):
|
189
|
-
if self._dataViewer is not None:
|
190
|
-
self._dataViewer.cleanBeforeQuit()
|
191
|
-
|
192
182
|
|
193
183
|
def main(argv):
|
194
184
|
import os
|
@@ -248,7 +238,6 @@ def main(argv):
|
|
248
238
|
widget.setWindowIcon(icons.getQIcon("tomwer"))
|
249
239
|
splash.finish(widget)
|
250
240
|
widget.show()
|
251
|
-
qt.QApplication.instance().aboutToQuit.connect(widget._aboutToQuit)
|
252
241
|
|
253
242
|
app.exec_()
|
254
243
|
|
tomwer/app/radiostack.py
CHANGED
@@ -7,9 +7,10 @@ import os
|
|
7
7
|
import signal
|
8
8
|
import sys
|
9
9
|
|
10
|
+
import silx
|
10
11
|
from silx.gui import qt
|
11
12
|
|
12
|
-
from tomwer.core.scan.
|
13
|
+
from tomwer.core.scan.nxtomoscan import NXtomoScan
|
13
14
|
from tomwer.core.utils.resource import increase_max_number_file
|
14
15
|
from tomwer.gui import icons
|
15
16
|
from tomwer.gui.stacks import RadioStack
|
@@ -29,7 +30,7 @@ def addFolderAndSubFolder(stack, path):
|
|
29
30
|
_path = os.path.join(path, f)
|
30
31
|
if os.path.isdir(_path) is True:
|
31
32
|
addFolderAndSubFolder(stack, _path)
|
32
|
-
elif os.path.isfile(_path) and
|
33
|
+
elif os.path.isfile(_path) and NXtomoScan.is_nexus_nxtomo_file(_path):
|
33
34
|
stack.addLeafScan(_path)
|
34
35
|
|
35
36
|
|
@@ -60,10 +61,11 @@ def main(argv):
|
|
60
61
|
increase_max_number_file()
|
61
62
|
|
62
63
|
options = parser.parse_args(argv[1:])
|
63
|
-
if options.use_opengl_plot:
|
64
|
-
import silx
|
65
64
|
|
65
|
+
if options.use_opengl_plot:
|
66
66
|
silx.config.DEFAULT_PLOT_BACKEND = "gl"
|
67
|
+
else:
|
68
|
+
silx.config.DEFAULT_PLOT_BACKEND = "matplotlib"
|
67
69
|
|
68
70
|
global app # QApplication must be global to avoid seg fault on quit
|
69
71
|
app = qt.QApplication.instance() or qt.QApplication(["tomwer"])
|
tomwer/app/samplemoved.py
CHANGED
@@ -7,6 +7,7 @@ import os
|
|
7
7
|
import signal
|
8
8
|
import sys
|
9
9
|
|
10
|
+
import silx
|
10
11
|
from silx.gui import qt
|
11
12
|
|
12
13
|
from tomwer.core.scan.scanfactory import ScanFactory
|
@@ -54,9 +55,9 @@ def main(argv):
|
|
54
55
|
options = parser.parse_args(argv[1:])
|
55
56
|
|
56
57
|
if options.use_opengl_plot:
|
57
|
-
import silx
|
58
|
-
|
59
58
|
silx.config.DEFAULT_PLOT_BACKEND = "gl"
|
59
|
+
else:
|
60
|
+
silx.config.DEFAULT_PLOT_BACKEND = "matplotlib"
|
60
61
|
|
61
62
|
increase_max_number_file()
|
62
63
|
|
tomwer/app/scanviewer.py
CHANGED
@@ -45,10 +45,12 @@ def main(argv):
|
|
45
45
|
scan_path=options.scan_path, entry=options.entry
|
46
46
|
)
|
47
47
|
|
48
|
-
|
49
|
-
import silx
|
48
|
+
import silx
|
50
49
|
|
50
|
+
if options.use_opengl_plot:
|
51
51
|
silx.config.DEFAULT_PLOT_BACKEND = "gl"
|
52
|
+
else:
|
53
|
+
silx.config.DEFAULT_PLOT_BACKEND = "matplotlib"
|
52
54
|
|
53
55
|
increase_max_number_file()
|
54
56
|
|
tomwer/app/sinogramviewer.py
CHANGED
@@ -7,6 +7,7 @@ import signal
|
|
7
7
|
import sys
|
8
8
|
import weakref
|
9
9
|
|
10
|
+
import silx
|
10
11
|
from silx.gui import qt
|
11
12
|
|
12
13
|
from tomwer.core.scan.scanfactory import ScanFactory
|
@@ -72,9 +73,9 @@ def main(argv):
|
|
72
73
|
options = parser.parse_args(argv[1:])
|
73
74
|
|
74
75
|
if options.use_opengl_plot:
|
75
|
-
import silx
|
76
|
-
|
77
76
|
silx.config.DEFAULT_PLOT_BACKEND = "gl"
|
77
|
+
else:
|
78
|
+
silx.config.DEFAULT_PLOT_BACKEND = "matplotlib"
|
78
79
|
|
79
80
|
scan = ScanFactory.create_scan_object(options.scan_path, entry=options.entry)
|
80
81
|
increase_max_number_file()
|
tomwer/app/slicestack.py
CHANGED
@@ -7,6 +7,7 @@ import os
|
|
7
7
|
import signal
|
8
8
|
import sys
|
9
9
|
|
10
|
+
import silx
|
10
11
|
from silx.gui import qt
|
11
12
|
|
12
13
|
from tomwer.core.utils.resource import increase_max_number_file
|
@@ -57,9 +58,9 @@ def main(argv):
|
|
57
58
|
options = parser.parse_args(argv[1:])
|
58
59
|
|
59
60
|
if options.use_opengl_plot:
|
60
|
-
import silx
|
61
|
-
|
62
61
|
silx.config.DEFAULT_PLOT_BACKEND = "gl"
|
62
|
+
else:
|
63
|
+
silx.config.DEFAULT_PLOT_BACKEND = "matplotlib"
|
63
64
|
|
64
65
|
increase_max_number_file()
|
65
66
|
|
tomwer/app/zstitching.py
CHANGED
@@ -5,18 +5,24 @@ import argparse
|
|
5
5
|
import logging
|
6
6
|
import signal
|
7
7
|
import sys
|
8
|
+
import functools
|
8
9
|
|
10
|
+
import silx
|
9
11
|
from silx.gui import qt
|
10
12
|
|
11
13
|
from nabu.utils import Progress
|
12
14
|
from nabu.stitching.config import StitchingType
|
13
15
|
|
16
|
+
from tomwer.core.settings import SlurmSettingsMode
|
14
17
|
from tomwer.core.utils.resource import increase_max_number_file
|
18
|
+
from tomwer.gui import icons
|
15
19
|
from tomwer.core.process.stitching.nabustitcher import StitcherTask
|
16
20
|
from tomwer.io.utils.tomoobj import get_tomo_objs_instances
|
17
21
|
from tomwer.gui.utils.splashscreen import getMainSplashScreen
|
18
22
|
from tomwer.gui.stitching.stitching import ZStitchingWindow as _ZStitchingWindow
|
23
|
+
from tomwer.gui.stitching import action as stitching_action
|
19
24
|
from tomwer.gui.cluster.slurm import SlurmSettingsWidget
|
25
|
+
from tomwer.core.scan.scanbase import TomwerScanBase
|
20
26
|
|
21
27
|
logging.basicConfig(level=logging.WARNING)
|
22
28
|
|
@@ -31,12 +37,30 @@ class MainWidget(qt.QTabWidget):
|
|
31
37
|
parent=None,
|
32
38
|
) -> None:
|
33
39
|
super().__init__(parent)
|
34
|
-
self._stitchingConfigWindow = _ZStitchingWindow(
|
40
|
+
self._stitchingConfigWindow = _ZStitchingWindow(
|
41
|
+
parent=self, with_configuration_action=False
|
42
|
+
)
|
35
43
|
self.addTab(self._stitchingConfigWindow, "stitching config")
|
44
|
+
settingsClass = SlurmSettingsMode.get_settings_class(
|
45
|
+
SlurmSettingsMode.STITCHING
|
46
|
+
)
|
36
47
|
self._slurmConfig = SlurmSettingsWidget(
|
37
|
-
parent=self, n_gpu=
|
48
|
+
parent=self, n_gpu=settingsClass.N_GPUS_PER_WORKER, jobLimitation=None
|
49
|
+
)
|
50
|
+
self._slurmConfig.setConfiguration(
|
51
|
+
{
|
52
|
+
"cpu-per-task": settingsClass.N_CORES_PER_TASK,
|
53
|
+
"n_tasks": settingsClass.N_TASKS,
|
54
|
+
"n_jobs": settingsClass.N_JOBS,
|
55
|
+
"memory": settingsClass.MEMORY_PER_WORKER,
|
56
|
+
"partition": settingsClass.PARTITION,
|
57
|
+
"n_gpus": settingsClass.N_GPUS_PER_WORKER,
|
58
|
+
"job_name": settingsClass.PROJECT_NAME,
|
59
|
+
"walltime": settingsClass.DEFAULT_WALLTIME,
|
60
|
+
"python_venv": settingsClass.PYTHON_VENV,
|
61
|
+
}
|
38
62
|
)
|
39
|
-
|
63
|
+
|
40
64
|
self._stitchingConfigWindow.setCallbackToGetSlurmConfig(
|
41
65
|
self._slurmConfig.getConfiguration
|
42
66
|
)
|
@@ -133,16 +157,63 @@ class MainWindow(qt.QDialog):
|
|
133
157
|
def __init__(self, parent=None) -> None:
|
134
158
|
super().__init__(parent)
|
135
159
|
self.setLayout(qt.QVBoxLayout())
|
160
|
+
# menu
|
161
|
+
self._menuBar = qt.QMenuBar(self)
|
162
|
+
self.layout().addWidget(self._menuBar)
|
163
|
+
self._menu = qt.QMenu("&Stitching")
|
164
|
+
self._menuBar.addMenu(self._menu)
|
165
|
+
# save / load configuration
|
166
|
+
self._loadConfigurationAction = stitching_action.LoadConfigurationAction(
|
167
|
+
self, "&Load configuration"
|
168
|
+
)
|
169
|
+
self._menu.addAction(self._loadConfigurationAction)
|
170
|
+
self._saveConfigurationAction = stitching_action.SaveConfigurationAction(
|
171
|
+
self, "&Save configuration"
|
172
|
+
)
|
173
|
+
self._menu.addAction(self._saveConfigurationAction)
|
174
|
+
# separator
|
175
|
+
self._menu.addSeparator()
|
176
|
+
# add tomo object
|
177
|
+
self._addTomoObjectAction = stitching_action.AddTomoObjectAction(
|
178
|
+
self, "&Add tomo object (volume or NXtomo)"
|
179
|
+
)
|
180
|
+
self._menu.addAction(self._addTomoObjectAction)
|
181
|
+
|
182
|
+
# main window
|
136
183
|
self.setWindowTitle("tomwer z-stitching")
|
137
184
|
self._mainWindow = MainWidget(parent=self)
|
138
185
|
self.layout().addWidget(self._mainWindow)
|
139
186
|
|
187
|
+
# button
|
140
188
|
types = qt.QDialogButtonBox.Apply
|
141
189
|
self._buttons = qt.QDialogButtonBox(self)
|
142
190
|
self._buttons.setStandardButtons(types)
|
143
191
|
self.layout().addWidget(self._buttons)
|
144
192
|
self._buttons.button(qt.QDialogButtonBox.Apply).setText("Launch stitching")
|
193
|
+
|
194
|
+
# connect signal / slot
|
145
195
|
self._buttons.button(qt.QDialogButtonBox.Apply).clicked.connect(self.accept)
|
196
|
+
self._loadConfigurationAction.triggered.connect(
|
197
|
+
functools.partial(
|
198
|
+
self._mainWindow._stitchingConfigWindow._loadSettings, file_path=None
|
199
|
+
)
|
200
|
+
)
|
201
|
+
self._saveConfigurationAction.triggered.connect(
|
202
|
+
functools.partial(
|
203
|
+
self._mainWindow._stitchingConfigWindow._saveSettings, file_path=None
|
204
|
+
)
|
205
|
+
)
|
206
|
+
self._addTomoObjectAction.triggered.connect(self._callbackAddTomoObj)
|
207
|
+
|
208
|
+
def _callbackAddTomoObj(self, *args, **kwargs):
|
209
|
+
"""move interface to the z-ordered list and call the 'add tomo obj' callback"""
|
210
|
+
orderedListWidget = (
|
211
|
+
self._mainWindow._stitchingConfigWindow._widget._mainWidget._zOrderedList
|
212
|
+
)
|
213
|
+
self._mainWindow._stitchingConfigWindow._widget._mainWidget.setCurrentWidget(
|
214
|
+
orderedListWidget
|
215
|
+
)
|
216
|
+
orderedListWidget._callbackAddTomoObj()
|
146
217
|
|
147
218
|
def close(self):
|
148
219
|
self._mainWindow.close()
|
@@ -227,13 +298,18 @@ def main(argv):
|
|
227
298
|
action="store_true",
|
228
299
|
default=False,
|
229
300
|
)
|
230
|
-
|
301
|
+
parser.add_argument(
|
302
|
+
"--check-scans",
|
303
|
+
help="If True will check scans before adding them. This check scan validity (virtual dataset contains data...)",
|
304
|
+
action="store_true",
|
305
|
+
default=False,
|
306
|
+
)
|
231
307
|
options = parser.parse_args(argv[1:])
|
232
308
|
|
233
309
|
if options.use_opengl_plot:
|
234
|
-
import silx
|
235
|
-
|
236
310
|
silx.config.DEFAULT_PLOT_BACKEND = "gl"
|
311
|
+
else:
|
312
|
+
silx.config.DEFAULT_PLOT_BACKEND = "matplotlib"
|
237
313
|
|
238
314
|
if options.debug:
|
239
315
|
logging.root.setLevel(logging.DEBUG)
|
@@ -258,6 +334,8 @@ def main(argv):
|
|
258
334
|
|
259
335
|
window = MainWindow()
|
260
336
|
window.setWindowFlags(qt.Qt.Window)
|
337
|
+
window.setWindowTitle("tomwer: z-stitching")
|
338
|
+
window.setWindowIcon(icons.getQIcon("tomwer"))
|
261
339
|
|
262
340
|
window.show()
|
263
341
|
from sluurp.utils import has_sbatch_available
|
@@ -271,6 +349,10 @@ def main(argv):
|
|
271
349
|
|
272
350
|
tomo_objs, (has_scans, has_vols) = get_tomo_objs_instances(options.tomo_objs)
|
273
351
|
for tomo_obj in tomo_objs:
|
352
|
+
if isinstance(tomo_obj, TomwerScanBase):
|
353
|
+
tomo_obj.set_check_behavior(
|
354
|
+
run_check=options.check_scans
|
355
|
+
) # speed up processing
|
274
356
|
window.addTomoObj(tomo_obj=tomo_obj)
|
275
357
|
if has_scans and has_vols:
|
276
358
|
_logger.warning(
|
tomwer/core/cluster/cluster.py
CHANGED
@@ -31,8 +31,11 @@ __license__ = "MIT"
|
|
31
31
|
__date__ = "12/10/2021"
|
32
32
|
|
33
33
|
|
34
|
+
import logging
|
34
35
|
from tomwer.core.settings import SlurmSettings as _SlurmSettings
|
35
36
|
|
37
|
+
_logger = logging.getLogger(__name__)
|
38
|
+
|
36
39
|
|
37
40
|
class SlurmClusterConfiguration:
|
38
41
|
"""Object shipping the configuration of a slurm cluster"""
|
@@ -48,6 +51,8 @@ class SlurmClusterConfiguration:
|
|
48
51
|
walltime=_SlurmSettings.DEFAULT_WALLTIME,
|
49
52
|
python_venv=_SlurmSettings.PYTHON_VENV,
|
50
53
|
n_jobs=_SlurmSettings.N_JOBS,
|
54
|
+
modules_to_load: tuple = _SlurmSettings.MODULES_TO_LOAD,
|
55
|
+
sbatch_extra_params: dict = _SlurmSettings.SBATCH_EXTRA_PARAMS,
|
51
56
|
) -> None:
|
52
57
|
self._n_cpu_per_task = n_cpu_per_task
|
53
58
|
self._n_task = n_tasks
|
@@ -57,7 +62,13 @@ class SlurmClusterConfiguration:
|
|
57
62
|
self._project_name = project_name
|
58
63
|
self._walltime = walltime
|
59
64
|
self._python_venv = python_venv
|
65
|
+
self._modules_to_load = modules_to_load
|
60
66
|
self._n_jobs = n_jobs
|
67
|
+
self._sbatch_extra_params = sbatch_extra_params
|
68
|
+
if python_venv not in (None, "") and len(modules_to_load) > 0:
|
69
|
+
_logger.warning(
|
70
|
+
"Either 'modules to load' of 'python venv' can be provided. Not both"
|
71
|
+
)
|
61
72
|
|
62
73
|
@property
|
63
74
|
def n_cpu_per_task(self):
|
@@ -95,11 +106,19 @@ class SlurmClusterConfiguration:
|
|
95
106
|
def python_venv(self):
|
96
107
|
return self._python_venv
|
97
108
|
|
109
|
+
@property
|
110
|
+
def modules_to_load(self) -> tuple:
|
111
|
+
return self._modules_to_load
|
112
|
+
|
98
113
|
@property
|
99
114
|
def port_range(self) -> tuple:
|
100
115
|
"""port range as (start:int, strop:int, step: int)"""
|
101
116
|
return self._port_range
|
102
117
|
|
118
|
+
@property
|
119
|
+
def sbatch_extra_params(self) -> dict:
|
120
|
+
return self._sbatch_extra_params
|
121
|
+
|
103
122
|
@property
|
104
123
|
def dashboard_port(self):
|
105
124
|
return self._dashboard_port
|
@@ -115,6 +134,8 @@ class SlurmClusterConfiguration:
|
|
115
134
|
"job_name": self.project_name,
|
116
135
|
"walltime": self.walltime,
|
117
136
|
"python_venv": self.python_venv,
|
137
|
+
"modules": self.modules_to_load,
|
138
|
+
"sbatch_extra_params": self.sbatch_extra_params,
|
118
139
|
}
|
119
140
|
|
120
141
|
@staticmethod
|
@@ -140,8 +161,13 @@ class SlurmClusterConfiguration:
|
|
140
161
|
self._walltime = dict_["walltime"]
|
141
162
|
if "python_venv" in dict_:
|
142
163
|
self._python_venv = dict_["python_venv"]
|
164
|
+
modules = dict_.get("modules", None)
|
165
|
+
if modules is not None:
|
166
|
+
self._modules_to_load = modules
|
143
167
|
if "port_range" in dict_:
|
144
168
|
self._port_range = dict_["port_range"]
|
145
169
|
if "dashboard_port" in dict_:
|
146
170
|
self._dashboard_port = dict_["dashboard_port"]
|
171
|
+
if "sbatch_extra_params" in dict_:
|
172
|
+
self._sbatch_extra_params = dict_["sbatch_extra_params"]
|
147
173
|
return self
|
tomwer/core/log/logger.py
CHANGED
@@ -51,10 +51,14 @@ from tomwer.core.log.processlog import (
|
|
51
51
|
|
52
52
|
# These are the sequences need to get colored ouput
|
53
53
|
_RESET_SEQ = "\033[0m"
|
54
|
-
_COLOR_SEQ = "\033[1;%dm"
|
55
54
|
_BOLD_SEQ = "\033[1m"
|
56
55
|
|
57
|
-
_BLACK
|
56
|
+
_BLACK = "\033[30m"
|
57
|
+
_RED = "\033[31m"
|
58
|
+
_GREEN = "\033[32m"
|
59
|
+
_YELLOW = "\033[33m"
|
60
|
+
_BLUE = "\033[34m"
|
61
|
+
_MAGENTA = "\033[35m"
|
58
62
|
|
59
63
|
LOG_COLORS = {
|
60
64
|
"WARNING": _MAGENTA,
|
@@ -90,9 +94,7 @@ class _ColoredFormatter(logging.Formatter):
|
|
90
94
|
def format(self, record):
|
91
95
|
levelname = record.levelname
|
92
96
|
if self.use_color is True and levelname in LOG_COLORS:
|
93
|
-
levelname_color =
|
94
|
-
_COLOR_SEQ % (30 + LOG_COLORS[levelname]) + levelname + _RESET_SEQ
|
95
|
-
)
|
97
|
+
levelname_color = LOG_COLORS[levelname] + levelname + _RESET_SEQ
|
96
98
|
record.levelname = levelname_color
|
97
99
|
record.asctime = self.formatTime(record, self.datefmt)
|
98
100
|
return logging.Formatter.format(self, record)
|
@@ -41,7 +41,7 @@ from tomwer.core.process.task import Task
|
|
41
41
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
42
42
|
from tomwer.core.scan.scanfactory import ScanFactory
|
43
43
|
|
44
|
-
from
|
44
|
+
from tomwer.core.utils.deprecation import deprecated_warning
|
45
45
|
|
46
46
|
_logger = logging.getLogger(__name__)
|
47
47
|
|
@@ -37,13 +37,13 @@ import typing
|
|
37
37
|
from ewokscore.task import Task as EwoksTask
|
38
38
|
from nxtomomill import converter as nxtomomill_converter
|
39
39
|
from silx.io.utils import h5py_read_dataset
|
40
|
-
from
|
40
|
+
from silx.io.utils import open as open_hdf5
|
41
41
|
|
42
42
|
import tomwer.version
|
43
43
|
from tomwer.core import settings
|
44
44
|
from tomwer.core.process.task import BaseProcessInfo
|
45
45
|
from tomwer.core.scan.blissscan import BlissScan
|
46
|
-
from tomwer.core.scan.
|
46
|
+
from tomwer.core.scan.nxtomoscan import NXtomoScan
|
47
47
|
|
48
48
|
from .rpcserver import DataListenerThread
|
49
49
|
|
@@ -102,6 +102,11 @@ class DataListener(BaseProcessInfo):
|
|
102
102
|
TIMOUT_READ_FILE = 30
|
103
103
|
"When the event 'scan_ended' is received all data might not have been write" " yet"
|
104
104
|
|
105
|
+
SWMR_MODE = None
|
106
|
+
"""The bliss writer is not using the swmr mode. This class has independant behavior regarding the tomoscan / nxotmo get_swmr_mode which is
|
107
|
+
dedicated to the internal tomotools behavior
|
108
|
+
"""
|
109
|
+
|
105
110
|
def __init__(self):
|
106
111
|
super().__init__()
|
107
112
|
self._host = settings.JSON_RPC_HOST
|
@@ -191,7 +196,7 @@ class DataListener(BaseProcessInfo):
|
|
191
196
|
for mf_emf in self.convert(bliss_file=sample_file, entry=entry):
|
192
197
|
master_file, entry_master_file = mf_emf
|
193
198
|
if master_file is not None and entry_master_file is not None:
|
194
|
-
scan =
|
199
|
+
scan = NXtomoScan(scan=master_file, entry=entry_master_file)
|
195
200
|
|
196
201
|
try:
|
197
202
|
# register process.
|
@@ -224,7 +229,7 @@ class DataListener(BaseProcessInfo):
|
|
224
229
|
"""Return the list of scans dir for this bliss_file / entry"""
|
225
230
|
|
226
231
|
def get_scan_indexes():
|
227
|
-
with
|
232
|
+
with open_hdf5(bliss_file) as h5f:
|
228
233
|
entry_node = h5f[entry]
|
229
234
|
if _SCAN_NUMBER_PATH in entry_node:
|
230
235
|
return h5py_read_dataset(entry_node[_SCAN_NUMBER_PATH])
|
@@ -249,7 +254,7 @@ class DataListener(BaseProcessInfo):
|
|
249
254
|
"""Return the proposal file of the experimentation if registred by the
|
250
255
|
data listener"""
|
251
256
|
if entry is None:
|
252
|
-
with
|
257
|
+
with open_hdf5(process_file) as h5f:
|
253
258
|
entries = BaseProcessInfo._get_process_nodes(
|
254
259
|
root_node=h5f, process=DataListener
|
255
260
|
)
|
@@ -264,7 +269,7 @@ class DataListener(BaseProcessInfo):
|
|
264
269
|
entry = list(entries.keys())[0]
|
265
270
|
_logger.info("take %s as default entry" % entry)
|
266
271
|
|
267
|
-
with
|
272
|
+
with open_hdf5(process_file) as h5f:
|
268
273
|
dl_nodes = BaseProcessInfo._get_process_nodes(
|
269
274
|
root_node=h5f[entry], process=DataListener
|
270
275
|
)
|
@@ -306,7 +311,7 @@ class DataListener(BaseProcessInfo):
|
|
306
311
|
"""Return the proposal file of the experimentation if registred by the
|
307
312
|
data listener"""
|
308
313
|
if entry is None:
|
309
|
-
with
|
314
|
+
with open_hdf5(process_file) as h5f:
|
310
315
|
entries = BaseProcessInfo._get_process_nodes(
|
311
316
|
root_node=h5f, process=DataListener
|
312
317
|
)
|
@@ -321,7 +326,7 @@ class DataListener(BaseProcessInfo):
|
|
321
326
|
entry = list(entries.keys())[0]
|
322
327
|
_logger.info("take %s as default entry" % entry)
|
323
328
|
|
324
|
-
with
|
329
|
+
with open_hdf5(process_file) as h5f:
|
325
330
|
dl_nodes = BaseProcessInfo._get_process_nodes(
|
326
331
|
root_node=h5f[entry], process=DataListener
|
327
332
|
)
|
@@ -355,7 +360,7 @@ class DataListener(BaseProcessInfo):
|
|
355
360
|
"""Return the proposal file of the experimentation if registred by the
|
356
361
|
data listener"""
|
357
362
|
if entry is None:
|
358
|
-
with
|
363
|
+
with open_hdf5(process_file) as h5f:
|
359
364
|
entries = BaseProcessInfo._get_process_nodes(
|
360
365
|
root_node=h5f, process=DataListener
|
361
366
|
)
|
@@ -370,7 +375,7 @@ class DataListener(BaseProcessInfo):
|
|
370
375
|
entry = list(entries.keys())[0]
|
371
376
|
_logger.info("take %s as default entry" % entry)
|
372
377
|
|
373
|
-
with
|
378
|
+
with open_hdf5(process_file) as h5f:
|
374
379
|
dl_nodes = BaseProcessInfo._get_process_nodes(
|
375
380
|
root_node=h5f[entry], process=DataListener
|
376
381
|
)
|
@@ -405,7 +410,7 @@ class DataListener(BaseProcessInfo):
|
|
405
410
|
specific sequence data
|
406
411
|
"""
|
407
412
|
if entry is None:
|
408
|
-
with
|
413
|
+
with open_hdf5(process_file) as h5f:
|
409
414
|
entries = BaseProcessInfo._get_process_nodes(
|
410
415
|
root_node=h5f, process=DataListener
|
411
416
|
)
|
@@ -420,7 +425,7 @@ class DataListener(BaseProcessInfo):
|
|
420
425
|
entry = list(entries.keys())[0]
|
421
426
|
_logger.info("take %s as default entry" % entry)
|
422
427
|
|
423
|
-
with
|
428
|
+
with open_hdf5(process_file) as h5f:
|
424
429
|
dl_nodes = BaseProcessInfo._get_process_nodes(
|
425
430
|
root_node=h5f[entry], process=DataListener
|
426
431
|
)
|
@@ -498,7 +503,7 @@ class DataListener(BaseProcessInfo):
|
|
498
503
|
# write
|
499
504
|
def sequence_is_finished():
|
500
505
|
try:
|
501
|
-
with
|
506
|
+
with open_hdf5(bliss_file) as h5f:
|
502
507
|
end_scan_path = "/".join((entry, "end_time"))
|
503
508
|
return end_scan_path in h5f
|
504
509
|
except Exception:
|
@@ -548,7 +553,7 @@ class DataListener(BaseProcessInfo):
|
|
548
553
|
return res == "Y"
|
549
554
|
|
550
555
|
def _signal_scan_ready(self, scan):
|
551
|
-
assert isinstance(scan,
|
556
|
+
assert isinstance(scan, NXtomoScan)
|
552
557
|
pass
|
553
558
|
|
554
559
|
def activate(self, activate=True):
|
@@ -50,15 +50,6 @@ except ImportError:
|
|
50
50
|
has_rsync = True
|
51
51
|
|
52
52
|
|
53
|
-
def get_info_val(lines, key):
|
54
|
-
r = range(len(lines))
|
55
|
-
key = key + "="
|
56
|
-
for i in r:
|
57
|
-
if key in lines[i]:
|
58
|
-
val = float(lines[i].split("=")[1])
|
59
|
-
return val
|
60
|
-
|
61
|
-
|
62
53
|
class _DataWatcherEDFProcess(_DataWatcherProcess):
|
63
54
|
"""
|
64
55
|
Base class for edf acquisition observation
|