Skip to content

Commit

Permalink
Merge pull request #765 from callumgassner/polar_new
Browse files Browse the repository at this point in the history
[ENH] 4+ Angle Polarisation widget and Hyper Spectra vector plot
  • Loading branch information
markotoplak authored Dec 18, 2024
2 parents 40712b5 + 80fdb4e commit 0d49e68
Show file tree
Hide file tree
Showing 20 changed files with 2,159 additions and 12 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ recursive-include orangecontrib/spectroscopy/datasets NeaReaderGSF_test/*
recursive-include orangecontrib/spectroscopy/datasets renishaw_test_files/*
recursive-include orangecontrib/spectroscopy/datasets photothermal/*
recursive-include orangecontrib/spectroscopy/datasets perkinelmer/*
recursive-include orangecontrib/spectroscopy/datasets polar/*

global-exclude __pycache__

Expand Down
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Widgets
widgets/pls
widgets/peakfit
widgets/snr
widgets/polar

Indices and tables
------------------
Expand Down
9 changes: 8 additions & 1 deletion doc/widgets.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,14 @@
"icon": "../orangecontrib/spectroscopy/widgets/icons/stackalign.svg",
"background": "light-blue",
"keywords": []
},
{
"text": "4+ Angle Polarisation",
"doc": "widgets/polar.md",
"icon": "../orangecontrib/spectroscopy/widgets/icons/unknown.svg",
"background": "light-blue",
"keywords": []
}
]
]
]
]
Binary file added doc/widgets/images/Polar-Example1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/widgets/images/Polar-Example2.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/widgets/images/Polar-stamped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions doc/widgets/polar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
4+ Angle Polarization
============

Calculates vibrational mode orientation from polarized infrared spectroscopy datasets

**Inputs**

- Data: input dataset(s)

**Outputs**

- Polar Data: dataset with selected feature(s) orientation information
- Curve Fit Model Data: dataset with the optimal parameters of the curve fit model

The **4+ Angle Polarization** widget allows you to calculate orientation information of selected features using polarized spectroscopy data collected at 4 or more polarization angles. The implemented algorithm is the same as that outlined by Hikima et al. (2013)<sup>1</sup>

If you use this widget for your data analysis, please cite the articles in which the <a href="https://doi.org/10.1021/ma302560q">method (Hikima et al. (2013)<sup>1</sup>)</a> and <a href="#references">widget (Gassner et al. (2025)<sup>2</sup>)</a> are introduced.

![](images/Polar-stamped.png)

1. Inputs: Define the polarization angles of the input dataset. Data can be passed to widget with two methods:
- *Multifile Input*: A single input with data from all polarization angles in a single dataset. (Each polarization angle must be separated with a categorical variable).
- *Multiple Inputs*: 1 input per polarization angle.
2. Features: Select the features to calculate the orientation of. Features are selected by clicking on the desired feature(s) and assigning a TDM value (see point 5). A default value is assigned using the current value in the "TDM Tilt (°)" box, changing this value will change the associated value of the selected feature(s). Deselecting features will not remove them from the list to be calculated, only features with ("Not used") will not be calculated (see point 8).
3. Data XY Selection: Define the attributes for the x and y axes for 2D datasets.
4. Spectra Type: The type of spectra on the input. A conversion to *Absorptance* is performed before calculating orientation information when *Absorbance* or *Transmittance* is selected (this does not affect meta and class variables).
5. TDM Tilt (°): The angle of the Transition Dipole Moment with respect to the molecular axis. Used in calculation of the value of Herman's orientation function.
6. Invert Angles: Invert the calculated Azimuth Angles about the 0 degree axis (i.e. so that 90 degrees is output as -90 degrees).
7. Average Spectra: Average all output variables across polarization angles.
8. Don't use selected features: Remove the selected features from the list to be used in calculations

Input Examples
-------
MultiFile Input

![](images/Polar-Example1.PNG)

Multiple Inputs

![](images/Polar-Example2.PNG)




References
-------


1. Hikima, Y.; Morikawa, J.; Hashimoto, T., Wavenumber Dependence of FT-IR Image of Molecular Orientation in Banded Spherulites of Poly(3-hydroxybutyrate) and Poly(L-lactic acid). Macromolecules 2013, 46, 1582-1590.
2. Gassner, C.; Vongsvivut, J.; Ryu, M.; Ng, S.H.; Toplak, M.; Takkalkar, P.; Fac, M.L.; Sims, N.A.; Wood, B.R.; Tobin, M.J.; Juodkazis, S.; Morikawa, J., 4+ Angle Polarization: New Multiple-Angle FTIR Polarization Widget for Molecular Orientation Analysis in the Open-Source Quasar Platform.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
1697.131066748047 1693.2739506872558 1689.416834626465 1685.5597185656738 1681.702602504883 1677.8454864440919 1673.9883703833011 1670.13125432251 1666.2741382617191 1662.417022200928 1658.5599061401367 1654.702790079346 1650.8456740185547 1646.988557957764 1643.1314418969728 1639.274325836182 1635.4172097753908 1631.5600937145996 1627.7029776538088 1623.8458615930176 1619.9887455322269 1616.1316294714356 1612.2745134106449 1608.4173973498537 1604.5602812890625 1600.7031652282717 1596.8460491674805 1592.9889331066897 1589.1318170458985 1585.2747009851078 1581.4175849243165 1577.5604688635258 1573.7033528027346 1569.8462367419434 1565.9891206811526 1562.1320046203614 1558.2748885595706 1554.4177724987794 1550.5606564379887 1546.7035403771974 1542.8464243164062 1538.9893082556155 1535.1321921948243 1531.2750761340335 1527.4179600732423 1523.5608440124515 1519.7037279516603 1515.846611890869 1511.9894958300783 1508.1323797692871 1504.2752637084964 1500.4181476477052 1496.5610315869144 1492.7039155261232 1488.8467994653324 1484.9896834045412 1481.13256734375 1477.2754512829592 1473.418335222168 1469.5612191613773 1465.704103100586 1461.8469870397953 1457.989870979004 1454.1327549182129 1450.275638857422 1446.418522796631 1442.5614067358401 1438.704290675049 1434.8471746142582 1430.990058553467 1427.1329424926757 1423.275826431885 1419.4187103710938 1415.561594310303 1411.7044782495118 1407.847362188721 1403.9902461279298 1400.133130067139 1396.2760140063479 1392.4188979455566 1388.5617818847659 1384.7046658239747 1380.847549763184 1376.9904337023927 1373.133317641602 1369.2762015808107 1365.4190855200195 1361.5619694592287 1357.7048533984375 1353.8477373376468 1349.9906212768556 1346.1335052160648 1342.2763891552736 1338.4192730944824 1334.5621570336916 1330.7050409729004 1326.8479249121096 1322.9908088513184 1319.1336927905277 1315.2765767297365 1311.4194606689457 1307.5623446081545 1303.7052285473633 1299.8481124865725 1295.9909964257813 1292.1338803649905 1288.2767643041993 1284.4196482434086 1280.5625321826174 1276.7054161218261 1272.8483000610354 1268.9911840002442 1265.1340679394534 1261.2769518786622 1257.4198358178714 1253.5627197570802 1249.705603696289 1245.8484876354983 1241.991371574707 1238.1342555139163 1234.277139453125 1230.4200233923343 1226.562907331543 1222.7057912707523 1218.8486752099611 1214.99155914917 1211.1344430883792 1207.277327027588 1203.4202109667972 map_x map_y 1214.0 - 1258.0 1500.0 - 1580.0
continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous continuous
meta meta meta meta
0.3711118698120117 0.43782272934913635 0.49062955379486084 0.5547452569007874 0.6374028921127319 0.711500346660614 0.7876919507980347 0.8770861625671387 0.9559172987937927 1.0098530054092407 1.0404753684997559 1.0543735027313232 1.0619465112686157 1.0437582731246948 1.0013220310211182 0.9536964297294617 0.897933840751648 0.8533709645271301 0.8181004524230957 0.7584443688392639 0.6689296364784241 0.5782220363616943 0.513115644454956 0.46961721777915955 0.43171659111976624 0.3991532325744629 0.3810955286026001 0.37965840101242065 0.386007159948349 0.3947145342826843 0.4098324477672577 0.4343760311603546 0.46137940883636475 0.49168214201927185 0.528336226940155 0.5667646527290344 0.6178287267684937 0.6604256629943848 0.6766932010650635 0.6885275840759277 0.6986993551254272 0.6930281519889832 0.6724157929420471 0.6501829028129578 0.6263569593429565 0.5885990858078003 0.5376056432723999 0.5005533695220947 0.4779326319694519 0.4443279504776001 0.39699268341064453 0.36137861013412476 0.33436083793640137 0.30747178196907043 0.2803654670715332 0.2625480592250824 0.2592535614967346 0.27015992999076843 0.29309216141700745 0.31150364875793457 0.3194276988506317 0.328142374753952 0.3443129062652588 0.35353028774261475 0.3476772606372833 0.33774372935295105 0.32855379581451416 0.3200712502002716 0.31163617968559265 0.3032289445400238 0.2943628430366516 0.28816357254981995 0.2909632623195648 0.29872336983680725 0.3025616407394409 0.3057458698749542 0.3115512728691101 0.31618112325668335 0.3176253139972687 0.3175846040248871 0.3153497576713562 0.3088831901550293 0.3000914454460144 0.29377707839012146 0.2888909578323364 0.28027477860450745 0.270122230052948 0.26286780834198 0.2575746774673462 0.2533765435218811 0.2540722191333771 0.26083439588546753 0.2694004774093628 0.27414125204086304 0.2728372812271118 0.26937466859817505 0.2672775387763977 0.2684006989002228 0.2723020315170288 0.27508431673049927 0.2749064266681671 0.274681955575943 0.2775912284851074 0.28367695212364197 0.2893185019493103 0.290900319814682 0.2906703054904938 0.2926110625267029 0.2950325608253479 0.2977401614189148 0.3037301301956177 0.3114270567893982 0.318378210067749 0.32530495524406433 0.3349395990371704 0.3490666151046753 0.3638021945953369 0.3744945526123047 0.3803212642669678 0.3803481459617615 0.37394478917121887 0.3625723719596863 0.34696418046951294 0.3287803828716278 0.31259098649024963 0.3022864758968353 0.2975075840950012 0.2938818633556366 0.2872605323791504 30442.5687 41538.7379 15.009961445779307 43.87936019111817
0.388348788022995 0.44867801666259766 0.502106249332428 0.5762503743171692 0.6664558053016663 0.739630937576294 0.8222108483314514 0.9173783659934998 0.9785887002944946 1.0107851028442383 1.0361779928207397 1.0637257099151611 1.0711760520935059 1.0423812866210938 1.025393009185791 0.9986843466758728 0.9373337626457214 0.8785869479179382 0.8271448612213135 0.7655133605003357 0.6908860802650452 0.6117749810218811 0.5471857190132141 0.4971246123313904 0.45541316270828247 0.42525458335876465 0.4062337279319763 0.39754077792167664 0.39981767535209656 0.41045162081718445 0.42612242698669434 0.4495392143726349 0.48013657331466675 0.509360134601593 0.5352477431297302 0.5706249475479126 0.6430520415306091 0.7104148864746094 0.7287077903747559 0.7300795912742615 0.7207353115081787 0.6928030848503113 0.6642997860908508 0.6465807557106018 0.6357985734939575 0.6169293522834778 0.5714240670204163 0.5247028470039368 0.49503496289253235 0.4588204622268677 0.41067439317703247 0.37448638677597046 0.34704023599624634 0.32218214869499207 0.29583585262298584 0.27490201592445374 0.26934197545051575 0.28096309304237366 0.3069058060646057 0.3270772397518158 0.33470597863197327 0.34152284264564514 0.35194724798202515 0.3573232889175415 0.3541431128978729 0.34866204857826233 0.3427005112171173 0.3312859833240509 0.3122206926345825 0.2955722510814667 0.2872144877910614 0.2867285907268524 0.2918354272842407 0.2956002652645111 0.2986833155155182 0.3060479462146759 0.31676867604255676 0.3262639045715332 0.330106645822525 0.32593291997909546 0.31699928641319275 0.30795541405677795 0.3018266558647156 0.29686442017555237 0.28721868991851807 0.2752007842063904 0.2667289972305298 0.2609139084815979 0.25778260827064514 0.2584190368652344 0.2610763907432556 0.2639258801937103 0.26595649123191833 0.26701226830482483 0.2679225206375122 0.2679891288280487 0.2669326663017273 0.2678163945674896 0.2720436155796051 0.2770630121231079 0.28001782298088074 0.27851158380508423 0.2751752436161041 0.276258647441864 0.2823660373687744 0.2899717390537262 0.29827389121055603 0.30697736144065857 0.3102128207683563 0.30654236674308777 0.30582261085510254 0.3128655254840851 0.3222534656524658 0.32939496636390686 0.33602944016456604 0.34821176528930664 0.3637096881866455 0.37178686261177063 0.3715791702270508 0.37046146392822266 0.36934414505958557 0.36342424154281616 0.350017786026001 0.33207470178604126 0.3140036165714264 0.2998875081539154 0.29220956563949585 0.2874009907245636 0.2815419137477875 30445.38885 41538.7379 14.936959331411803 45.349811063094954
0.366887629032135 0.43671754002571106 0.49220016598701477 0.5703327059745789 0.6657547950744629 0.731933057308197 0.7937033176422119 0.8747525215148926 0.9398021697998047 0.9730452299118042 1.0031681060791016 1.0538406372070312 1.0965853929519653 1.0494016408920288 0.9825043678283691 0.9511120319366455 0.9302560687065125 0.8842418789863586 0.8129315972328186 0.7183979153633118 0.6205475330352783 0.5415375232696533 0.48775240778923035 0.44761666655540466 0.41458284854888916 0.39335882663726807 0.3796997666358948 0.36864838004112244 0.36498430371284485 0.3680277466773987 0.3732655644416809 0.38918817043304443 0.42386338114738464 0.46311137080192566 0.4917769134044647 0.5237820148468018 0.5971131920814514 0.6691277027130127 0.6892750859260559 0.7003340125083923 0.7168111801147461 0.6999649405479431 0.6541981101036072 0.6189929246902466 0.5926592946052551 0.5696735382080078 0.5413363575935364 0.5053853988647461 0.465243935585022 0.41113007068634033 0.36086025834083557 0.32808783650398254 0.3003191649913788 0.2793380916118622 0.26471295952796936 0.2541550099849701 0.24993854761123657 0.25305330753326416 0.2655698359012604 0.27899375557899475 0.2841063439846039 0.28888702392578125 0.30285078287124634 0.3161625862121582 0.3197145164012909 0.3178388774394989 0.31100529432296753 0.29754751920700073 0.28191861510276794 0.2750825583934784 0.27559351921081543 0.27823397517204285 0.2830919921398163 0.2850538194179535 0.2825995981693268 0.28359857201576233 0.2883332371711731 0.289949893951416 0.2929544150829315 0.30135759711265564 0.30265331268310547 0.2906714677810669 0.2753030061721802 0.2651992440223694 0.25924843549728394 0.25318726897239685 0.24550479650497437 0.23828820884227753 0.23315896093845367 0.23029816150665283 0.2334306240081787 0.24293583631515503 0.2510787546634674 0.25073981285095215 0.24615781009197235 0.2464907467365265 0.2522513270378113 0.2587389051914215 0.262591689825058 0.263126403093338 0.26156532764434814 0.2589862048625946 0.2572213411331177 0.2594248950481415 0.2655974328517914 0.27193424105644226 0.27772676944732666 0.28423818945884705 0.28888431191444397 0.29118603467941284 0.2921951413154602 0.29164180159568787 0.2948339283466339 0.3066503405570984 0.32164159417152405 0.333238422870636 0.34339842200279236 0.355623722076416 0.36564287543296814 0.36494630575180054 0.35201695561408997 0.3341171145439148 0.3175579309463501 0.30399125814437866 0.2928829789161682 0.28347793221473694 0.2780621647834778 0.276618093252182 0.27352389693260193 30442.5687 41541.616519999996 14.140093941838566 42.63377488797279
0.36428871750831604 0.43003931641578674 0.47958770394325256 0.5450240969657898 0.634536862373352 0.7099695801734924 0.7796786427497864 0.8637834787368774 0.942089855670929 0.9903811812400818 1.0105667114257812 1.0208871364593506 1.005222201347351 0.963545024394989 0.9371297359466553 0.9139838814735413 0.8946059942245483 0.8827653527259827 0.840722918510437 0.7564958333969116 0.6611053943634033 0.5774503946304321 0.5202354192733765 0.48433250188827515 0.45376747846603394 0.4260224401950836 0.4059300422668457 0.3930695950984955 0.38632991909980774 0.3889123797416687 0.4001465141773224 0.4183931052684784 0.4428093135356903 0.47215187549591064 0.5050704479217529 0.5453080534934998 0.6085248589515686 0.658994734287262 0.668915331363678 0.6675289869308472 0.6717699766159058 0.6808158755302429 0.6681414842605591 0.6372467875480652 0.6000738739967346 0.5683797597885132 0.544323742389679 0.516345202922821 0.48224183917045593 0.4387160539627075 0.39499184489250183 0.3595888912677765 0.3304763436317444 0.3092094361782074 0.28860795497894287 0.26972246170043945 0.2605076730251312 0.26343077421188354 0.28140151500701904 0.29994896054267883 0.30823972821235657 0.31485551595687866 0.32437241077423096 0.33080095052719116 0.3303925395011902 0.3248642385005951 0.3165438175201416 0.3061983585357666 0.2946605384349823 0.2872968912124634 0.2868692874908447 0.2896806299686432 0.2909656763076782 0.2920180857181549 0.2945660948753357 0.2972028851509094 0.29964983463287354 0.3004482090473175 0.29766783118247986 0.2939799129962921 0.2927486002445221 0.2923987805843353 0.2889113426208496 0.2816716730594635 0.27281782031059265 0.2626931965351105 0.2514967918395996 0.24271203577518463 0.23827271163463593 0.23637256026268005 0.2380509227514267 0.24506837129592896 0.25348952412605286 0.25623422861099243 0.25412917137145996 0.2532842457294464 0.2547925114631653 0.2577175199985504 0.26068350672721863 0.2616606056690216 0.2597542703151703 0.2559884488582611 0.2536808252334595 0.256541907787323 0.2641761898994446 0.271513968706131 0.2755036950111389 0.27728980779647827 0.27779620885849 0.27858373522758484 0.28195881843566895 0.28836870193481445 0.29790475964546204 0.3091188371181488 0.317819207906723 0.3241935074329376 0.33264613151550293 0.3433806300163269 0.3505949378013611 0.35062962770462036 0.34647127985954285 0.3387751281261444 0.32535696029663086 0.3086860477924347 0.2940033972263336 0.2858646810054779 0.2827148139476776 0.2769644856452942 0.26818761229515076 30445.38885 41541.616519999996 13.949567230311496 43.05058779046659
Loading

0 comments on commit 0d49e68

Please sign in to comment.