PaIRS-UniNa 0.1.13__cp310-cp310-win_amd64.whl → 0.2.8__cp310-cp310-win_amd64.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.
Files changed (292) hide show
  1. PaIRS_UniNa/Calibration_Tab.py +331 -0
  2. PaIRS_UniNa/Changes.txt +134 -2
  3. PaIRS_UniNa/Custom_Top.py +299 -299
  4. PaIRS_UniNa/Explorer.py +3136 -0
  5. PaIRS_UniNa/FolderLoop.py +562 -0
  6. PaIRS_UniNa/Input_Tab.py +831 -0
  7. PaIRS_UniNa/Input_Tab_CalVi.py +786 -0
  8. PaIRS_UniNa/Input_Tab_tools.py +3025 -0
  9. PaIRS_UniNa/Log_Tab.py +57 -14
  10. PaIRS_UniNa/Output_Tab.py +922 -0
  11. PaIRS_UniNa/PaIRS_PIV.py +111 -18
  12. PaIRS_UniNa/PaIRS_pypacks.py +698 -140
  13. PaIRS_UniNa/Process_Tab.py +1221 -1402
  14. PaIRS_UniNa/Process_Tab_CalVi.py +137 -262
  15. PaIRS_UniNa/Process_Tab_Disp.py +163 -0
  16. PaIRS_UniNa/Process_Tab_Min.py +120 -0
  17. PaIRS_UniNa/Saving_tools.py +296 -0
  18. PaIRS_UniNa/TabTools.py +863 -543
  19. PaIRS_UniNa/Vis_Tab.py +1898 -1315
  20. PaIRS_UniNa/Vis_Tab_CalVi.py +484 -356
  21. PaIRS_UniNa/Whatsnew.py +59 -10
  22. PaIRS_UniNa/_PaIRS_PIV.pyd +0 -0
  23. PaIRS_UniNa/__init__.py +4 -3
  24. PaIRS_UniNa/addwidgets_ps.py +326 -56
  25. PaIRS_UniNa/calib.py +19 -12
  26. PaIRS_UniNa/calibView.py +48 -25
  27. PaIRS_UniNa/gPaIRS.py +3902 -3461
  28. PaIRS_UniNa/gPalette.py +189 -170
  29. PaIRS_UniNa/icons/align_all.png +0 -0
  30. PaIRS_UniNa/icons/announcement.png +0 -0
  31. PaIRS_UniNa/icons/automatic_levels_off.png +0 -0
  32. PaIRS_UniNa/icons/automatic_levels_on.png +0 -0
  33. PaIRS_UniNa/icons/automatic_off.png +0 -0
  34. PaIRS_UniNa/icons/automatic_on.png +0 -0
  35. PaIRS_UniNa/icons/automatic_size_off.png +0 -0
  36. PaIRS_UniNa/icons/automatic_size_on.png +0 -0
  37. PaIRS_UniNa/icons/bin_off.png +0 -0
  38. PaIRS_UniNa/icons/bin_on.png +0 -0
  39. PaIRS_UniNa/icons/brush_cursor.png +0 -0
  40. PaIRS_UniNa/icons/bugfix.png +0 -0
  41. PaIRS_UniNa/icons/cal_proc.png +0 -0
  42. PaIRS_UniNa/icons/cal_proc_off.png +0 -0
  43. PaIRS_UniNa/icons/cal_step.png +0 -0
  44. PaIRS_UniNa/icons/cal_step_off.png +0 -0
  45. PaIRS_UniNa/icons/calibration_logo.png +0 -0
  46. PaIRS_UniNa/icons/change_folder.png +0 -0
  47. PaIRS_UniNa/icons/change_folder_off.png +0 -0
  48. PaIRS_UniNa/icons/close_all.png +0 -0
  49. PaIRS_UniNa/icons/close_workspace.png +0 -0
  50. PaIRS_UniNa/icons/colormap.png +0 -0
  51. PaIRS_UniNa/icons/colormaps/Accent.png +0 -0
  52. PaIRS_UniNa/icons/colormaps/BrBG.png +0 -0
  53. PaIRS_UniNa/icons/colormaps/Dark2.png +0 -0
  54. PaIRS_UniNa/icons/colormaps/PRGn.png +0 -0
  55. PaIRS_UniNa/icons/colormaps/Paired.png +0 -0
  56. PaIRS_UniNa/icons/colormaps/Pastel1.png +0 -0
  57. PaIRS_UniNa/icons/colormaps/Pastel2.png +0 -0
  58. PaIRS_UniNa/icons/colormaps/PiYG.png +0 -0
  59. PaIRS_UniNa/icons/colormaps/PuOr.png +0 -0
  60. PaIRS_UniNa/icons/colormaps/RdBu.png +0 -0
  61. PaIRS_UniNa/icons/colormaps/RdGy.png +0 -0
  62. PaIRS_UniNa/icons/colormaps/RdYlBu.png +0 -0
  63. PaIRS_UniNa/icons/colormaps/RdYlGn.png +0 -0
  64. PaIRS_UniNa/icons/colormaps/Set1.png +0 -0
  65. PaIRS_UniNa/icons/colormaps/Set2.png +0 -0
  66. PaIRS_UniNa/icons/colormaps/Set3.png +0 -0
  67. PaIRS_UniNa/icons/colormaps/Spectral.png +0 -0
  68. PaIRS_UniNa/icons/colormaps/Wistia.png +0 -0
  69. PaIRS_UniNa/icons/colormaps/afmhot.png +0 -0
  70. PaIRS_UniNa/icons/colormaps/autumn.png +0 -0
  71. PaIRS_UniNa/icons/colormaps/binary.png +0 -0
  72. PaIRS_UniNa/icons/colormaps/blackVector.png +0 -0
  73. PaIRS_UniNa/icons/colormaps/blueVector.png +0 -0
  74. PaIRS_UniNa/icons/colormaps/bone.png +0 -0
  75. PaIRS_UniNa/icons/colormaps/brg.png +0 -0
  76. PaIRS_UniNa/icons/colormaps/bwr.png +0 -0
  77. PaIRS_UniNa/icons/colormaps/cividis.png +0 -0
  78. PaIRS_UniNa/icons/colormaps/cool.png +0 -0
  79. PaIRS_UniNa/icons/colormaps/coolwarm.png +0 -0
  80. PaIRS_UniNa/icons/colormaps/copper.png +0 -0
  81. PaIRS_UniNa/icons/colormaps/cubehelix.png +0 -0
  82. PaIRS_UniNa/icons/colormaps/cyanVector.png +0 -0
  83. PaIRS_UniNa/icons/colormaps/flag.png +0 -0
  84. PaIRS_UniNa/icons/colormaps/gist_heat.png +0 -0
  85. PaIRS_UniNa/icons/colormaps/gray.png +0 -0
  86. PaIRS_UniNa/icons/colormaps/greenVector.png +0 -0
  87. PaIRS_UniNa/icons/colormaps/hot.png +0 -0
  88. PaIRS_UniNa/icons/colormaps/hsv.png +0 -0
  89. PaIRS_UniNa/icons/colormaps/inferno.png +0 -0
  90. PaIRS_UniNa/icons/colormaps/jet.png +0 -0
  91. PaIRS_UniNa/icons/colormaps/magentaVector.png +0 -0
  92. PaIRS_UniNa/icons/colormaps/magma.png +0 -0
  93. PaIRS_UniNa/icons/colormaps/ocean.png +0 -0
  94. PaIRS_UniNa/icons/colormaps/pink.png +0 -0
  95. PaIRS_UniNa/icons/colormaps/plasma.png +0 -0
  96. PaIRS_UniNa/icons/colormaps/prism.png +0 -0
  97. PaIRS_UniNa/icons/colormaps/rainbow.png +0 -0
  98. PaIRS_UniNa/icons/colormaps/redVector.png +0 -0
  99. PaIRS_UniNa/icons/colormaps/seismic.png +0 -0
  100. PaIRS_UniNa/icons/colormaps/spring.png +0 -0
  101. PaIRS_UniNa/icons/colormaps/summer.png +0 -0
  102. PaIRS_UniNa/icons/colormaps/tab10.png +0 -0
  103. PaIRS_UniNa/icons/colormaps/tab20.png +0 -0
  104. PaIRS_UniNa/icons/colormaps/tab20b.png +0 -0
  105. PaIRS_UniNa/icons/colormaps/tab20c.png +0 -0
  106. PaIRS_UniNa/icons/colormaps/terrain.png +0 -0
  107. PaIRS_UniNa/icons/colormaps/twilight.png +0 -0
  108. PaIRS_UniNa/icons/colormaps/viridis.png +0 -0
  109. PaIRS_UniNa/icons/colormaps/whiteVector.png +0 -0
  110. PaIRS_UniNa/icons/colormaps/winter.png +0 -0
  111. PaIRS_UniNa/icons/colormaps/yellowVector.png +0 -0
  112. PaIRS_UniNa/icons/common_region.png +0 -0
  113. PaIRS_UniNa/icons/common_region_off.png +0 -0
  114. PaIRS_UniNa/icons/completed.png +0 -0
  115. PaIRS_UniNa/icons/contourf_off.png +0 -0
  116. PaIRS_UniNa/icons/contourf_on.png +0 -0
  117. PaIRS_UniNa/icons/copy.png +0 -0
  118. PaIRS_UniNa/icons/copy_process.png +0 -0
  119. PaIRS_UniNa/icons/copy_process_off.png +0 -0
  120. PaIRS_UniNa/icons/cut.png +0 -0
  121. PaIRS_UniNa/icons/cut_warnings.png +0 -0
  122. PaIRS_UniNa/icons/darkmode.png +0 -0
  123. PaIRS_UniNa/icons/disp_step.png +0 -0
  124. PaIRS_UniNa/icons/disp_step_off.png +0 -0
  125. PaIRS_UniNa/icons/edit_list.png +0 -0
  126. PaIRS_UniNa/icons/example_list.png +0 -0
  127. PaIRS_UniNa/icons/flaticon_PaIRS_beta.png +0 -0
  128. PaIRS_UniNa/icons/flaticon_PaIRS_download_warning.png +0 -0
  129. PaIRS_UniNa/icons/flip_y_off.png +0 -0
  130. PaIRS_UniNa/icons/flip_y_on.png +0 -0
  131. PaIRS_UniNa/icons/folder_loop_cleanup.png +0 -0
  132. PaIRS_UniNa/icons/folder_loop_cleanup_off.png +0 -0
  133. PaIRS_UniNa/icons/gear.gif +0 -0
  134. PaIRS_UniNa/icons/gear.png +0 -0
  135. PaIRS_UniNa/icons/import_set.png +0 -0
  136. PaIRS_UniNa/icons/information.png +0 -0
  137. PaIRS_UniNa/icons/input_logo.png +0 -0
  138. PaIRS_UniNa/icons/issue.png +0 -0
  139. PaIRS_UniNa/icons/laser_NTR.png +0 -0
  140. PaIRS_UniNa/icons/laser_TR_double.png +0 -0
  141. PaIRS_UniNa/icons/laser_TR_single.png +0 -0
  142. PaIRS_UniNa/icons/link.png +0 -0
  143. PaIRS_UniNa/icons/linked.png +0 -0
  144. PaIRS_UniNa/icons/log_logo.png +0 -0
  145. PaIRS_UniNa/icons/logo_opaco.png +0 -0
  146. PaIRS_UniNa/icons/measure.png +0 -0
  147. PaIRS_UniNa/icons/measure_off.png +0 -0
  148. PaIRS_UniNa/icons/min_proc.png +0 -0
  149. PaIRS_UniNa/icons/min_proc_off.png +0 -0
  150. PaIRS_UniNa/icons/min_step.png +0 -0
  151. PaIRS_UniNa/icons/min_step_off.png +0 -0
  152. PaIRS_UniNa/icons/new_workspace.png +0 -0
  153. PaIRS_UniNa/icons/open_image.png +0 -0
  154. PaIRS_UniNa/icons/open_new_window.png +0 -0
  155. PaIRS_UniNa/icons/open_result.png +0 -0
  156. PaIRS_UniNa/icons/open_workspace.png +0 -0
  157. PaIRS_UniNa/icons/output_logo.png +0 -0
  158. PaIRS_UniNa/icons/paste_above.png +0 -0
  159. PaIRS_UniNa/icons/paste_below.png +0 -0
  160. PaIRS_UniNa/icons/paused.png +0 -0
  161. PaIRS_UniNa/icons/piv_proc.png +0 -0
  162. PaIRS_UniNa/icons/piv_proc_off.png +0 -0
  163. PaIRS_UniNa/icons/piv_step.png +0 -0
  164. PaIRS_UniNa/icons/piv_step_off.png +0 -0
  165. PaIRS_UniNa/icons/process_logo.png +0 -0
  166. PaIRS_UniNa/icons/process_loop.png +0 -0
  167. PaIRS_UniNa/icons/project.png +0 -0
  168. PaIRS_UniNa/icons/pylog.png +0 -0
  169. PaIRS_UniNa/icons/python_warning.png +0 -0
  170. PaIRS_UniNa/icons/queue.png +0 -0
  171. PaIRS_UniNa/icons/read.png +0 -0
  172. PaIRS_UniNa/icons/read_list.png +0 -0
  173. PaIRS_UniNa/icons/reset.png +0 -0
  174. PaIRS_UniNa/icons/reset_levels.png +0 -0
  175. PaIRS_UniNa/icons/restore_undo.png +0 -0
  176. PaIRS_UniNa/icons/running.gif +0 -0
  177. PaIRS_UniNa/icons/running.png +0 -0
  178. PaIRS_UniNa/icons/running_warn.png +0 -0
  179. PaIRS_UniNa/icons/save_and_stop.png +0 -0
  180. PaIRS_UniNa/icons/save_cfg.png +0 -0
  181. PaIRS_UniNa/icons/saveas_workspace.png +0 -0
  182. PaIRS_UniNa/icons/scale_all.png +0 -0
  183. PaIRS_UniNa/icons/scale_down.png +0 -0
  184. PaIRS_UniNa/icons/scale_up.png +0 -0
  185. PaIRS_UniNa/icons/scan_list.png +0 -0
  186. PaIRS_UniNa/icons/scan_path.png +0 -0
  187. PaIRS_UniNa/icons/scan_path_loop.png +0 -0
  188. PaIRS_UniNa/icons/scan_path_loop_off.png +0 -0
  189. PaIRS_UniNa/icons/search.png +0 -0
  190. PaIRS_UniNa/icons/showIW_off.png +0 -0
  191. PaIRS_UniNa/icons/showIW_on.png +0 -0
  192. PaIRS_UniNa/icons/show_all.png +0 -0
  193. PaIRS_UniNa/icons/sort.png +0 -0
  194. PaIRS_UniNa/icons/sort_reversed.png +0 -0
  195. PaIRS_UniNa/icons/spiv_proc.png +0 -0
  196. PaIRS_UniNa/icons/spiv_proc_off.png +0 -0
  197. PaIRS_UniNa/icons/star.png +0 -0
  198. PaIRS_UniNa/icons/step_inheritance.png +0 -0
  199. PaIRS_UniNa/icons/subMIN_off.png +0 -0
  200. PaIRS_UniNa/icons/subMIN_on.png +0 -0
  201. PaIRS_UniNa/icons/unedited.png +0 -0
  202. PaIRS_UniNa/icons/uninitialized.png +0 -0
  203. PaIRS_UniNa/icons/unlink.png +0 -0
  204. PaIRS_UniNa/icons/unwrap_items.png +0 -0
  205. PaIRS_UniNa/icons/vectorColor.png +0 -0
  206. PaIRS_UniNa/icons/view.png +0 -0
  207. PaIRS_UniNa/icons/view_off.png +0 -0
  208. PaIRS_UniNa/icons/vis_logo.png +0 -0
  209. PaIRS_UniNa/icons/warning_circle.png +0 -0
  210. PaIRS_UniNa/icons/window.png +0 -0
  211. PaIRS_UniNa/icons/workspace.png +0 -0
  212. PaIRS_UniNa/icons/wrap_items.png +0 -0
  213. PaIRS_UniNa/icons/write_list.png +0 -0
  214. PaIRS_UniNa/listLib.py +303 -0
  215. PaIRS_UniNa/mtfPIV.py +8 -8
  216. PaIRS_UniNa/parForMulti.py +7 -5
  217. PaIRS_UniNa/parForWorkers.py +370 -31
  218. PaIRS_UniNa/pivParFor.py +233 -229
  219. PaIRS_UniNa/plt_util.py +141 -141
  220. PaIRS_UniNa/preProcParFor.py +153 -148
  221. PaIRS_UniNa/procTools.py +631 -178
  222. PaIRS_UniNa/readcfg.py +31 -1
  223. PaIRS_UniNa/rqrdpckgs.txt +9 -0
  224. PaIRS_UniNa/stereoPivParFor.py +227 -0
  225. PaIRS_UniNa/tAVarie.py +215 -215
  226. PaIRS_UniNa/tabSplitter.py +612 -0
  227. PaIRS_UniNa/ui_Calibration_Tab.py +545 -0
  228. PaIRS_UniNa/ui_Custom_Top.py +5 -5
  229. PaIRS_UniNa/ui_Input_Tab.py +1101 -0
  230. PaIRS_UniNa/{ui_Import_Tab_CalVi.py → ui_Input_Tab_CalVi.py} +1282 -1275
  231. PaIRS_UniNa/ui_Log_Tab.py +262 -257
  232. PaIRS_UniNa/{ui_Export_Tab.py → ui_Output_Tab.py} +2361 -1778
  233. PaIRS_UniNa/ui_Process_Tab.py +3809 -3758
  234. PaIRS_UniNa/ui_Process_Tab_CalVi.py +1547 -1546
  235. PaIRS_UniNa/ui_Process_Tab_Disp.py +1141 -0
  236. PaIRS_UniNa/ui_Process_Tab_Min.py +437 -0
  237. PaIRS_UniNa/ui_Vis_Tab.py +1626 -1208
  238. PaIRS_UniNa/ui_Vis_Tab_CalVi.py +1249 -1249
  239. PaIRS_UniNa/ui_Whatsnew.py +131 -131
  240. PaIRS_UniNa/ui_gPairs.py +876 -950
  241. PaIRS_UniNa/ui_infoPaIRS.py +550 -425
  242. PaIRS_UniNa/whatsnew.txt +6 -4
  243. {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/METADATA +69 -51
  244. pairs_unina-0.2.8.dist-info/RECORD +329 -0
  245. {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/WHEEL +1 -1
  246. PaIRS_UniNa/CalVi.py +0 -18
  247. PaIRS_UniNa/Export_Tab.py +0 -574
  248. PaIRS_UniNa/Import_Tab.py +0 -657
  249. PaIRS_UniNa/Import_Tab_CalVi.py +0 -861
  250. PaIRS_UniNa/Import_Tab_tools.py +0 -598
  251. PaIRS_UniNa/Tree_Tab.py +0 -543
  252. PaIRS_UniNa/gCalVi.py +0 -2024
  253. PaIRS_UniNa/icons/add.png +0 -0
  254. PaIRS_UniNa/icons/cancelled.png +0 -0
  255. PaIRS_UniNa/icons/chain.png +0 -0
  256. PaIRS_UniNa/icons/chain_broken.png +0 -0
  257. PaIRS_UniNa/icons/default_sizes.png +0 -0
  258. PaIRS_UniNa/icons/dock_tabs.png +0 -0
  259. PaIRS_UniNa/icons/done.png +0 -0
  260. PaIRS_UniNa/icons/down_arrow.png +0 -0
  261. PaIRS_UniNa/icons/export_logo.png +0 -0
  262. PaIRS_UniNa/icons/fast_delete.png +0 -0
  263. PaIRS_UniNa/icons/flip_y.png +0 -0
  264. PaIRS_UniNa/icons/ganci.png +0 -0
  265. PaIRS_UniNa/icons/import_blue.png +0 -0
  266. PaIRS_UniNa/icons/import_logo.png +0 -0
  267. PaIRS_UniNa/icons/missing.png +0 -0
  268. PaIRS_UniNa/icons/process_icon.png +0 -0
  269. PaIRS_UniNa/icons/processing.png +0 -0
  270. PaIRS_UniNa/icons/restart.png +0 -0
  271. PaIRS_UniNa/icons/right_arrow.png +0 -0
  272. PaIRS_UniNa/icons/run_piv.png +0 -0
  273. PaIRS_UniNa/icons/terminal.png +0 -0
  274. PaIRS_UniNa/icons/undock_tabs.png +0 -0
  275. PaIRS_UniNa/icons/vect_field.png +0 -0
  276. PaIRS_UniNa/icons/w0.png +0 -0
  277. PaIRS_UniNa/icons/w1.png +0 -0
  278. PaIRS_UniNa/icons/w2.png +0 -0
  279. PaIRS_UniNa/icons/w3.png +0 -0
  280. PaIRS_UniNa/icons/w4.png +0 -0
  281. PaIRS_UniNa/icons/w5.png +0 -0
  282. PaIRS_UniNa/run_CalVi.py +0 -14
  283. PaIRS_UniNa/run_gcalvi.py +0 -5
  284. PaIRS_UniNa/ui_Import_Tab.py +0 -1077
  285. PaIRS_UniNa/ui_Tree_Tab.py +0 -684
  286. PaIRS_UniNa/ui_gCalVi.py +0 -640
  287. PaIRS_UniNa/ui_infoCalVi.py +0 -428
  288. PaIRS_UniNa-0.1.13.dist-info/LICENSE +0 -19
  289. PaIRS_UniNa-0.1.13.dist-info/RECORD +0 -174
  290. /PaIRS_UniNa/icons/{clean_queue.png → clean.png} +0 -0
  291. /PaIRS_UniNa/icons/{waiting_c.png → sandglass.png} +0 -0
  292. {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/top_level.txt +0 -0
PaIRS_UniNa/Export_Tab.py DELETED
@@ -1,574 +0,0 @@
1
- from .ui_Export_Tab import*
2
- from .TabTools import *
3
-
4
- outType_items={
5
- '.mat': 'binary',
6
- '.plt': 'tecplot (binary)',
7
- #'tecplot (ASCII)': '.plt',
8
- }
9
- class OUTpar(TABpar):
10
- def __init__(self):
11
- self.setup()
12
- super().__init__()
13
- self.name='OUTpar'
14
- self.surname='OUTPUT_Tab'
15
- self.unchecked_fields+=['FlagValidPath','FlagValidSubFold','FlagValidRoot','FlagSameAsInput']
16
-
17
- def setup(self):
18
- self.FlagValidSet = True
19
- self.FlagSameAsInput = True
20
- self.FlagValidPath = True
21
- self.path = basefold
22
- self.inputPath = basefold
23
- self.FlagSubFold = True
24
- self.FlagValidSubFold = 1
25
- self.subfold = 'out_PaIRS/'
26
- self.FlagSave = True
27
- self.FlagValidRoot = True
28
- self.root = 'out'
29
- self.outType = 0
30
- self.x = 0
31
- self.y = 0
32
- self.w = 1
33
- self.h = 1
34
- self.W = 1
35
- self.H = 1
36
- self.aimop = [0]
37
- self.bimop = [0]
38
- self.vecop = [0]
39
- self.xres = float(1.000)
40
- self.pixAR = float(1.000)
41
- self.dt = float(1000)
42
-
43
- class Export_Tab(gPaIRS_Tab):
44
- class Export_Tab_signals(gPaIRS_Tab.Tab_Signals):
45
- pass
46
-
47
- def __init__(self,*args):
48
- parent=None
49
- flagInit=True
50
- if len(args): parent=args[0]
51
- if len(args)>1: flagInit=args[1]
52
- super().__init__(parent,Ui_ExportTab,OUTpar)
53
- self.signals=self.Export_Tab_signals(self)
54
-
55
- #------------------------------------- Graphical interface: widgets
56
- self.ui: Ui_ExportTab
57
- ui=self.ui
58
- ui.spin_x.addwid=[ui.spin_w]
59
- ui.spin_y.addwid=[ui.spin_h]
60
- ui.combo_out_type.clear()
61
- for item in outType_items.values():
62
- ui.combo_out_type.addItem(item)
63
-
64
- self.setupWid() #---------------- IMPORTANT
65
-
66
- #------------------------------------- Graphical interface: miscellanea
67
- self.mapx = QPixmap(''+ icons_path +'redx.png')
68
- self.mapv = QPixmap(''+ icons_path +'greenv.png')
69
- self.mapw = QPixmap(''+ icons_path +'waiting_c.png')
70
- self.Lab_warning=QPixmap(u""+ icons_path +"warning.png")
71
-
72
- self.aim_qtim=ImageQt(''+ icons_path +'axes.png')
73
- self.bim_qtim=ImageQt(''+ icons_path +'background.png')
74
- self.vim_qtim=ImageQt(''+ icons_path +'background_vectors.png')
75
-
76
-
77
- self.aim_qtim=ImageQt(''+ icons_path +'axes.png')
78
- self.bim_qtim=ImageQt(''+ icons_path +'background.png')
79
- self.vim_qtim=ImageQt(''+ icons_path +'background_vectors.png')
80
- self.image_labels=[None,ImageQt(''+ icons_path +'rotate_counter.png'),
81
- ImageQt(''+ icons_path +'mirror_x.png'),ImageQt(''+ icons_path +'mirror_y.png'),
82
- ImageQt(''+ icons_path +'rotate_clock.png')]
83
- self.velocity_labels=[None,ImageQt(''+ icons_path +'rotate_v_counter.png'),
84
- ImageQt(''+ icons_path +'mirror_u.png'),ImageQt(''+ icons_path +'mirror_v.png'),
85
- ImageQt(''+ icons_path +'rotate_v_clock.png')]
86
-
87
- aim,bim,vim=self.getQPixmap()
88
- self.ui.aim.setPixmap(aim)
89
- self.ui.aim_2.setPixmap(aim)
90
- self.ui.aim_3.setPixmap(aim)
91
- self.ui.bim.setPixmap(vim)
92
- self.ui.bim_2.setPixmap(bim)
93
- self.ui.bim_3.setPixmap(vim)
94
-
95
- self.rotate_counter = QTransform().rotate(-90)
96
- self.rotate_clock = QTransform().rotate(+90)
97
- self.mirror_x = QTransform().scale(1,-1)
98
- self.mirror_y = QTransform().scale(-1,1)
99
-
100
- #------------------------------------- Declaration of parameters
101
- self.OUTpar_base=OUTpar()
102
- self.OUTpar:OUTpar=self.TABpar
103
- self.OUTpar_old:OUTpar=self.TABpar_old
104
- self.defineSetTABpar(self.setOUTpar)
105
-
106
- #------------------------------------- Callbacks
107
- self.setupCallbacks()
108
-
109
- #------------------------------------- Initializing
110
- if flagInit:
111
- self.initialize()
112
-
113
- def initialize(self):
114
- pri.Info.yellow(f'{"*"*20} OUTPUT initialization {"*"*20}')
115
- self.OUTpar.w=self.OUTpar.h=self.OUTpar.W=self.OUTpar.H=1000
116
- self.adjustOUTpar()
117
- self.setTABpar(True)
118
-
119
- def setupCallbacks(self):
120
- #Callbacks
121
- self.setSpinxywhCallbacks()
122
- spin_names=['x_res','y_res','dt']
123
- spin_tips=['Image resolution along X','Image resolution along Y','Time delay between frames']
124
- self.setSpinCallbacks(spin_names,spin_tips)
125
-
126
- signals=[["clicked"],
127
- ["toggled"],
128
- ["returnPressed","editingFinished"],
129
- ["activated"]]
130
- fields=["button",
131
- "check",
132
- "edit",
133
- "combo"]
134
- names=[ ['rot_counter','rot_clock','mirror_x','mirror_y','rotv_counter','rotv_clock',\
135
- 'flip_u','flip_v','reset_rot_flip','path'], #button,
136
- ['save','same_as_input','subfold'], #check
137
- ['root','path','path_subfold'], #edit
138
- ['out_type']] #combo
139
- tips=[ ['Counterclockwise rotation of image','Clockwise rotation of image','Horizontal mirroring of image','Vertical mirroring of image','Counterclockwise rotation of velocity field','Clockwise rotation of velocity field',\
140
- 'Flip of velocity vectors along X','Flip of velocity vectors along Y','Reset of rotations and mirroring/flip','Output folder path'], #button,
141
- ['Save results','Output folder path same as input','Create subfolder'], #check
142
- ['Root of output files','Output folder path','Output subfolder path'], #edit
143
- ['Type of output files','Files to be saved']] #combo
144
-
145
- for f,N,S,T in zip(fields,names,signals,tips):
146
- for n,t in zip(N,T):
147
- wid=getattr(self.ui,f+"_"+n)
148
- fcallback=getattr(self,f+"_"+n+"_callback")
149
- fcallbackWrapped=self.addParWrapper(fcallback,t)
150
- for s in S:
151
- sig=getattr(wid,s)
152
- sig.connect(fcallbackWrapped)
153
-
154
-
155
- #*************************************************** Rotation and flip
156
- def getQPixmap(self):
157
- aim=QPixmap.fromImage(self.aim_qtim)
158
- bim=QPixmap.fromImage(self.bim_qtim)
159
- vim=QPixmap.fromImage(self.vim_qtim)
160
- return aim, bim, vim
161
-
162
- def RotMirror(self,addop):
163
- if addop[0]!=0:
164
- self.OUTpar.aimop=self.OUTpar.aimop+[addop[0]]
165
- Itransf=np.eye(2,2)
166
- Itransf=self.imTransf_op2I(Itransf,self.OUTpar.aimop,False)
167
- self.OUTpar.aimop=self.imTransf_I2op(Itransf)
168
- if addop[1]!=0:
169
- self.OUTpar.bimop=self.OUTpar.bimop+[addop[1]]
170
- Itransf=np.eye(2,2)
171
- Itransf=self.imTransf_op2I(Itransf,self.OUTpar.bimop,False)
172
- self.OUTpar.bimop=self.imTransf_I2op(Itransf)
173
- self.OUTpar.vecop=self.OUTpar.bimop+self.OUTpar.aimop
174
- Itransf=np.eye(2,2)
175
- Itransf=self.imTransf_op2I(Itransf,self.OUTpar.vecop,False)
176
- self.OUTpar.vecop=self.imTransf_I2op(Itransf)
177
-
178
-
179
- def RotMirror_Pixmaps(self):
180
- #aim_qtim,bim_qtim,aim_rot,bim_rot,v_rot,vmat_rot = self.allocateQPixmap()
181
- _,bim_rot,vim_rot = self.getQPixmap()
182
- opList=[self.OUTpar.bimop,self.OUTpar.vecop]
183
- labList=[self.ui.bim_2,self.ui.bim_3]
184
- imList=[bim_rot,vim_rot]
185
-
186
- for ops,lab,im in zip(opList,labList,imList):
187
- for _,op in enumerate(ops):
188
- if op==1:
189
- im=im.transformed(self.rotate_counter)
190
- elif op==-1:
191
- im=im.transformed(self.rotate_clock)
192
- elif op==3:
193
- im=im.transformed(self.mirror_x)
194
- elif op==2:
195
- im=im.transformed(self.mirror_y)
196
- geom=lab.geometry()
197
- geom.setWidth(im.width())
198
- geom.setHeight(im.height())
199
- geom.setY(lab.parentWidget().maximumHeight()-im.height()-5)
200
- lab.setMinimumSize(im.width(),im.height())
201
- lab.setMaximumSize (im.width(),im.height())
202
- lab.setGeometry(geom)
203
- lab.setPixmap(im)
204
-
205
- opList=[self.OUTpar.bimop,self.OUTpar.aimop]
206
- imageList=[self.image_labels,self.velocity_labels]
207
- nList=[2,3]
208
- for ops,image_labels,n in zip(opList,imageList,nList):
209
- cont=0
210
- for k,op in enumerate(ops):
211
- if op:
212
- cont+=1
213
- lab:QLabel=getattr(self.ui,f'lab_op{k+1}_{n}')
214
- lab.setPixmap(QPixmap.fromImage(image_labels[op]))
215
- for j in range(cont,3):
216
- lab:QLabel=getattr(self.ui,f'lab_op{j+1}_{n}')
217
- lab.setPixmap(QPixmap())
218
- if cont:
219
- getattr(self.ui,f'lab_op{0}_{n}').hide()
220
- else:
221
- getattr(self.ui,f'lab_op{0}_{n}').show()
222
- return
223
-
224
- def imTransf_op2I(self,I,op,flagInv):
225
- for i in range(len(op)):
226
- if op[i]==1: #rotation counter
227
- I=self.matRot90(I.copy(),flagInv)
228
- elif op[i]==-1: #clock
229
- I=self.matRot90(I.copy(), not flagInv)
230
- elif op[i]==3 or op[i]==2:
231
- I=self.matMirror(I.copy(),op[i]-2)
232
- return I
233
-
234
- def matRot90(self,I,flagInv):
235
- #RH =(I[0,0]==I[1,1]) and (I[0,1]==-I[1,0])
236
- #if not RH: flagInv= not flagInv
237
- if not flagInv: #direct counter
238
- a=I[0:np.size(I,0),0].copy()
239
- I[0:np.size(I,0),0]=-I[0:np.size(I,0),1]
240
- I[0:np.size(I,0),1]=+a
241
- else:
242
- a=I[0:np.size(I,0),0].copy()
243
- I[0:np.size(I,0),0]=+I[0:np.size(I,0),1]
244
- I[0:np.size(I,0),1]=-a
245
- return I
246
-
247
- def matMirror(self,I,ind):
248
- #ind=1 mirror_x, ind=0 mirror_y
249
- I[0:np.size(I,0),ind]=-I[0:np.size(I,0),ind]
250
- return I
251
-
252
- def imTransf_I2op(self,I):
253
- op=[0]
254
- RHim= I[0,0]==I[1,1] and I[1,0]==-I[0,1]
255
- if RHim:
256
- if I[0,0]==1: op=[0]
257
- elif I[0,0]==-1: op=[1,1]
258
- elif I[0,1]==1: op=[1]
259
- elif I[0,1]==-1: op=[-1]
260
- else:
261
- if I[0,0]==1: op=[3]
262
- elif I[0,0]==-1: op=[2]
263
- elif I[0,1]==1: op=[1,2]
264
- elif I[0,1]==-1: op=[1,3]
265
- return op
266
-
267
- def button_rot_counter_callback(self):
268
- self.RotMirror([0,1])
269
-
270
- def button_rot_clock_callback(self):
271
- self.RotMirror([0,-1])
272
-
273
- def button_mirror_x_callback(self):
274
- self.RotMirror([0,3])
275
-
276
- def button_mirror_y_callback(self):
277
- self.RotMirror([0,2])
278
-
279
- def button_rotv_counter_callback(self):
280
- self.RotMirror([1,0])
281
-
282
- def button_rotv_clock_callback(self):
283
- self.RotMirror([-1,0])
284
-
285
- def button_flip_v_callback(self):
286
- self.RotMirror([3,0])
287
-
288
- def button_flip_u_callback(self):
289
- self.RotMirror([2,0,2])
290
-
291
- def button_reset_rot_flip_callback(self):
292
- self.OUTpar.aimop=[0]
293
- self.OUTpar.bimop=[0]
294
- self.OUTpar.vecop=[0]
295
- self.RotMirror([-2,-2,-2])
296
-
297
- #*************************************************** From Parameters to UI
298
- def adjustOUTpar(self):
299
- self.OUTpar.path=myStandardPath(self.OUTpar.path)
300
- self.setFlagValidPath()
301
- self.OUTpar.subfold=myStandardPath(self.OUTpar.subfold)
302
- self.setFlagValidSubFold()
303
- self.OUTpar.root=myStandardRoot(self.OUTpar.root)
304
- self.setFlagValidRoot()
305
- return
306
-
307
- def setOUTpar(self):
308
- #Resize/Reshape
309
- self.ui.w_Flip_Image.setEnabled(self.OUTpar.FlagValidSet)
310
- self.setMinMaxSpinxywh()
311
- self.setValueSpinxywh()
312
- self.RotMirror_Pixmaps()
313
- self.setResolution()
314
-
315
- self.ui.check_save.setChecked(self.OUTpar.FlagSave)
316
- self.check_save_action()
317
- self.setRootLabel()
318
- self.ui.check_same_as_input.setChecked(self.OUTpar.FlagSameAsInput)
319
- self.check_same_as_input_action()
320
- self.ui.edit_path.setText(self.OUTpar.path)
321
- self.setPathLabel()
322
- self.ui.check_subfold.setChecked(self.OUTpar.FlagSubFold)
323
- self.check_subfold_action()
324
- self.ui.edit_path_subfold.setText(self.OUTpar.subfold)
325
- self.setSubFoldLabel()
326
-
327
- def setResolution(self):
328
- self.ui.spin_x_res.setValue(self.OUTpar.xres)
329
- self.ui.spin_y_res.setValue(self.OUTpar.pixAR)
330
- self.ui.spin_dt.setValue(self.OUTpar.dt)
331
- self.adjustResLabel()
332
-
333
- def adjustResLabel(self):
334
- Velx=float(1000/(self.OUTpar.xres*self.OUTpar.dt))
335
- Vely=float(Velx/self.OUTpar.pixAR)
336
- self.ui.label_Res_x.setText(f"X: {Velx:.6g} m/s")
337
- adjustFont(self.ui.label_Res_x)
338
- self.ui.label_Res_y.setText(f"Y: {Vely:.6g} m/s")
339
- adjustFont(self.ui.label_Res_y)
340
-
341
- def check_save_action(self):
342
- if not self.OUTpar.FlagSave:
343
- self.ui.w_SaveResults.hide()
344
- self.ui.w_OutputFold_Button.hide()
345
- self.ui.w_OutputSubfold.hide()
346
- else:
347
- self.ui.w_SaveResults.show()
348
- self.ui.w_OutputFold_Button.show()
349
- self.ui.w_OutputSubfold.show()
350
- self.ui.edit_root.setText(self.OUTpar.root)
351
- self.ui.combo_out_type.setCurrentIndex(self.OUTpar.outType)
352
-
353
- def setRootLabel(self):
354
- if self.OUTpar.FlagValidRoot==-2:
355
- self.ui.label_check_root.setPixmap(self.Lab_warning)
356
- self.ui.label_check_root.setToolTip("There are files with the same filename root in the selected path! 😰")
357
- elif self.OUTpar.FlagValidRoot==-1:
358
- self.ui.label_check_root.setPixmap(self.Lab_warning)
359
- self.ui.label_check_root.setToolTip("It was not possible to make the specified output directory! 😰")
360
- elif self.OUTpar.FlagValidRoot==0:
361
- self.ui.label_check_root.setPixmap(self.mapx)
362
- self.ui.label_check_root.setToolTip("Filename root not admitted! 😞")
363
- if self.OUTpar.FlagValidRoot==1:
364
- self.ui.label_check_root.setPixmap(self.mapv)
365
- self.ui.label_check_root.setToolTip("Filename root admitted! 😃")
366
-
367
- def setPathLabel(self):
368
- if self.OUTpar.FlagValidPath:
369
- self.ui.label_check_path.setPixmap(self.mapv)
370
- self.ui.label_check_path.setToolTip("This path exists! 😃")
371
- else:
372
- self.ui.label_check_path.setPixmap(self.mapx)
373
- self.ui.label_check_path.setToolTip("This path does not exist! 😞")
374
-
375
- def check_subfold_action(self):
376
- if not self.OUTpar.FlagSubFold:
377
- self.ui.w_OutputSubfold_name.hide()
378
- else:
379
- self.ui.w_OutputSubfold_name.show()
380
- self.ui.edit_path_subfold.setText(myStandardPath(self.OUTpar.subfold))
381
-
382
- def setSubFoldLabel(self):
383
- if self.OUTpar.FlagValidSubFold==-1:
384
- self.ui.label_check_path_subfold.setPixmap(self.Lab_warning)
385
- self.ui.label_check_path_subfold.setToolTip("Current path already exists! 😰")
386
- elif self.OUTpar.FlagValidSubFold==0:
387
- self.ui.label_check_path_subfold.setPixmap(self.mapx)
388
- self.ui.label_check_path_subfold.setToolTip("Pathname not admitted! 😞")
389
- elif self.OUTpar.FlagValidSubFold==1:
390
- self.ui.label_check_path_subfold.setPixmap(self.mapv)
391
- self.ui.label_check_path_subfold.setToolTip("Pathname admitted! 😃")
392
-
393
- #*************************************************** Edit path and root
394
- #******************** path
395
- def check_same_as_input_callback(self):
396
- self.OUTpar.FlagSameAsInput=self.ui.check_same_as_input.isChecked()
397
- self.check_same_as_input_action()
398
- self.setFlagValidPath()
399
- self.setFlagValidSubFold()
400
-
401
- def check_same_as_input_action(self):
402
- if self.OUTpar.FlagSameAsInput:
403
- self.ui.w_OutputFold.setEnabled(False)
404
- self.ui.w_button_path.setEnabled(False)
405
- self.OUTpar.path=self.OUTpar.inputPath
406
- self.ui.edit_path.setText(self.OUTpar.inputPath)
407
- else:
408
- self.ui.w_OutputFold.setEnabled(True)
409
- self.ui.w_button_path.setEnabled(True)
410
-
411
- def edit_path_changing(self):
412
- self.ui.label_check_path.setPixmap(QPixmap())
413
-
414
- def edit_path_callback(self):
415
- currpath=myStandardPath(self.ui.edit_path.text())
416
- directory_path = myStandardPath(os.getcwd())
417
- if directory_path in currpath:
418
- currpath=currpath.replace(directory_path,'./')
419
- self.OUTpar.path=currpath
420
- self.setFlagValidPath()
421
-
422
- def setFlagValidPath(self,*args):
423
- if len(args): OUTpar_prev=args[0]
424
- else: OUTpar_prev=self.OUTpar
425
- OUTpar_prev.FlagValidPath=os.path.exists(self.OUTpar.path)
426
-
427
- def button_path_callback(self):
428
- directory = str(QFileDialog.getExistingDirectory(self,\
429
- "Choose a folder", dir=self.OUTpar.path,options=optionNativeDialog))
430
- currpath='{}'.format(directory)
431
- if not currpath=='':
432
- self.ui.edit_path.setText(currpath)
433
- out_edit_path=self.edit_path_callback()
434
- return out_edit_path
435
- else:
436
- return [-1,None]
437
-
438
- #******************** subfold
439
- def check_subfold_callback(self):
440
- self.OUTpar.FlagSubFold=self.ui.check_subfold.isChecked()
441
- self.check_subfold_action()
442
-
443
- def edit_path_subfold_changing(self):
444
- self.ui.label_check_path_subfold.setPixmap(QPixmap())
445
-
446
- def edit_path_subfold_callback(self):
447
- subfold=myStandardPath(self.ui.edit_path_subfold.text())
448
- self.OUTpar.subfold=subfold
449
- self.setFlagValidSubFold()
450
-
451
- def setFlagValidSubFold(self,*args):
452
- if len(args): OUTpar_prev=args[0]
453
- else: OUTpar_prev=self.OUTpar
454
- if OUTpar_prev.FlagValidPath:
455
- currpath=myStandardPath(OUTpar_prev.path)
456
- else:
457
- currpath='./'
458
- currpath=myStandardPath(currpath+OUTpar_prev.subfold)
459
- if OUTpar_prev.FlagValidPath and os.path.exists(currpath):
460
- OUTpar_prev.FlagValidSubFold=-1
461
- else:
462
- try:
463
- os.mkdir(currpath)
464
- except:
465
- FlagDeleteFolder=False
466
- OUTpar_prev.FlagValidSubFold=0
467
- else:
468
- FlagDeleteFolder=True
469
- OUTpar_prev.FlagValidSubFold=1
470
- finally:
471
- if FlagDeleteFolder:
472
- os.rmdir(currpath)
473
-
474
- #******************** root
475
- def check_save_callback(self):
476
- self.OUTpar.FlagSave=self.ui.check_save.isChecked()
477
- self.check_save_action()
478
-
479
- def edit_root_changing(self):
480
- self.ui.label_check_root.setPixmap(QPixmap())
481
-
482
- def edit_root_callback(self):
483
- entry=myStandardRoot(self.ui.edit_root.text())
484
- self.ui.edit_root.setText(entry)
485
- self.OUTpar.root=entry
486
- self.setFlagValidRoot()
487
-
488
- def setFlagValidRoot(self,*args):
489
- if len(args): OUTpar_prev=args[0]
490
- else: OUTpar_prev=self.OUTpar
491
- ext=list(outType_items)[OUTpar_prev.outType]
492
- FlagExistPath=False
493
- FlagCreateSubFold=False
494
- if OUTpar_prev.FlagValidPath:
495
- currpath=myStandardPath(OUTpar_prev.path)
496
- if OUTpar_prev.FlagValidSubFold:
497
- currpath=myStandardPath(currpath+OUTpar_prev.subfold)
498
- if OUTpar_prev.FlagValidSubFold==1: FlagCreateSubFold=not os.path.exists(currpath)
499
- elif OUTpar_prev.FlagValidSubFold==-1: FlagExistPath=True
500
- else:
501
- currpath='./'
502
- pattern=myStandardRoot(currpath+OUTpar_prev.root)+'*'+ext
503
- FlagExist=False
504
- if FlagExistPath:
505
- files=findFiles_sorted(pattern)
506
- FlagExist=len(files)>0
507
- if FlagExist:
508
- OUTpar_prev.FlagValidRoot=-2
509
- else:
510
- try:
511
- if FlagCreateSubFold:
512
- os.mkdir(currpath)
513
- FlagDeleteSubFold=True
514
- else:
515
- FlagDeleteSubFold=False
516
- except:
517
- FlagDeleteSubFold=False
518
- OUTpar_prev.FlagValidRoot=-1
519
- else:
520
- try:
521
- filename=pattern.replace('*','a0')+'.delmeplease'
522
- open(filename,'w')
523
- except:
524
- FlagDeleteFile=False
525
- OUTpar_prev.FlagValidRoot=0
526
- else:
527
- FlagDeleteFile=True
528
- OUTpar_prev.FlagValidRoot=1
529
- finally:
530
- if FlagDeleteFile:
531
- os.remove(filename)
532
- finally:
533
- if FlagDeleteSubFold:
534
- os.rmdir(currpath)
535
-
536
- def combo_out_type_callback(self):
537
- self.OUTpar.outType=self.ui.combo_out_type.currentIndex()
538
- self.setFlagValidRoot()
539
-
540
- def setFlagValid(self,*args):
541
- if len(args): OUTpar_prev=args[0]
542
- else: OUTpar_prev=self.OUTpar
543
- self.setFlagValidPath(OUTpar_prev)
544
- self.setFlagValidSubFold(OUTpar_prev)
545
- self.setFlagValidRoot(OUTpar_prev)
546
-
547
- #*************************************************** Resolution
548
- def spin_x_res_callback(self):
549
- if self.ui.spin_x_res.hasFocus():
550
- self.OUTpar.xres=self.ui.spin_x_res.value()
551
- self.adjustResLabel()
552
-
553
- def spin_y_res_callback(self):
554
- if self.ui.spin_y_res.hasFocus():
555
- self.OUTpar.pixAR=self.ui.spin_y_res.value()
556
- self.adjustResLabel()
557
-
558
- def spin_dt_callback(self):
559
- if self.ui.spin_dt.hasFocus():
560
- self.OUTpar.dt=self.ui.spin_dt.value()
561
- self.adjustResLabel()
562
-
563
-
564
- if __name__ == "__main__":
565
- import sys
566
- app=QApplication.instance()
567
- if not app:app = QApplication(sys.argv)
568
- app.setStyle('Fusion')
569
- object = Export_Tab(None)
570
- object.show()
571
- app.exec()
572
- app.quit()
573
- app=None
574
-