Diff of the two buildlogs: -- --- b1/build.log 2024-04-20 17:18:07.108209197 +0000 +++ b2/build.log 2024-04-20 17:21:17.980059158 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Sat Apr 20 05:12:25 -12 2024 -I: pbuilder-time-stamp: 1713633145 +I: Current time: Sat May 24 13:41:09 +14 2025 +I: pbuilder-time-stamp: 1748043669 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/unstable-reproducible-base.tgz] I: copying local configuration @@ -27,54 +27,86 @@ dpkg-source: info: unpacking octave-optics_0.1.4-4.debian.tar.xz I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/34549/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/116337/tmp/hooks/D01_modify_environment starting +debug: Running on ionos16-i386. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 May 23 23:41 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/116337/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/116337/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='i386' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=11 ' - DISTRIBUTION='unstable' - HOME='/root' - HOST_ARCH='i386' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="21" [3]="1" [4]="release" [5]="i686-pc-linux-gnu") + BASH_VERSION='5.2.21(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=i386 + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=21 ' + DIRSTACK=() + DISTRIBUTION=unstable + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=i686 + HOST_ARCH=i386 IFS=' ' - INVOCATION_ID='4f6f2d8af27a44c09687a3b66cf2280e' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - LD_LIBRARY_PATH='/usr/lib/libeatmydata' - LD_PRELOAD='libeatmydata.so' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='34549' - PS1='# ' - PS2='> ' + INVOCATION_ID=41397b24c0c14eac81751bc52f647320 + LANG=C + LANGUAGE=de_CH:de + LC_ALL=C + LD_LIBRARY_PATH=/usr/lib/libeatmydata + LD_PRELOAD=libeatmydata.so + MACHTYPE=i686-pc-linux-gnu + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnu + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=116337 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.bVqZRCJ8/pbuilderrc_HP5Z --distribution unstable --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.bVqZRCJ8/b1 --logfile b1/build.log octave-optics_0.1.4-4.dsc' - SUDO_GID='112' - SUDO_UID='107' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://78.137.99.97:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.bVqZRCJ8/pbuilderrc_ozVu --distribution unstable --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.bVqZRCJ8/b2 --logfile b2/build.log octave-optics_0.1.4-4.dsc' + SUDO_GID=112 + SUDO_UID=107 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://85.184.249.68:3128 I: uname -a - Linux ionos12-i386 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux + Linux i-capture-the-hostname 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux I: ls -l /bin - lrwxrwxrwx 1 root root 7 Apr 19 07:43 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/34549/tmp/hooks/D02_print_environment finished + lrwxrwxrwx 1 root root 7 May 23 14:06 /bin -> usr/bin +I: user script /srv/workspace/pbuilder/116337/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -667,7 +699,7 @@ Get: 547 http://deb.debian.org/debian unstable/main i386 texlive-latex-recommended all 2023.20240207-1 [8843 kB] Get: 548 http://deb.debian.org/debian unstable/main i386 texlive-pictures all 2023.20240207-1 [16.7 MB] Get: 549 http://deb.debian.org/debian unstable/main i386 texlive-latex-extra all 2023.20240207-1 [19.7 MB] -Fetched 312 MB in 5s (60.5 MB/s) +Fetched 312 MB in 4s (84.4 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libpython3.11-minimal:i386. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19681 files and directories currently installed.) @@ -2445,8 +2477,8 @@ Setting up tzdata (2024a-3) ... Current default time zone: 'Etc/UTC' -Local time is now: Sat Apr 20 17:13:43 UTC 2024. -Universal Time is now: Sat Apr 20 17:13:43 UTC 2024. +Local time is now: Fri May 23 23:42:04 UTC 2025. +Universal Time is now: Fri May 23 23:42:04 UTC 2025. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up liberror-perl (0.17029-2) ... @@ -2943,7 +2975,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/reproducible-path/octave-optics-0.1.4/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../octave-optics_0.1.4-4_source.changes +I: user script /srv/workspace/pbuilder/116337/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for unstable +I: user script /srv/workspace/pbuilder/116337/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/octave-optics-0.1.4/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../octave-optics_0.1.4-4_source.changes dpkg-buildpackage: info: source package octave-optics dpkg-buildpackage: info: source version 0.1.4-4 dpkg-buildpackage: info: source distribution unstable @@ -3808,400 +3844,6 @@ Checking package... Run the unit tests... Checking m files ... -[inst/zernike_name.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/zernike_name.m -***** assert (zernike_name (4), "defocus") -***** assert (zernike_name (22), "-") -***** error (zernike_name (0)) -***** error (zernike_name ([1 2])) -***** error (zernike_name (pi)) -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/zernike_osa_ansi_to_mn.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/zernike_osa_ansi_to_mn.m -***** test - [m,n]=zernike_osa_ansi_to_mn(0); - assert([m n],[0 0]) - [m,n]=zernike_osa_ansi_to_mn(1); - assert([m n],[-1 1]) - [m,n]=zernike_osa_ansi_to_mn(2); - assert([m n],[1 1]) - [m,n]=zernike_osa_ansi_to_mn(3); - assert([m n],[-2 2]) - [m,n]=zernike_osa_ansi_to_mn(4); - assert([m n],[0 2]) - [m,n]=zernike_osa_ansi_to_mn(5); - assert([m n],[2 2]) - [m,n]=zernike_osa_ansi_to_mn(6); - assert([m n],[-3 3]) - [m,n]=zernike_osa_ansi_to_mn(7); - assert([m n],[-1 3]) - [m,n]=zernike_osa_ansi_to_mn(8); - assert([m n],[1 3]) - [m,n]=zernike_osa_ansi_to_mn(9); - assert([m n],[3 3]) - [m,n]=zernike_osa_ansi_to_mn(10); - assert([m n],[-4 4]) - [m,n]=zernike_osa_ansi_to_mn(11); - assert([m n],[-2 4]) - [m,n]=zernike_osa_ansi_to_mn(12); - assert([m n],[0 4]) - [m,n]=zernike_osa_ansi_to_mn(13); - assert([m n],[2 4]) - [m,n]=zernike_osa_ansi_to_mn(14); - assert([m n],[4 4]) - [m,n]=zernike_osa_ansi_to_mn(15); - assert([m n],[-5 5]) - [m,n]=zernike_osa_ansi_to_mn(16); - assert([m n],[-3 5]) - [m,n]=zernike_osa_ansi_to_mn(17); - assert([m n],[-1 5]) - [m,n]=zernike_osa_ansi_to_mn(18); - assert([m n],[1 5]) - [m,n]=zernike_osa_ansi_to_mn(19); - assert([m n],[3 5]) - [m,n]=zernike_osa_ansi_to_mn(20); - assert([m n],[5 5]) - [m,n]=zernike_osa_ansi_to_mn(21); - assert([m n],[-6 6]) - [m,n]=zernike_osa_ansi_to_mn(22); - assert([m n],[-4 6]) - [m,n]=zernike_osa_ansi_to_mn(23); - assert([m n],[-2 6]) - [m,n]=zernike_osa_ansi_to_mn(24); - assert([m n],[0 6]) - [m,n]=zernike_osa_ansi_to_mn(25); - assert([m n],[2 6]) - [m,n]=zernike_osa_ansi_to_mn(26); - assert([m n],[4 6]) - [m,n]=zernike_osa_ansi_to_mn(27); - assert([m n],[6 6]) - [m,n]=zernike_osa_ansi_to_mn(28); - assert([m n],[-7 7]) - [m,n]=zernike_osa_ansi_to_mn(29); - assert([m n],[-5 7]) - [m,n]=zernike_osa_ansi_to_mn(30); - assert([m n],[-3 7]) - [m,n]=zernike_osa_ansi_to_mn(31); - assert([m n],[-1 7]) - [m,n]=zernike_osa_ansi_to_mn(32); - assert([m n],[1 7]) - [m,n]=zernike_osa_ansi_to_mn(33); - assert([m n],[3 7]) - [m,n]=zernike_osa_ansi_to_mn(34); - assert([m n],[5 7]) - [m,n]=zernike_osa_ansi_to_mn(35); - assert([m n],[7 7]) -***** test - [m,n]=zernike_osa_ansi_to_mn([2 7 15 35]); - assert(m,[1 -1 -5 7]) - assert(n,[1 3 5 7]) -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/zernike_cartesian.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/zernike_cartesian.m -***** demo - t = linspace (-1, 1, 80); - [x, y] = meshgrid (t, t); - max_order = 16; - Z = zernike_cartesian (x, y, max_order); - for k = 1:max_order - subplot (4, 4, k) - factors = zeros (max_order, 1); - factors(k) = 1; - z = reshape (Z*factors, size (x)); - imagesc (z) - axis ("off", "equal") - zname = strrep (zernike_name (k), " ", "\n"); - title (zname) - endfor -***** demo - n=30; - [x,y,z] = sombrero (n); - z += 0.05 * peaks (x./4, y./4); - z += 0.02 * x; - figure - surf (x, y, z) - title ("Original sombrero + peaks + tilt"); - - ## approximate sombrero+peaks - d = 10; - x /= d; - y /= d; - max_order = 50; - Z = zernike_cartesian (x, y, max_order, false); - f = Z\z(:); - ## create approximated plot - z_approx = reshape (Z * f, n, n); - figure - surf (10 * x, 10 * y, z_approx) - title ("approximated"); -***** assert (zernike_cartesian (0, 0, 1), 1) -***** error (zernike_cartesian (0, 0, 0)) -***** error (zernike_cartesian (0, 0, pi)) -***** error (zernike_cartesian ()) -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/zernike_noll_to_mn.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/zernike_noll_to_mn.m -***** test - [m,n]=zernike_noll_to_mn(1); - assert([m n],[0 0]) -***** test - [m,n]=zernike_noll_to_mn(2); - assert([m n],[1 1]) -***** test - [m,n]=zernike_noll_to_mn(3); - assert([m n],[-1 1]) -***** test - [m,n]=zernike_noll_to_mn(4); - assert([m n],[0 2]) -***** test - [m,n]=zernike_noll_to_mn(5); - assert([m n],[-2 2]) -***** test - [m,n]=zernike_noll_to_mn(20); - assert([m n],[5 5]) -***** test - [m,n]=zernike_noll_to_mn(34); - assert([m n],[5 7]) -***** test - [m,n]=zernike_noll_to_mn(35); - assert([m n],[-7 7]) -***** test - [m,n]=zernike_noll_to_mn(36); - assert([m n],[7 7]) -***** test - [m,n]=zernike_noll_to_mn([2 5 8 35]); - assert(m,[1 -2 1 -7]) - assert(n,[1 2 3 7]) -10 tests, 10 passed, 0 known failure, 0 skipped -[inst/jones_rotator.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_rotator.m -***** test - % test default return value - A = jones_rotator(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test serial application of rotator - angle = rand(1, 1); - A1 = jones_rotator(angle); - A2 = jones_rotator(angle*2); - R = A1*A1-A2; - assert(norm(R,inf), 0, 1e-9); - -***** test - % another test of serial application of rotator - angle1 = rand(1, 1); - angle2 = rand(1, 1); - A1 = jones_rotator(angle1); - A2 = jones_rotator(angle2); - A12 = jones_rotator(angle1+angle2); - R = A1*A2-A12; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test different angle value interpretations - angle = rand(1, 1); - A1 = jones_rotator(angle); - A2 = jones_rotator(-angle*180/pi(), 'deg'); - R = A2*A1-jones_unity(); - assert(norm(R,inf), 0, 1e-9); - -***** test - % test size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = jones_rotator(R); - csize = size(C); - assert(rsize == csize); - end -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/mueller_circdiattenuator.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_circdiattenuator.m -***** test - % test default return value - A = mueller_circdiattenuator(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test equality of providing diattenuation or kx and ky - d = rand(1, 1); - kr = 1; - kl = (1-d)./(1+d); - A1 = mueller_circdiattenuator(d); - A2 = mueller_circdiattenuator(kr, kl); - R = A1-A2; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test serial application of circular diattenuators - kr = rand(1, 1); - kl = rand(1, 1); - A1 = mueller_circdiattenuator(kr,kl); - A2 = mueller_circdiattenuator(kr*kr,kl*kl); - R = A1*A1-A2; - assert(norm(R,inf), 0, 1e-9); - -***** test - % another test of serial application of retarder elements - kr1 = rand(1, 1); - kr2 = rand(1, 1); - kl1 = rand(1, 1); - kl2 = rand(1, 1); - A1 = mueller_circdiattenuator(kr1,kl1); - A2 = mueller_circdiattenuator(kr2,kl2); - A12 = mueller_circdiattenuator(kr1*kr2,kl1*kl2); - R = A1*A2-A12; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test mode - kr = rand(1, 1); - kl = rand(1, 1); - A1 = mueller_circdiattenuator(kr,kl); - A2 = mueller_circdiattenuator(kr,kl,'int'); - A3 = mueller_circdiattenuator(sqrt(kr),sqrt(kl),'amp'); - R1 = A1-A2; - R2 = A1-A3; - assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); - -***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = mueller_circdiattenuator(R); - csize = size(C); - assert(rsize == csize); - end - -***** test - % another test correct size of return values - kr = rand(3,4,5); - kl = rand(5,4,3); - C = mueller_circdiattenuator(kr,kl); - csize = size(C); - assert(csize == [5,4,5]); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/jones_mirror.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_mirror.m -***** test - % test mirror that is its own inverted element - A = jones_mirror(); - R = (A-1\A); - assert(norm(R,inf), 0, 1e-9); - -***** test - % test direct size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - rsize = size(rand(asize)); - U = jones_mirror(rsize); - usize = size(U); - assert(usize == rsize); - end - -***** test - % test indirect size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - C = cell(asize); - csize = size(C); - U = jones_mirror(C); - usize = size(U); - assert(usize == csize); - end - -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_cpleft.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_cpleft.m -***** test - % test default return value - V = jones_cpleft(); - R = V-[1;-1i]; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test return value - amplitude = rand(1, 1); - V = jones_cpleft(amplitude); - R = V-[1;-1i]*amplitude; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = jones_cpleft(R); - csize = size(C); - assert(rsize == csize); - end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_linretarder.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_linretarder.m -***** test - % test default return value - A = jones_linretarder(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test serial application of linear retarder elements - phase = rand(1, 1); - A1 = jones_linretarder(phase); - A2 = jones_linretarder(phase*2); - R = A1*A1-A2; - assert(norm(R,inf), 0, 1e-9); - -***** test - % another test of serial application of retarder elements - phase1 = rand(1, 1); - phase2 = rand(1, 1); - A1 = jones_linretarder(phase1); - A2 = jones_linretarder(phase2); - A12 = jones_linretarder(phase1+phase2); - R = A1*A2-A12; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test mode - phase = rand(1, 1); - A1 = jones_linretarder(phase); - A2 = jones_linretarder(phase*180/pi(), 'deg'); - A3 = jones_linretarder(phase/(2*pi()), 'wav'); - R1 = A1-A2; - R2 = A1-A3; - assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); - -***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = jones_linretarder(R); - csize = size(C); - assert(rsize == csize); - end -5 tests, 5 passed, 0 known failure, 0 skipped [inst/jones_rotate.m] >>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_rotate.m ***** test @@ -4282,164 +3924,65 @@ assert(csize == [4,3,4]); 8 tests, 8 passed, 0 known failure, 0 skipped -[inst/stokes_isstokes.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_isstokes.m -***** test - % test type check - V1 = stokes_unpolarized(); - V2 = char(V1); - t1 = stokes_isstokes(V1); - t2 = stokes_isstokes(V2); - assert(t1 && ~t2); - +[inst/mueller_rotate.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_rotate.m ***** test - % test size check - V1 = stokes_unpolarized(); - V2 = V1; - V2(5,1) = 1; - t1 = stokes_isstokes(V1); - t2 = stokes_isstokes(V2); - assert(t1 && ~t2); + % default return value: unity matrix + A = mueller_rotate(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); ***** test - % test size of return value - V1 = stokes_unpolarized(ones(2,3,4)); - V1{2,2,2} = 0; - V2 = stokes_unpolarized(ones(4,3,2)); - V2{1,1,1} = 0; - t1 = stokes_isstokes(V1); - t2 = stokes_isstokes(V2); - assert((size(t1)==size(V1)) && (size(t2)==size(V2))); + % rotation by 0 should do nothing + delay = rand(1,1); + M = mueller_linretarder(delay); + A = mueller_rotate(M, 0); + R = M-A; + assert(norm(R,inf), 0, 1e-9); ***** test - % test size of return value - V1 = stokes_unpolarized(ones(2,3,4)); - V2 = stokes_unpolarized(1); - [t1,t2] = stokes_isstokes(V1,V2); - assert((size(t1)==size(V1)) && (size(t2)==[1,1])); + % undo rotation by 2nd opposite rotation + delay = rand(1,1); + angle = rand(1, 1); + M = mueller_linretarder(delay); + A1 = mueller_rotate(M, angle); + A2 = mueller_rotate(A1, -angle); + R = A2-M; + assert(norm(R,inf), 0, 1e-9); ***** test - % test indivial elements of return value - V1 = stokes_unpolarized(ones(2,3,4)); - V1{2,2,2} = 0; - V2 = stokes_unpolarized(ones(4,3,2)); - V2{1,1,1} = 0; - t1 = stokes_isstokes(V1); - t2 = stokes_isstokes(V2); - assert(t1(1,1,1) && ~t1(2,2,2) && ~t2(1,1,1) && t2(2,2,2)); -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/jones_intensity.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_intensity.m -***** test - % test size and value of return values - r1 = rand(2,3,4); - V1 = jones_lphorizontal(sqrt(r1)); - r2 = rand(4,3,2); - V2 = jones_lpvertical(sqrt(r2)); - i1 = jones_intensity(V1); - i2 = jones_intensity(V2); - d1 = i1-r1; - d2 = i2-r2; - assert(max(d1(:))+max(d2(:)), 0, 1e-9); + % test serial application of rotation + delay = rand(1,1); + angle1 = rand(1, 1); + angle2 = rand(1, 1); + M = mueller_linretarder(delay); + A1 = mueller_rotate(M, angle1); + A2 = mueller_rotate(A1, angle2); + A12 = mueller_rotate(M, angle1+angle2); + R = A2-A12; + assert(norm(R,inf), 0, 1e-9); ***** test - % test size and value of return values - r1 = rand(2,3,4); - V1 = jones_lphorizontal(sqrt(r1)); - r2 = rand(1,1); - V2 = jones_lpvertical(sqrt(r2)); - [i1,i2] = jones_intensity(V1,V2); - d1 = i1-r1; - d2 = i2-r2; - assert(max(d1(:))+max(d2(:)), 0, 1e-9); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/jones_linpolarizer.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_linpolarizer.m -***** test - % applying an ideal linear polarizer twice is identical to - % apply it once! - A = jones_linpolarizer(); - R = A*A-A; + % testing MODE parameter + angle = rand(1, 1); + A1 = mueller_rotate(mueller_waveplate(0.5), angle, 'rad'); + A2 = mueller_rotate(mueller_waveplate(0.5), angle*180/pi(), 'deg'); + R = A2-A1; assert(norm(R,inf), 0, 1e-9); ***** test - % test direct size parameter + % size of return value determined by 1st argument + angle = rand(1,1); for dim = 1:5 asize = randi([1 4], 1, dim); rsize = size(rand(asize)); - U = jones_linpolarizer(rsize); - usize = size(U); - assert(usize == rsize); - end - -***** test - % test indirect size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - C = cell(asize); + C = mueller_rotate(mueller_unity(rsize), angle); csize = size(C); - U = jones_linpolarizer(C); - usize = size(U); - assert(usize == csize); + assert(rsize == csize); end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_checkmueller.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_checkmueller.m -***** test - % test type check - A1 = mueller_unity(); - A2 = char(A1); - t1 = mueller_checkmueller(A1); - t2 = mueller_checkmueller(A2); - assert(t1 && ~t2); - -***** test - % test size check - A1 = mueller_unity(); - A2 = A1; - A2(5,5) = 1; - t1 = mueller_checkmueller(A1); - t2 = mueller_checkmueller(A2); - assert(t1 && ~t2); - -***** test - % test size of return value - A1 = mueller_mirror([2,3,4]); - A1{2,2,2} = 0; - A2 = mueller_mirror([4,3,2]); - A2{1,1,1} = 0; - t1 = mueller_checkmueller(A1); - t2 = mueller_checkmueller(A2); - assert((size(A1)==size(t1)) && (size(A2)==size(t2))); - -***** test - % test indivial elements of return value - A1 = mueller_mirror([2,3,4]); - A1{2,2,2} = ones(4,4)*0.99; - A2 = mueller_mirror([4,3,2]); - A2{1,1,1} = ones(4,4)*1.01; - t1 = mueller_checkmueller(A1); - t2 = mueller_checkmueller(A2); - assert(t1(1,1,1) && ~t1(2,2,2) && ~t2(1,1,1) && t2(2,2,2)); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/jones_lpminus45.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_lpminus45.m -***** test - % test default return value - V = jones_lpminus45(); - R = V-[1;-1]; - assert(norm(R,inf), 0, 1e-9); - ***** test - % test return value - amplitude = rand(1, 1); - V = jones_lpminus45(amplitude); - R = V-[1;-1]*amplitude; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test correct size of return values + % size if return value determined by 2nd argument for dim = 1:5 asize = randi([1 4], 1, dim); R = rand(asize); @@ -4447,24 +3990,53 @@ R = {R}; end rsize = size(R); - C = jones_lpminus45(R); + C = mueller_rotate(mueller_unity(), R); csize = size(C); assert(rsize == csize); end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/stokes_cpright.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_cpright.m + +***** test + % size if return value determined by both argument + M = mueller_unity([4,3,2]); + angle = rand(2,3,4); + C = mueller_rotate(M, angle); + csize = size(C); + assert(csize == [4,3,4]); + +8 tests, 8 passed, 0 known failure, 0 skipped +[inst/stokes_degpolarization.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_degpolarization.m +***** test + % test size of return values + r1 = rand(2,3,4); + V1 = stokes_unpolarized(r1); + r2 = rand(4,3,2); + V2 = stokes_unpolarized(r2); + [d1,d2] = stokes_degpolarization(V1,V2); + assert((size(d1)==size(r1)) && size(size(d2)==size(r2))); + +***** test + % test return values + r1 = rand(1,1); + V1 = stokes_cpleft(r1)+stokes_unpolarized(1-r1); + r2 = rand(1,1); + V2 = stokes_unpolarized(r2); + [d1,d2] = stokes_degpolarization(V1,V2); + assert((d1==r1) && (d2==0)); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/stokes_lphorizontal.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_lphorizontal.m ***** test % test default return value - V = stokes_cpright(); - R = V-[1;0;0;1]; + V = stokes_lphorizontal(); + R = V-[1;1;0;0]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value intensity = rand(1, 1); - V = stokes_cpright(intensity); - R = V-[1;0;0;1]*intensity; + V = stokes_lphorizontal(intensity); + R = V-[1;1;0;0]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -4476,63 +4048,11 @@ R = {R}; end rsize = size(R); - C = stokes_cpright(R); + C = stokes_lphorizontal(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_waveplate.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_waveplate.m -***** test - % test default return value - A = jones_waveplate(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); -***** test - % test serial application of absorptive elements - delay = rand(1, 1); - A1 = jones_waveplate(delay); - A2 = jones_waveplate(delay*2); - R = A1*A1-A2; - assert(norm(R,inf), 0, 1e-9); -***** test - % another test of serial application of absorptive elements - delay1 = rand(1, 1); - delay2 = rand(1, 1); - A1 = jones_waveplate(delay1); - A2 = jones_waveplate(delay2); - A12 = jones_waveplate(delay1+delay2); - R = A1*A2-A12; - assert(norm(R,inf), 0, 1e-9); -***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = jones_waveplate(R); - csize = size(C); - assert(csize, rsize); - end -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/zernike_polar.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/zernike_polar.m -***** test - r = 0.2; - phi = 1.23; - n = 4; - ret = zernike_polar (r, phi, n); - assert (ret, [1 r*cos(phi) r*sin(phi) 2*r^2-1], 5*eps) -***** test - r = [0.5 0.8]; - phi = [pi/4 pi/4]; - n = 4; - ret = zernike_polar (r, phi, n); - assert (ret, [1 r(1)*cos(phi(1)) r(1)*sin(phi(1)) 2*r(1)^2-1; 1 r(2)*cos(phi(2)) r(2)*sin(phi(2)) 2*r(2)^2-1], 5*eps) -2 tests, 2 passed, 0 known failure, 0 skipped [inst/stokes_intensity.m] >>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_intensity.m ***** test @@ -4554,19 +4074,19 @@ [i1,i2] = stokes_intensity(V1,V2); assert(all(i1==r1) && all(i2==r2)); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/stokes_lpplus45.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_lpplus45.m +[inst/jones_cpleft.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_cpleft.m ***** test % test default return value - V = stokes_lpplus45(); - R = V-[1;0;1;0]; + V = jones_cpleft(); + R = V-[1;-1i]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value - intensity = rand(1, 1); - V = stokes_lpplus45(intensity); - R = V-[1;0;1;0]*intensity; + amplitude = rand(1, 1); + V = jones_cpleft(amplitude); + R = V-[1;-1i]*amplitude; assert(norm(R,inf), 0, 1e-9); ***** test @@ -4578,63 +4098,78 @@ R = {R}; end rsize = size(R); - C = stokes_lpplus45(R); + C = jones_cpleft(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_lindiattenuator.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_lindiattenuator.m +[inst/jones_linpolarizer.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_linpolarizer.m ***** test - % test default return value - A = mueller_lindiattenuator(); + % applying an ideal linear polarizer twice is identical to + % apply it once! + A = jones_linpolarizer(); R = A*A-A; assert(norm(R,inf), 0, 1e-9); ***** test - % test equality of providing diattenuation or kx and ky - d = rand(1, 1); - kx = 1; - ky = (1-d)./(1+d); - A1 = mueller_lindiattenuator(d); - A2 = mueller_lindiattenuator(kx, ky); - R = A1-A2; + % test direct size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + rsize = size(rand(asize)); + U = jones_linpolarizer(rsize); + usize = size(U); + assert(usize == rsize); + end + +***** test + % test indirect size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + C = cell(asize); + csize = size(C); + U = jones_linpolarizer(C); + usize = size(U); + assert(usize == csize); + end + +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/jones_rotator.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_rotator.m +***** test + % test default return value + A = jones_rotator(); + R = A*A-A; assert(norm(R,inf), 0, 1e-9); ***** test - % test serial application of linear diattenuators - kx = rand(1, 1); - ky = rand(1, 1); - A1 = mueller_lindiattenuator(kx,ky); - A2 = mueller_lindiattenuator(kx*kx,ky*ky); + % test serial application of rotator + angle = rand(1, 1); + A1 = jones_rotator(angle); + A2 = jones_rotator(angle*2); R = A1*A1-A2; assert(norm(R,inf), 0, 1e-9); ***** test - % another test of serial application of retarder elements - kx1 = rand(1, 1); - kx2 = rand(1, 1); - ky1 = rand(1, 1); - ky2 = rand(1, 1); - A1 = mueller_lindiattenuator(kx1,ky1); - A2 = mueller_lindiattenuator(kx2,ky2); - A12 = mueller_lindiattenuator(kx1*kx2,ky1*ky2); + % another test of serial application of rotator + angle1 = rand(1, 1); + angle2 = rand(1, 1); + A1 = jones_rotator(angle1); + A2 = jones_rotator(angle2); + A12 = jones_rotator(angle1+angle2); R = A1*A2-A12; assert(norm(R,inf), 0, 1e-9); ***** test - % test mode - kx = rand(1, 1); - ky = rand(1, 1); - A1 = mueller_lindiattenuator(kx,ky); - A2 = mueller_lindiattenuator(kx,ky,'int'); - A3 = mueller_lindiattenuator(sqrt(kx),sqrt(ky),'amp'); - R1 = A1-A2; - R2 = A1-A3; - assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); + % test different angle value interpretations + angle = rand(1, 1); + A1 = jones_rotator(angle); + A2 = jones_rotator(-angle*180/pi(), 'deg'); + R = A2*A1-jones_unity(); + assert(norm(R,inf), 0, 1e-9); ***** test - % test correct size of return values + % test size of return values for dim = 1:5 asize = randi([1 4], 1, dim); R = rand(asize); @@ -4642,97 +4177,114 @@ R = {R}; end rsize = size(R); - C = mueller_lindiattenuator(R); + C = jones_rotator(R); csize = size(C); assert(rsize == csize); end - -***** test - % another test correct size of return values - kx = rand(3,4,5); - ky = rand(5,4,3); - C = mueller_lindiattenuator(kx,ky); - csize = size(C); - assert(csize == [5,4,5]); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/jones_cpright.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_cpright.m +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/stokes_isstokes.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_isstokes.m ***** test - % test default return value - V = jones_cpright(); - R = V-[1;1i]; - assert(norm(R,inf), 0, 1e-9); + % test type check + V1 = stokes_unpolarized(); + V2 = char(V1); + t1 = stokes_isstokes(V1); + t2 = stokes_isstokes(V2); + assert(t1 && ~t2); ***** test - % test return value - amplitude = rand(1, 1); - V = jones_cpright(amplitude); - R = V-[1;1i]*amplitude; - assert(norm(R,inf), 0, 1e-9); + % test size check + V1 = stokes_unpolarized(); + V2 = V1; + V2(5,1) = 1; + t1 = stokes_isstokes(V1); + t2 = stokes_isstokes(V2); + assert(t1 && ~t2); ***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = jones_cpright(R); - csize = size(C); - assert(rsize == csize); - end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_lindiattenuator.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_lindiattenuator.m -***** test - % test default return value - A = jones_lindiattenuator(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); + % test size of return value + V1 = stokes_unpolarized(ones(2,3,4)); + V1{2,2,2} = 0; + V2 = stokes_unpolarized(ones(4,3,2)); + V2{1,1,1} = 0; + t1 = stokes_isstokes(V1); + t2 = stokes_isstokes(V2); + assert((size(t1)==size(V1)) && (size(t2)==size(V2))); ***** test - % test equality of providing diattenuation or kx and ky - d = rand(1, 1); - kx = 1; - ky = (1-d)./(1+d); - A1 = jones_lindiattenuator(d); - A2 = jones_lindiattenuator(kx, ky); - R = A1-A2; - assert(norm(R,inf), 0, 1e-9); + % test size of return value + V1 = stokes_unpolarized(ones(2,3,4)); + V2 = stokes_unpolarized(1); + [t1,t2] = stokes_isstokes(V1,V2); + assert((size(t1)==size(V1)) && (size(t2)==[1,1])); ***** test - % test serial application of linear diattenuators - kx = rand(1, 1); - ky = rand(1, 1); - A1 = jones_lindiattenuator(kx,ky); - A2 = jones_lindiattenuator(kx*kx,ky*ky); - R = A1*A1-A2; - assert(norm(R,inf), 0, 1e-9); - + % test indivial elements of return value + V1 = stokes_unpolarized(ones(2,3,4)); + V1{2,2,2} = 0; + V2 = stokes_unpolarized(ones(4,3,2)); + V2{1,1,1} = 0; + t1 = stokes_isstokes(V1); + t2 = stokes_isstokes(V2); + assert(t1(1,1,1) && ~t1(2,2,2) && ~t2(1,1,1) && t2(2,2,2)); +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/zernike_cartesian.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/zernike_cartesian.m +***** demo + t = linspace (-1, 1, 80); + [x, y] = meshgrid (t, t); + max_order = 16; + Z = zernike_cartesian (x, y, max_order); + for k = 1:max_order + subplot (4, 4, k) + factors = zeros (max_order, 1); + factors(k) = 1; + z = reshape (Z*factors, size (x)); + imagesc (z) + axis ("off", "equal") + zname = strrep (zernike_name (k), " ", "\n"); + title (zname) + endfor +***** demo + n=30; + [x,y,z] = sombrero (n); + z += 0.05 * peaks (x./4, y./4); + z += 0.02 * x; + figure + surf (x, y, z) + title ("Original sombrero + peaks + tilt"); + + ## approximate sombrero+peaks + d = 10; + x /= d; + y /= d; + max_order = 50; + Z = zernike_cartesian (x, y, max_order, false); + f = Z\z(:); + ## create approximated plot + z_approx = reshape (Z * f, n, n); + figure + surf (10 * x, 10 * y, z_approx) + title ("approximated"); +***** assert (zernike_cartesian (0, 0, 1), 1) +***** error (zernike_cartesian (0, 0, 0)) +***** error (zernike_cartesian (0, 0, pi)) +***** error (zernike_cartesian ()) +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/stokes_lpplus45.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_lpplus45.m ***** test - % another test of serial application of retarder elements - kx1 = rand(1, 1); - kx2 = rand(1, 1); - ky1 = rand(1, 1); - ky2 = rand(1, 1); - A1 = jones_lindiattenuator(kx1,ky1); - A2 = jones_lindiattenuator(kx2,ky2); - A12 = jones_lindiattenuator(kx1*kx2,ky1*ky2); - R = A1*A2-A12; + % test default return value + V = stokes_lpplus45(); + R = V-[1;0;1;0]; assert(norm(R,inf), 0, 1e-9); ***** test - % test mode - kx = rand(1, 1); - ky = rand(1, 1); - A1 = jones_lindiattenuator(kx,ky); - A2 = jones_lindiattenuator(kx,ky,'int'); - A3 = jones_lindiattenuator(sqrt(kx),sqrt(ky),'amp'); - R1 = A1-A2; - R2 = A1-A3; - assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); + % test return value + intensity = rand(1, 1); + V = stokes_lpplus45(intensity); + R = V-[1;0;1;0]*intensity; + assert(norm(R,inf), 0, 1e-9); ***** test % test correct size of return values @@ -4743,19 +4295,11 @@ R = {R}; end rsize = size(R); - C = jones_lindiattenuator(R); + C = stokes_lpplus45(R); csize = size(C); assert(rsize == csize); end - -***** test - % another test correct size of return values - kx = rand(3,4,5); - ky = rand(5,4,3); - C = jones_lindiattenuator(kx,ky); - csize = size(C); - assert(csize == [5,4,5]); -7 tests, 7 passed, 0 known failure, 0 skipped +3 tests, 3 passed, 0 known failure, 0 skipped [inst/mueller_circretarder.m] >>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_circretarder.m ***** test @@ -4806,30 +4350,19 @@ assert(rsize == csize); end 5 tests, 5 passed, 0 known failure, 0 skipped -[inst/mueller_waveplate.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_waveplate.m +[inst/stokes_unpolarized.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_unpolarized.m ***** test % test default return value - A = mueller_waveplate(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test serial application of absorptive elements - delay = rand(1, 1); - A1 = mueller_waveplate(delay); - A2 = mueller_waveplate(delay*2); - R = A1*A1-A2; + V = stokes_unpolarized(); + R = V-[1;0;0;0]; assert(norm(R,inf), 0, 1e-9); ***** test - % another test of serial application of absorptive elements - delay1 = rand(1, 1); - delay2 = rand(1, 1); - A1 = mueller_waveplate(delay1); - A2 = mueller_waveplate(delay2); - A12 = mueller_waveplate(delay1+delay2); - R = A1*A2-A12; + % test return value + intensity = rand(1, 1); + V = stokes_unpolarized(intensity); + R = V-[1;0;0;0]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -4841,80 +4374,19 @@ R = {R}; end rsize = size(R); - C = mueller_waveplate(R); + C = stokes_unpolarized(R); csize = size(C); assert(rsize == csize); end -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/mueller_mirror.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_mirror.m -***** test - % test mirror that is its own inverted element - A = mueller_mirror(); - R = (A-1\A); - assert(norm(R,inf), 0, 1e-9); - -***** test - % test direct size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - rsize = size(rand(asize)); - U = mueller_mirror(rsize); - usize = size(U); - assert(usize == rsize); - end - -***** test - % test indirect size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - C = cell(asize); - csize = size(C); - U = mueller_mirror(C); - usize = size(U); - assert(usize == csize); - end - 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/zernike_R_poly.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/zernike_R_poly.m -***** assert (zernike_R_poly (0, 0), [1]) -***** assert (zernike_R_poly (1, 1), [1 0]) -***** assert (zernike_R_poly (0, 2), [2 0 -1]) -***** assert (zernike_R_poly (2, 2), [1 0 0]) -***** assert (zernike_R_poly (1, 3), [3 0 -2 0]) -***** assert (zernike_R_poly (3, 3), [1 0 0 0]) -***** assert (zernike_R_poly (0, 4), [6 0 -6 0 1]) -***** assert (zernike_R_poly (2, 4), [4 0 -3 0 0]) -***** assert (zernike_R_poly (4, 4), [1 0 0 0 0]) -***** assert (zernike_R_poly (1, 5), [10 0 -12 0 3 0]) -***** assert (zernike_R_poly (3, 5), [5 0 -4 0 0 0]) -***** assert (zernike_R_poly (5, 5), [1 0 0 0 0 0]) -***** assert (zernike_R_poly (0, 6), [20 0 -30 0 12 0 -1]) -***** assert (zernike_R_poly (2, 6), [15 0 -20 0 6 0 0]) -***** assert (zernike_R_poly (4, 6), [ 6 0 -5 0 0 0 0]) -***** assert (zernike_R_poly (6, 6), [ 1 0 0 0 0 0 0]) -16 tests, 16 passed, 0 known failure, 0 skipped -[inst/stokes_degpolarization.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_degpolarization.m -***** test - % test size of return values - r1 = rand(2,3,4); - V1 = stokes_unpolarized(r1); - r2 = rand(4,3,2); - V2 = stokes_unpolarized(r2); - [d1,d2] = stokes_degpolarization(V1,V2); - assert((size(d1)==size(r1)) && size(size(d2)==size(r2))); - -***** test - % test return values - r1 = rand(1,1); - V1 = stokes_cpleft(r1)+stokes_unpolarized(1-r1); - r2 = rand(1,1); - V2 = stokes_unpolarized(r2); - [d1,d2] = stokes_degpolarization(V1,V2); - assert((d1==r1) && (d2==0)); -2 tests, 2 passed, 0 known failure, 0 skipped +[inst/zernike_name.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/zernike_name.m +***** assert (zernike_name (4), "defocus") +***** assert (zernike_name (22), "-") +***** error (zernike_name (0)) +***** error (zernike_name ([1 2])) +***** error (zernike_name (pi)) +5 tests, 5 passed, 0 known failure, 0 skipped [inst/mueller_homogeneous_elliptic_retarder.m] >>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_homogeneous_elliptic_retarder.m ***** test @@ -4946,19 +4418,19 @@ csize = size(C); assert(csize == [6,5,6]); 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/stokes_cpleft.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_cpleft.m +[inst/jones_cpright.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_cpright.m ***** test % test default return value - V = stokes_cpleft(); - R = V-[1;0;0;-1]; + V = jones_cpright(); + R = V-[1;1i]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value - intensity = rand(1, 1); - V = stokes_cpleft(intensity); - R = V-[1;0;0;-1]*intensity; + amplitude = rand(1, 1); + V = jones_cpright(amplitude); + R = V-[1;1i]*amplitude; assert(norm(R,inf), 0, 1e-9); ***** test @@ -4970,7 +4442,7 @@ R = {R}; end rsize = size(R); - C = stokes_cpleft(R); + C = jones_cpright(R); csize = size(C); assert(rsize == csize); end @@ -5067,149 +4539,121 @@ % example 3: send light with horizontal linear polarization through % rotating waveplates with increasing delay and subsequent polarizer 4 tests, 4 passed, 0 known failure, 0 skipped -[inst/stokes_lpvertical.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_lpvertical.m +[inst/zernike_noll_to_mn.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/zernike_noll_to_mn.m ***** test - % test default return value - V = stokes_lpvertical(); - R = V-[1;-1;0;0]; - assert(norm(R,inf), 0, 1e-9); - + [m,n]=zernike_noll_to_mn(1); + assert([m n],[0 0]) ***** test - % test return value - intensity = rand(1, 1); - V = stokes_lpvertical(intensity); - R = V-[1;-1;0;0]*intensity; - assert(norm(R,inf), 0, 1e-9); - + [m,n]=zernike_noll_to_mn(2); + assert([m n],[1 1]) ***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = stokes_lpvertical(R); - csize = size(C); - assert(rsize == csize); - end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_lpplus45.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_lpplus45.m + [m,n]=zernike_noll_to_mn(3); + assert([m n],[-1 1]) ***** test - % test default return value - V = jones_lpplus45(); - R = V-[1;1]; - assert(norm(R,inf), 0, 1e-9); - + [m,n]=zernike_noll_to_mn(4); + assert([m n],[0 2]) ***** test - % test return value - amplitude = rand(1, 1); - V = jones_lpplus45(amplitude); - R = V-[1;1]*amplitude; - assert(norm(R,inf), 0, 1e-9); - + [m,n]=zernike_noll_to_mn(5); + assert([m n],[-2 2]) ***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = jones_lpplus45(R); - csize = size(C); - assert(rsize == csize); - end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_unity.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_unity.m + [m,n]=zernike_noll_to_mn(20); + assert([m n],[5 5]) ***** test - A = jones_unity(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - + [m,n]=zernike_noll_to_mn(34); + assert([m n],[5 7]) ***** test - for dim = 1:5 - asize = randi([1 4], 1, dim); - C = cell(asize); - csize = size(C); - U = jones_unity(C); - usize = size(U); - assert(usize == csize); - end - + [m,n]=zernike_noll_to_mn(35); + assert([m n],[-7 7]) ***** test - for dim = 1:5 - asize = randi([1 4], 1, dim); - rsize = size(rand(asize)); - U = jones_unity(rsize); - usize = size(U); - assert(usize == rsize); - end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_rotate.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_rotate.m + [m,n]=zernike_noll_to_mn(36); + assert([m n],[7 7]) ***** test - % default return value: unity matrix - A = mueller_rotate(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); + [m,n]=zernike_noll_to_mn([2 5 8 35]); + assert(m,[1 -2 1 -7]) + assert(n,[1 2 3 7]) +10 tests, 10 passed, 0 known failure, 0 skipped +[inst/jones_intensity.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_intensity.m +***** test + % test size and value of return values + r1 = rand(2,3,4); + V1 = jones_lphorizontal(sqrt(r1)); + r2 = rand(4,3,2); + V2 = jones_lpvertical(sqrt(r2)); + i1 = jones_intensity(V1); + i2 = jones_intensity(V2); + d1 = i1-r1; + d2 = i2-r2; + assert(max(d1(:))+max(d2(:)), 0, 1e-9); ***** test - % rotation by 0 should do nothing - delay = rand(1,1); - M = mueller_linretarder(delay); - A = mueller_rotate(M, 0); - R = M-A; - assert(norm(R,inf), 0, 1e-9); + % test size and value of return values + r1 = rand(2,3,4); + V1 = jones_lphorizontal(sqrt(r1)); + r2 = rand(1,1); + V2 = jones_lpvertical(sqrt(r2)); + [i1,i2] = jones_intensity(V1,V2); + d1 = i1-r1; + d2 = i2-r2; + assert(max(d1(:))+max(d2(:)), 0, 1e-9); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/mueller_ismueller.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_ismueller.m +***** test + % test type check + A1 = mueller_unity(); + A2 = char(A1); + t1 = mueller_ismueller(A1); + t2 = mueller_ismueller(A2); + assert(t1 && ~t2); ***** test - % undo rotation by 2nd opposite rotation - delay = rand(1,1); - angle = rand(1, 1); - M = mueller_linretarder(delay); - A1 = mueller_rotate(M, angle); - A2 = mueller_rotate(A1, -angle); - R = A2-M; - assert(norm(R,inf), 0, 1e-9); + % test size check + A1 = mueller_unity(); + A2 = A1; + A2(5,5) = 1; + t1 = mueller_ismueller(A1); + t2 = mueller_ismueller(A2); + assert(t1 && ~t2); ***** test - % test serial application of rotation - delay = rand(1,1); - angle1 = rand(1, 1); - angle2 = rand(1, 1); - M = mueller_linretarder(delay); - A1 = mueller_rotate(M, angle1); - A2 = mueller_rotate(A1, angle2); - A12 = mueller_rotate(M, angle1+angle2); - R = A2-A12; - assert(norm(R,inf), 0, 1e-9); + % test size of return value + A1 = mueller_mirror([2,3,4]); + A1{2,2,2} = 0; + A2 = mueller_mirror([4,3,2]); + A2{1,1,1} = 0; + t1 = mueller_ismueller(A1); + t2 = mueller_ismueller(A2); + assert((size(A1)==size(t1)) && (size(A2)==size(t2))); ***** test - % testing MODE parameter - angle = rand(1, 1); - A1 = mueller_rotate(mueller_waveplate(0.5), angle, 'rad'); - A2 = mueller_rotate(mueller_waveplate(0.5), angle*180/pi(), 'deg'); - R = A2-A1; + % test indivial elements of return value + A1 = mueller_mirror([2,3,4]); + A1{2,2,2} = 0; + A2 = mueller_mirror([4,3,2]); + A2{1,1,1} = 0; + t1 = mueller_ismueller(A1); + t2 = mueller_ismueller(A2); + assert(t1(1,1,1) && ~t1(2,2,2) && ~t2(1,1,1) && t2(2,2,2)); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/jones_lpplus45.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_lpplus45.m +***** test + % test default return value + V = jones_lpplus45(); + R = V-[1;1]; assert(norm(R,inf), 0, 1e-9); ***** test - % size of return value determined by 1st argument - angle = rand(1,1); - for dim = 1:5 - asize = randi([1 4], 1, dim); - rsize = size(rand(asize)); - C = mueller_rotate(mueller_unity(rsize), angle); - csize = size(C); - assert(rsize == csize); - end + % test return value + amplitude = rand(1, 1); + V = jones_lpplus45(amplitude); + R = V-[1;1]*amplitude; + assert(norm(R,inf), 0, 1e-9); ***** test - % size if return value determined by 2nd argument + % test correct size of return values for dim = 1:5 asize = randi([1 4], 1, dim); R = rand(asize); @@ -5217,76 +4661,10 @@ R = {R}; end rsize = size(R); - C = mueller_rotate(mueller_unity(), R); + C = jones_lpplus45(R); csize = size(C); assert(rsize == csize); end - -***** test - % size if return value determined by both argument - M = mueller_unity([4,3,2]); - angle = rand(2,3,4); - C = mueller_rotate(M, angle); - csize = size(C); - assert(csize == [4,3,4]); - -8 tests, 8 passed, 0 known failure, 0 skipped -[inst/mueller_unity.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_unity.m -***** test - A = mueller_unity(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - -***** test - for dim = 1:5 - asize = randi([1 4], 1, dim); - C = cell(asize); - csize = size(C); - U = mueller_unity(C); - usize = size(U); - assert(usize == csize); - end - -***** test - for dim = 1:5 - asize = randi([1 4], 1, dim); - rsize = size(rand(asize)); - U = mueller_unity(rsize); - usize = size(U); - assert(usize == rsize); - end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_linpolarizer.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_linpolarizer.m -***** test - % applying a linear polarizer twice is identical to - % apply it once! - A = mueller_linpolarizer(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test direct size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - rsize = size(rand(asize)); - U = mueller_linpolarizer(rsize); - usize = size(U); - assert(usize == rsize); - end - -***** test - % test indirect size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - C = cell(asize); - csize = size(C); - U = mueller_linpolarizer(C); - usize = size(U); - assert(usize == csize); - end - 3 tests, 3 passed, 0 known failure, 0 skipped [inst/jones.m] >>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones.m @@ -5380,19 +4758,48 @@ % example 3: send light with horizontal linear polarization through % rotating waveplates with increasing delay and subsequent polarizer 4 tests, 4 passed, 0 known failure, 0 skipped -[inst/stokes_lpminus45.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_lpminus45.m +[inst/mueller_homogeneous_elliptic_diattenuator.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_homogeneous_elliptic_diattenuator.m ***** test % test default return value - V = stokes_lpminus45(); - R = V-[1;0;-1;0]; + A = mueller_homogeneous_elliptic_diattenuator(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test modes + t0 = rand(1,1); + d = rand(1,1); + azimuth = rand(1,1); + ellipticity = rand(1,1); + A1 = mueller_homogeneous_elliptic_diattenuator(t0,d,azimuth,ellipticity); + A2 = mueller_homogeneous_elliptic_diattenuator(t0,d,azimuth*180/pi(),ellipticity,'deg'); + R = (A2-A1); + assert(norm(R,inf), 0, 1e-9); + +***** test + % another test correct size of return values + t0 = rand(3,4,5); + d = rand(4,5,6); + azimuth = rand(5,4,3); + ellipticity = rand(6,5,4); + C = mueller_homogeneous_elliptic_diattenuator(t0,d,azimuth,ellipticity); + csize = size(C); + assert(csize == [6,5,6]); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/stokes_cpleft.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_cpleft.m +***** test + % test default return value + V = stokes_cpleft(); + R = V-[1;0;0;-1]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value intensity = rand(1, 1); - V = stokes_lpminus45(intensity); - R = V-[1;0;-1;0]*intensity; + V = stokes_cpleft(intensity); + R = V-[1;0;0;-1]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -5404,24 +4811,54 @@ R = {R}; end rsize = size(R); - C = stokes_lpminus45(R); + C = stokes_cpleft(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_lpvertical.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_lpvertical.m +[inst/mueller_mirror.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_mirror.m +***** test + % test mirror that is its own inverted element + A = mueller_mirror(); + R = (A-1\A); + assert(norm(R,inf), 0, 1e-9); + +***** test + % test direct size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + rsize = size(rand(asize)); + U = mueller_mirror(rsize); + usize = size(U); + assert(usize == rsize); + end + +***** test + % test indirect size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + C = cell(asize); + csize = size(C); + U = mueller_mirror(C); + usize = size(U); + assert(usize == csize); + end + +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/stokes_lpminus45.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_lpminus45.m ***** test % test default return value - V = jones_lpvertical(); - R = V-[0;1]; + V = stokes_lpminus45(); + R = V-[1;0;-1;0]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value - amplitude = rand(1, 1); - V = jones_lpvertical(amplitude); - R = V-[0;1]*amplitude; + intensity = rand(1, 1); + V = stokes_lpminus45(intensity); + R = V-[1;0;-1;0]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -5433,7 +4870,7 @@ R = {R}; end rsize = size(R); - C = jones_lpvertical(R); + C = stokes_lpminus45(R); csize = size(C); assert(rsize == csize); end @@ -5478,6 +4915,56 @@ assert(rsize == csize); end 4 tests, 4 passed, 0 known failure, 0 skipped +[inst/mueller_linretarder.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_linretarder.m +***** test + % test default return value + A = mueller_linretarder(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test serial application of linear retarder elements + phase = rand(1, 1); + A1 = mueller_linretarder(phase); + A2 = mueller_linretarder(phase*2); + R = A1*A1-A2; + assert(norm(R,inf), 0, 1e-9); + +***** test + % another test of serial application of retarder elements + phase1 = rand(1, 1); + phase2 = rand(1, 1); + A1 = mueller_linretarder(phase1); + A2 = mueller_linretarder(phase2); + A12 = mueller_linretarder(phase1+phase2); + R = A1*A2-A12; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test mode + phase = rand(1, 1); + A1 = mueller_linretarder(phase); + A2 = mueller_linretarder(phase*180/pi(), 'deg'); + A3 = mueller_linretarder(phase/(2*pi()), 'wav'); + R1 = A1-A2; + R2 = A1-A3; + assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); + +***** test + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = mueller_linretarder(R); + csize = size(C); + assert(rsize == csize); + end +5 tests, 5 passed, 0 known failure, 0 skipped [inst/mueller_rotator.m] >>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_rotator.m ***** test @@ -5526,19 +5013,19 @@ assert(rsize == csize); end 5 tests, 5 passed, 0 known failure, 0 skipped -[inst/stokes_lphorizontal.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_lphorizontal.m +[inst/stokes_lpvertical.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_lpvertical.m ***** test % test default return value - V = stokes_lphorizontal(); - R = V-[1;1;0;0]; + V = stokes_lpvertical(); + R = V-[1;-1;0;0]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value intensity = rand(1, 1); - V = stokes_lphorizontal(intensity); - R = V-[1;1;0;0]*intensity; + V = stokes_lpvertical(intensity); + R = V-[1;-1;0;0]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -5550,53 +5037,35 @@ R = {R}; end rsize = size(R); - C = stokes_lphorizontal(R); + C = stokes_lpvertical(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_homogeneous_elliptic_diattenuator.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_homogeneous_elliptic_diattenuator.m +[inst/mueller_absorber.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_absorber.m ***** test % test default return value - A = mueller_homogeneous_elliptic_diattenuator(); + A = mueller_absorber(); R = A*A-A; assert(norm(R,inf), 0, 1e-9); ***** test - % test modes - t0 = rand(1,1); - d = rand(1,1); - azimuth = rand(1,1); - ellipticity = rand(1,1); - A1 = mueller_homogeneous_elliptic_diattenuator(t0,d,azimuth,ellipticity); - A2 = mueller_homogeneous_elliptic_diattenuator(t0,d,azimuth*180/pi(),ellipticity,'deg'); - R = (A2-A1); - assert(norm(R,inf), 0, 1e-9); - -***** test - % another test correct size of return values - t0 = rand(3,4,5); - d = rand(4,5,6); - azimuth = rand(5,4,3); - ellipticity = rand(6,5,4); - C = mueller_homogeneous_elliptic_diattenuator(t0,d,azimuth,ellipticity); - csize = size(C); - assert(csize == [6,5,6]); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/stokes_unpolarized.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_unpolarized.m -***** test - % test default return value - V = stokes_unpolarized(); - R = V-[1;0;0;0]; + % test serial appliation of absorptive elements + absorption = rand(1, 1); + A1 = mueller_absorber(absorption); + A2 = mueller_absorber(1-(1-absorption)^2); + R = A1*A1-A2; assert(norm(R,inf), 0, 1e-9); ***** test - % test return value - intensity = rand(1, 1); - V = stokes_unpolarized(intensity); - R = V-[1;0;0;0]*intensity; + % another test of serial appliation of absorptive elements + absorption1 = rand(1, 1); + absorption2 = rand(1, 1); + A1 = mueller_absorber(absorption1); + A2 = mueller_absorber(absorption2); + A12 = mueller_absorber(1-((1-absorption1)*(1-absorption2))); + R = A1*A2-A12; assert(norm(R,inf), 0, 1e-9); ***** test @@ -5608,24 +5077,24 @@ R = {R}; end rsize = size(R); - C = stokes_unpolarized(R); + C = mueller_absorber(R); csize = size(C); assert(rsize == csize); end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_lphorizontal.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_lphorizontal.m +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/jones_lpvertical.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_lpvertical.m ***** test % test default return value - V = jones_lphorizontal(); - R = V-[1;0]; + V = jones_lpvertical(); + R = V-[0;1]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value amplitude = rand(1, 1); - V = jones_lphorizontal(amplitude); - R = V-[1;0]*amplitude; + V = jones_lpvertical(amplitude); + R = V-[0;1]*amplitude; assert(norm(R,inf), 0, 1e-9); ***** test @@ -5637,24 +5106,24 @@ R = {R}; end rsize = size(R); - C = jones_lphorizontal(R); + C = jones_lpvertical(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_linretarder.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_linretarder.m +[inst/jones_linretarder.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_linretarder.m ***** test % test default return value - A = mueller_linretarder(); + A = jones_linretarder(); R = A*A-A; assert(norm(R,inf), 0, 1e-9); ***** test % test serial application of linear retarder elements phase = rand(1, 1); - A1 = mueller_linretarder(phase); - A2 = mueller_linretarder(phase*2); + A1 = jones_linretarder(phase); + A2 = jones_linretarder(phase*2); R = A1*A1-A2; assert(norm(R,inf), 0, 1e-9); @@ -5662,18 +5131,18 @@ % another test of serial application of retarder elements phase1 = rand(1, 1); phase2 = rand(1, 1); - A1 = mueller_linretarder(phase1); - A2 = mueller_linretarder(phase2); - A12 = mueller_linretarder(phase1+phase2); + A1 = jones_linretarder(phase1); + A2 = jones_linretarder(phase2); + A12 = jones_linretarder(phase1+phase2); R = A1*A2-A12; assert(norm(R,inf), 0, 1e-9); ***** test % test mode phase = rand(1, 1); - A1 = mueller_linretarder(phase); - A2 = mueller_linretarder(phase*180/pi(), 'deg'); - A3 = mueller_linretarder(phase/(2*pi()), 'wav'); + A1 = jones_linretarder(phase); + A2 = jones_linretarder(phase*180/pi(), 'deg'); + A3 = jones_linretarder(phase/(2*pi()), 'wav'); R1 = A1-A2; R2 = A1-A3; assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); @@ -5687,19 +5156,271 @@ R = {R}; end rsize = size(R); - C = mueller_linretarder(R); + C = jones_linretarder(R); csize = size(C); assert(rsize == csize); end 5 tests, 5 passed, 0 known failure, 0 skipped -[inst/mueller_ismueller.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_ismueller.m +[inst/jones_waveplate.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_waveplate.m +***** test + % test default return value + A = jones_waveplate(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); +***** test + % test serial application of absorptive elements + delay = rand(1, 1); + A1 = jones_waveplate(delay); + A2 = jones_waveplate(delay*2); + R = A1*A1-A2; + assert(norm(R,inf), 0, 1e-9); +***** test + % another test of serial application of absorptive elements + delay1 = rand(1, 1); + delay2 = rand(1, 1); + A1 = jones_waveplate(delay1); + A2 = jones_waveplate(delay2); + A12 = jones_waveplate(delay1+delay2); + R = A1*A2-A12; + assert(norm(R,inf), 0, 1e-9); +***** test + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = jones_waveplate(R); + csize = size(C); + assert(csize, rsize); + end +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/jones_lindiattenuator.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_lindiattenuator.m +***** test + % test default return value + A = jones_lindiattenuator(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test equality of providing diattenuation or kx and ky + d = rand(1, 1); + kx = 1; + ky = (1-d)./(1+d); + A1 = jones_lindiattenuator(d); + A2 = jones_lindiattenuator(kx, ky); + R = A1-A2; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test serial application of linear diattenuators + kx = rand(1, 1); + ky = rand(1, 1); + A1 = jones_lindiattenuator(kx,ky); + A2 = jones_lindiattenuator(kx*kx,ky*ky); + R = A1*A1-A2; + assert(norm(R,inf), 0, 1e-9); + +***** test + % another test of serial application of retarder elements + kx1 = rand(1, 1); + kx2 = rand(1, 1); + ky1 = rand(1, 1); + ky2 = rand(1, 1); + A1 = jones_lindiattenuator(kx1,ky1); + A2 = jones_lindiattenuator(kx2,ky2); + A12 = jones_lindiattenuator(kx1*kx2,ky1*ky2); + R = A1*A2-A12; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test mode + kx = rand(1, 1); + ky = rand(1, 1); + A1 = jones_lindiattenuator(kx,ky); + A2 = jones_lindiattenuator(kx,ky,'int'); + A3 = jones_lindiattenuator(sqrt(kx),sqrt(ky),'amp'); + R1 = A1-A2; + R2 = A1-A3; + assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); + +***** test + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = jones_lindiattenuator(R); + csize = size(C); + assert(rsize == csize); + end + +***** test + % another test correct size of return values + kx = rand(3,4,5); + ky = rand(5,4,3); + C = jones_lindiattenuator(kx,ky); + csize = size(C); + assert(csize == [5,4,5]); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/stokes_cpright.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/stokes_cpright.m +***** test + % test default return value + V = stokes_cpright(); + R = V-[1;0;0;1]; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test return value + intensity = rand(1, 1); + V = stokes_cpright(intensity); + R = V-[1;0;0;1]*intensity; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = stokes_cpright(R); + csize = size(C); + assert(rsize == csize); + end +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/mueller_waveplate.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_waveplate.m +***** test + % test default return value + A = mueller_waveplate(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test serial application of absorptive elements + delay = rand(1, 1); + A1 = mueller_waveplate(delay); + A2 = mueller_waveplate(delay*2); + R = A1*A1-A2; + assert(norm(R,inf), 0, 1e-9); + +***** test + % another test of serial application of absorptive elements + delay1 = rand(1, 1); + delay2 = rand(1, 1); + A1 = mueller_waveplate(delay1); + A2 = mueller_waveplate(delay2); + A12 = mueller_waveplate(delay1+delay2); + R = A1*A2-A12; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = mueller_waveplate(R); + csize = size(C); + assert(rsize == csize); + end +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/jones_mirror.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_mirror.m +***** test + % test mirror that is its own inverted element + A = jones_mirror(); + R = (A-1\A); + assert(norm(R,inf), 0, 1e-9); + +***** test + % test direct size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + rsize = size(rand(asize)); + U = jones_mirror(rsize); + usize = size(U); + assert(usize == rsize); + end + +***** test + % test indirect size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + C = cell(asize); + csize = size(C); + U = jones_mirror(C); + usize = size(U); + assert(usize == csize); + end + +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/jones_lpminus45.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_lpminus45.m +***** test + % test default return value + V = jones_lpminus45(); + R = V-[1;-1]; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test return value + amplitude = rand(1, 1); + V = jones_lpminus45(amplitude); + R = V-[1;-1]*amplitude; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = jones_lpminus45(R); + csize = size(C); + assert(rsize == csize); + end +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/zernike_polar.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/zernike_polar.m +***** test + r = 0.2; + phi = 1.23; + n = 4; + ret = zernike_polar (r, phi, n); + assert (ret, [1 r*cos(phi) r*sin(phi) 2*r^2-1], 5*eps) +***** test + r = [0.5 0.8]; + phi = [pi/4 pi/4]; + n = 4; + ret = zernike_polar (r, phi, n); + assert (ret, [1 r(1)*cos(phi(1)) r(1)*sin(phi(1)) 2*r(1)^2-1; 1 r(2)*cos(phi(2)) r(2)*sin(phi(2)) 2*r(2)^2-1], 5*eps) +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/mueller_checkmueller.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_checkmueller.m ***** test % test type check A1 = mueller_unity(); A2 = char(A1); - t1 = mueller_ismueller(A1); - t2 = mueller_ismueller(A2); + t1 = mueller_checkmueller(A1); + t2 = mueller_checkmueller(A2); assert(t1 && ~t2); ***** test @@ -5707,8 +5428,8 @@ A1 = mueller_unity(); A2 = A1; A2(5,5) = 1; - t1 = mueller_ismueller(A1); - t2 = mueller_ismueller(A2); + t1 = mueller_checkmueller(A1); + t2 = mueller_checkmueller(A2); assert(t1 && ~t2); ***** test @@ -5717,47 +5438,208 @@ A1{2,2,2} = 0; A2 = mueller_mirror([4,3,2]); A2{1,1,1} = 0; - t1 = mueller_ismueller(A1); - t2 = mueller_ismueller(A2); + t1 = mueller_checkmueller(A1); + t2 = mueller_checkmueller(A2); assert((size(A1)==size(t1)) && (size(A2)==size(t2))); ***** test % test indivial elements of return value A1 = mueller_mirror([2,3,4]); - A1{2,2,2} = 0; + A1{2,2,2} = ones(4,4)*0.99; A2 = mueller_mirror([4,3,2]); - A2{1,1,1} = 0; - t1 = mueller_ismueller(A1); - t2 = mueller_ismueller(A2); + A2{1,1,1} = ones(4,4)*1.01; + t1 = mueller_checkmueller(A1); + t2 = mueller_checkmueller(A2); assert(t1(1,1,1) && ~t1(2,2,2) && ~t2(1,1,1) && t2(2,2,2)); 4 tests, 4 passed, 0 known failure, 0 skipped -[inst/mueller_absorber.m] ->>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_absorber.m +[inst/zernike_osa_ansi_to_mn.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/zernike_osa_ansi_to_mn.m +***** test + [m,n]=zernike_osa_ansi_to_mn(0); + assert([m n],[0 0]) + [m,n]=zernike_osa_ansi_to_mn(1); + assert([m n],[-1 1]) + [m,n]=zernike_osa_ansi_to_mn(2); + assert([m n],[1 1]) + [m,n]=zernike_osa_ansi_to_mn(3); + assert([m n],[-2 2]) + [m,n]=zernike_osa_ansi_to_mn(4); + assert([m n],[0 2]) + [m,n]=zernike_osa_ansi_to_mn(5); + assert([m n],[2 2]) + [m,n]=zernike_osa_ansi_to_mn(6); + assert([m n],[-3 3]) + [m,n]=zernike_osa_ansi_to_mn(7); + assert([m n],[-1 3]) + [m,n]=zernike_osa_ansi_to_mn(8); + assert([m n],[1 3]) + [m,n]=zernike_osa_ansi_to_mn(9); + assert([m n],[3 3]) + [m,n]=zernike_osa_ansi_to_mn(10); + assert([m n],[-4 4]) + [m,n]=zernike_osa_ansi_to_mn(11); + assert([m n],[-2 4]) + [m,n]=zernike_osa_ansi_to_mn(12); + assert([m n],[0 4]) + [m,n]=zernike_osa_ansi_to_mn(13); + assert([m n],[2 4]) + [m,n]=zernike_osa_ansi_to_mn(14); + assert([m n],[4 4]) + [m,n]=zernike_osa_ansi_to_mn(15); + assert([m n],[-5 5]) + [m,n]=zernike_osa_ansi_to_mn(16); + assert([m n],[-3 5]) + [m,n]=zernike_osa_ansi_to_mn(17); + assert([m n],[-1 5]) + [m,n]=zernike_osa_ansi_to_mn(18); + assert([m n],[1 5]) + [m,n]=zernike_osa_ansi_to_mn(19); + assert([m n],[3 5]) + [m,n]=zernike_osa_ansi_to_mn(20); + assert([m n],[5 5]) + [m,n]=zernike_osa_ansi_to_mn(21); + assert([m n],[-6 6]) + [m,n]=zernike_osa_ansi_to_mn(22); + assert([m n],[-4 6]) + [m,n]=zernike_osa_ansi_to_mn(23); + assert([m n],[-2 6]) + [m,n]=zernike_osa_ansi_to_mn(24); + assert([m n],[0 6]) + [m,n]=zernike_osa_ansi_to_mn(25); + assert([m n],[2 6]) + [m,n]=zernike_osa_ansi_to_mn(26); + assert([m n],[4 6]) + [m,n]=zernike_osa_ansi_to_mn(27); + assert([m n],[6 6]) + [m,n]=zernike_osa_ansi_to_mn(28); + assert([m n],[-7 7]) + [m,n]=zernike_osa_ansi_to_mn(29); + assert([m n],[-5 7]) + [m,n]=zernike_osa_ansi_to_mn(30); + assert([m n],[-3 7]) + [m,n]=zernike_osa_ansi_to_mn(31); + assert([m n],[-1 7]) + [m,n]=zernike_osa_ansi_to_mn(32); + assert([m n],[1 7]) + [m,n]=zernike_osa_ansi_to_mn(33); + assert([m n],[3 7]) + [m,n]=zernike_osa_ansi_to_mn(34); + assert([m n],[5 7]) + [m,n]=zernike_osa_ansi_to_mn(35); + assert([m n],[7 7]) +***** test + [m,n]=zernike_osa_ansi_to_mn([2 7 15 35]); + assert(m,[1 -1 -5 7]) + assert(n,[1 3 5 7]) +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/jones_unity.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_unity.m +***** test + A = jones_unity(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + for dim = 1:5 + asize = randi([1 4], 1, dim); + C = cell(asize); + csize = size(C); + U = jones_unity(C); + usize = size(U); + assert(usize == csize); + end + +***** test + for dim = 1:5 + asize = randi([1 4], 1, dim); + rsize = size(rand(asize)); + U = jones_unity(rsize); + usize = size(U); + assert(usize == rsize); + end +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/mueller_linpolarizer.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_linpolarizer.m +***** test + % applying a linear polarizer twice is identical to + % apply it once! + A = mueller_linpolarizer(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test direct size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + rsize = size(rand(asize)); + U = mueller_linpolarizer(rsize); + usize = size(U); + assert(usize == rsize); + end + +***** test + % test indirect size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + C = cell(asize); + csize = size(C); + U = mueller_linpolarizer(C); + usize = size(U); + assert(usize == csize); + end + +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/mueller_circdiattenuator.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_circdiattenuator.m ***** test % test default return value - A = mueller_absorber(); + A = mueller_circdiattenuator(); R = A*A-A; assert(norm(R,inf), 0, 1e-9); ***** test - % test serial appliation of absorptive elements - absorption = rand(1, 1); - A1 = mueller_absorber(absorption); - A2 = mueller_absorber(1-(1-absorption)^2); + % test equality of providing diattenuation or kx and ky + d = rand(1, 1); + kr = 1; + kl = (1-d)./(1+d); + A1 = mueller_circdiattenuator(d); + A2 = mueller_circdiattenuator(kr, kl); + R = A1-A2; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test serial application of circular diattenuators + kr = rand(1, 1); + kl = rand(1, 1); + A1 = mueller_circdiattenuator(kr,kl); + A2 = mueller_circdiattenuator(kr*kr,kl*kl); R = A1*A1-A2; assert(norm(R,inf), 0, 1e-9); ***** test - % another test of serial appliation of absorptive elements - absorption1 = rand(1, 1); - absorption2 = rand(1, 1); - A1 = mueller_absorber(absorption1); - A2 = mueller_absorber(absorption2); - A12 = mueller_absorber(1-((1-absorption1)*(1-absorption2))); + % another test of serial application of retarder elements + kr1 = rand(1, 1); + kr2 = rand(1, 1); + kl1 = rand(1, 1); + kl2 = rand(1, 1); + A1 = mueller_circdiattenuator(kr1,kl1); + A2 = mueller_circdiattenuator(kr2,kl2); + A12 = mueller_circdiattenuator(kr1*kr2,kl1*kl2); R = A1*A2-A12; assert(norm(R,inf), 0, 1e-9); ***** test + % test mode + kr = rand(1, 1); + kl = rand(1, 1); + A1 = mueller_circdiattenuator(kr,kl); + A2 = mueller_circdiattenuator(kr,kl,'int'); + A3 = mueller_circdiattenuator(sqrt(kr),sqrt(kl),'amp'); + R1 = A1-A2; + R2 = A1-A3; + assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); + +***** test % test correct size of return values for dim = 1:5 asize = randi([1 4], 1, dim); @@ -5766,11 +5648,165 @@ R = {R}; end rsize = size(R); - C = mueller_absorber(R); + C = mueller_circdiattenuator(R); csize = size(C); assert(rsize == csize); end -4 tests, 4 passed, 0 known failure, 0 skipped + +***** test + % another test correct size of return values + kr = rand(3,4,5); + kl = rand(5,4,3); + C = mueller_circdiattenuator(kr,kl); + csize = size(C); + assert(csize == [5,4,5]); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/jones_lphorizontal.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/jones_lphorizontal.m +***** test + % test default return value + V = jones_lphorizontal(); + R = V-[1;0]; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test return value + amplitude = rand(1, 1); + V = jones_lphorizontal(amplitude); + R = V-[1;0]*amplitude; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = jones_lphorizontal(R); + csize = size(C); + assert(rsize == csize); + end +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/mueller_lindiattenuator.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_lindiattenuator.m +***** test + % test default return value + A = mueller_lindiattenuator(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test equality of providing diattenuation or kx and ky + d = rand(1, 1); + kx = 1; + ky = (1-d)./(1+d); + A1 = mueller_lindiattenuator(d); + A2 = mueller_lindiattenuator(kx, ky); + R = A1-A2; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test serial application of linear diattenuators + kx = rand(1, 1); + ky = rand(1, 1); + A1 = mueller_lindiattenuator(kx,ky); + A2 = mueller_lindiattenuator(kx*kx,ky*ky); + R = A1*A1-A2; + assert(norm(R,inf), 0, 1e-9); + +***** test + % another test of serial application of retarder elements + kx1 = rand(1, 1); + kx2 = rand(1, 1); + ky1 = rand(1, 1); + ky2 = rand(1, 1); + A1 = mueller_lindiattenuator(kx1,ky1); + A2 = mueller_lindiattenuator(kx2,ky2); + A12 = mueller_lindiattenuator(kx1*kx2,ky1*ky2); + R = A1*A2-A12; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test mode + kx = rand(1, 1); + ky = rand(1, 1); + A1 = mueller_lindiattenuator(kx,ky); + A2 = mueller_lindiattenuator(kx,ky,'int'); + A3 = mueller_lindiattenuator(sqrt(kx),sqrt(ky),'amp'); + R1 = A1-A2; + R2 = A1-A3; + assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); + +***** test + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = mueller_lindiattenuator(R); + csize = size(C); + assert(rsize == csize); + end + +***** test + % another test correct size of return values + kx = rand(3,4,5); + ky = rand(5,4,3); + C = mueller_lindiattenuator(kx,ky); + csize = size(C); + assert(csize == [5,4,5]); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/zernike_R_poly.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/zernike_R_poly.m +***** assert (zernike_R_poly (0, 0), [1]) +***** assert (zernike_R_poly (1, 1), [1 0]) +***** assert (zernike_R_poly (0, 2), [2 0 -1]) +***** assert (zernike_R_poly (2, 2), [1 0 0]) +***** assert (zernike_R_poly (1, 3), [3 0 -2 0]) +***** assert (zernike_R_poly (3, 3), [1 0 0 0]) +***** assert (zernike_R_poly (0, 4), [6 0 -6 0 1]) +***** assert (zernike_R_poly (2, 4), [4 0 -3 0 0]) +***** assert (zernike_R_poly (4, 4), [1 0 0 0 0]) +***** assert (zernike_R_poly (1, 5), [10 0 -12 0 3 0]) +***** assert (zernike_R_poly (3, 5), [5 0 -4 0 0 0]) +***** assert (zernike_R_poly (5, 5), [1 0 0 0 0 0]) +***** assert (zernike_R_poly (0, 6), [20 0 -30 0 12 0 -1]) +***** assert (zernike_R_poly (2, 6), [15 0 -20 0 6 0 0]) +***** assert (zernike_R_poly (4, 6), [ 6 0 -5 0 0 0 0]) +***** assert (zernike_R_poly (6, 6), [ 1 0 0 0 0 0 0]) +16 tests, 16 passed, 0 known failure, 0 skipped +[inst/mueller_unity.m] +>>>>> /build/reproducible-path/octave-optics-0.1.4/inst/mueller_unity.m +***** test + A = mueller_unity(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + for dim = 1:5 + asize = randi([1 4], 1, dim); + C = cell(asize); + csize = size(C); + U = mueller_unity(C); + usize = size(U); + assert(usize == csize); + end + +***** test + for dim = 1:5 + asize = randi([1 4], 1, dim); + rsize = size(rand(asize)); + U = mueller_unity(rsize); + usize = size(U); + assert(usize == rsize); + end +3 tests, 3 passed, 0 known failure, 0 skipped Checking C++ files ... Done running the unit tests. Summary: 207 tests, 207 passed, 0 known failures, 0 skipped @@ -5799,12 +5835,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: not including original source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/116337/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/116337/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/34549 and its subdirectories -I: Current time: Sat Apr 20 05:18:06 -12 2024 -I: pbuilder-time-stamp: 1713633486 +I: removing directory /srv/workspace/pbuilder/116337 and its subdirectories +I: Current time: Sat May 24 13:44:16 +14 2025 +I: pbuilder-time-stamp: 1748043856