Diff of the two buildlogs: -- --- b1/build.log 2023-06-08 13:38:35.063217041 +0000 +++ b2/build.log 2023-06-08 14:38:44.545515522 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Thu Jun 8 01:26:15 -12 2023 -I: pbuilder-time-stamp: 1686230775 +I: Current time: Fri Jun 9 03:38:53 +14 2023 +I: pbuilder-time-stamp: 1686231533 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/bookworm-reproducible-base.tgz] I: copying local configuration @@ -16,7 +16,7 @@ I: copying [./octave-optics_0.1.4.orig.tar.gz] I: copying [./octave-optics_0.1.4-4.debian.tar.xz] I: Extracting source -gpgv: Signature made Mon Dec 5 02:29:35 2022 -12 +gpgv: Signature made Tue Dec 6 04:29:35 2022 +14 gpgv: using RSA key 3F464391498FE874BDB5D98F2124AA1983785C90 gpgv: issuer "rafael@debian.org" gpgv: Can't check signature: No public key @@ -26,135 +26,167 @@ 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/4216/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/24587/tmp/hooks/D01_modify_environment starting +debug: Running on wbq0. +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 Jun 9 03:40 /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/24587/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/24587/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='armhf' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=3 ' - DISTRIBUTION='bookworm' - HOME='/root' - HOST_ARCH='armhf' + 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]="15" [3]="1" [4]="release" [5]="arm-unknown-linux-gnueabihf") + BASH_VERSION='5.2.15(1)-release' + BUILDDIR=/build + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=armhf + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=4 ' + DIRSTACK=() + DISTRIBUTION=bookworm + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=arm + HOST_ARCH=armhf IFS=' ' - INVOCATION_ID='bd2f74f90470425382ba734cbe96a4d2' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - 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='4216' - PS1='# ' - PS2='> ' + INVOCATION_ID=ca16bd41a55a4376b2a18a4bfb262fa0 + LANG=C + LANGUAGE=it_CH:it + LC_ALL=C + MACHTYPE=arm-unknown-linux-gnueabihf + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnueabihf + 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=24587 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.pNpfJHDK/pbuilderrc_4ZQE --distribution bookworm --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.pNpfJHDK/b1 --logfile b1/build.log octave-optics_0.1.4-4.dsc' - SUDO_GID='113' - SUDO_UID='107' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://10.0.0.15:3142/' + 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.pNpfJHDK/pbuilderrc_iuts --distribution bookworm --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.pNpfJHDK/b2 --logfile b2/build.log --extrapackages usrmerge octave-optics_0.1.4-4.dsc' + SUDO_GID=113 + SUDO_UID=107 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://10.0.0.15:3142/ I: uname -a - Linux virt64c 5.10.0-23-arm64 #1 SMP Debian 5.10.179-1 (2023-05-12) aarch64 GNU/Linux + Linux i-capture-the-hostname 5.10.0-23-armmp #1 SMP Debian 5.10.179-1 (2023-05-12) armv7l GNU/Linux I: ls -l /bin total 5072 - -rwxr-xr-x 1 root root 838488 Apr 23 09:24 bash - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bunzip2 - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bzcat - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzcmp -> bzdiff - -rwxr-xr-x 1 root root 2225 Sep 18 2022 bzdiff - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzegrep -> bzgrep - -rwxr-xr-x 1 root root 4893 Nov 27 2021 bzexe - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzfgrep -> bzgrep - -rwxr-xr-x 1 root root 3775 Sep 18 2022 bzgrep - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bzip2 - -rwxr-xr-x 1 root root 67112 Sep 18 2022 bzip2recover - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzless -> bzmore - -rwxr-xr-x 1 root root 1297 Sep 18 2022 bzmore - -rwxr-xr-x 1 root root 67632 Sep 20 2022 cat - -rwxr-xr-x 1 root root 67676 Sep 20 2022 chgrp - -rwxr-xr-x 1 root root 67644 Sep 20 2022 chmod - -rwxr-xr-x 1 root root 67684 Sep 20 2022 chown - -rwxr-xr-x 1 root root 133532 Sep 20 2022 cp - -rwxr-xr-x 1 root root 132868 Jan 5 01:20 dash - -rwxr-xr-x 1 root root 133220 Sep 20 2022 date - -rwxr-xr-x 1 root root 67732 Sep 20 2022 dd - -rwxr-xr-x 1 root root 68104 Sep 20 2022 df - -rwxr-xr-x 1 root root 133632 Sep 20 2022 dir - -rwxr-xr-x 1 root root 59128 Mar 22 21:02 dmesg - lrwxrwxrwx 1 root root 8 Dec 19 01:33 dnsdomainname -> hostname - lrwxrwxrwx 1 root root 8 Dec 19 01:33 domainname -> hostname - -rwxr-xr-x 1 root root 67560 Sep 20 2022 echo - -rwxr-xr-x 1 root root 41 Jan 24 02:43 egrep - -rwxr-xr-x 1 root root 67548 Sep 20 2022 false - -rwxr-xr-x 1 root root 41 Jan 24 02:43 fgrep - -rwxr-xr-x 1 root root 55748 Mar 22 21:02 findmnt - -rwsr-xr-x 1 root root 26208 Mar 22 20:15 fusermount - -rwxr-xr-x 1 root root 128608 Jan 24 02:43 grep - -rwxr-xr-x 2 root root 2346 Apr 9 2022 gunzip - -rwxr-xr-x 1 root root 6447 Apr 9 2022 gzexe - -rwxr-xr-x 1 root root 64220 Apr 9 2022 gzip - -rwxr-xr-x 1 root root 67032 Dec 19 01:33 hostname - -rwxr-xr-x 1 root root 67720 Sep 20 2022 ln - -rwxr-xr-x 1 root root 35132 Mar 22 21:51 login - -rwxr-xr-x 1 root root 133632 Sep 20 2022 ls - -rwxr-xr-x 1 root root 136808 Mar 22 21:02 lsblk - -rwxr-xr-x 1 root root 67800 Sep 20 2022 mkdir - -rwxr-xr-x 1 root root 67764 Sep 20 2022 mknod - -rwxr-xr-x 1 root root 67596 Sep 20 2022 mktemp - -rwxr-xr-x 1 root root 38504 Mar 22 21:02 more - -rwsr-xr-x 1 root root 38496 Mar 22 21:02 mount - -rwxr-xr-x 1 root root 9824 Mar 22 21:02 mountpoint - -rwxr-xr-x 1 root root 133532 Sep 20 2022 mv - lrwxrwxrwx 1 root root 8 Dec 19 01:33 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Apr 2 18:25 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 67608 Sep 20 2022 pwd - lrwxrwxrwx 1 root root 4 Apr 23 09:24 rbash -> bash - -rwxr-xr-x 1 root root 67600 Sep 20 2022 readlink - -rwxr-xr-x 1 root root 67672 Sep 20 2022 rm - -rwxr-xr-x 1 root root 67600 Sep 20 2022 rmdir - -rwxr-xr-x 1 root root 67400 Nov 2 2022 run-parts - -rwxr-xr-x 1 root root 133372 Jan 5 07:55 sed - lrwxrwxrwx 1 root root 4 Jan 5 01:20 sh -> dash - -rwxr-xr-x 1 root root 67584 Sep 20 2022 sleep - -rwxr-xr-x 1 root root 67644 Sep 20 2022 stty - -rwsr-xr-x 1 root root 50800 Mar 22 21:02 su - -rwxr-xr-x 1 root root 67584 Sep 20 2022 sync - -rwxr-xr-x 1 root root 336764 Apr 6 02:25 tar - -rwxr-xr-x 1 root root 67144 Nov 2 2022 tempfile - -rwxr-xr-x 1 root root 133224 Sep 20 2022 touch - -rwxr-xr-x 1 root root 67548 Sep 20 2022 true - -rwxr-xr-x 1 root root 9768 Mar 22 20:15 ulockmgr_server - -rwsr-xr-x 1 root root 22108 Mar 22 21:02 umount - -rwxr-xr-x 1 root root 67572 Sep 20 2022 uname - -rwxr-xr-x 2 root root 2346 Apr 9 2022 uncompress - -rwxr-xr-x 1 root root 133632 Sep 20 2022 vdir - -rwxr-xr-x 1 root root 42608 Mar 22 21:02 wdctl - lrwxrwxrwx 1 root root 8 Dec 19 01:33 ypdomainname -> hostname - -rwxr-xr-x 1 root root 1984 Apr 9 2022 zcat - -rwxr-xr-x 1 root root 1678 Apr 9 2022 zcmp - -rwxr-xr-x 1 root root 6460 Apr 9 2022 zdiff - -rwxr-xr-x 1 root root 29 Apr 9 2022 zegrep - -rwxr-xr-x 1 root root 29 Apr 9 2022 zfgrep - -rwxr-xr-x 1 root root 2081 Apr 9 2022 zforce - -rwxr-xr-x 1 root root 8103 Apr 9 2022 zgrep - -rwxr-xr-x 1 root root 2206 Apr 9 2022 zless - -rwxr-xr-x 1 root root 1842 Apr 9 2022 zmore - -rwxr-xr-x 1 root root 4577 Apr 9 2022 znew -I: user script /srv/workspace/pbuilder/4216/tmp/hooks/D02_print_environment finished + -rwxr-xr-x 1 root root 838488 Apr 24 11:24 bash + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bunzip2 + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bzcat + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzcmp -> bzdiff + -rwxr-xr-x 1 root root 2225 Sep 19 2022 bzdiff + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzegrep -> bzgrep + -rwxr-xr-x 1 root root 4893 Nov 28 2021 bzexe + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzfgrep -> bzgrep + -rwxr-xr-x 1 root root 3775 Sep 19 2022 bzgrep + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bzip2 + -rwxr-xr-x 1 root root 67112 Sep 19 2022 bzip2recover + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzless -> bzmore + -rwxr-xr-x 1 root root 1297 Sep 19 2022 bzmore + -rwxr-xr-x 1 root root 67632 Sep 21 2022 cat + -rwxr-xr-x 1 root root 67676 Sep 21 2022 chgrp + -rwxr-xr-x 1 root root 67644 Sep 21 2022 chmod + -rwxr-xr-x 1 root root 67684 Sep 21 2022 chown + -rwxr-xr-x 1 root root 133532 Sep 21 2022 cp + -rwxr-xr-x 1 root root 132868 Jan 6 03:20 dash + -rwxr-xr-x 1 root root 133220 Sep 21 2022 date + -rwxr-xr-x 1 root root 67732 Sep 21 2022 dd + -rwxr-xr-x 1 root root 68104 Sep 21 2022 df + -rwxr-xr-x 1 root root 133632 Sep 21 2022 dir + -rwxr-xr-x 1 root root 59128 Mar 23 23:02 dmesg + lrwxrwxrwx 1 root root 8 Dec 20 03:33 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Dec 20 03:33 domainname -> hostname + -rwxr-xr-x 1 root root 67560 Sep 21 2022 echo + -rwxr-xr-x 1 root root 41 Jan 25 04:43 egrep + -rwxr-xr-x 1 root root 67548 Sep 21 2022 false + -rwxr-xr-x 1 root root 41 Jan 25 04:43 fgrep + -rwxr-xr-x 1 root root 55748 Mar 23 23:02 findmnt + -rwsr-xr-x 1 root root 26208 Mar 23 22:15 fusermount + -rwxr-xr-x 1 root root 128608 Jan 25 04:43 grep + -rwxr-xr-x 2 root root 2346 Apr 10 2022 gunzip + -rwxr-xr-x 1 root root 6447 Apr 10 2022 gzexe + -rwxr-xr-x 1 root root 64220 Apr 10 2022 gzip + -rwxr-xr-x 1 root root 67032 Dec 20 03:33 hostname + -rwxr-xr-x 1 root root 67720 Sep 21 2022 ln + -rwxr-xr-x 1 root root 35132 Mar 23 23:51 login + -rwxr-xr-x 1 root root 133632 Sep 21 2022 ls + -rwxr-xr-x 1 root root 136808 Mar 23 23:02 lsblk + -rwxr-xr-x 1 root root 67800 Sep 21 2022 mkdir + -rwxr-xr-x 1 root root 67764 Sep 21 2022 mknod + -rwxr-xr-x 1 root root 67596 Sep 21 2022 mktemp + -rwxr-xr-x 1 root root 38504 Mar 23 23:02 more + -rwsr-xr-x 1 root root 38496 Mar 23 23:02 mount + -rwxr-xr-x 1 root root 9824 Mar 23 23:02 mountpoint + -rwxr-xr-x 1 root root 133532 Sep 21 2022 mv + lrwxrwxrwx 1 root root 8 Dec 20 03:33 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Apr 3 20:25 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 67608 Sep 21 2022 pwd + lrwxrwxrwx 1 root root 4 Apr 24 11:24 rbash -> bash + -rwxr-xr-x 1 root root 67600 Sep 21 2022 readlink + -rwxr-xr-x 1 root root 67672 Sep 21 2022 rm + -rwxr-xr-x 1 root root 67600 Sep 21 2022 rmdir + -rwxr-xr-x 1 root root 67400 Nov 3 2022 run-parts + -rwxr-xr-x 1 root root 133372 Jan 6 09:55 sed + lrwxrwxrwx 1 root root 9 Jun 9 03:40 sh -> /bin/bash + -rwxr-xr-x 1 root root 67584 Sep 21 2022 sleep + -rwxr-xr-x 1 root root 67644 Sep 21 2022 stty + -rwsr-xr-x 1 root root 50800 Mar 23 23:02 su + -rwxr-xr-x 1 root root 67584 Sep 21 2022 sync + -rwxr-xr-x 1 root root 336764 Apr 7 04:25 tar + -rwxr-xr-x 1 root root 67144 Nov 3 2022 tempfile + -rwxr-xr-x 1 root root 133224 Sep 21 2022 touch + -rwxr-xr-x 1 root root 67548 Sep 21 2022 true + -rwxr-xr-x 1 root root 9768 Mar 23 22:15 ulockmgr_server + -rwsr-xr-x 1 root root 22108 Mar 23 23:02 umount + -rwxr-xr-x 1 root root 67572 Sep 21 2022 uname + -rwxr-xr-x 2 root root 2346 Apr 10 2022 uncompress + -rwxr-xr-x 1 root root 133632 Sep 21 2022 vdir + -rwxr-xr-x 1 root root 42608 Mar 23 23:02 wdctl + lrwxrwxrwx 1 root root 8 Dec 20 03:33 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1984 Apr 10 2022 zcat + -rwxr-xr-x 1 root root 1678 Apr 10 2022 zcmp + -rwxr-xr-x 1 root root 6460 Apr 10 2022 zdiff + -rwxr-xr-x 1 root root 29 Apr 10 2022 zegrep + -rwxr-xr-x 1 root root 29 Apr 10 2022 zfgrep + -rwxr-xr-x 1 root root 2081 Apr 10 2022 zforce + -rwxr-xr-x 1 root root 8103 Apr 10 2022 zgrep + -rwxr-xr-x 1 root root 2206 Apr 10 2022 zless + -rwxr-xr-x 1 root root 1842 Apr 10 2022 zmore + -rwxr-xr-x 1 root root 4577 Apr 10 2022 znew +I: user script /srv/workspace/pbuilder/24587/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -739,7 +771,7 @@ Get: 539 http://deb.debian.org/debian bookworm/main armhf texlive-latex-recommended all 2022.20230122-3 [8880 kB] Get: 540 http://deb.debian.org/debian bookworm/main armhf texlive-pictures all 2022.20230122-3 [15.8 MB] Get: 541 http://deb.debian.org/debian bookworm/main armhf texlive-latex-extra all 2022.20230122-4 [19.2 MB] -Fetched 267 MB in 8s (33.8 MB/s) +Fetched 267 MB in 46s (5816 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libpython3.11-minimal:armhf. (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 ... 19324 files and directories currently installed.) @@ -2971,8 +3003,19 @@ Writing extended state information... Building tag database... -> Finished parsing the build-deps +Reading package lists... +Building dependency tree... +Reading state information... +usrmerge is already the newest version (35). +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. I: Building the package -I: Running cd /build/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/24587/tmp/hooks/A99_set_merged_usr starting +Re-configuring usrmerge... +removed '/etc/unsupported-skip-usrmerge-conversion' +The system has been successfully converted. +I: user script /srv/workspace/pbuilder/24587/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/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 @@ -3832,98 +3875,282 @@ dh_octave_check -O--buildsystem=octave Checking package... Checking m files ... -[inst/mueller_homogeneous_elliptic_retarder.m] ->>>>> /build/octave-optics-0.1.4/inst/mueller_homogeneous_elliptic_retarder.m +[inst/stokes_lpvertical.m] +>>>>> /build/octave-optics-0.1.4/inst/stokes_lpvertical.m ***** test % test default return value - A = mueller_homogeneous_elliptic_retarder(); + 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_lpvertical(intensity); + R = V-[1;-1;0;0]*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_lpvertical(R); + csize = size(C); + assert(rsize == csize); + end +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/mueller_depolarizer.m] +>>>>> /build/octave-optics-0.1.4/inst/mueller_depolarizer.m +***** test + % test default return value + A = mueller_depolarizer(); R = A*A-A; assert(norm(R,inf), 0, 1e-9); ***** test - % test modes - t0 = rand(1,1); - delay = rand(1,1); - azimuth = rand(1,1); - ellipticity = rand(1,1); - A1 = mueller_homogeneous_elliptic_retarder(t0,delay,azimuth,ellipticity); - A2 = mueller_homogeneous_elliptic_retarder(t0,delay*180/pi(),azimuth,ellipticity,'deg'); - A3 = mueller_homogeneous_elliptic_retarder(t0,delay/(2*pi()),azimuth,ellipticity,'wav'); - A4 = mueller_homogeneous_elliptic_retarder(t0,delay,azimuth*180/pi(),ellipticity,'rad','deg'); - R = (A2-A1)+(A3-A1)+(A4-A1); + % test serial application of matrix + depolarization = rand(1, 1); + A1 = mueller_depolarizer(depolarization); + A2 = mueller_depolarizer(depolarization^2); + R = A1*A1-A2; assert(norm(R,inf), 0, 1e-9); ***** test - % another test correct size of return values - t0 = rand(3,4,5); - delay = rand(4,5,6); - azimuth = rand(5,4,3); - ellipticity = rand(6,5,4); - C = mueller_homogeneous_elliptic_retarder(t0,delay,azimuth,ellipticity); - csize = size(C); - assert(csize == [6,5,6]); + % another test of serial application + depolarization1 = rand(1, 1); + depolarization2 = rand(1, 1); + A1 = mueller_depolarizer(depolarization1); + A2 = mueller_depolarizer(depolarization2); + A12 = mueller_depolarizer(depolarization1*depolarization2); + R = A1*A2-A12; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test size of return value + 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_depolarizer(R); + csize = size(C); + assert(rsize == csize); + end +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/jones.m] +>>>>> /build/octave-optics-0.1.4/inst/jones.m +***** error A = jones(); +***** test + % test singular argument, should just be returned + M = jones_waveplate(rand(1,1),'wav'); + MM = jones(M); + R = MM-M; + assert(norm(R,inf), 0, 1e-9); +***** test + % send light with horizontal linear polarization through a rotating + % 1/2-waveplate and subsequent polarizer: final intensity should + % vary as cos(2*angle)^2. + % This test feeds jones() with one cell array only! + angles = 0:360; + wps = jones_rotate(jones_waveplate(0.5, 'wav'), angles, 'deg'); + lightin = jones_lphorizontal(); + lightout = jones(jones_linpolarizer(),wps,lightin); + ilightout = jones_intensity(lightout); + R = ilightout-(cosd(angles.*2).^2); + assert(norm(R,inf), 0, 1e-9); +***** test + % this is a more thorough test: send light with horizontal linear + % polarization through two rotating 1/2-waveplates (combining to + % a 1/1-waveplate) and subsequent polarizer: final intensity + % should not vary! + % This test feeds jones() with two cell arrays. + angles = 0:360; + wps1 = jones_rotate(jones_waveplate(0.5, 'wav'), angles, 'deg'); + wps2 = jones_rotate(jones_waveplate(0.5, 'wav'), angles, 'deg'); + lightin = jones_lphorizontal(); + lightout = jones(jones_linpolarizer(),wps2,wps1,lightin); + ilightout = jones_intensity(lightout); + R = ilightout-1; + assert(norm(R,inf), 0, 1e-9); +***** demo + angles = 0:360; + wps = jones_rotate(jones_waveplate(0.5, 'wav'), angles, 'deg'); + lightin = jones_lphorizontal(); + lightout = jones(jones_linpolarizer(),wps,lightin); + ilightout = jones_intensity(lightout); + figure(); + plot(angles, ilightout); + title('transmitted intensity [should look like cos(2*a)^2'); + xlabel('angle of halfwave plate axis'); + ylabel('intensity [a.u.]'); + legend('transmitted intensity'); + % ----------------------------------------------------------------- + % example 1: send light with horizontal linear polarization through + % a rotating, perfect halfwave plate and subsequent polarizer: + % final intensity should vary as cos(2*angle)^2. +***** demo + angles = 0:360; + wps = jones_rotate(jones_waveplate(0.5, 'wav'), angles, 'deg'); + wps2 = jones_rotate(jones_waveplate(0.45, 'wav'), angles, 'deg'); + lightin = jones_lphorizontal(); + lightout = jones(jones_linpolarizer(),wps,lightin); + ilightout = jones_intensity(lightout); + lightout2 = jones(jones_linpolarizer(),wps2,lightin); + ilightout2 = jones_intensity(lightout2); + figure(); + plot(angles, ilightout, angles, ilightout2); + title('transmitted intensity with perfect and non-perfect halfwave plate'); + xlabel('angle of halfwave plate axis'); + ylabel('intensity [a.u.]'); + legend('perfect (0.5-)plate', 'non-perfect (0.45-)plate'); + % ----------------------------------------------------------------- + % example 2: send light with horizontal linear polarization through + % a rotating, non-perfect halfwave plate and subsequent polarizer: + % final intensity should deviate from the perfect cos(2*angle)^2 + % curve, never reaching zero transmission +***** demo + angle = 0:360; + delay = 0:0.05:1; + % angles are in rows, delays in columns + angle_all = repmat(angle, [length(delay), 1]); + delay_all = repmat(delay', [1, length(angle)]); + wps3 = jones_waveplate(delay_all, 'wav'); + wps3 = jones_rotate(wps3, angle_all, 'deg'); + lightin = jones_lphorizontal(); + lightout3 = jones(jones_linpolarizer(),wps3,lightin); + ilightout3 = jones_intensity(lightout3); + figure(); + plot(angle, ilightout3); + title('transmitted intensity with plates of increasing delay'); + xlabel('angle of plate axis'); + ylabel('intensity [a.u.]'); + legend(cellfun(@(x)sprintf('delay=%.2f',x),num2cell(delay),'UniformOutput',false)); + % ----------------------------------------------------------------- + % 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/jones_linpolarizer.m] +>>>>> /build/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; + 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_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/zernike_polar.m] ->>>>> /build/octave-optics-0.1.4/inst/zernike_polar.m +[inst/mueller_mirror.m] +>>>>> /build/octave-optics-0.1.4/inst/mueller_mirror.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 mirror that is its own inverted element + A = mueller_mirror(); + R = (A-1\A); + assert(norm(R,inf), 0, 1e-9); + ***** 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_circdiattenuator.m] ->>>>> /build/octave-optics-0.1.4/inst/mueller_circdiattenuator.m + % 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_name.m] +>>>>> /build/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/jones_lindiattenuator.m] +>>>>> /build/octave-optics-0.1.4/inst/jones_lindiattenuator.m ***** test % test default return value - A = mueller_circdiattenuator(); + 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); - kr = 1; - kl = (1-d)./(1+d); - A1 = mueller_circdiattenuator(d); - A2 = mueller_circdiattenuator(kr, kl); + 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 circular diattenuators - kr = rand(1, 1); - kl = rand(1, 1); - A1 = mueller_circdiattenuator(kr,kl); - A2 = mueller_circdiattenuator(kr*kr,kl*kl); + % 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 - 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); + 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 - 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'); + 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); @@ -3937,55 +4164,100 @@ R = {R}; end rsize = size(R); - C = mueller_circdiattenuator(R); + C = jones_lindiattenuator(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); + 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/mueller_rotator.m] ->>>>> /build/octave-optics-0.1.4/inst/mueller_rotator.m +[inst/zernike_cartesian.m] +>>>>> /build/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/mueller_circretarder.m] +>>>>> /build/octave-optics-0.1.4/inst/mueller_circretarder.m ***** test % test default return value - A = mueller_rotator(); + A = mueller_circretarder(); R = A*A-A; assert(norm(R,inf), 0, 1e-9); ***** test - % test serial application of rotator - angle = rand(1, 1); - A1 = mueller_rotator(angle); - A2 = mueller_rotator(angle*2); + % test serial application of circular retarder elements + phase = rand(1, 1); + A1 = mueller_circretarder(phase); + A2 = mueller_circretarder(phase*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 = mueller_rotator(angle1); - A2 = mueller_rotator(angle2); - A12 = mueller_rotator(angle1+angle2); + % another test of serial application of retarder elements + phase1 = rand(1, 1); + phase2 = rand(1, 1); + A1 = mueller_circretarder(phase1); + A2 = mueller_circretarder(phase2); + A12 = mueller_circretarder(phase1+phase2); R = A1*A2-A12; assert(norm(R,inf), 0, 1e-9); ***** test - % test different angle value interpretations - angle = rand(1, 1); - A1 = mueller_rotator(angle); - A2 = mueller_rotator(-angle*180/pi(), 'deg'); - R = A2*A1-mueller_unity(); - assert(norm(R,inf), 0, 1e-9); + % test mode + phase = rand(1, 1); + A1 = mueller_circretarder(phase); + A2 = mueller_circretarder(phase*180/pi(), 'deg'); + A3 = mueller_circretarder(phase/(2*pi()), 'wav'); + R1 = A1-A2; + R2 = A1-A3; + assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); ***** test - % test size of return values + % test correct size of return values for dim = 1:5 asize = randi([1 4], 1, dim); R = rand(asize); @@ -3993,51 +4265,24 @@ R = {R}; end rsize = size(R); - C = mueller_rotator(R); + C = mueller_circretarder(R); csize = size(C); assert(rsize == csize); end 5 tests, 5 passed, 0 known failure, 0 skipped -[inst/zernike_name.m] ->>>>> /build/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_R_poly.m] ->>>>> /build/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_cpright.m] ->>>>> /build/octave-optics-0.1.4/inst/stokes_cpright.m +[inst/jones_cpleft.m] +>>>>> /build/octave-optics-0.1.4/inst/jones_cpleft.m ***** test % test default return value - V = stokes_cpright(); - R = V-[1;0;0;1]; + V = jones_cpleft(); + R = V-[1;-1i]; 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; + amplitude = rand(1, 1); + V = jones_cpleft(amplitude); + R = V-[1;-1i]*amplitude; assert(norm(R,inf), 0, 1e-9); ***** test @@ -4049,113 +4294,100 @@ R = {R}; end rsize = size(R); - C = stokes_cpright(R); + C = jones_cpleft(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/stokes_isstokes.m] ->>>>> /build/octave-optics-0.1.4/inst/stokes_isstokes.m +[inst/mueller_lindiattenuator.m] +>>>>> /build/octave-optics-0.1.4/inst/mueller_lindiattenuator.m ***** test - % test type check - V1 = stokes_unpolarized(); - V2 = char(V1); - t1 = stokes_isstokes(V1); - t2 = stokes_isstokes(V2); - assert(t1 && ~t2); + % test default return value + A = mueller_lindiattenuator(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); ***** test - % test size check - V1 = stokes_unpolarized(); - V2 = V1; - V2(5,1) = 1; - t1 = stokes_isstokes(V1); - t2 = stokes_isstokes(V2); - assert(t1 && ~t2); + % 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 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 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 - % 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])); + % 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 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/stokes_degpolarization.m] ->>>>> /build/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 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 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/jones_rotator.m] ->>>>> /build/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 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 - % 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); - + % 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/stokes_cpleft.m] +>>>>> /build/octave-optics-0.1.4/inst/stokes_cpleft.m ***** 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; + % test default return value + V = stokes_cpleft(); + R = V-[1;0;0;-1]; 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(); + % test return value + intensity = rand(1, 1); + V = stokes_cpleft(intensity); + R = V-[1;0;0;-1]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test - % test size of return values + % test correct size of return values for dim = 1:5 asize = randi([1 4], 1, dim); R = rand(asize); @@ -4163,24 +4395,24 @@ R = {R}; end rsize = size(R); - C = jones_rotator(R); + C = stokes_cpleft(R); csize = size(C); assert(rsize == csize); end -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/stokes_lpvertical.m] ->>>>> /build/octave-optics-0.1.4/inst/stokes_lpvertical.m +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/jones_lpvertical.m] +>>>>> /build/octave-optics-0.1.4/inst/jones_lpvertical.m ***** test % test default return value - V = stokes_lpvertical(); - R = V-[1;-1;0;0]; + V = jones_lpvertical(); + R = V-[0;1]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value - intensity = rand(1, 1); - V = stokes_lpvertical(intensity); - R = V-[1;-1;0;0]*intensity; + amplitude = rand(1, 1); + V = jones_lpvertical(amplitude); + R = V-[0;1]*amplitude; assert(norm(R,inf), 0, 1e-9); ***** test @@ -4192,24 +4424,50 @@ R = {R}; end rsize = size(R); - C = stokes_lpvertical(R); + C = jones_lpvertical(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/stokes_lpplus45.m] ->>>>> /build/octave-optics-0.1.4/inst/stokes_lpplus45.m +[inst/mueller_unity.m] +>>>>> /build/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/jones_cpright.m] +>>>>> /build/octave-optics-0.1.4/inst/jones_cpright.m ***** test % test default return value - V = stokes_lpplus45(); - R = V-[1;0;1;0]; + V = jones_cpright(); + 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_cpright(amplitude); + R = V-[1;1i]*amplitude; assert(norm(R,inf), 0, 1e-9); ***** test @@ -4221,48 +4479,38 @@ R = {R}; end rsize = size(R); - C = stokes_lpplus45(R); + C = jones_cpright(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_circretarder.m] ->>>>> /build/octave-optics-0.1.4/inst/mueller_circretarder.m +[inst/mueller_absorber.m] +>>>>> /build/octave-optics-0.1.4/inst/mueller_absorber.m ***** test % test default return value - A = mueller_circretarder(); + A = mueller_absorber(); R = A*A-A; assert(norm(R,inf), 0, 1e-9); ***** test - % test serial application of circular retarder elements - phase = rand(1, 1); - A1 = mueller_circretarder(phase); - A2 = mueller_circretarder(phase*2); + % 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 - % another test of serial application of retarder elements - phase1 = rand(1, 1); - phase2 = rand(1, 1); - A1 = mueller_circretarder(phase1); - A2 = mueller_circretarder(phase2); - A12 = mueller_circretarder(phase1+phase2); + % 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 - % test mode - phase = rand(1, 1); - A1 = mueller_circretarder(phase); - A2 = mueller_circretarder(phase*180/pi(), 'deg'); - A3 = mueller_circretarder(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); @@ -4271,26 +4519,34 @@ R = {R}; end rsize = size(R); - C = mueller_circretarder(R); + C = mueller_absorber(R); csize = size(C); assert(rsize == csize); end -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/stokes_unpolarized.m] ->>>>> /build/octave-optics-0.1.4/inst/stokes_unpolarized.m +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/jones_waveplate.m] +>>>>> /build/octave-optics-0.1.4/inst/jones_waveplate.m ***** test % test default return value - V = stokes_unpolarized(); - R = V-[1;0;0;0]; + A = jones_waveplate(); + R = A*A-A; 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; + % 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 @@ -4300,11 +4556,11 @@ R = {R}; end rsize = size(R); - C = stokes_unpolarized(R); + C = jones_waveplate(R); csize = size(C); - assert(rsize == csize); + assert(csize, rsize); end -3 tests, 3 passed, 0 known failure, 0 skipped +4 tests, 4 passed, 0 known failure, 0 skipped [inst/jones_mirror.m] >>>>> /build/octave-optics-0.1.4/inst/jones_mirror.m ***** test @@ -4335,19 +4591,19 @@ end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_lpvertical.m] ->>>>> /build/octave-optics-0.1.4/inst/jones_lpvertical.m +[inst/stokes_cpright.m] +>>>>> /build/octave-optics-0.1.4/inst/stokes_cpright.m ***** test % test default return value - V = jones_lpvertical(); - R = V-[0;1]; + V = stokes_cpright(); + R = V-[1;0;0;1]; 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_cpright(intensity); + R = V-[1;0;0;1]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -4359,103 +4615,87 @@ R = {R}; end rsize = size(R); - C = jones_lpvertical(R); + C = stokes_cpright(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_stokes.m] ->>>>> /build/octave-optics-0.1.4/inst/mueller_stokes.m -***** error A = mueller_stokes(); +[inst/jones_linretarder.m] +>>>>> /build/octave-optics-0.1.4/inst/jones_linretarder.m ***** test - % test singular argument, should just be returned - M = mueller_waveplate(rand(1,1),'wav'); - MM = mueller_stokes(M); - R = MM-M; + % test default return value + A = jones_linretarder(); + R = A*A-A; assert(norm(R,inf), 0, 1e-9); + ***** test - % send light with horizontal linear polarization through a rotating - % 1/2-waveplate and subsequent polarizer: final intensity should - % vary as cos(2*angle)^2. - % This test feeds mueller_stokes() with one cell array only! - angles = 0:360; - wps = mueller_rotate(mueller_waveplate(0.5, 'wav'), angles, 'deg'); - lightin = stokes_lphorizontal(); - lightout = mueller_stokes(mueller_linpolarizer(),wps,lightin); - ilightout = stokes_intensity(lightout); - R = ilightout-(cosd(angles.*2).^2); + % 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 - % this is a more thorough test: send light with horizontal linear - % polarization through two rotating 1/2-waveplates (combining to - % a 1/1-waveplate) and subsequent polarizer: final intensity - % should not vary! - % This test feeds mueller_stokes() with two cell arrays. - angles = 0:360; - wps1 = mueller_rotate(mueller_waveplate(0.5, 'wav'), angles, 'deg'); - wps2 = mueller_rotate(mueller_waveplate(0.5, 'wav'), angles, 'deg'); - lightin = stokes_lphorizontal(); - lightout = mueller_stokes(mueller_linpolarizer(),wps2,wps1,lightin); - ilightout = stokes_intensity(lightout); - R = ilightout-1; + % 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); -***** demo - angles = 0:360; - wps = mueller_rotate(mueller_waveplate(0.5, 'wav'), angles, 'deg'); - lightin = stokes_lphorizontal(); - lightout = mueller_stokes(mueller_linpolarizer(),wps,lightin); - ilightout = stokes_intensity(lightout); - figure(); - plot(angles, ilightout); - title('transmitted intensity [should look like cos(2*a)^2'); - xlabel('angle of halfwave plate axis'); - ylabel('intensity [a.u.]'); - legend('transmitted intensity'); - % ----------------------------------------------------------------- - % example 1: send light with horizontal linear polarization through - % a rotating, perfect halfwave plate and subsequent polarizer: - % final intensity should vary as cos(2*angle)^2. -***** demo - angles = 0:360; - wps = mueller_rotate(mueller_waveplate(0.5, 'wav'), angles, 'deg'); - wps2 = mueller_rotate(mueller_waveplate(0.45, 'wav'), angles, 'deg'); - lightin = stokes_lphorizontal(); - lightout = mueller_stokes(mueller_linpolarizer(),wps,lightin); - ilightout = stokes_intensity(lightout); - lightout2 = mueller_stokes(mueller_linpolarizer(),wps2,lightin); - ilightout2 = stokes_intensity(lightout2); - figure(); - plot(angles, ilightout, angles, ilightout2); - title('transmitted intensity with perfect and non-perfect halfwave plate'); - xlabel('angle of halfwave plate axis'); - ylabel('intensity [a.u.]'); - legend('perfect (0.5-)plate', 'non-perfect (0.45-)plate'); - % ----------------------------------------------------------------- - % example 2: send light with horizontal linear polarization through - % a rotating, non-perfect halfwave plate and subsequent polarizer: - % final intensity should deviate from the perfect cos(2*angle)^2 - % curve, never reaching zero transmission -***** demo - angle = 0:360; - delay = 0:0.05:1; - % angles are in rows, delays in columns - angle_all = repmat(angle, [length(delay), 1]); - delay_all = repmat(delay', [1, length(angle)]); - wps3 = mueller_waveplate(delay_all, 'wav'); - wps3 = mueller_rotate(wps3, angle_all, 'deg'); - lightin = stokes_lphorizontal(); - lightout3 = mueller_stokes(mueller_linpolarizer(),wps3,lightin); - ilightout3 = stokes_intensity(lightout3); - figure(); - plot(angle, ilightout3); - title('transmitted intensity with plates of increasing delay'); - xlabel('angle of plate axis'); - ylabel('intensity [a.u.]'); - legend(cellfun(@(x)sprintf('delay=%.2f',x),num2cell(delay),'UniformOutput',false)); - % ----------------------------------------------------------------- - % 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 + +***** 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_unity.m] +>>>>> /build/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_ismueller.m] >>>>> /build/octave-optics-0.1.4/inst/mueller_ismueller.m ***** test @@ -4495,84 +4735,65 @@ 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/mueller_depolarizer.m] ->>>>> /build/octave-optics-0.1.4/inst/mueller_depolarizer.m +[inst/zernike_polar.m] +>>>>> /build/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_homogeneous_elliptic_retarder.m] +>>>>> /build/octave-optics-0.1.4/inst/mueller_homogeneous_elliptic_retarder.m ***** test % test default return value - A = mueller_depolarizer(); + A = mueller_homogeneous_elliptic_retarder(); R = A*A-A; assert(norm(R,inf), 0, 1e-9); ***** test - % test serial application of matrix - depolarization = rand(1, 1); - A1 = mueller_depolarizer(depolarization); - A2 = mueller_depolarizer(depolarization^2); - R = A1*A1-A2; - assert(norm(R,inf), 0, 1e-9); - -***** test - % another test of serial application - depolarization1 = rand(1, 1); - depolarization2 = rand(1, 1); - A1 = mueller_depolarizer(depolarization1); - A2 = mueller_depolarizer(depolarization2); - A12 = mueller_depolarizer(depolarization1*depolarization2); - R = A1*A2-A12; + % test modes + t0 = rand(1,1); + delay = rand(1,1); + azimuth = rand(1,1); + ellipticity = rand(1,1); + A1 = mueller_homogeneous_elliptic_retarder(t0,delay,azimuth,ellipticity); + A2 = mueller_homogeneous_elliptic_retarder(t0,delay*180/pi(),azimuth,ellipticity,'deg'); + A3 = mueller_homogeneous_elliptic_retarder(t0,delay/(2*pi()),azimuth,ellipticity,'wav'); + A4 = mueller_homogeneous_elliptic_retarder(t0,delay,azimuth*180/pi(),ellipticity,'rad','deg'); + R = (A2-A1)+(A3-A1)+(A4-A1); assert(norm(R,inf), 0, 1e-9); ***** test - % test size of return value - 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_depolarizer(R); - csize = size(C); - assert(rsize == csize); - end -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/jones_intensity.m] ->>>>> /build/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 - % 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_lphorizontal.m] ->>>>> /build/octave-optics-0.1.4/inst/jones_lphorizontal.m + % another test correct size of return values + t0 = rand(3,4,5); + delay = rand(4,5,6); + azimuth = rand(5,4,3); + ellipticity = rand(6,5,4); + C = mueller_homogeneous_elliptic_retarder(t0,delay,azimuth,ellipticity); + csize = size(C); + assert(csize == [6,5,6]); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/stokes_lpminus45.m] +>>>>> /build/octave-optics-0.1.4/inst/stokes_lpminus45.m ***** test % test default return value - V = jones_lphorizontal(); - R = V-[1;0]; + 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_lphorizontal(amplitude); - R = V-[1;0]*amplitude; + intensity = rand(1, 1); + V = stokes_lpminus45(intensity); + R = V-[1;0;-1;0]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -4584,43 +4805,57 @@ R = {R}; end rsize = size(R); - C = jones_lphorizontal(R); + C = stokes_lpminus45(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_linretarder.m] ->>>>> /build/octave-optics-0.1.4/inst/jones_linretarder.m +[inst/mueller_circdiattenuator.m] +>>>>> /build/octave-optics-0.1.4/inst/mueller_circdiattenuator.m ***** test % test default return value - A = jones_linretarder(); + A = mueller_circdiattenuator(); 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); + % 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 - phase1 = rand(1, 1); - phase2 = rand(1, 1); - A1 = jones_linretarder(phase1); - A2 = jones_linretarder(phase2); - A12 = jones_linretarder(phase1+phase2); + 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 - phase = rand(1, 1); - A1 = jones_linretarder(phase); - A2 = jones_linretarder(phase*180/pi(), 'deg'); - A3 = jones_linretarder(phase/(2*pi()), 'wav'); + 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); @@ -4634,40 +4869,78 @@ R = {R}; end rsize = size(R); - C = jones_linretarder(R); + C = mueller_circdiattenuator(R); csize = size(C); assert(rsize == csize); end -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/jones_cpleft.m] ->>>>> /build/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); + % 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_intensity.m] +>>>>> /build/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 - % 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 + % 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/zernike_noll_to_mn.m] +>>>>> /build/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/zernike_osa_ansi_to_mn.m] >>>>> /build/octave-optics-0.1.4/inst/zernike_osa_ansi_to_mn.m ***** test @@ -4748,91 +5021,19 @@ assert(m,[1 -1 -5 7]) assert(n,[1 3 5 7]) 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/jones_lindiattenuator.m] ->>>>> /build/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_cpleft.m] ->>>>> /build/octave-optics-0.1.4/inst/stokes_cpleft.m +[inst/stokes_lpplus45.m] +>>>>> /build/octave-optics-0.1.4/inst/stokes_lpplus45.m ***** test % test default return value - V = stokes_cpleft(); - R = V-[1;0;0;-1]; + V = stokes_lpplus45(); + R = V-[1;0;1;0]; 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; + V = stokes_lpplus45(intensity); + R = V-[1;0;1;0]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -4844,79 +5045,11 @@ R = {R}; end rsize = size(R); - C = stokes_cpleft(R); + C = stokes_lpplus45(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_linpolarizer.m] ->>>>> /build/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_waveplate.m] ->>>>> /build/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/mueller_rotate.m] >>>>> /build/octave-optics-0.1.4/inst/mueller_rotate.m ***** test @@ -4997,19 +5130,19 @@ assert(csize == [4,3,4]); 8 tests, 8 passed, 0 known failure, 0 skipped -[inst/stokes_lpminus45.m] ->>>>> /build/octave-optics-0.1.4/inst/stokes_lpminus45.m +[inst/jones_lphorizontal.m] +>>>>> /build/octave-optics-0.1.4/inst/jones_lphorizontal.m ***** test % test default return value - V = stokes_lpminus45(); - R = V-[1;0;-1;0]; + V = jones_lphorizontal(); + R = V-[1;0]; 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; + amplitude = rand(1, 1); + V = jones_lphorizontal(amplitude); + R = V-[1;0]*amplitude; assert(norm(R,inf), 0, 1e-9); ***** test @@ -5021,28 +5154,86 @@ R = {R}; end rsize = size(R); - C = stokes_lpminus45(R); + C = jones_lphorizontal(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/stokes_lphorizontal.m] ->>>>> /build/octave-optics-0.1.4/inst/stokes_lphorizontal.m +[inst/mueller_checkmueller.m] +>>>>> /build/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/mueller_rotator.m] +>>>>> /build/octave-optics-0.1.4/inst/mueller_rotator.m ***** test % test default return value - V = stokes_lphorizontal(); - R = V-[1;1;0;0]; + A = mueller_rotator(); + R = A*A-A; 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; + % test serial application of rotator + angle = rand(1, 1); + A1 = mueller_rotator(angle); + A2 = mueller_rotator(angle*2); + R = A1*A1-A2; assert(norm(R,inf), 0, 1e-9); ***** test - % test correct size of return values + % another test of serial application of rotator + angle1 = rand(1, 1); + angle2 = rand(1, 1); + A1 = mueller_rotator(angle1); + A2 = mueller_rotator(angle2); + A12 = mueller_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 = mueller_rotator(angle); + A2 = mueller_rotator(-angle*180/pi(), 'deg'); + R = A2*A1-mueller_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); @@ -5050,38 +5241,183 @@ R = {R}; end rsize = size(R); - C = stokes_lphorizontal(R); + C = mueller_rotator(R); csize = size(C); assert(rsize == csize); end +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/stokes_isstokes.m] +>>>>> /build/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); + +***** test + % 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 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 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 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/mueller_homogeneous_elliptic_diattenuator.m] +>>>>> /build/octave-optics-0.1.4/inst/mueller_homogeneous_elliptic_diattenuator.m +***** test + % test default return value + 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/mueller_absorber.m] ->>>>> /build/octave-optics-0.1.4/inst/mueller_absorber.m +[inst/mueller_linpolarizer.m] +>>>>> /build/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_linretarder.m] +>>>>> /build/octave-optics-0.1.4/inst/mueller_linretarder.m ***** test % test default return value - A = mueller_absorber(); + A = mueller_linretarder(); 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 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 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 + 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/jones_lpplus45.m] +>>>>> /build/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 + % test return value + amplitude = rand(1, 1); + V = jones_lpplus45(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); @@ -5090,11 +5426,11 @@ R = {R}; end rsize = size(R); - C = mueller_absorber(R); + C = jones_lpplus45(R); csize = size(C); assert(rsize == csize); end -4 tests, 4 passed, 0 known failure, 0 skipped +3 tests, 3 passed, 0 known failure, 0 skipped [inst/jones_rotate.m] >>>>> /build/octave-optics-0.1.4/inst/jones_rotate.m ***** test @@ -5175,23 +5511,81 @@ assert(csize == [4,3,4]); 8 tests, 8 passed, 0 known failure, 0 skipped -[inst/jones_cpright.m] ->>>>> /build/octave-optics-0.1.4/inst/jones_cpright.m +[inst/zernike_R_poly.m] +>>>>> /build/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/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/jones_rotator.m] +>>>>> /build/octave-optics-0.1.4/inst/jones_rotator.m ***** test % test default return value - V = jones_cpright(); - R = V-[1;1i]; + A = jones_rotator(); + R = A*A-A; assert(norm(R,inf), 0, 1e-9); ***** test - % test return value - amplitude = rand(1, 1); - V = jones_cpright(amplitude); - R = V-[1;1i]*amplitude; + % 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 - % test correct size of return values + % 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); @@ -5199,86 +5593,92 @@ R = {R}; end rsize = size(R); - C = jones_cpright(R); + C = jones_rotator(R); csize = size(C); assert(rsize == csize); end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/zernike_noll_to_mn.m] ->>>>> /build/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]) +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/mueller_waveplate.m] +>>>>> /build/octave-optics-0.1.4/inst/mueller_waveplate.m ***** test - [m,n]=zernike_noll_to_mn(34); - assert([m n],[5 7]) + % test default return value + A = mueller_waveplate(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + ***** test - [m,n]=zernike_noll_to_mn(35); - assert([m n],[-7 7]) + % 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 - [m,n]=zernike_noll_to_mn(36); - assert([m n],[7 7]) + % 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 - [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.m] ->>>>> /build/octave-optics-0.1.4/inst/jones.m -***** error A = jones(); + % 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/mueller_stokes.m] +>>>>> /build/octave-optics-0.1.4/inst/mueller_stokes.m +***** error A = mueller_stokes(); ***** test % test singular argument, should just be returned - M = jones_waveplate(rand(1,1),'wav'); - MM = jones(M); + M = mueller_waveplate(rand(1,1),'wav'); + MM = mueller_stokes(M); R = MM-M; assert(norm(R,inf), 0, 1e-9); ***** test % send light with horizontal linear polarization through a rotating % 1/2-waveplate and subsequent polarizer: final intensity should % vary as cos(2*angle)^2. - % This test feeds jones() with one cell array only! + % This test feeds mueller_stokes() with one cell array only! angles = 0:360; - wps = jones_rotate(jones_waveplate(0.5, 'wav'), angles, 'deg'); - lightin = jones_lphorizontal(); - lightout = jones(jones_linpolarizer(),wps,lightin); - ilightout = jones_intensity(lightout); + wps = mueller_rotate(mueller_waveplate(0.5, 'wav'), angles, 'deg'); + lightin = stokes_lphorizontal(); + lightout = mueller_stokes(mueller_linpolarizer(),wps,lightin); + ilightout = stokes_intensity(lightout); R = ilightout-(cosd(angles.*2).^2); assert(norm(R,inf), 0, 1e-9); ***** test % this is a more thorough test: send light with horizontal linear % polarization through two rotating 1/2-waveplates (combining to % a 1/1-waveplate) and subsequent polarizer: final intensity - % should not vary! - % This test feeds jones() with two cell arrays. + % should not vary! + % This test feeds mueller_stokes() with two cell arrays. angles = 0:360; - wps1 = jones_rotate(jones_waveplate(0.5, 'wav'), angles, 'deg'); - wps2 = jones_rotate(jones_waveplate(0.5, 'wav'), angles, 'deg'); - lightin = jones_lphorizontal(); - lightout = jones(jones_linpolarizer(),wps2,wps1,lightin); - ilightout = jones_intensity(lightout); + wps1 = mueller_rotate(mueller_waveplate(0.5, 'wav'), angles, 'deg'); + wps2 = mueller_rotate(mueller_waveplate(0.5, 'wav'), angles, 'deg'); + lightin = stokes_lphorizontal(); + lightout = mueller_stokes(mueller_linpolarizer(),wps2,wps1,lightin); + ilightout = stokes_intensity(lightout); R = ilightout-1; assert(norm(R,inf), 0, 1e-9); ***** demo angles = 0:360; - wps = jones_rotate(jones_waveplate(0.5, 'wav'), angles, 'deg'); - lightin = jones_lphorizontal(); - lightout = jones(jones_linpolarizer(),wps,lightin); - ilightout = jones_intensity(lightout); + wps = mueller_rotate(mueller_waveplate(0.5, 'wav'), angles, 'deg'); + lightin = stokes_lphorizontal(); + lightout = mueller_stokes(mueller_linpolarizer(),wps,lightin); + ilightout = stokes_intensity(lightout); figure(); plot(angles, ilightout); title('transmitted intensity [should look like cos(2*a)^2'); @@ -5291,13 +5691,13 @@ % final intensity should vary as cos(2*angle)^2. ***** demo angles = 0:360; - wps = jones_rotate(jones_waveplate(0.5, 'wav'), angles, 'deg'); - wps2 = jones_rotate(jones_waveplate(0.45, 'wav'), angles, 'deg'); - lightin = jones_lphorizontal(); - lightout = jones(jones_linpolarizer(),wps,lightin); - ilightout = jones_intensity(lightout); - lightout2 = jones(jones_linpolarizer(),wps2,lightin); - ilightout2 = jones_intensity(lightout2); + wps = mueller_rotate(mueller_waveplate(0.5, 'wav'), angles, 'deg'); + wps2 = mueller_rotate(mueller_waveplate(0.45, 'wav'), angles, 'deg'); + lightin = stokes_lphorizontal(); + lightout = mueller_stokes(mueller_linpolarizer(),wps,lightin); + ilightout = stokes_intensity(lightout); + lightout2 = mueller_stokes(mueller_linpolarizer(),wps2,lightin); + ilightout2 = stokes_intensity(lightout2); figure(); plot(angles, ilightout, angles, ilightout2); title('transmitted intensity with perfect and non-perfect halfwave plate'); @@ -5315,11 +5715,11 @@ % angles are in rows, delays in columns angle_all = repmat(angle, [length(delay), 1]); delay_all = repmat(delay', [1, length(angle)]); - wps3 = jones_waveplate(delay_all, 'wav'); - wps3 = jones_rotate(wps3, angle_all, 'deg'); - lightin = jones_lphorizontal(); - lightout3 = jones(jones_linpolarizer(),wps3,lightin); - ilightout3 = jones_intensity(lightout3); + wps3 = mueller_waveplate(delay_all, 'wav'); + wps3 = mueller_rotate(wps3, angle_all, 'deg'); + lightin = stokes_lphorizontal(); + lightout3 = mueller_stokes(mueller_linpolarizer(),wps3,lightin); + ilightout3 = stokes_intensity(lightout3); figure(); plot(angle, ilightout3); title('transmitted intensity with plates of increasing delay'); @@ -5328,160 +5728,42 @@ legend(cellfun(@(x)sprintf('delay=%.2f',x),num2cell(delay),'UniformOutput',false)); % ----------------------------------------------------------------- % 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/mueller_checkmueller.m] ->>>>> /build/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)); + % rotating waveplates with increasing delay and subsequent polarizer 4 tests, 4 passed, 0 known failure, 0 skipped -[inst/jones_linpolarizer.m] ->>>>> /build/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; - 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_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_unity.m] ->>>>> /build/octave-optics-0.1.4/inst/jones_unity.m -***** test - A = jones_unity(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - +[inst/stokes_intensity.m] +>>>>> /build/octave-optics-0.1.4/inst/stokes_intensity.m ***** 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 size and value of return values + r1 = rand(2,3,4); + V1 = stokes_unpolarized(r1); + r2 = rand(4,3,2); + V2 = stokes_unpolarized(r2); + i1 = stokes_intensity(V1); + i2 = stokes_intensity(V2); + assert(all(i1==r1) && all(i2==r2)); ***** 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/zernike_cartesian.m] ->>>>> /build/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/jones_lpplus45.m] ->>>>> /build/octave-optics-0.1.4/inst/jones_lpplus45.m + % test size and value of return values + r1 = rand(2,3,4); + V1 = stokes_unpolarized(r1); + r2 = rand(1,1); + V2 = stokes_unpolarized(r2); + [i1,i2] = stokes_intensity(V1,V2); + assert(all(i1==r1) && all(i2==r2)); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/jones_lpminus45.m] +>>>>> /build/octave-optics-0.1.4/inst/jones_lpminus45.m ***** test % test default return value - V = jones_lpplus45(); - R = V-[1;1]; + V = jones_lpminus45(); + R = V-[1;-1]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value amplitude = rand(1, 1); - V = jones_lpplus45(amplitude); - R = V-[1;1]*amplitude; + V = jones_lpminus45(amplitude); + R = V-[1;-1]*amplitude; assert(norm(R,inf), 0, 1e-9); ***** test @@ -5493,62 +5775,27 @@ R = {R}; end rsize = size(R); - C = jones_lpplus45(R); + C = jones_lpminus45(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_lindiattenuator.m] ->>>>> /build/octave-optics-0.1.4/inst/mueller_lindiattenuator.m +[inst/stokes_unpolarized.m] +>>>>> /build/octave-optics-0.1.4/inst/stokes_unpolarized.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; + V = stokes_unpolarized(); + R = V-[1;0;0;0]; 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; + % 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 - % 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); @@ -5557,102 +5804,24 @@ R = {R}; end rsize = size(R); - C = mueller_lindiattenuator(R); + C = stokes_unpolarized(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/mueller_mirror.m] ->>>>> /build/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/mueller_waveplate.m] ->>>>> /build/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_lpminus45.m] ->>>>> /build/octave-optics-0.1.4/inst/jones_lpminus45.m +[inst/stokes_lphorizontal.m] +>>>>> /build/octave-optics-0.1.4/inst/stokes_lphorizontal.m ***** test % test default return value - V = jones_lpminus45(); - R = V-[1;-1]; + V = stokes_lphorizontal(); + R = V-[1;1;0;0]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value - amplitude = rand(1, 1); - V = jones_lpminus45(amplitude); - R = V-[1;-1]*amplitude; + intensity = rand(1, 1); + V = stokes_lphorizontal(intensity); + R = V-[1;1;0;0]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -5664,137 +5833,11 @@ R = {R}; end rsize = size(R); - C = jones_lpminus45(R); + C = stokes_lphorizontal(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/stokes_intensity.m] ->>>>> /build/octave-optics-0.1.4/inst/stokes_intensity.m -***** test - % test size and value of return values - r1 = rand(2,3,4); - V1 = stokes_unpolarized(r1); - r2 = rand(4,3,2); - V2 = stokes_unpolarized(r2); - i1 = stokes_intensity(V1); - i2 = stokes_intensity(V2); - assert(all(i1==r1) && all(i2==r2)); - -***** test - % test size and value of return values - r1 = rand(2,3,4); - V1 = stokes_unpolarized(r1); - r2 = rand(1,1); - V2 = stokes_unpolarized(r2); - [i1,i2] = stokes_intensity(V1,V2); - assert(all(i1==r1) && all(i2==r2)); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/mueller_unity.m] ->>>>> /build/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_homogeneous_elliptic_diattenuator.m] ->>>>> /build/octave-optics-0.1.4/inst/mueller_homogeneous_elliptic_diattenuator.m -***** test - % test default return value - 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/mueller_linretarder.m] ->>>>> /build/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 Checking C++ files ... Summary: 207 tests, 207 passed, 0 known failures, 0 skipped dh_installdocs -O--buildsystem=octave @@ -5822,12 +5865,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/24587/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/24587/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/4216 and its subdirectories -I: Current time: Thu Jun 8 01:38:26 -12 2023 -I: pbuilder-time-stamp: 1686231506 +I: removing directory /srv/workspace/pbuilder/24587 and its subdirectories +I: Current time: Fri Jun 9 04:38:39 +14 2023 +I: pbuilder-time-stamp: 1686235119