pymodaq 4.2.4__py3-none-any.whl → 5.0.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.
Potentially problematic release.
This version of pymodaq might be problematic. Click here for more details.
- pymodaq/__init__.py +30 -23
- pymodaq/control_modules/daq_move.py +27 -14
- pymodaq/control_modules/daq_move_ui.py +28 -12
- pymodaq/control_modules/daq_viewer.py +38 -28
- pymodaq/control_modules/daq_viewer_ui.py +6 -6
- pymodaq/control_modules/mocks.py +1 -1
- pymodaq/control_modules/move_utility_classes.py +19 -10
- pymodaq/control_modules/utils.py +18 -12
- pymodaq/control_modules/viewer_utility_classes.py +13 -4
- pymodaq/dashboard.py +164 -115
- pymodaq/examples/custom_app.py +13 -16
- pymodaq/examples/custom_viewer.py +6 -6
- pymodaq/examples/function_plotter.py +13 -12
- pymodaq/examples/parameter_ex.py +50 -25
- pymodaq/examples/tcp_client.py +1 -1
- pymodaq/extensions/__init__.py +1 -1
- pymodaq/extensions/bayesian/bayesian_optimisation.py +15 -12
- pymodaq/extensions/bayesian/utils.py +10 -10
- pymodaq/extensions/console.py +10 -13
- pymodaq/extensions/{daq_logger.py → daq_logger/daq_logger.py} +36 -56
- pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger.py +16 -15
- pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger_models.py +2 -0
- pymodaq/{utils/h5modules → extensions/daq_logger}/h5logging.py +7 -8
- pymodaq/extensions/daq_scan.py +153 -247
- pymodaq/extensions/daq_scan_ui.py +11 -9
- pymodaq/extensions/h5browser.py +8 -8
- pymodaq/extensions/pid/__init__.py +6 -3
- pymodaq/extensions/pid/daq_move_PID.py +4 -2
- pymodaq/extensions/pid/pid_controller.py +15 -12
- pymodaq/extensions/pid/utils.py +10 -5
- pymodaq/extensions/utils.py +5 -3
- pymodaq/post_treatment/load_and_plot.py +10 -7
- pymodaq/resources/preset_default.xml +1 -1
- pymodaq/utils/array_manipulation.py +4 -384
- pymodaq/utils/calibration_camera.py +12 -9
- pymodaq/utils/chrono_timer.py +7 -5
- pymodaq/utils/config.py +3 -450
- pymodaq/utils/daq_utils.py +6 -708
- pymodaq/utils/data.py +9 -2774
- pymodaq/utils/exceptions.py +0 -4
- pymodaq/utils/gui_utils/__init__.py +8 -8
- pymodaq/utils/gui_utils/loader_utils.py +38 -0
- pymodaq/utils/gui_utils/utils.py +6 -138
- pymodaq/utils/h5modules/__init__.py +0 -4
- pymodaq/utils/h5modules/module_saving.py +15 -8
- pymodaq/utils/leco/__init__.py +2 -2
- pymodaq/utils/leco/daq_move_LECODirector.py +2 -2
- pymodaq/utils/leco/daq_xDviewer_LECODirector.py +2 -2
- pymodaq/utils/leco/director_utils.py +2 -2
- pymodaq/utils/leco/leco_director.py +3 -3
- pymodaq/utils/leco/pymodaq_listener.py +2 -2
- pymodaq/utils/leco/utils.py +1 -1
- pymodaq/utils/logger.py +4 -76
- pymodaq/utils/managers/batchscan_manager.py +16 -19
- pymodaq/utils/managers/modules_manager.py +10 -7
- pymodaq/utils/managers/overshoot_manager.py +3 -5
- pymodaq/utils/managers/preset_manager.py +37 -15
- pymodaq/utils/managers/preset_manager_utils.py +11 -9
- pymodaq/utils/managers/remote_manager.py +12 -10
- pymodaq/utils/math_utils.py +4 -572
- pymodaq/utils/parameter/__init__.py +4 -11
- pymodaq/utils/parameter/utils.py +4 -299
- pymodaq/utils/scanner/scan_config.py +1 -1
- pymodaq/utils/scanner/scan_factory.py +16 -12
- pymodaq/utils/{plotting → scanner}/scan_selector.py +19 -20
- pymodaq/utils/scanner/scanner.py +10 -8
- pymodaq/utils/scanner/scanners/_1d_scanners.py +8 -5
- pymodaq/utils/scanner/scanners/_2d_scanners.py +5 -5
- pymodaq/utils/scanner/scanners/sequential.py +8 -8
- pymodaq/utils/scanner/scanners/tabular.py +9 -9
- pymodaq/utils/scanner/utils.py +6 -4
- pymodaq/utils/svg/svg_viewer2D.py +3 -4
- pymodaq/utils/tcp_ip/serializer.py +64 -16
- pymodaq/utils/tcp_ip/tcp_server_client.py +10 -8
- {pymodaq-4.2.4.dist-info → pymodaq-5.0.0.dist-info}/METADATA +5 -3
- pymodaq-5.0.0.dist-info/RECORD +123 -0
- pymodaq/post_treatment/process_to_scalar.py +0 -263
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/1d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/2d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/3d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add_Step.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve_All.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Browse_Dir_Path.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Calculator.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnGroup.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnNum.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnText.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnTime.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnWave.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Close3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ColorPicker.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Contract.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Create.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/DeleteLayer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditOpen.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditRedo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditUndo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Ellipse.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EllipseFilled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ErrorMessage.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Exit.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Expand.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/FFT.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/HLM.ico +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Histogram.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/LUT_LookUpTable.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Marker.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Math.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MeasurementStudio_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Move.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveDown.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveUp.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Multiply.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewFile.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewLayer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_File.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_Folder.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_1D.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_2D.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_sim.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Options.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Pass.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/RGB.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rectangle.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/RectangleFilled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Redo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Region.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rendezvous.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SELECT.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Search.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SelectPolygon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Select_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Settings.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snap&Save.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Spreadsheet.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Status.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Subtract.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Vision.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Volts.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Wait2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_1_1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_in.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_out.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_to_Selection.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/abort.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/advanced2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/autoscale.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/b_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/back.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/bg_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera_snap.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/cartesian.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/close2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/cluster2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/color.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/color2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/continuous.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/data.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/delay.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/download.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/download2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/error2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ethernet.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/exit2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/fan.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/filter2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/g_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/gear2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/grab.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/graph.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/green_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/grey_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greyscale.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/home2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/information2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ini.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/integrator.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/joystick.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/limiter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/load_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meshPlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_contour.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_straight_line.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/movie.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/multi_point.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/multiplexer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/new.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/openArrow.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/openTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/overlay.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pause.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/permute.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/phase.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/play.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/polar.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pole_zero.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerMeter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/properties.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/r_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/radiocontrolbutton.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/read2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/red_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/remove.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/reset.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/rgb_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/robot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/rotation2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/run2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/run_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/saturation.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/saveTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/save_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_horizontally.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_vertically.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/search2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_none.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/snap.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sort_ascend.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/spectrumAnalyzer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/start.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/status_cancelled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sum.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/surfacePlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/tree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/updateTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility_small.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/vector.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/verify.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/video.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/wait.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/waterfallPlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/watershed.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/yellow_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zip_file.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomAuto.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomReset.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.bat +0 -2
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.qrc +0 -234
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources_rc.py +0 -127150
- pymodaq/resources/QtDesigner_Ressources/icons.svg +0 -142
- pymodaq/resources/VERSION +0 -1
- pymodaq/resources/config_template.toml +0 -94
- pymodaq/resources/triangulation_data.npy +0 -0
- pymodaq/utils/abstract/__init__.py +0 -48
- pymodaq/utils/db/__init__.py +0 -0
- pymodaq/utils/db/db_logger/__init__.py +0 -0
- pymodaq/utils/enums.py +0 -76
- pymodaq/utils/factory.py +0 -82
- pymodaq/utils/gui_utils/custom_app.py +0 -133
- pymodaq/utils/gui_utils/dock.py +0 -107
- pymodaq/utils/gui_utils/file_io.py +0 -93
- pymodaq/utils/gui_utils/layout.py +0 -34
- pymodaq/utils/gui_utils/list_picker.py +0 -38
- pymodaq/utils/gui_utils/widgets/__init__.py +0 -5
- pymodaq/utils/gui_utils/widgets/label.py +0 -24
- pymodaq/utils/gui_utils/widgets/lcd.py +0 -111
- pymodaq/utils/gui_utils/widgets/push.py +0 -149
- pymodaq/utils/gui_utils/widgets/qled.py +0 -62
- pymodaq/utils/gui_utils/widgets/spinbox.py +0 -24
- pymodaq/utils/gui_utils/widgets/table.py +0 -263
- pymodaq/utils/gui_utils/widgets/tree_layout.py +0 -188
- pymodaq/utils/gui_utils/widgets/tree_toml.py +0 -102
- pymodaq/utils/h5modules/backends.py +0 -1022
- pymodaq/utils/h5modules/browsing.py +0 -625
- pymodaq/utils/h5modules/data_saving.py +0 -1105
- pymodaq/utils/h5modules/exporter.py +0 -119
- pymodaq/utils/h5modules/exporters/__init__.py +0 -0
- pymodaq/utils/h5modules/exporters/base.py +0 -111
- pymodaq/utils/h5modules/exporters/flimj.py +0 -63
- pymodaq/utils/h5modules/exporters/hyperspy.py +0 -143
- pymodaq/utils/h5modules/saving.py +0 -866
- pymodaq/utils/h5modules/utils.py +0 -115
- pymodaq/utils/managers/action_manager.py +0 -489
- pymodaq/utils/managers/parameter_manager.py +0 -282
- pymodaq/utils/managers/roi_manager.py +0 -726
- pymodaq/utils/messenger.py +0 -66
- pymodaq/utils/parameter/ioxml.py +0 -542
- pymodaq/utils/parameter/pymodaq_ptypes/__init__.py +0 -38
- pymodaq/utils/parameter/pymodaq_ptypes/bool.py +0 -31
- pymodaq/utils/parameter/pymodaq_ptypes/date.py +0 -126
- pymodaq/utils/parameter/pymodaq_ptypes/filedir.py +0 -143
- pymodaq/utils/parameter/pymodaq_ptypes/itemselect.py +0 -265
- pymodaq/utils/parameter/pymodaq_ptypes/led.py +0 -44
- pymodaq/utils/parameter/pymodaq_ptypes/list.py +0 -150
- pymodaq/utils/parameter/pymodaq_ptypes/numeric.py +0 -18
- pymodaq/utils/parameter/pymodaq_ptypes/pixmap.py +0 -175
- pymodaq/utils/parameter/pymodaq_ptypes/slide.py +0 -145
- pymodaq/utils/parameter/pymodaq_ptypes/table.py +0 -135
- pymodaq/utils/parameter/pymodaq_ptypes/tableview.py +0 -149
- pymodaq/utils/parameter/pymodaq_ptypes/text.py +0 -142
- pymodaq/utils/plotting/__init__.py +0 -0
- pymodaq/utils/plotting/data_viewers/__init__.py +0 -10
- pymodaq/utils/plotting/data_viewers/base.py +0 -286
- pymodaq/utils/plotting/data_viewers/viewer.py +0 -274
- pymodaq/utils/plotting/data_viewers/viewer0D.py +0 -298
- pymodaq/utils/plotting/data_viewers/viewer1D.py +0 -826
- pymodaq/utils/plotting/data_viewers/viewer1Dbasic.py +0 -231
- pymodaq/utils/plotting/data_viewers/viewer2D.py +0 -1118
- pymodaq/utils/plotting/data_viewers/viewer2D_basic.py +0 -146
- pymodaq/utils/plotting/data_viewers/viewerND.py +0 -800
- pymodaq/utils/plotting/gant_chart.py +0 -123
- pymodaq/utils/plotting/image_viewer.py +0 -97
- pymodaq/utils/plotting/items/__init__.py +0 -0
- pymodaq/utils/plotting/items/axis_scaled.py +0 -93
- pymodaq/utils/plotting/items/crosshair.py +0 -94
- pymodaq/utils/plotting/items/image.py +0 -388
- pymodaq/utils/plotting/navigator.py +0 -353
- pymodaq/utils/plotting/plotter/plotter.py +0 -94
- pymodaq/utils/plotting/plotter/plotters/__init__.py +0 -0
- pymodaq/utils/plotting/plotter/plotters/matplotlib_plotters.py +0 -134
- pymodaq/utils/plotting/plotter/plotters/qt_plotters.py +0 -78
- pymodaq/utils/plotting/utils/__init__.py +0 -0
- pymodaq/utils/plotting/utils/axes_viewer.py +0 -88
- pymodaq/utils/plotting/utils/filter.py +0 -585
- pymodaq/utils/plotting/utils/lineout.py +0 -226
- pymodaq/utils/plotting/utils/plot_utils.py +0 -579
- pymodaq/utils/plotting/utils/signalND.py +0 -1347
- pymodaq/utils/plotting/widgets.py +0 -76
- pymodaq/utils/qvariant.py +0 -12
- pymodaq/utils/slicing.py +0 -63
- pymodaq/utils/units.py +0 -216
- pymodaq-4.2.4.dist-info/RECORD +0 -438
- /pymodaq/{post_treatment/daq_analysis → extensions/daq_logger}/__init__.py +0 -0
- /pymodaq/{utils/abstract/logger.py → extensions/daq_logger/abstract.py} +0 -0
- /pymodaq/{resources/QtDesigner_Ressources → extensions/daq_logger/db}/__init__.py +0 -0
- {pymodaq-4.2.4.dist-info → pymodaq-5.0.0.dist-info}/WHEEL +0 -0
- {pymodaq-4.2.4.dist-info → pymodaq-5.0.0.dist-info}/entry_points.txt +0 -0
- {pymodaq-4.2.4.dist-info → pymodaq-5.0.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,826 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
import datetime
|
|
3
|
-
from collections import OrderedDict
|
|
4
|
-
from typing import List, Iterable, Union, Dict, Tuple
|
|
5
|
-
|
|
6
|
-
from qtpy import QtWidgets
|
|
7
|
-
from qtpy.QtCore import QObject, Slot, Signal, Qt, QRectF
|
|
8
|
-
import pyqtgraph as pg
|
|
9
|
-
import numpy as np
|
|
10
|
-
|
|
11
|
-
from pymodaq.utils.data import DataRaw, DataFromRoi, Axis, DataToExport, DataCalculated, DataWithAxes
|
|
12
|
-
from pymodaq.utils.logger import set_logger, get_module_name
|
|
13
|
-
from pymodaq.utils.parameter import utils as putils
|
|
14
|
-
from pymodaq.utils.plotting.items.crosshair import Crosshair
|
|
15
|
-
from pymodaq.utils import daq_utils as utils
|
|
16
|
-
import pymodaq.utils.math_utils as mutils
|
|
17
|
-
from pymodaq.utils.managers.action_manager import ActionManager
|
|
18
|
-
from pymodaq.utils.plotting.data_viewers.viewer import ViewerBase
|
|
19
|
-
from pymodaq.utils.plotting.utils.plot_utils import make_dashed_pens, RoiInfo
|
|
20
|
-
from pymodaq.utils.managers.roi_manager import ROIManager
|
|
21
|
-
from pymodaq.utils.plotting.utils.filter import Filter1DFromCrosshair, Filter1DFromRois
|
|
22
|
-
from pymodaq.utils.plotting.widgets import PlotWidget
|
|
23
|
-
from pymodaq.utils.plotting.data_viewers.viewer0D import Viewer0D
|
|
24
|
-
|
|
25
|
-
logger = set_logger(get_module_name(__file__))
|
|
26
|
-
|
|
27
|
-
PLOT_COLORS = utils.plot_colors
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class DataDisplayer(QObject):
|
|
31
|
-
"""
|
|
32
|
-
This Object deals with the display of 1D data on a plotitem
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
updated_item = Signal(list)
|
|
36
|
-
labels_changed = Signal(list)
|
|
37
|
-
|
|
38
|
-
def __init__(self, plotitem: pg.PlotItem, flip_axes=False, plot_colors=PLOT_COLORS):
|
|
39
|
-
super().__init__()
|
|
40
|
-
self._doxy = False
|
|
41
|
-
self._do_sort = False
|
|
42
|
-
self._do_scatter = False
|
|
43
|
-
self._show_errors = False
|
|
44
|
-
self._flip_axes = flip_axes
|
|
45
|
-
self._plotitem = plotitem
|
|
46
|
-
self._plotitem.addLegend()
|
|
47
|
-
self._plot_items: List[pg.PlotDataItem] = []
|
|
48
|
-
self._boundary_items: List[Tuple[pg.PlotDataItem, pg.PlotDataItem]] = []
|
|
49
|
-
self._fill_items: List[pg.FillBetweenItem] = []
|
|
50
|
-
self._overlay_items: List[pg.PlotDataItem] = []
|
|
51
|
-
self._axis: Axis = None
|
|
52
|
-
self._data: DataWithAxes = None
|
|
53
|
-
self._plot_colors = plot_colors
|
|
54
|
-
|
|
55
|
-
@property
|
|
56
|
-
def Ndata(self):
|
|
57
|
-
return len(self._data) if self._data is not None else 0
|
|
58
|
-
|
|
59
|
-
def update_colors(self, colors: list):
|
|
60
|
-
self._plot_colors[0:len(colors)] = colors
|
|
61
|
-
self.update_data(self._data, force_update=True)
|
|
62
|
-
|
|
63
|
-
self._doxy = False
|
|
64
|
-
self._do_sort = False
|
|
65
|
-
|
|
66
|
-
@property
|
|
67
|
-
def legend(self):
|
|
68
|
-
return self._plotitem.legend
|
|
69
|
-
|
|
70
|
-
def update_axis(self, axis: Axis):
|
|
71
|
-
self._axis = axis.copy()
|
|
72
|
-
if self._axis.get_data() is None: # create real data vector once here for subsequent use
|
|
73
|
-
self._axis.create_linear_data(axis.size)
|
|
74
|
-
|
|
75
|
-
def get_axis(self) -> Axis:
|
|
76
|
-
return self._axis
|
|
77
|
-
|
|
78
|
-
def get_plot_items(self):
|
|
79
|
-
return self._plot_items
|
|
80
|
-
|
|
81
|
-
def get_plot_item(self, index: int):
|
|
82
|
-
return self._plot_items[index]
|
|
83
|
-
|
|
84
|
-
def update_data(self, data: DataRaw, do_xy=False, sort_data=False, force_update=False,
|
|
85
|
-
do_scatter=False, show_errors=False):
|
|
86
|
-
if data is not None:
|
|
87
|
-
if data.labels != self.labels or self._show_errors != show_errors:
|
|
88
|
-
force_update = True
|
|
89
|
-
self._data = data
|
|
90
|
-
if len(data) != len(self._plot_items) or force_update:
|
|
91
|
-
self.update_display_items(data, show_errors)
|
|
92
|
-
self.update_plot(do_xy, data, sort_data, do_scatter, show_errors)
|
|
93
|
-
|
|
94
|
-
def update_xy(self, do_xy=False):
|
|
95
|
-
self._doxy = do_xy
|
|
96
|
-
self.update_plot(do_xy, sort_data=self._do_sort, scatter=self._do_scatter)
|
|
97
|
-
|
|
98
|
-
def update_sort(self, do_sort=False):
|
|
99
|
-
self._do_sort = do_sort
|
|
100
|
-
self.update_plot(self._doxy, sort_data=self._do_sort, scatter=self._do_scatter)
|
|
101
|
-
|
|
102
|
-
def update_scatter(self, do_scatter=False):
|
|
103
|
-
self._do_scatter = do_scatter
|
|
104
|
-
self.update_plot(self._doxy, sort_data=self._do_sort, scatter=self._do_scatter)
|
|
105
|
-
|
|
106
|
-
def update_errors(self, show_errors=False):
|
|
107
|
-
self._show_errors = show_errors
|
|
108
|
-
self.update_data(self._data, self._doxy, sort_data=self._do_sort, force_update=True,
|
|
109
|
-
do_scatter=self._do_scatter, show_errors=show_errors)
|
|
110
|
-
|
|
111
|
-
def update_plot(self, do_xy=True, data=None, sort_data=False, scatter=False, show_errors=False):
|
|
112
|
-
if data is None:
|
|
113
|
-
data = self._data
|
|
114
|
-
if data is not None:
|
|
115
|
-
if sort_data:
|
|
116
|
-
data = data.sort_data()
|
|
117
|
-
if len(data.axes) == 0:
|
|
118
|
-
data.create_missing_axes()
|
|
119
|
-
self._doxy = do_xy
|
|
120
|
-
self._do_sort = sort_data
|
|
121
|
-
self._show_errors = show_errors
|
|
122
|
-
self.update_xyplot(do_xy, data)
|
|
123
|
-
|
|
124
|
-
if scatter and self.get_plot_items()[0].opts['symbol'] is None:
|
|
125
|
-
if 'symbol_size' in data.extra_attributes:
|
|
126
|
-
symbol_size = data.symbol_size
|
|
127
|
-
else:
|
|
128
|
-
symbol_size = 5
|
|
129
|
-
if 'symbol' in data.extra_attributes:
|
|
130
|
-
symbol = data.symbol
|
|
131
|
-
else:
|
|
132
|
-
symbol = 'o'
|
|
133
|
-
if 'color' in data.extra_attributes:
|
|
134
|
-
color = data.color
|
|
135
|
-
else:
|
|
136
|
-
color = None
|
|
137
|
-
self.plot_with_scatter(True, symbol_size, symbol, color)
|
|
138
|
-
elif not scatter and self.get_plot_items()[0].opts['symbol'] is not None:
|
|
139
|
-
self.plot_with_scatter(False)
|
|
140
|
-
|
|
141
|
-
def update_xyplot(self, do_xy=True, dwa: DataWithAxes=None):
|
|
142
|
-
if dwa is None:
|
|
143
|
-
dwa = self._data
|
|
144
|
-
_axis = dwa.get_axis_from_index(0)[0]
|
|
145
|
-
_axis_array = _axis.get_data()
|
|
146
|
-
for ind_data, dat in enumerate(dwa.data):
|
|
147
|
-
if dwa.size > 0:
|
|
148
|
-
if not do_xy:
|
|
149
|
-
if self._flip_axes:
|
|
150
|
-
self._plot_items[ind_data].setData(dat, _axis_array)
|
|
151
|
-
else:
|
|
152
|
-
self._plot_items[ind_data].setData(_axis_array, dat)
|
|
153
|
-
if self._show_errors:
|
|
154
|
-
self._boundary_items[ind_data][0].setData(
|
|
155
|
-
_axis_array,
|
|
156
|
-
dat + dwa.get_error(ind_data))
|
|
157
|
-
self._boundary_items[ind_data][1].setData(
|
|
158
|
-
_axis_array,
|
|
159
|
-
dat - dwa.get_error(ind_data))
|
|
160
|
-
else:
|
|
161
|
-
self._plot_items[ind_data].setData(np.array([]), np.array([]))
|
|
162
|
-
|
|
163
|
-
if do_xy:
|
|
164
|
-
for ind, data_array in enumerate(dwa[1:]):
|
|
165
|
-
self._plot_items[ind].setData(dwa.data[0], data_array)
|
|
166
|
-
axis = self._plotitem.getAxis('bottom')
|
|
167
|
-
axis.setLabel(text=dwa.labels[0], units='')
|
|
168
|
-
axis = self._plotitem.getAxis('left')
|
|
169
|
-
axis.setLabel(text=' / '.join(dwa.labels[1:]), units='')
|
|
170
|
-
self.legend.setVisible(False)
|
|
171
|
-
|
|
172
|
-
else:
|
|
173
|
-
axis = self._plotitem.getAxis('bottom')
|
|
174
|
-
axis.setLabel(text=_axis.label, units=_axis.units)
|
|
175
|
-
axis = self._plotitem.getAxis('left')
|
|
176
|
-
axis.setLabel(text='', units='')
|
|
177
|
-
self.legend.setVisible(True)
|
|
178
|
-
|
|
179
|
-
def plot_with_scatter(self, with_scatter=True, symbol_size=5, symbol='o', color=None):
|
|
180
|
-
|
|
181
|
-
for ind, plot_item in enumerate(self.get_plot_items()):
|
|
182
|
-
if color is None:
|
|
183
|
-
color = self._plot_colors[ind]
|
|
184
|
-
if with_scatter:
|
|
185
|
-
pen = None
|
|
186
|
-
symbol_type = symbol
|
|
187
|
-
brush = color
|
|
188
|
-
|
|
189
|
-
else:
|
|
190
|
-
pen = color
|
|
191
|
-
symbol_type = None
|
|
192
|
-
brush = None
|
|
193
|
-
|
|
194
|
-
plot_item.setPen(pen)
|
|
195
|
-
plot_item.setSymbolBrush(brush)
|
|
196
|
-
plot_item.setSymbol(symbol_type)
|
|
197
|
-
plot_item.setSymbolSize(symbol_size)
|
|
198
|
-
|
|
199
|
-
def update_display_items(self, data: DataWithAxes = None, show_errors=False):
|
|
200
|
-
while len(self._plot_items) > 0:
|
|
201
|
-
self._plotitem.removeItem(self._plot_items.pop(0))
|
|
202
|
-
if len(self._boundary_items) > 0:
|
|
203
|
-
b_items = self._boundary_items.pop(0)
|
|
204
|
-
self._plotitem.removeItem(b_items[0])
|
|
205
|
-
self._plotitem.removeItem(b_items[1])
|
|
206
|
-
self._plotitem.removeItem(self._fill_items.pop(0))
|
|
207
|
-
|
|
208
|
-
if data is not None:
|
|
209
|
-
for ind in range(len(data)):
|
|
210
|
-
self._plot_items.append(pg.PlotDataItem(pen=self._plot_colors[ind]))
|
|
211
|
-
self._plotitem.addItem(self._plot_items[-1])
|
|
212
|
-
self.legend.addItem(self._plot_items[-1], data.labels[ind])
|
|
213
|
-
if show_errors:
|
|
214
|
-
self._boundary_items.append((pg.PlotDataItem(pen=list(self._plot_colors[ind]) + [100]),
|
|
215
|
-
pg.PlotDataItem(pen=list(self._plot_colors[ind]) + [100])))
|
|
216
|
-
self._plotitem.addItem(self._boundary_items[-1][0])
|
|
217
|
-
self._plotitem.addItem(self._boundary_items[-1][1])
|
|
218
|
-
self._fill_items.append(pg.FillBetweenItem(*self._boundary_items[-1],
|
|
219
|
-
list(self._plot_colors[ind]) + [100]))
|
|
220
|
-
self._plotitem.addItem(self._fill_items[-1])
|
|
221
|
-
|
|
222
|
-
self.updated_item.emit(self._plot_items)
|
|
223
|
-
self.labels_changed.emit(data.labels)
|
|
224
|
-
|
|
225
|
-
@property
|
|
226
|
-
def labels(self):
|
|
227
|
-
if self._data is None:
|
|
228
|
-
return []
|
|
229
|
-
else:
|
|
230
|
-
return self._data.labels
|
|
231
|
-
|
|
232
|
-
def legend_items(self):
|
|
233
|
-
return [item[1].text for item in self.legend.items]
|
|
234
|
-
|
|
235
|
-
def show_overlay(self, show=True):
|
|
236
|
-
if not show:
|
|
237
|
-
while len(self._overlay_items) > 0:
|
|
238
|
-
self._plotitem.removeItem(self._overlay_items.pop(0))
|
|
239
|
-
else:
|
|
240
|
-
for ind in range(len(self._data)):
|
|
241
|
-
pen = pg.mkPen(color=self._plot_colors[ind], style=Qt.CustomDashLine)
|
|
242
|
-
pen.setDashPattern([10, 10])
|
|
243
|
-
self._overlay_items.append(pg.PlotDataItem(pen=pen))
|
|
244
|
-
self._plotitem.addItem(self._overlay_items[-1])
|
|
245
|
-
if self._do_sort:
|
|
246
|
-
self._overlay_items[ind].setData(
|
|
247
|
-
self._data.sort_data().get_axis_from_index(0)[0].get_data(),
|
|
248
|
-
self._data.sort_data()[ind])
|
|
249
|
-
else:
|
|
250
|
-
self._overlay_items[ind].setData(
|
|
251
|
-
self._data.get_axis_from_index(0)[0].get_data(),
|
|
252
|
-
self._data[ind])
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
class View1D(ActionManager, QObject):
|
|
257
|
-
def __init__(self, parent_widget: QtWidgets.QWidget = None, show_toolbar=True,
|
|
258
|
-
no_margins=False, flip_axes=False):
|
|
259
|
-
QObject.__init__(self)
|
|
260
|
-
ActionManager.__init__(self, toolbar=QtWidgets.QToolBar())
|
|
261
|
-
|
|
262
|
-
self.no_margins = no_margins
|
|
263
|
-
self.flip_axes = flip_axes
|
|
264
|
-
|
|
265
|
-
self.data_displayer: DataDisplayer = None
|
|
266
|
-
self.plot_widget: PlotWidget = None
|
|
267
|
-
self.lineout_widgets: QtWidgets.QWidget = None
|
|
268
|
-
self.lineout_viewers: Viewer0D = None
|
|
269
|
-
self.crosshair: Crosshair = None
|
|
270
|
-
|
|
271
|
-
self.roi_target = pg.InfiniteLine(pen='w')
|
|
272
|
-
self.ROIselect = pg.LinearRegionItem(pen='w')
|
|
273
|
-
|
|
274
|
-
self.setup_actions()
|
|
275
|
-
|
|
276
|
-
self.parent_widget = parent_widget
|
|
277
|
-
if self.parent_widget is None:
|
|
278
|
-
self.parent_widget = QtWidgets.QWidget()
|
|
279
|
-
self.parent_widget.show()
|
|
280
|
-
|
|
281
|
-
self.plot_widget = PlotWidget()
|
|
282
|
-
self.roi_manager = ROIManager('1D')
|
|
283
|
-
self.data_displayer = DataDisplayer(self.plotitem, flip_axes=self.flip_axes)
|
|
284
|
-
self.other_data_displayers: Dict[str, DataDisplayer] = {}
|
|
285
|
-
self.setup_widgets()
|
|
286
|
-
|
|
287
|
-
self.connect_things()
|
|
288
|
-
self.prepare_ui()
|
|
289
|
-
|
|
290
|
-
self.plotitem.addItem(self.roi_target)
|
|
291
|
-
self.plotitem.addItem(self.ROIselect)
|
|
292
|
-
self.roi_target.setVisible(False)
|
|
293
|
-
self.ROIselect.setVisible(False)
|
|
294
|
-
|
|
295
|
-
self.show_toolbar = show_toolbar
|
|
296
|
-
if not self.show_toolbar:
|
|
297
|
-
self.splitter_ver.setSizes([0, 1, 0])
|
|
298
|
-
|
|
299
|
-
def add_data_displayer(self, displayer_name: str, plot_colors=PLOT_COLORS):
|
|
300
|
-
self.other_data_displayers[displayer_name] = DataDisplayer(self.plotitem, self.flip_axes,
|
|
301
|
-
plot_colors)
|
|
302
|
-
|
|
303
|
-
def remove_data_displayer(self, displayer_name: str):
|
|
304
|
-
displayer = self.other_data_displayers.pop(displayer_name, None)
|
|
305
|
-
if displayer is not None:
|
|
306
|
-
displayer.update_display_items()
|
|
307
|
-
|
|
308
|
-
@Slot(int, str, str)
|
|
309
|
-
def add_roi_displayer(self, index, roi_type='', roi_name=''):
|
|
310
|
-
color = self.roi_manager.ROIs[roi_name].color
|
|
311
|
-
self.lineout_viewers.view.add_data_displayer(
|
|
312
|
-
roi_name, make_dashed_pens(color, self.data_displayer.Ndata))
|
|
313
|
-
|
|
314
|
-
@Slot(str)
|
|
315
|
-
def remove_roi_displayer(self, roi_name=''):
|
|
316
|
-
self.lineout_viewers.view.remove_data_displayer(roi_name)
|
|
317
|
-
|
|
318
|
-
def move_roi_target(self, pos: Iterable[float], **kwargs):
|
|
319
|
-
if not self.roi_target.isVisible():
|
|
320
|
-
self.roi_target.setVisible(True)
|
|
321
|
-
self.roi_target.setPos(pos[0])
|
|
322
|
-
|
|
323
|
-
def get_double_clicked(self):
|
|
324
|
-
return self.plot_widget.view.sig_double_clicked
|
|
325
|
-
|
|
326
|
-
def display_roi_lineouts(self, roi_dte: DataToExport):
|
|
327
|
-
for roi_name in roi_dte.get_origins('Data0D'):
|
|
328
|
-
self.lineout_viewers.view.display_data(
|
|
329
|
-
roi_dte.get_data_from_name_origin('IntData', roi_name), displayer=roi_name)
|
|
330
|
-
|
|
331
|
-
@property
|
|
332
|
-
def axis(self):
|
|
333
|
-
"""Get the current axis used to display data"""
|
|
334
|
-
return self.data_displayer.get_axis()
|
|
335
|
-
|
|
336
|
-
@property
|
|
337
|
-
def plotitem(self):
|
|
338
|
-
return self.plot_widget.plotItem
|
|
339
|
-
|
|
340
|
-
def get_crosshair_signal(self):
|
|
341
|
-
"""Convenience function from the Crosshair"""
|
|
342
|
-
return self.crosshair.crosshair_dragged
|
|
343
|
-
|
|
344
|
-
def get_crosshair_position(self):
|
|
345
|
-
"""Convenience function from the Crosshair"""
|
|
346
|
-
return self.crosshair.get_positions()
|
|
347
|
-
|
|
348
|
-
def set_crosshair_position(self, *positions):
|
|
349
|
-
"""Convenience function from the Crosshair"""
|
|
350
|
-
self.crosshair.set_crosshair_position(*positions)
|
|
351
|
-
|
|
352
|
-
def display_data(self, data: Union[DataWithAxes, DataToExport], displayer: str = None):
|
|
353
|
-
if displayer is None:
|
|
354
|
-
if isinstance(data, DataWithAxes):
|
|
355
|
-
self.set_action_visible('xyplot', len(data) == 2)
|
|
356
|
-
self.data_displayer.update_data(data, self.is_action_checked('xyplot'),
|
|
357
|
-
self.is_action_checked('sort'),
|
|
358
|
-
do_scatter=self.is_action_checked('scatter'),
|
|
359
|
-
show_errors=self.is_action_checked('errors'))
|
|
360
|
-
elif isinstance(data, DataToExport):
|
|
361
|
-
self.set_action_visible('xyplot', len(data[0]) == 2)
|
|
362
|
-
self.data_displayer.update_data(data.pop(0), self.is_action_checked('xyplot'),
|
|
363
|
-
self.is_action_checked('sort'),
|
|
364
|
-
do_scatter=self.is_action_checked('scatter'),
|
|
365
|
-
show_errors=self.is_action_checked('errors'))
|
|
366
|
-
if len(data) > 0:
|
|
367
|
-
self.data_displayer.add_other_data(data)
|
|
368
|
-
elif displayer in self.other_data_displayers:
|
|
369
|
-
self.other_data_displayers[displayer].update_data(data,
|
|
370
|
-
self.is_action_checked('xyplot'),
|
|
371
|
-
self.is_action_checked('sort'))
|
|
372
|
-
|
|
373
|
-
def prepare_ui(self):
|
|
374
|
-
self.show_hide_crosshair(False)
|
|
375
|
-
|
|
376
|
-
def do_math(self):
|
|
377
|
-
try:
|
|
378
|
-
if self.is_action_checked('do_math'):
|
|
379
|
-
self.roi_manager.roiwidget.show()
|
|
380
|
-
self.lineout_widgets.show()
|
|
381
|
-
else:
|
|
382
|
-
self.lineout_widgets.hide()
|
|
383
|
-
self.roi_manager.roiwidget.hide()
|
|
384
|
-
|
|
385
|
-
except Exception as e:
|
|
386
|
-
logger.exception(str(e))
|
|
387
|
-
|
|
388
|
-
@Slot(int, str)
|
|
389
|
-
def update_roi_channels(self, index, roi_type=''):
|
|
390
|
-
"""Update the use_channel setting each time a ROI is added"""
|
|
391
|
-
self.roi_manager.update_use_channel(self.data_displayer.labels.copy())
|
|
392
|
-
|
|
393
|
-
def setup_widgets(self):
|
|
394
|
-
self.parent_widget.setLayout(QtWidgets.QVBoxLayout())
|
|
395
|
-
if self.no_margins:
|
|
396
|
-
self.parent_widget.layout().setContentsMargins(0, 0, 0, 0)
|
|
397
|
-
splitter_hor = QtWidgets.QSplitter(Qt.Horizontal)
|
|
398
|
-
self.parent_widget.layout().addWidget(splitter_hor)
|
|
399
|
-
|
|
400
|
-
self.splitter_ver = QtWidgets.QSplitter(Qt.Vertical)
|
|
401
|
-
splitter_hor.addWidget(self.splitter_ver)
|
|
402
|
-
splitter_hor.addWidget(self.roi_manager.roiwidget)
|
|
403
|
-
self.roi_manager.roiwidget.hide()
|
|
404
|
-
|
|
405
|
-
self.splitter_ver.addWidget(self.toolbar)
|
|
406
|
-
|
|
407
|
-
self.lineout_widgets = QtWidgets.QWidget()
|
|
408
|
-
self.lineout_viewers = Viewer0D(self.lineout_widgets, show_toolbar=False,
|
|
409
|
-
no_margins=True)
|
|
410
|
-
self.lineout_widgets.setContentsMargins(0, 0, 0, 0)
|
|
411
|
-
self.lineout_widgets.hide()
|
|
412
|
-
|
|
413
|
-
self.splitter_ver.addWidget(self.plot_widget)
|
|
414
|
-
self.splitter_ver.addWidget(self.lineout_widgets)
|
|
415
|
-
self.roi_manager.viewer_widget = self.plot_widget
|
|
416
|
-
|
|
417
|
-
self.crosshair = Crosshair(self.plotitem, orientation='vertical')
|
|
418
|
-
self.show_hide_crosshair()
|
|
419
|
-
|
|
420
|
-
def connect_things(self):
|
|
421
|
-
self.connect_action('aspect_ratio', self.lock_aspect_ratio)
|
|
422
|
-
|
|
423
|
-
self.connect_action('do_math', self.do_math)
|
|
424
|
-
self.connect_action('scatter', self.data_displayer.update_scatter)
|
|
425
|
-
self.connect_action('xyplot', self.data_displayer.update_xy)
|
|
426
|
-
self.connect_action('sort', self.data_displayer.update_sort)
|
|
427
|
-
self.connect_action('crosshair', self.show_hide_crosshair)
|
|
428
|
-
self.connect_action('overlay', self.data_displayer.show_overlay)
|
|
429
|
-
self.connect_action('errors', self.data_displayer.update_errors)
|
|
430
|
-
self.connect_action('ROIselect', self.show_ROI_select)
|
|
431
|
-
|
|
432
|
-
self.roi_manager.new_ROI_signal.connect(self.update_roi_channels)
|
|
433
|
-
self.roi_manager.new_ROI_signal.connect(self.add_roi_displayer)
|
|
434
|
-
self.roi_manager.new_ROI_signal.connect(self.lineout_viewers.get_action('clear').click)
|
|
435
|
-
self.roi_manager.remove_ROI_signal.connect(self.remove_roi_displayer)
|
|
436
|
-
|
|
437
|
-
self.roi_manager.color_signal.connect(self.update_colors)
|
|
438
|
-
self.data_displayer.labels_changed.connect(self.roi_manager.update_use_channel)
|
|
439
|
-
|
|
440
|
-
def update_colors(self, colors: list):
|
|
441
|
-
for ind, roi_name in enumerate(self.roi_manager.ROIs):
|
|
442
|
-
self.lineout_viewers.update_colors(make_dashed_pens(colors[ind]), displayer=roi_name)
|
|
443
|
-
|
|
444
|
-
def show_ROI_select(self):
|
|
445
|
-
self.ROIselect.setVisible(self.is_action_checked('ROIselect'))
|
|
446
|
-
|
|
447
|
-
def setup_actions(self):
|
|
448
|
-
self.add_action('do_math', 'Math', 'Calculator', 'Do Math using ROI', checkable=True)
|
|
449
|
-
self.add_action('crosshair', 'Crosshair', 'reset', 'Show data cursor', checkable=True)
|
|
450
|
-
self.add_action('aspect_ratio', 'AspectRatio', 'Zoom_1_1', 'Fix the aspect ratio',
|
|
451
|
-
checkable=True)
|
|
452
|
-
self.add_action('scatter', 'Scatter', 'Marker', 'Switch between line or scatter plots',
|
|
453
|
-
checkable=True)
|
|
454
|
-
self.add_action('xyplot', 'XYPlotting', '2d',
|
|
455
|
-
'Switch between normal or XY representation (valid for 2 channels)',
|
|
456
|
-
checkable=True,
|
|
457
|
-
visible=False)
|
|
458
|
-
self.add_action('overlay', 'Overlay', 'overlay', 'Plot overlays of current data',
|
|
459
|
-
checkable=True)
|
|
460
|
-
self.add_action('errors', 'Errors', 'Statistics2', 'Plot boundaries (~error bars) of '
|
|
461
|
-
'the data',
|
|
462
|
-
checkable=True)
|
|
463
|
-
self.add_action('sort', 'Sort Data', 'sort_ascend',
|
|
464
|
-
'Display data in a sorted fashion with respect to axis',
|
|
465
|
-
checkable=True)
|
|
466
|
-
self.add_action('ROIselect', 'ROI Select', 'Select_24',
|
|
467
|
-
tip='Show/Hide ROI selection area', checkable=True)
|
|
468
|
-
self.add_action('x_label', 'x:')
|
|
469
|
-
self.add_action('y_label', 'y:')
|
|
470
|
-
|
|
471
|
-
def lock_aspect_ratio(self):
|
|
472
|
-
if self.is_action_checked('aspect_ratio'):
|
|
473
|
-
self.plotitem.vb.setAspectLocked(lock=True, ratio=1)
|
|
474
|
-
else:
|
|
475
|
-
self.plotitem.vb.setAspectLocked(lock=False)
|
|
476
|
-
|
|
477
|
-
def update_crosshair_data(self, crosshair_dte: DataToExport):
|
|
478
|
-
if len(crosshair_dte) > 0:
|
|
479
|
-
dwa = crosshair_dte[0]
|
|
480
|
-
string = "y="
|
|
481
|
-
for data_array in dwa:
|
|
482
|
-
string += f"{float(data_array[0]):.3e} / "
|
|
483
|
-
self.get_action('y_label').setText(string)
|
|
484
|
-
self.get_action('x_label').setText(f"x={float(dwa.axes[0].get_data()[0]):.3e} ")
|
|
485
|
-
|
|
486
|
-
@Slot(bool)
|
|
487
|
-
def show_hide_crosshair(self, show=True):
|
|
488
|
-
self.crosshair.setVisible(show)
|
|
489
|
-
self.set_action_visible('x_label', show)
|
|
490
|
-
self.set_action_visible('y_label', show)
|
|
491
|
-
if self.is_action_checked('crosshair'):
|
|
492
|
-
range = self.plotitem.vb.viewRange()
|
|
493
|
-
self.crosshair.set_crosshair_position(xpos=np.mean(np.array(range[0])))
|
|
494
|
-
|
|
495
|
-
def add_plot_item(self, item):
|
|
496
|
-
self.plotitem.addItem(item)
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
class Viewer1D(ViewerBase):
|
|
500
|
-
""" DataWithAxis of type Data1D can be plotted using this data viewer
|
|
501
|
-
|
|
502
|
-
Methods
|
|
503
|
-
-------
|
|
504
|
-
show_data:
|
|
505
|
-
parameter:
|
|
506
|
-
* dwa: a DataWithaxis
|
|
507
|
-
* scatter_dwa: an optional extra DataWithAxis to be plotted with scatter points
|
|
508
|
-
it could define extra_attributes such as symbol: str (to define the symbol layout
|
|
509
|
-
default: 'o') and symbol_size: int (to define the symbol size)
|
|
510
|
-
|
|
511
|
-
"""
|
|
512
|
-
|
|
513
|
-
def __init__(self, parent: QtWidgets.QWidget = None, title='', show_toolbar=True, no_margins=False,
|
|
514
|
-
flip_axes=False):
|
|
515
|
-
super().__init__(parent=parent, title=title)
|
|
516
|
-
|
|
517
|
-
self.view = View1D(self.parent, show_toolbar=show_toolbar, no_margins=no_margins, flip_axes=flip_axes)
|
|
518
|
-
|
|
519
|
-
self.filter_from_rois = Filter1DFromRois(self.view.roi_manager)
|
|
520
|
-
self.filter_from_rois.register_activation_signal(self.view.get_action('do_math').triggered)
|
|
521
|
-
self.filter_from_rois.register_target_slot(self.process_roi_lineouts)
|
|
522
|
-
|
|
523
|
-
self.filter_from_crosshair = Filter1DFromCrosshair(self.view.crosshair)
|
|
524
|
-
self.filter_from_crosshair.register_activation_signal(self.view.get_action('crosshair').triggered)
|
|
525
|
-
self.filter_from_crosshair.register_target_slot(self.process_crosshair_lineouts)
|
|
526
|
-
|
|
527
|
-
self.prepare_connect_ui()
|
|
528
|
-
|
|
529
|
-
self._labels = []
|
|
530
|
-
|
|
531
|
-
def update_colors(self, colors: List, displayer=None):
|
|
532
|
-
if displayer is None:
|
|
533
|
-
self.view.data_displayer.update_colors(colors)
|
|
534
|
-
elif displayer in self.view.other_data_displayers:
|
|
535
|
-
self.view.other_data_displayers[displayer].update_colors(colors)
|
|
536
|
-
|
|
537
|
-
@property
|
|
538
|
-
def roi_manager(self):
|
|
539
|
-
"""Convenience method """
|
|
540
|
-
return self.view.roi_manager
|
|
541
|
-
|
|
542
|
-
@property
|
|
543
|
-
def roi_target(self) -> pg.InfiniteLine:
|
|
544
|
-
return self.view.roi_target
|
|
545
|
-
|
|
546
|
-
def move_roi_target(self, pos: Iterable[float] = None):
|
|
547
|
-
"""move a specific read only ROI at the given position on the viewer"""
|
|
548
|
-
self.view.move_roi_target(pos)
|
|
549
|
-
|
|
550
|
-
@property
|
|
551
|
-
def crosshair(self):
|
|
552
|
-
"""Convenience method """
|
|
553
|
-
return self.view.crosshair
|
|
554
|
-
|
|
555
|
-
def set_crosshair_position(self, xpos, ypos=0):
|
|
556
|
-
"""Convenience method to set the crosshair positions"""
|
|
557
|
-
self.view.crosshair.set_crosshair_position(xpos=xpos, ypos=ypos)
|
|
558
|
-
|
|
559
|
-
def add_plot_item(self, item):
|
|
560
|
-
self.view.add_plot_item(item)
|
|
561
|
-
|
|
562
|
-
def process_crosshair_lineouts(self, crosshair_dte: DataToExport):
|
|
563
|
-
self.view.update_crosshair_data(crosshair_dte)
|
|
564
|
-
self.crosshair_dragged.emit(*self.view.crosshair.get_positions())
|
|
565
|
-
|
|
566
|
-
def process_roi_lineouts(self, roi_dte: DataToExport):
|
|
567
|
-
self.view.display_roi_lineouts(roi_dte)
|
|
568
|
-
self.measure_data_dict = dict([])
|
|
569
|
-
self.measure_data_dict = roi_dte.merge_as_dwa('Data0D').to_dict()
|
|
570
|
-
QtWidgets.QApplication.processEvents()
|
|
571
|
-
self.view.roi_manager.settings.child('measurements').setValue(self.measure_data_dict)
|
|
572
|
-
|
|
573
|
-
if not self._display_temporary:
|
|
574
|
-
roi_dte_bis = roi_dte.deepcopy()
|
|
575
|
-
for dwa in roi_dte_bis:
|
|
576
|
-
if dwa.name == 'HorData':
|
|
577
|
-
dwa.name = f'Hlineout_{dwa.origin}'
|
|
578
|
-
elif dwa.name == 'IntData':
|
|
579
|
-
dwa.name = f'Integrated_{dwa.origin}'
|
|
580
|
-
self.data_to_export.append(roi_dte_bis.data)
|
|
581
|
-
self.data_to_export_signal.emit(self.data_to_export)
|
|
582
|
-
self.ROI_changed.emit()
|
|
583
|
-
|
|
584
|
-
def prepare_connect_ui(self):
|
|
585
|
-
self.view.ROIselect.sigRegionChangeFinished.connect(self.selected_region_changed)
|
|
586
|
-
self._data_to_show_signal.connect(self.view.display_data)
|
|
587
|
-
self.roi_manager.roi_changed.connect(self.roi_changed)
|
|
588
|
-
self.roi_manager.roi_value_changed.connect(self.roi_changed)
|
|
589
|
-
|
|
590
|
-
self.view.get_crosshair_signal().connect(self.crosshair_changed)
|
|
591
|
-
self.view.get_double_clicked().connect(self.double_clicked)
|
|
592
|
-
|
|
593
|
-
def selected_region_changed(self):
|
|
594
|
-
if self.view.is_action_checked('ROIselect'):
|
|
595
|
-
self.roi_select_signal.emit(RoiInfo.info_from_linear_roi(self.view.ROIselect))
|
|
596
|
-
|
|
597
|
-
def double_clicked(self, posx, posy=0):
|
|
598
|
-
if self.view.is_action_checked('crosshair'):
|
|
599
|
-
self.view.crosshair.set_crosshair_position(posx)
|
|
600
|
-
self.crosshair_changed()
|
|
601
|
-
self.sig_double_clicked.emit(posx, posy)
|
|
602
|
-
|
|
603
|
-
def roi_changed(self):
|
|
604
|
-
self.filter_from_rois.filter_data(self._raw_data)
|
|
605
|
-
|
|
606
|
-
def crosshair_changed(self):
|
|
607
|
-
self.filter_from_crosshair.filter_data(self._raw_data)
|
|
608
|
-
|
|
609
|
-
def activate_roi(self, activate=True):
|
|
610
|
-
self.view.set_action_checked('do_math', activate)
|
|
611
|
-
self.view.get_action('do_math').triggered.emit(activate)
|
|
612
|
-
|
|
613
|
-
@property
|
|
614
|
-
def labels(self):
|
|
615
|
-
return self._labels
|
|
616
|
-
|
|
617
|
-
@labels.setter
|
|
618
|
-
def labels(self, labels):
|
|
619
|
-
if labels != self._labels:
|
|
620
|
-
self._labels = labels
|
|
621
|
-
|
|
622
|
-
def _show_data(self, data: DataWithAxes, *args, scatter_dwa: DataWithAxes =None,
|
|
623
|
-
**kwargs):
|
|
624
|
-
self.labels = data.labels
|
|
625
|
-
if len(data.axes) == 0:
|
|
626
|
-
self.get_axis_from_view(data)
|
|
627
|
-
|
|
628
|
-
self.view.display_data(data)
|
|
629
|
-
|
|
630
|
-
if scatter_dwa is not None:
|
|
631
|
-
if isinstance(scatter_dwa, DataWithAxes):
|
|
632
|
-
if scatter_dwa.name not in self.view.other_data_displayers:
|
|
633
|
-
self.view.add_data_displayer(scatter_dwa.name, [(255, 0, 0)])
|
|
634
|
-
self.view.other_data_displayers[scatter_dwa.name].update_data(
|
|
635
|
-
scatter_dwa, do_scatter=True)
|
|
636
|
-
|
|
637
|
-
if len(self.view.roi_manager.ROIs) == 0:
|
|
638
|
-
self.data_to_export_signal.emit(self.data_to_export)
|
|
639
|
-
else:
|
|
640
|
-
self.roi_changed()
|
|
641
|
-
if self.view.is_action_checked('crosshair'):
|
|
642
|
-
self.crosshair_changed()
|
|
643
|
-
|
|
644
|
-
def get_axis_from_view(self, data: DataWithAxes):
|
|
645
|
-
if self.view.axis is not None:
|
|
646
|
-
data.axes = [self.view.axis]
|
|
647
|
-
else:
|
|
648
|
-
data.create_missing_axes()
|
|
649
|
-
|
|
650
|
-
def update_status(self, txt):
|
|
651
|
-
logger.info(txt)
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
def main():
|
|
655
|
-
app = QtWidgets.QApplication(sys.argv)
|
|
656
|
-
Form = QtWidgets.QWidget()
|
|
657
|
-
prog = Viewer1D(Form)
|
|
658
|
-
|
|
659
|
-
from pymodaq.utils.math_utils import gauss1D
|
|
660
|
-
|
|
661
|
-
x = np.linspace(0, 200, 201)
|
|
662
|
-
y1 = gauss1D(x, 75, 25)
|
|
663
|
-
y2 = gauss1D(x, 120, 50, 2)
|
|
664
|
-
tau_half = 27
|
|
665
|
-
tau2 = 100
|
|
666
|
-
x0 = 50
|
|
667
|
-
dx = 20
|
|
668
|
-
ydata_expodec = np.zeros((len(x)))
|
|
669
|
-
ydata_expodec[:50] = 1 * gauss1D(x[:50], x0, dx, 2)
|
|
670
|
-
ydata_expodec[50:] = 1 * np.exp(-(x[50:] - x0) / (tau_half / np.log(2))) # +1*np.exp(-(x[50:]-x0)/tau2)
|
|
671
|
-
ydata_expodec += 0.1 * np.random.rand(len(x))
|
|
672
|
-
|
|
673
|
-
# x = np.sin(np.linspace(0,6*np.pi,201))
|
|
674
|
-
# y = np.sin(np.linspace(0, 6*np.pi, 201)+np.pi/2)
|
|
675
|
-
data = DataRaw('mydata', data=[y1, ydata_expodec, -ydata_expodec, -y1,
|
|
676
|
-
y1, ydata_expodec, -ydata_expodec, -y1,
|
|
677
|
-
y1, ydata_expodec, -ydata_expodec, -y1,],
|
|
678
|
-
axes=[Axis('myaxis', 'units', data=x)])
|
|
679
|
-
|
|
680
|
-
Form.show()
|
|
681
|
-
prog.view.get_action('do_math').trigger()
|
|
682
|
-
|
|
683
|
-
def print_data(data: DataToExport):
|
|
684
|
-
print(data.data)
|
|
685
|
-
print('******')
|
|
686
|
-
print(data.get_data_from_dim('Data1D'))
|
|
687
|
-
print('******')
|
|
688
|
-
print(data.get_data_from_dim('Data0D'))
|
|
689
|
-
print('***********************************')
|
|
690
|
-
|
|
691
|
-
#prog.data_to_export_signal.connect(print_data)
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
QtWidgets.QApplication.processEvents()
|
|
695
|
-
prog.show_data(data)
|
|
696
|
-
QtWidgets.QApplication.processEvents()
|
|
697
|
-
sys.exit(app.exec_())
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
def main_unsorted():
|
|
701
|
-
app = QtWidgets.QApplication(sys.argv)
|
|
702
|
-
widget = QtWidgets.QWidget()
|
|
703
|
-
prog = Viewer1D(widget)
|
|
704
|
-
|
|
705
|
-
from pymodaq.utils.math_utils import gauss1D
|
|
706
|
-
|
|
707
|
-
x = np.linspace(0, 200, 201)
|
|
708
|
-
xaxis = np.concatenate((x, x[::-1]))
|
|
709
|
-
y = gauss1D(x, 75, 25)
|
|
710
|
-
yaxis = np.concatenate((y, -y))
|
|
711
|
-
data = DataRaw('mydata', data=[yaxis],
|
|
712
|
-
axes=[Axis('myaxis', 'units', data=xaxis)])
|
|
713
|
-
widget.show()
|
|
714
|
-
prog.show_data(data)
|
|
715
|
-
|
|
716
|
-
sys.exit(app.exec_())
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
def main_random():
|
|
720
|
-
app = QtWidgets.QApplication(sys.argv)
|
|
721
|
-
widget = QtWidgets.QWidget()
|
|
722
|
-
prog = Viewer1D(widget)
|
|
723
|
-
|
|
724
|
-
from pymodaq.utils.math_utils import gauss1D
|
|
725
|
-
x = np.random.randint(201, size=201)
|
|
726
|
-
y1 = gauss1D(x, 75, 25)
|
|
727
|
-
y2 = gauss1D(x, 120, 50, 2)
|
|
728
|
-
|
|
729
|
-
QtWidgets.QApplication.processEvents()
|
|
730
|
-
data = DataRaw('mydata', data=[y1, y2],
|
|
731
|
-
axes=[Axis('myaxis', 'units', data=x, index=0, spread_order=0)],
|
|
732
|
-
nav_indexes=(0, ))
|
|
733
|
-
|
|
734
|
-
widget.show()
|
|
735
|
-
prog.show_data(data)
|
|
736
|
-
QtWidgets.QApplication.processEvents()
|
|
737
|
-
sys.exit(app.exec_())
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
def main_extra_scatter():
|
|
741
|
-
app = QtWidgets.QApplication(sys.argv)
|
|
742
|
-
widget = QtWidgets.QWidget()
|
|
743
|
-
prog = Viewer1D(widget)
|
|
744
|
-
|
|
745
|
-
from pymodaq.utils.math_utils import gauss1D
|
|
746
|
-
x = np.linspace(0, 200, 201)
|
|
747
|
-
xlow = np.linspace(0, 200, 21)
|
|
748
|
-
y = gauss1D(x, 75, 25)
|
|
749
|
-
ylow = gauss1D(xlow, 75, 25)
|
|
750
|
-
|
|
751
|
-
QtWidgets.QApplication.processEvents()
|
|
752
|
-
data = DataRaw('mydata', data=[y],
|
|
753
|
-
axes=[Axis('myaxis', 'units', data=x, index=0, spread_order=0)],
|
|
754
|
-
labels=['Initial data'],
|
|
755
|
-
)
|
|
756
|
-
scatter_dwa = DataRaw('scatter', data=[ylow],
|
|
757
|
-
axes=[Axis('myaxis', 'units', data=xlow, index=0, spread_order=0)],
|
|
758
|
-
labels=['subsampled'],
|
|
759
|
-
symbol='d',
|
|
760
|
-
symbol_size=18,
|
|
761
|
-
color='b')
|
|
762
|
-
|
|
763
|
-
widget.show()
|
|
764
|
-
prog.show_data(data, scatter_dwa=scatter_dwa)
|
|
765
|
-
QtWidgets.QApplication.processEvents()
|
|
766
|
-
sys.exit(app.exec_())
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
def main_errors():
|
|
770
|
-
app = QtWidgets.QApplication(sys.argv)
|
|
771
|
-
widget = QtWidgets.QWidget()
|
|
772
|
-
prog = Viewer1D(widget)
|
|
773
|
-
|
|
774
|
-
from pymodaq.utils.math_utils import gauss1D
|
|
775
|
-
x = np.linspace(0, 200, 201)
|
|
776
|
-
y1 = gauss1D(x, 75, 25)
|
|
777
|
-
y2 = gauss1D(x, 120, 50, 2)
|
|
778
|
-
|
|
779
|
-
QtWidgets.QApplication.processEvents()
|
|
780
|
-
data = DataRaw('mydata', data=[y1, y2],
|
|
781
|
-
axes=[Axis('myaxis', 'units', data=x, index=0, spread_order=0)],
|
|
782
|
-
errors=(np.random.random_sample(x.shape),
|
|
783
|
-
np.random.random_sample(x.shape)))
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
widget.show()
|
|
787
|
-
prog.show_data(data)
|
|
788
|
-
QtWidgets.QApplication.processEvents()
|
|
789
|
-
sys.exit(app.exec_())
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
def main_view1D():
|
|
793
|
-
app = QtWidgets.QApplication(sys.argv)
|
|
794
|
-
widget = QtWidgets.QWidget()
|
|
795
|
-
prog = View1D(widget)
|
|
796
|
-
widget.show()
|
|
797
|
-
sys.exit(app.exec_())
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
def main_nans():
|
|
801
|
-
app = QtWidgets.QApplication(sys.argv)
|
|
802
|
-
widget = QtWidgets.QWidget()
|
|
803
|
-
prog = Viewer1D(widget)
|
|
804
|
-
|
|
805
|
-
from pymodaq.utils.math_utils import gauss1D
|
|
806
|
-
|
|
807
|
-
x = np.linspace(0, 200, 201)
|
|
808
|
-
y = gauss1D(x, 75, 25)
|
|
809
|
-
|
|
810
|
-
y[100:150] = np.nan
|
|
811
|
-
data = DataRaw('mydata', data=[y],
|
|
812
|
-
axes=[Axis('myaxis', 'units', data=x)])
|
|
813
|
-
|
|
814
|
-
widget.show()
|
|
815
|
-
prog.show_data(data)
|
|
816
|
-
|
|
817
|
-
sys.exit(app.exec_())
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
if __name__ == '__main__': # pragma: no cover
|
|
821
|
-
main()
|
|
822
|
-
# main_random()
|
|
823
|
-
#main_errors()
|
|
824
|
-
#main_extra_scatter()
|
|
825
|
-
#main_view1D()
|
|
826
|
-
#main_nans()
|