Diff of the two buildlogs: -- --- b1/build.log 2020-06-16 10:38:55.101987843 +0000 +++ b2/build.log 2020-06-16 10:48:51.690338965 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Mon Jul 19 05:00:39 -12 2021 -I: pbuilder-time-stamp: 1626714039 +I: Current time: Wed Jun 17 00:38:57 +14 2020 +I: pbuilder-time-stamp: 1592303937 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/buster-reproducible-base.tgz] I: copying local configuration @@ -18,7 +18,7 @@ I: Extracting source gpgv: unknown type of key resource 'trustedkeys.kbx' gpgv: keyblock resource '/root/.gnupg/trustedkeys.kbx': General error -gpgv: Signature made Thu Jan 3 23:07:11 2019 -12 +gpgv: Signature made Sat Jan 5 01:07:11 2019 +14 gpgv: using RSA key 3F464391498FE874BDB5D98F2124AA1983785C90 gpgv: Can't check signature: No public key dpkg-source: warning: failed to verify signature on ./octave-optics_0.1.3-2.dsc @@ -27,138 +27,172 @@ dpkg-source: info: unpacking octave-optics_0.1.3-2.debian.tar.xz I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/22689/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/23792/tmp/hooks/D01_modify_environment starting +debug: Running on profitbricks-build12-i386. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +Removing 'diversion of /bin/sh to /bin/sh.distrib by dash' +Adding 'diversion of /bin/sh to /bin/sh.distrib by bash' +Removing 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash' +Adding 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by 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/23792/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/23792/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='i386' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=18' - DISTRIBUTION='' - HOME='/root' - HOST_ARCH='i386' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="0" [2]="3" [3]="1" [4]="release" [5]="i686-pc-linux-gnu") + BASH_VERSION='5.0.3(1)-release' + BUILDDIR=/build + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=i386 + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=10' + DIRSTACK=() + DISTRIBUTION= + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=i686 + HOST_ARCH=i386 IFS=' ' - INVOCATION_ID='0a355cbc208f4bf6b81d020edd6492a3' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - LD_LIBRARY_PATH='/usr/lib/libeatmydata' - LD_PRELOAD='libeatmydata.so' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='22689' - PS1='# ' - PS2='> ' + INVOCATION_ID=9cdfbb3472bb40898729ab4e783a0002 + LANG=C + LANGUAGE=de_CH:de + LC_ALL=C + LD_LIBRARY_PATH=/usr/lib/libeatmydata + LD_PRELOAD=libeatmydata.so + MACHTYPE=i686-pc-linux-gnu + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnu + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=23792 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/tmp.ffHbZcn2x0/pbuilderrc_RgRf --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/buster-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.ffHbZcn2x0/b1 --logfile b1/build.log octave-optics_0.1.3-2.dsc' - SUDO_GID='112' - SUDO_UID='107' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://85.184.249.68:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/tmp.ffHbZcn2x0/pbuilderrc_mE7f --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/buster-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/tmp.ffHbZcn2x0/b2 --logfile b2/build.log octave-optics_0.1.3-2.dsc' + SUDO_GID=112 + SUDO_UID=107 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://78.137.99.97:3128 I: uname -a - Linux profitbricks-build16-i386 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux + Linux i-capture-the-hostname 4.19.0-9-686-pae #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) i686 GNU/Linux I: ls -l /bin - total 5476 - -rwxr-xr-x 1 root root 1302248 Apr 17 2019 bash - -rwxr-xr-x 3 root root 38280 Jul 10 2019 bunzip2 - -rwxr-xr-x 3 root root 38280 Jul 10 2019 bzcat - lrwxrwxrwx 1 root root 6 Jul 10 2019 bzcmp -> bzdiff - -rwxr-xr-x 1 root root 2227 Jul 10 2019 bzdiff - lrwxrwxrwx 1 root root 6 Jul 10 2019 bzegrep -> bzgrep - -rwxr-xr-x 1 root root 4877 Jun 24 2019 bzexe - lrwxrwxrwx 1 root root 6 Jul 10 2019 bzfgrep -> bzgrep - -rwxr-xr-x 1 root root 3641 Jul 10 2019 bzgrep - -rwxr-xr-x 3 root root 38280 Jul 10 2019 bzip2 - -rwxr-xr-x 1 root root 17768 Jul 10 2019 bzip2recover - lrwxrwxrwx 1 root root 6 Jul 10 2019 bzless -> bzmore - -rwxr-xr-x 1 root root 1297 Jul 10 2019 bzmore - -rwxr-xr-x 1 root root 38692 Feb 28 2019 cat - -rwxr-xr-x 1 root root 75588 Feb 28 2019 chgrp - -rwxr-xr-x 1 root root 63268 Feb 28 2019 chmod - -rwxr-xr-x 1 root root 75588 Feb 28 2019 chown - -rwxr-xr-x 1 root root 153732 Feb 28 2019 cp - -rwxr-xr-x 1 root root 132820 Jan 17 2019 dash - -rwxr-xr-x 1 root root 120676 Feb 28 2019 date - -rwxr-xr-x 1 root root 92040 Feb 28 2019 dd - -rwxr-xr-x 1 root root 100620 Feb 28 2019 df - -rwxr-xr-x 1 root root 149736 Feb 28 2019 dir - -rwxr-xr-x 1 root root 79412 Jan 9 2019 dmesg - lrwxrwxrwx 1 root root 8 Sep 26 2018 dnsdomainname -> hostname - lrwxrwxrwx 1 root root 8 Sep 26 2018 domainname -> hostname - -rwxr-xr-x 1 root root 34532 Feb 28 2019 echo - -rwxr-xr-x 1 root root 28 Jan 7 2019 egrep - -rwxr-xr-x 1 root root 34532 Feb 28 2019 false - -rwxr-xr-x 1 root root 28 Jan 7 2019 fgrep - -rwxr-xr-x 1 root root 67700 Jan 9 2019 findmnt - -rwsr-xr-x 1 root root 30112 Apr 22 2020 fusermount - -rwxr-xr-x 1 root root 206392 Jan 7 2019 grep - -rwxr-xr-x 2 root root 2345 Jan 5 2019 gunzip - -rwxr-xr-x 1 root root 6375 Jan 5 2019 gzexe - -rwxr-xr-x 1 root root 100952 Jan 5 2019 gzip - -rwxr-xr-x 1 root root 21916 Sep 26 2018 hostname - -rwxr-xr-x 1 root root 79752 Feb 28 2019 ln - -rwxr-xr-x 1 root root 55400 Jul 26 2018 login - -rwxr-xr-x 1 root root 149736 Feb 28 2019 ls - -rwxr-xr-x 1 root root 112032 Jan 9 2019 lsblk - -rwxr-xr-x 1 root root 87972 Feb 28 2019 mkdir - -rwxr-xr-x 1 root root 79748 Feb 28 2019 mknod - -rwxr-xr-x 1 root root 46916 Feb 28 2019 mktemp - -rwxr-xr-x 1 root root 42348 Jan 9 2019 more - -rwsr-xr-x 1 root root 50592 Jan 9 2019 mount - -rwxr-xr-x 1 root root 13724 Jan 9 2019 mountpoint - -rwxr-xr-x 1 root root 157832 Feb 28 2019 mv - lrwxrwxrwx 1 root root 8 Sep 26 2018 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Feb 14 2019 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 38660 Feb 28 2019 pwd - lrwxrwxrwx 1 root root 4 Apr 17 2019 rbash -> bash - -rwxr-xr-x 1 root root 46852 Feb 28 2019 readlink - -rwxr-xr-x 1 root root 75588 Feb 28 2019 rm - -rwxr-xr-x 1 root root 42756 Feb 28 2019 rmdir - -rwxr-xr-x 1 root root 22276 Jan 21 2019 run-parts - -rwxr-xr-x 1 root root 125036 Dec 22 2018 sed - lrwxrwxrwx 1 root root 4 Jul 19 02:48 sh -> dash - -rwxr-xr-x 1 root root 34532 Feb 28 2019 sleep - -rwxr-xr-x 1 root root 79652 Feb 28 2019 stty - -rwsr-xr-x 1 root root 71072 Jan 9 2019 su - -rwxr-xr-x 1 root root 34564 Feb 28 2019 sync - -rwxr-xr-x 1 root root 504024 Apr 23 2019 tar - -rwxr-xr-x 1 root root 13860 Jan 21 2019 tempfile - -rwxr-xr-x 1 root root 104292 Feb 28 2019 touch - -rwxr-xr-x 1 root root 34532 Feb 28 2019 true - -rwxr-xr-x 1 root root 17768 Apr 22 2020 ulockmgr_server - -rwsr-xr-x 1 root root 30108 Jan 9 2019 umount - -rwxr-xr-x 1 root root 34532 Feb 28 2019 uname - -rwxr-xr-x 2 root root 2345 Jan 5 2019 uncompress - -rwxr-xr-x 1 root root 149736 Feb 28 2019 vdir - -rwxr-xr-x 1 root root 34208 Jan 9 2019 wdctl - -rwxr-xr-x 1 root root 946 Jan 21 2019 which - lrwxrwxrwx 1 root root 8 Sep 26 2018 ypdomainname -> hostname - -rwxr-xr-x 1 root root 1983 Jan 5 2019 zcat - -rwxr-xr-x 1 root root 1677 Jan 5 2019 zcmp - -rwxr-xr-x 1 root root 5879 Jan 5 2019 zdiff - -rwxr-xr-x 1 root root 29 Jan 5 2019 zegrep - -rwxr-xr-x 1 root root 29 Jan 5 2019 zfgrep - -rwxr-xr-x 1 root root 2080 Jan 5 2019 zforce - -rwxr-xr-x 1 root root 7584 Jan 5 2019 zgrep - -rwxr-xr-x 1 root root 2205 Jan 5 2019 zless - -rwxr-xr-x 1 root root 1841 Jan 5 2019 zmore - -rwxr-xr-x 1 root root 4552 Jan 5 2019 znew -I: user script /srv/workspace/pbuilder/22689/tmp/hooks/D02_print_environment finished + total 5496 + -rwxr-xr-x 1 root root 1302248 Apr 18 2019 bash + -rwxr-xr-x 3 root root 38280 Jul 11 2019 bunzip2 + -rwxr-xr-x 3 root root 38280 Jul 11 2019 bzcat + lrwxrwxrwx 1 root root 6 Jul 11 2019 bzcmp -> bzdiff + -rwxr-xr-x 1 root root 2227 Jul 11 2019 bzdiff + lrwxrwxrwx 1 root root 6 Jul 11 2019 bzegrep -> bzgrep + -rwxr-xr-x 1 root root 4877 Jun 25 2019 bzexe + lrwxrwxrwx 1 root root 6 Jul 11 2019 bzfgrep -> bzgrep + -rwxr-xr-x 1 root root 3641 Jul 11 2019 bzgrep + -rwxr-xr-x 3 root root 38280 Jul 11 2019 bzip2 + -rwxr-xr-x 1 root root 17768 Jul 11 2019 bzip2recover + lrwxrwxrwx 1 root root 6 Jul 11 2019 bzless -> bzmore + -rwxr-xr-x 1 root root 1297 Jul 11 2019 bzmore + -rwxr-xr-x 1 root root 38692 Mar 1 2019 cat + -rwxr-xr-x 1 root root 75588 Mar 1 2019 chgrp + -rwxr-xr-x 1 root root 63268 Mar 1 2019 chmod + -rwxr-xr-x 1 root root 75588 Mar 1 2019 chown + -rwxr-xr-x 1 root root 153732 Mar 1 2019 cp + -rwxr-xr-x 1 root root 132820 Jan 18 2019 dash + -rwxr-xr-x 1 root root 120676 Mar 1 2019 date + -rwxr-xr-x 1 root root 92040 Mar 1 2019 dd + -rwxr-xr-x 1 root root 100620 Mar 1 2019 df + -rwxr-xr-x 1 root root 149736 Mar 1 2019 dir + -rwxr-xr-x 1 root root 79412 Jan 10 2019 dmesg + lrwxrwxrwx 1 root root 8 Sep 27 2018 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Sep 27 2018 domainname -> hostname + -rwxr-xr-x 1 root root 34532 Mar 1 2019 echo + -rwxr-xr-x 1 root root 28 Jan 8 2019 egrep + -rwxr-xr-x 1 root root 34532 Mar 1 2019 false + -rwxr-xr-x 1 root root 28 Jan 8 2019 fgrep + -rwxr-xr-x 1 root root 67700 Jan 10 2019 findmnt + -rwsr-xr-x 1 root root 30112 Apr 23 09:38 fusermount + -rwxr-xr-x 1 root root 206392 Jan 8 2019 grep + -rwxr-xr-x 2 root root 2345 Jan 6 2019 gunzip + -rwxr-xr-x 1 root root 6375 Jan 6 2019 gzexe + -rwxr-xr-x 1 root root 100952 Jan 6 2019 gzip + -rwxr-xr-x 1 root root 21916 Sep 27 2018 hostname + -rwxr-xr-x 1 root root 79752 Mar 1 2019 ln + -rwxr-xr-x 1 root root 55400 Jul 27 2018 login + -rwxr-xr-x 1 root root 149736 Mar 1 2019 ls + -rwxr-xr-x 1 root root 112032 Jan 10 2019 lsblk + -rwxr-xr-x 1 root root 87972 Mar 1 2019 mkdir + -rwxr-xr-x 1 root root 79748 Mar 1 2019 mknod + -rwxr-xr-x 1 root root 46916 Mar 1 2019 mktemp + -rwxr-xr-x 1 root root 42348 Jan 10 2019 more + -rwsr-xr-x 1 root root 50592 Jan 10 2019 mount + -rwxr-xr-x 1 root root 13724 Jan 10 2019 mountpoint + -rwxr-xr-x 1 root root 157832 Mar 1 2019 mv + lrwxrwxrwx 1 root root 8 Sep 27 2018 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Feb 15 2019 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 38660 Mar 1 2019 pwd + lrwxrwxrwx 1 root root 4 Apr 18 2019 rbash -> bash + -rwxr-xr-x 1 root root 46852 Mar 1 2019 readlink + -rwxr-xr-x 1 root root 75588 Mar 1 2019 rm + -rwxr-xr-x 1 root root 42756 Mar 1 2019 rmdir + -rwxr-xr-x 1 root root 22276 Jan 22 2019 run-parts + -rwxr-xr-x 1 root root 125036 Dec 23 2018 sed + lrwxrwxrwx 1 root root 4 Jun 17 00:42 sh -> bash + lrwxrwxrwx 1 root root 4 Jun 16 22:25 sh.distrib -> dash + -rwxr-xr-x 1 root root 34532 Mar 1 2019 sleep + -rwxr-xr-x 1 root root 79652 Mar 1 2019 stty + -rwsr-xr-x 1 root root 71072 Jan 10 2019 su + -rwxr-xr-x 1 root root 34564 Mar 1 2019 sync + -rwxr-xr-x 1 root root 504024 Apr 24 2019 tar + -rwxr-xr-x 1 root root 13860 Jan 22 2019 tempfile + -rwxr-xr-x 1 root root 104292 Mar 1 2019 touch + -rwxr-xr-x 1 root root 34532 Mar 1 2019 true + -rwxr-xr-x 1 root root 17768 Apr 23 09:38 ulockmgr_server + -rwsr-xr-x 1 root root 30108 Jan 10 2019 umount + -rwxr-xr-x 1 root root 34532 Mar 1 2019 uname + -rwxr-xr-x 2 root root 2345 Jan 6 2019 uncompress + -rwxr-xr-x 1 root root 149736 Mar 1 2019 vdir + -rwxr-xr-x 1 root root 34208 Jan 10 2019 wdctl + -rwxr-xr-x 1 root root 946 Jan 22 2019 which + lrwxrwxrwx 1 root root 8 Sep 27 2018 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1983 Jan 6 2019 zcat + -rwxr-xr-x 1 root root 1677 Jan 6 2019 zcmp + -rwxr-xr-x 1 root root 5879 Jan 6 2019 zdiff + -rwxr-xr-x 1 root root 29 Jan 6 2019 zegrep + -rwxr-xr-x 1 root root 29 Jan 6 2019 zfgrep + -rwxr-xr-x 1 root root 2080 Jan 6 2019 zforce + -rwxr-xr-x 1 root root 7584 Jan 6 2019 zgrep + -rwxr-xr-x 1 root root 2205 Jan 6 2019 zless + -rwxr-xr-x 1 root root 1841 Jan 6 2019 zmore + -rwxr-xr-x 1 root root 4552 Jan 6 2019 znew +I: user script /srv/workspace/pbuilder/23792/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -546,7 +580,7 @@ Get: 348 http://deb.debian.org/debian buster/main i386 fonts-freefont-otf all 20120503-9 [3169 kB] Get: 349 http://deb.debian.org/debian buster/main i386 dh-octave-autopkgtest all 0.6.2 [8308 B] Get: 350 http://deb.debian.org/debian buster/main i386 dh-octave all 0.6.2 [19.9 kB] -Fetched 135 MB in 2s (63.6 MB/s) +Fetched 135 MB in 44s (3049 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libbsd0:i386. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19234 files and directories currently installed.) @@ -1993,7 +2027,7 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/octave-optics-0.1.3/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b +I: Running cd /build/octave-optics-0.1.3/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b dpkg-buildpackage: info: source package octave-optics dpkg-buildpackage: info: source version 0.1.3-2 dpkg-buildpackage: info: source distribution unstable @@ -2027,6 +2061,299 @@ dh_octave_check -O--buildsystem=octave Checking package... Checking m files ... +[inst/zernike_name.m] +>>>>> /build/octave-optics-0.1.3/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_cartesian.m] +>>>>> /build/octave-optics-0.1.3/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 +***** assert (zernike_cartesian (0, 0, 1), 1) +***** error (zernike_cartesian (0, 0, 0)) +***** error (zernike_cartesian (0, 0, pi)) +***** error (zernike_cartesian ()) +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/zernike_noll_to_mn.m] +>>>>> /build/octave-optics-0.1.3/inst/zernike_noll_to_mn.m +***** test + [m,n]=zernike_noll_to_mn(1); + assert([m n],[0 0]) +***** test + [m,n]=zernike_noll_to_mn(2); + assert([m n],[1 1]) +***** test + [m,n]=zernike_noll_to_mn(3); + assert([m n],[-1 1]) +***** test + [m,n]=zernike_noll_to_mn(4); + assert([m n],[0 2]) +***** test + [m,n]=zernike_noll_to_mn(5); + assert([m n],[-2 2]) +***** test + [m,n]=zernike_noll_to_mn(20); + assert([m n],[5 5]) +***** test + [m,n]=zernike_noll_to_mn(34); + assert([m n],[5 7]) +***** test + [m,n]=zernike_noll_to_mn(35); + assert([m n],[-7 7]) +***** test + [m,n]=zernike_noll_to_mn(36); + assert([m n],[7 7]) +***** test + [m,n]=zernike_noll_to_mn([2 5 8 35]); + assert(m,[1 -2 1 -7]) + assert(n,[1 2 3 7]) +10 tests, 10 passed, 0 known failure, 0 skipped +[inst/jones_rotator.m] +>>>>> /build/octave-optics-0.1.3/inst/jones_rotator.m +***** test + % test default return value + A = jones_rotator(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test serial application of rotator + angle = rand(1, 1); + A1 = jones_rotator(angle); + A2 = jones_rotator(angle*2); + R = A1*A1-A2; + assert(norm(R,inf), 0, 1e-9); + +***** test + % another test of serial application of rotator + angle1 = rand(1, 1); + angle2 = rand(1, 1); + A1 = jones_rotator(angle1); + A2 = jones_rotator(angle2); + A12 = jones_rotator(angle1+angle2); + R = A1*A2-A12; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test different angle value interpretations + angle = rand(1, 1); + A1 = jones_rotator(angle); + A2 = jones_rotator(-angle*180/pi(), 'deg'); + R = A2*A1-jones_unity(); + assert(norm(R,inf), 0, 1e-9); + +***** test + % test size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = jones_rotator(R); + csize = size(C); + assert(rsize == csize); + end +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/mueller_circdiattenuator.m] +>>>>> /build/octave-optics-0.1.3/inst/mueller_circdiattenuator.m +***** test + % test default return value + A = mueller_circdiattenuator(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test equality of providing diattenuation or kx and ky + d = rand(1, 1); + kr = 1; + kl = (1-d)./(1+d); + A1 = mueller_circdiattenuator(d); + A2 = mueller_circdiattenuator(kr, kl); + R = A1-A2; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test serial application of circular diattenuators + kr = rand(1, 1); + kl = rand(1, 1); + A1 = mueller_circdiattenuator(kr,kl); + A2 = mueller_circdiattenuator(kr*kr,kl*kl); + R = A1*A1-A2; + assert(norm(R,inf), 0, 1e-9); + +***** test + % another test of serial application of retarder elements + kr1 = rand(1, 1); + kr2 = rand(1, 1); + kl1 = rand(1, 1); + kl2 = rand(1, 1); + A1 = mueller_circdiattenuator(kr1,kl1); + A2 = mueller_circdiattenuator(kr2,kl2); + A12 = mueller_circdiattenuator(kr1*kr2,kl1*kl2); + R = A1*A2-A12; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test mode + kr = rand(1, 1); + kl = rand(1, 1); + A1 = mueller_circdiattenuator(kr,kl); + A2 = mueller_circdiattenuator(kr,kl,'int'); + A3 = mueller_circdiattenuator(sqrt(kr),sqrt(kl),'amp'); + R1 = A1-A2; + R2 = A1-A3; + assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); + +***** test + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = mueller_circdiattenuator(R); + csize = size(C); + assert(rsize == csize); + end + +***** test + % another test correct size of return values + kr = rand(3,4,5); + kl = rand(5,4,3); + C = mueller_circdiattenuator(kr,kl); + csize = size(C); + assert(csize == [5,4,5]); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/jones_mirror.m] +>>>>> /build/octave-optics-0.1.3/inst/jones_mirror.m +***** test + % test mirror that is its own inverted element + A = jones_mirror(); + R = (A-1\A); + assert(norm(R,inf), 0, 1e-9); + +***** test + % test direct size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + rsize = size(rand(asize)); + U = jones_mirror(rsize); + usize = size(U); + assert(usize == rsize); + end + +***** test + % test indirect size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + C = cell(asize); + csize = size(C); + U = jones_mirror(C); + usize = size(U); + assert(usize == csize); + end + +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/jones_cpleft.m] +>>>>> /build/octave-optics-0.1.3/inst/jones_cpleft.m +***** test + % test default return value + V = jones_cpleft(); + R = V-[1;-1i]; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test return value + amplitude = rand(1, 1); + V = jones_cpleft(amplitude); + R = V-[1;-1i]*amplitude; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = jones_cpleft(R); + csize = size(C); + assert(rsize == csize); + end +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/jones_linretarder.m] +>>>>> /build/octave-optics-0.1.3/inst/jones_linretarder.m +***** test + % test default return value + A = jones_linretarder(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test serial application of linear retarder elements + phase = rand(1, 1); + A1 = jones_linretarder(phase); + A2 = jones_linretarder(phase*2); + R = A1*A1-A2; + assert(norm(R,inf), 0, 1e-9); + +***** test + % another test of serial application of retarder elements + phase1 = rand(1, 1); + phase2 = rand(1, 1); + A1 = jones_linretarder(phase1); + A2 = jones_linretarder(phase2); + A12 = jones_linretarder(phase1+phase2); + R = A1*A2-A12; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test mode + phase = rand(1, 1); + A1 = jones_linretarder(phase); + A2 = jones_linretarder(phase*180/pi(), 'deg'); + A3 = jones_linretarder(phase/(2*pi()), 'wav'); + R1 = A1-A2; + R2 = A1-A3; + assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); + +***** test + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = jones_linretarder(R); + csize = size(C); + assert(rsize == csize); + end +5 tests, 5 passed, 0 known failure, 0 skipped [inst/jones_rotate.m] >>>>> /build/octave-optics-0.1.3/inst/jones_rotate.m ***** test @@ -2107,65 +2434,164 @@ assert(csize == [4,3,4]); 8 tests, 8 passed, 0 known failure, 0 skipped -[inst/mueller_rotate.m] ->>>>> /build/octave-optics-0.1.3/inst/mueller_rotate.m +[inst/stokes_isstokes.m] +>>>>> /build/octave-optics-0.1.3/inst/stokes_isstokes.m ***** test - % default return value: unity matrix - A = mueller_rotate(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); + % test type check + V1 = stokes_unpolarized(); + V2 = char(V1); + t1 = stokes_isstokes(V1); + t2 = stokes_isstokes(V2); + assert(t1 && ~t2); ***** test - % rotation by 0 should do nothing - delay = rand(1,1); - M = mueller_linretarder(delay); - A = mueller_rotate(M, 0); - R = M-A; - assert(norm(R,inf), 0, 1e-9); + % test size check + V1 = stokes_unpolarized(); + V2 = V1; + V2(5,1) = 1; + t1 = stokes_isstokes(V1); + t2 = stokes_isstokes(V2); + assert(t1 && ~t2); ***** test - % undo rotation by 2nd opposite rotation - delay = rand(1,1); - angle = rand(1, 1); - M = mueller_linretarder(delay); - A1 = mueller_rotate(M, angle); - A2 = mueller_rotate(A1, -angle); - R = A2-M; - assert(norm(R,inf), 0, 1e-9); + % test size 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 serial application of rotation - delay = rand(1,1); - angle1 = rand(1, 1); - angle2 = rand(1, 1); - M = mueller_linretarder(delay); - A1 = mueller_rotate(M, angle1); - A2 = mueller_rotate(A1, angle2); - A12 = mueller_rotate(M, angle1+angle2); - R = A2-A12; - assert(norm(R,inf), 0, 1e-9); + % test size of return value + 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 - % testing MODE parameter - angle = rand(1, 1); - A1 = mueller_rotate(mueller_waveplate(0.5), angle, 'rad'); - A2 = mueller_rotate(mueller_waveplate(0.5), angle*180/pi(), 'deg'); - R = A2-A1; + % test indivial elements of return value + V1 = stokes_unpolarized(ones(2,3,4)); + V1{2,2,2} = 0; + V2 = stokes_unpolarized(ones(4,3,2)); + V2{1,1,1} = 0; + t1 = stokes_isstokes(V1); + t2 = stokes_isstokes(V2); + assert(t1(1,1,1) && ~t1(2,2,2) && ~t2(1,1,1) && t2(2,2,2)); +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/jones_intensity.m] +>>>>> /build/octave-optics-0.1.3/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_linpolarizer.m] +>>>>> /build/octave-optics-0.1.3/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 - % size of return value determined by 1st argument - angle = rand(1,1); + % test direct size parameter for dim = 1:5 asize = randi([1 4], 1, dim); rsize = size(rand(asize)); - C = mueller_rotate(mueller_unity(rsize), angle); + 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); - assert(rsize == csize); + U = jones_linpolarizer(C); + usize = size(U); + assert(usize == csize); end +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/mueller_checkmueller.m] +>>>>> /build/octave-optics-0.1.3/inst/mueller_checkmueller.m ***** test - % size if return value determined by 2nd argument + % test type check + A1 = mueller_unity(); + A2 = char(A1); + t1 = mueller_checkmueller(A1); + t2 = mueller_checkmueller(A2); + assert(t1 && ~t2); + +***** test + % test size check + A1 = mueller_unity(); + A2 = A1; + A2(5,5) = 1; + t1 = mueller_checkmueller(A1); + t2 = mueller_checkmueller(A2); + assert(t1 && ~t2); + +***** test + % test size of return value + A1 = mueller_mirror([2,3,4]); + A1{2,2,2} = 0; + A2 = mueller_mirror([4,3,2]); + A2{1,1,1} = 0; + t1 = mueller_checkmueller(A1); + t2 = mueller_checkmueller(A2); + assert((size(A1)==size(t1)) && (size(A2)==size(t2))); + +***** test + % test indivial elements of return value + A1 = mueller_mirror([2,3,4]); + A1{2,2,2} = ones(4,4)*0.99; + A2 = mueller_mirror([4,3,2]); + A2{1,1,1} = ones(4,4)*1.01; + t1 = mueller_checkmueller(A1); + t2 = mueller_checkmueller(A2); + assert(t1(1,1,1) && ~t1(2,2,2) && ~t2(1,1,1) && t2(2,2,2)); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/jones_lpminus45.m] +>>>>> /build/octave-optics-0.1.3/inst/jones_lpminus45.m +***** test + % test default return value + V = jones_lpminus45(); + R = V-[1;-1]; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test return value + amplitude = rand(1, 1); + V = jones_lpminus45(amplitude); + R = V-[1;-1]*amplitude; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test correct size of return values for dim = 1:5 asize = randi([1 4], 1, dim); R = rand(asize); @@ -2173,53 +2599,24 @@ R = {R}; end rsize = size(R); - C = mueller_rotate(mueller_unity(), R); + C = jones_lpminus45(R); csize = size(C); assert(rsize == csize); end - -***** test - % size if return value determined by both argument - M = mueller_unity([4,3,2]); - angle = rand(2,3,4); - C = mueller_rotate(M, angle); - csize = size(C); - assert(csize == [4,3,4]); - -8 tests, 8 passed, 0 known failure, 0 skipped -[inst/stokes_degpolarization.m] ->>>>> /build/octave-optics-0.1.3/inst/stokes_degpolarization.m -***** test - % test size of return values - r1 = rand(2,3,4); - V1 = stokes_unpolarized(r1); - r2 = rand(4,3,2); - V2 = stokes_unpolarized(r2); - [d1,d2] = stokes_degpolarization(V1,V2); - assert((size(d1)==size(r1)) && size(size(d2)==size(r2))); - -***** test - % test return values - r1 = rand(1,1); - V1 = stokes_cpleft(r1)+stokes_unpolarized(1-r1); - r2 = rand(1,1); - V2 = stokes_unpolarized(r2); - [d1,d2] = stokes_degpolarization(V1,V2); - assert((d1==r1) && (d2==0)); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/stokes_lphorizontal.m] ->>>>> /build/octave-optics-0.1.3/inst/stokes_lphorizontal.m +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/stokes_cpright.m] +>>>>> /build/octave-optics-0.1.3/inst/stokes_cpright.m ***** test % test default return value - V = stokes_lphorizontal(); - R = V-[1;1;0;0]; + V = stokes_cpright(); + R = V-[1;0;0;1]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value intensity = rand(1, 1); - V = stokes_lphorizontal(intensity); - R = V-[1;1;0;0]*intensity; + V = stokes_cpright(intensity); + R = V-[1;0;0;1]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -2231,11 +2628,63 @@ R = {R}; end rsize = size(R); - C = stokes_lphorizontal(R); + C = stokes_cpright(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped +[inst/jones_waveplate.m] +>>>>> /build/octave-optics-0.1.3/inst/jones_waveplate.m +***** test + % test default return value + A = jones_waveplate(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); +***** test + % test serial application of absorptive elements + delay = rand(1, 1); + A1 = jones_waveplate(delay); + A2 = jones_waveplate(delay*2); + R = A1*A1-A2; + assert(norm(R,inf), 0, 1e-9); +***** test + % another test of serial application of absorptive elements + delay1 = rand(1, 1); + delay2 = rand(1, 1); + A1 = jones_waveplate(delay1); + A2 = jones_waveplate(delay2); + A12 = jones_waveplate(delay1+delay2); + R = A1*A2-A12; + assert(norm(R,inf), 0, 1e-9); +***** test + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = jones_waveplate(R); + csize = size(C); + assert(csize, rsize); + end +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/zernike_polar.m] +>>>>> /build/octave-optics-0.1.3/inst/zernike_polar.m +***** test + r = 0.2; + phi = 1.23; + n = 4; + ret = zernike_polar (r, phi, n); + assert (ret, [1 r*cos(phi) r*sin(phi) 2*r^2-1], 5*eps) +***** test + r = [0.5 0.8]; + phi = [pi/4 pi/4]; + n = 4; + ret = zernike_polar (r, phi, n); + assert (ret, [1 r(1)*cos(phi(1)) r(1)*sin(phi(1)) 2*r(1)^2-1; 1 r(2)*cos(phi(2)) r(2)*sin(phi(2)) 2*r(2)^2-1], 5*eps) +2 tests, 2 passed, 0 known failure, 0 skipped [inst/stokes_intensity.m] >>>>> /build/octave-optics-0.1.3/inst/stokes_intensity.m ***** test @@ -2257,19 +2706,19 @@ [i1,i2] = stokes_intensity(V1,V2); assert(all(i1==r1) && all(i2==r2)); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/jones_cpleft.m] ->>>>> /build/octave-optics-0.1.3/inst/jones_cpleft.m +[inst/stokes_lpplus45.m] +>>>>> /build/octave-optics-0.1.3/inst/stokes_lpplus45.m ***** test % test default return value - V = jones_cpleft(); - R = V-[1;-1i]; + V = stokes_lpplus45(); + R = V-[1;0;1;0]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value - amplitude = rand(1, 1); - V = jones_cpleft(amplitude); - R = V-[1;-1i]*amplitude; + intensity = rand(1, 1); + V = stokes_lpplus45(intensity); + R = V-[1;0;1;0]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -2281,78 +2730,63 @@ R = {R}; end rsize = size(R); - C = jones_cpleft(R); + C = stokes_lpplus45(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_linpolarizer.m] ->>>>> /build/octave-optics-0.1.3/inst/jones_linpolarizer.m +[inst/mueller_lindiattenuator.m] +>>>>> /build/octave-optics-0.1.3/inst/mueller_lindiattenuator.m ***** test - % applying an ideal linear polarizer twice is identical to - % apply it once! - A = jones_linpolarizer(); + % test default return value + A = mueller_lindiattenuator(); 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_rotator.m] ->>>>> /build/octave-optics-0.1.3/inst/jones_rotator.m -***** test - % test default return value - A = jones_rotator(); - R = A*A-A; + % 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 rotator - angle = rand(1, 1); - A1 = jones_rotator(angle); - A2 = jones_rotator(angle*2); + % test serial application of linear diattenuators + kx = rand(1, 1); + ky = rand(1, 1); + A1 = mueller_lindiattenuator(kx,ky); + A2 = mueller_lindiattenuator(kx*kx,ky*ky); R = A1*A1-A2; assert(norm(R,inf), 0, 1e-9); ***** test - % another test of serial application of rotator - angle1 = rand(1, 1); - angle2 = rand(1, 1); - A1 = jones_rotator(angle1); - A2 = jones_rotator(angle2); - A12 = jones_rotator(angle1+angle2); + % 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 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 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 size of return values + % test correct size of return values for dim = 1:5 asize = randi([1 4], 1, dim); R = rand(asize); @@ -2360,95 +2794,99 @@ R = {R}; end rsize = size(R); - C = jones_rotator(R); + C = mueller_lindiattenuator(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.3/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); - + % another test correct size of return values + kx = rand(3,4,5); + ky = rand(5,4,3); + C = mueller_lindiattenuator(kx,ky); + csize = size(C); + assert(csize == [5,4,5]); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/jones_cpright.m] +>>>>> /build/octave-optics-0.1.3/inst/jones_cpright.m ***** 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 default return value + V = jones_cpright(); + R = V-[1;1i]; + 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])); + % test return value + amplitude = rand(1, 1); + V = jones_cpright(amplitude); + R = V-[1;1i]*amplitude; + 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/zernike_cartesian.m] ->>>>> /build/octave-optics-0.1.3/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 -***** assert (zernike_cartesian (0, 0, 1), 1) -***** error (zernike_cartesian (0, 0, 0)) -***** error (zernike_cartesian (0, 0, pi)) -***** error (zernike_cartesian ()) -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/stokes_lpplus45.m] ->>>>> /build/octave-optics-0.1.3/inst/stokes_lpplus45.m + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = jones_cpright(R); + csize = size(C); + assert(rsize == csize); + end +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/jones_lindiattenuator.m] +>>>>> /build/octave-optics-0.1.3/inst/jones_lindiattenuator.m ***** test % test default return value - V = stokes_lpplus45(); - R = V-[1;0;1;0]; + A = jones_lindiattenuator(); + R = A*A-A; 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; + % 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); @@ -2457,11 +2895,19 @@ R = {R}; end rsize = size(R); - C = stokes_lpplus45(R); + C = jones_lindiattenuator(R); csize = size(C); assert(rsize == csize); end -3 tests, 3 passed, 0 known failure, 0 skipped + +***** 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/mueller_circretarder.m] >>>>> /build/octave-optics-0.1.3/inst/mueller_circretarder.m ***** test @@ -2512,19 +2958,30 @@ assert(rsize == csize); end 5 tests, 5 passed, 0 known failure, 0 skipped -[inst/stokes_unpolarized.m] ->>>>> /build/octave-optics-0.1.3/inst/stokes_unpolarized.m +[inst/mueller_waveplate.m] +>>>>> /build/octave-optics-0.1.3/inst/mueller_waveplate.m ***** test % test default return value - V = stokes_unpolarized(); - R = V-[1;0;0;0]; + A = mueller_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 = 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 @@ -2536,19 +2993,80 @@ R = {R}; end rsize = size(R); - C = stokes_unpolarized(R); + C = mueller_waveplate(R); csize = size(C); assert(rsize == csize); end +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/mueller_mirror.m] +>>>>> /build/octave-optics-0.1.3/inst/mueller_mirror.m +***** test + % test mirror that is its own inverted element + A = mueller_mirror(); + R = (A-1\A); + assert(norm(R,inf), 0, 1e-9); + +***** test + % test direct size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + rsize = size(rand(asize)); + U = mueller_mirror(rsize); + usize = size(U); + assert(usize == rsize); + end + +***** test + % test indirect size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + C = cell(asize); + csize = size(C); + U = mueller_mirror(C); + usize = size(U); + assert(usize == csize); + end + 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/zernike_name.m] ->>>>> /build/octave-optics-0.1.3/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.3/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.3/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/mueller_homogeneous_elliptic_retarder.m] >>>>> /build/octave-optics-0.1.3/inst/mueller_homogeneous_elliptic_retarder.m ***** test @@ -2580,19 +3098,19 @@ csize = size(C); assert(csize == [6,5,6]); 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_cpright.m] ->>>>> /build/octave-optics-0.1.3/inst/jones_cpright.m +[inst/stokes_cpleft.m] +>>>>> /build/octave-optics-0.1.3/inst/stokes_cpleft.m ***** test % test default return value - V = jones_cpright(); - R = V-[1;1i]; + V = stokes_cpleft(); + R = V-[1;0;0;-1]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value - amplitude = rand(1, 1); - V = jones_cpright(amplitude); - R = V-[1;1i]*amplitude; + intensity = rand(1, 1); + V = stokes_cpleft(intensity); + R = V-[1;0;0;-1]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -2604,7 +3122,7 @@ R = {R}; end rsize = size(R); - C = jones_cpright(R); + C = stokes_cpleft(R); csize = size(C); assert(rsize == csize); end @@ -2701,104 +3219,35 @@ % 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/zernike_noll_to_mn.m] ->>>>> /build/octave-optics-0.1.3/inst/zernike_noll_to_mn.m -***** test - [m,n]=zernike_noll_to_mn(1); - assert([m n],[0 0]) -***** test - [m,n]=zernike_noll_to_mn(2); - assert([m n],[1 1]) -***** test - [m,n]=zernike_noll_to_mn(3); - assert([m n],[-1 1]) -***** test - [m,n]=zernike_noll_to_mn(4); - assert([m n],[0 2]) -***** test - [m,n]=zernike_noll_to_mn(5); - assert([m n],[-2 2]) -***** test - [m,n]=zernike_noll_to_mn(20); - assert([m n],[5 5]) -***** test - [m,n]=zernike_noll_to_mn(34); - assert([m n],[5 7]) -***** test - [m,n]=zernike_noll_to_mn(35); - assert([m n],[-7 7]) -***** test - [m,n]=zernike_noll_to_mn(36); - assert([m n],[7 7]) -***** test - [m,n]=zernike_noll_to_mn([2 5 8 35]); - assert(m,[1 -2 1 -7]) - assert(n,[1 2 3 7]) -10 tests, 10 passed, 0 known failure, 0 skipped -[inst/jones_intensity.m] ->>>>> /build/octave-optics-0.1.3/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/mueller_ismueller.m] ->>>>> /build/octave-optics-0.1.3/inst/mueller_ismueller.m -***** test - % test type check - A1 = mueller_unity(); - A2 = char(A1); - t1 = mueller_ismueller(A1); - t2 = mueller_ismueller(A2); - assert(t1 && ~t2); - +[inst/stokes_lpvertical.m] +>>>>> /build/octave-optics-0.1.3/inst/stokes_lpvertical.m ***** test - % test size check - A1 = mueller_unity(); - A2 = A1; - A2(5,5) = 1; - t1 = mueller_ismueller(A1); - t2 = mueller_ismueller(A2); - assert(t1 && ~t2); + % test default return value + V = stokes_lpvertical(); + R = V-[1;-1;0;0]; + assert(norm(R,inf), 0, 1e-9); ***** 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_ismueller(A1); - t2 = mueller_ismueller(A2); - assert((size(A1)==size(t1)) && (size(A2)==size(t2))); + % 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 indivial elements of return value - A1 = mueller_mirror([2,3,4]); - A1{2,2,2} = 0; - A2 = mueller_mirror([4,3,2]); - A2{1,1,1} = 0; - t1 = mueller_ismueller(A1); - t2 = mueller_ismueller(A2); - assert(t1(1,1,1) && ~t1(2,2,2) && ~t2(1,1,1) && t2(2,2,2)); -4 tests, 4 passed, 0 known failure, 0 skipped + % test correct size of return values + for dim = 1:5 + asize = randi([1 4], 1, dim); + R = rand(asize); + if numel(R) == 1 + R = {R}; + end + rsize = size(R); + C = stokes_lpvertical(R); + csize = size(C); + assert(rsize == csize); + end +3 tests, 3 passed, 0 known failure, 0 skipped [inst/jones_lpplus45.m] >>>>> /build/octave-optics-0.1.3/inst/jones_lpplus45.m ***** test @@ -2828,6 +3277,169 @@ assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped +[inst/jones_unity.m] +>>>>> /build/octave-optics-0.1.3/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_rotate.m] +>>>>> /build/octave-optics-0.1.3/inst/mueller_rotate.m +***** test + % default return value: unity matrix + A = mueller_rotate(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + % rotation by 0 should do nothing + delay = rand(1,1); + M = mueller_linretarder(delay); + A = mueller_rotate(M, 0); + R = M-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + % undo rotation by 2nd opposite rotation + delay = rand(1,1); + angle = rand(1, 1); + M = mueller_linretarder(delay); + A1 = mueller_rotate(M, angle); + A2 = mueller_rotate(A1, -angle); + R = A2-M; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test serial application of rotation + delay = rand(1,1); + angle1 = rand(1, 1); + angle2 = rand(1, 1); + M = mueller_linretarder(delay); + A1 = mueller_rotate(M, angle1); + A2 = mueller_rotate(A1, angle2); + A12 = mueller_rotate(M, angle1+angle2); + R = A2-A12; + assert(norm(R,inf), 0, 1e-9); + +***** test + % testing MODE parameter + angle = rand(1, 1); + A1 = mueller_rotate(mueller_waveplate(0.5), angle, 'rad'); + A2 = mueller_rotate(mueller_waveplate(0.5), angle*180/pi(), 'deg'); + R = A2-A1; + assert(norm(R,inf), 0, 1e-9); + +***** test + % size of return value determined by 1st argument + angle = rand(1,1); + for dim = 1:5 + asize = randi([1 4], 1, dim); + rsize = size(rand(asize)); + C = mueller_rotate(mueller_unity(rsize), angle); + csize = size(C); + assert(rsize == csize); + end + +***** test + % size if return value determined by 2nd argument + 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_rotate(mueller_unity(), R); + csize = size(C); + assert(rsize == csize); + end + +***** test + % size if return value determined by both argument + M = mueller_unity([4,3,2]); + angle = rand(2,3,4); + C = mueller_rotate(M, angle); + csize = size(C); + assert(csize == [4,3,4]); + +8 tests, 8 passed, 0 known failure, 0 skipped +[inst/mueller_unity.m] +>>>>> /build/octave-optics-0.1.3/inst/mueller_unity.m +***** test + A = mueller_unity(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + for dim = 1:5 + asize = randi([1 4], 1, dim); + C = cell(asize); + csize = size(C); + U = mueller_unity(C); + usize = size(U); + assert(usize == csize); + end + +***** test + for dim = 1:5 + asize = randi([1 4], 1, dim); + rsize = size(rand(asize)); + U = mueller_unity(rsize); + usize = size(U); + assert(usize == rsize); + end +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/mueller_linpolarizer.m] +>>>>> /build/octave-optics-0.1.3/inst/mueller_linpolarizer.m +***** test + % applying a linear polarizer twice is identical to + % apply it once! + A = mueller_linpolarizer(); + R = A*A-A; + assert(norm(R,inf), 0, 1e-9); + +***** test + % test direct size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + rsize = size(rand(asize)); + U = mueller_linpolarizer(rsize); + usize = size(U); + assert(usize == rsize); + end + +***** test + % test indirect size parameter + for dim = 1:5 + asize = randi([1 4], 1, dim); + C = cell(asize); + csize = size(C); + U = mueller_linpolarizer(C); + usize = size(U); + assert(usize == csize); + end + +3 tests, 3 passed, 0 known failure, 0 skipped [inst/jones.m] >>>>> /build/octave-optics-0.1.3/inst/jones.m ***** error A = jones(); @@ -2920,48 +3532,19 @@ % 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_homogeneous_elliptic_diattenuator.m] ->>>>> /build/octave-optics-0.1.3/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/stokes_cpleft.m] ->>>>> /build/octave-optics-0.1.3/inst/stokes_cpleft.m +[inst/stokes_lpminus45.m] +>>>>> /build/octave-optics-0.1.3/inst/stokes_lpminus45.m ***** test % test default return value - V = stokes_cpleft(); - R = V-[1;0;0;-1]; + V = stokes_lpminus45(); + 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_lpminus45(intensity); + R = V-[1;0;-1;0]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -2973,54 +3556,24 @@ R = {R}; end rsize = size(R); - C = stokes_cpleft(R); + C = stokes_lpminus45(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_mirror.m] ->>>>> /build/octave-optics-0.1.3/inst/mueller_mirror.m -***** test - % test mirror that is its own inverted element - A = mueller_mirror(); - R = (A-1\A); - assert(norm(R,inf), 0, 1e-9); - -***** test - % test direct size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - rsize = size(rand(asize)); - U = mueller_mirror(rsize); - usize = size(U); - assert(usize == rsize); - end - -***** test - % test indirect size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - C = cell(asize); - csize = size(C); - U = mueller_mirror(C); - usize = size(U); - assert(usize == csize); - end - -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/stokes_lpminus45.m] ->>>>> /build/octave-optics-0.1.3/inst/stokes_lpminus45.m +[inst/jones_lpvertical.m] +>>>>> /build/octave-optics-0.1.3/inst/jones_lpvertical.m ***** test % test default return value - V = stokes_lpminus45(); - R = V-[1;0;-1;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_lpminus45(intensity); - R = V-[1;0;-1;0]*intensity; + amplitude = rand(1, 1); + V = jones_lpvertical(amplitude); + R = V-[0;1]*amplitude; assert(norm(R,inf), 0, 1e-9); ***** test @@ -3032,7 +3585,7 @@ R = {R}; end rsize = size(R); - C = stokes_lpminus45(R); + C = jones_lpvertical(R); csize = size(C); assert(rsize == csize); end @@ -3077,56 +3630,6 @@ assert(rsize == csize); end 4 tests, 4 passed, 0 known failure, 0 skipped -[inst/mueller_linretarder.m] ->>>>> /build/octave-optics-0.1.3/inst/mueller_linretarder.m -***** test - % test default return value - A = mueller_linretarder(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test serial application of linear retarder elements - phase = rand(1, 1); - A1 = mueller_linretarder(phase); - A2 = mueller_linretarder(phase*2); - R = A1*A1-A2; - assert(norm(R,inf), 0, 1e-9); - -***** test - % another test of serial application of retarder elements - phase1 = rand(1, 1); - phase2 = rand(1, 1); - A1 = mueller_linretarder(phase1); - A2 = mueller_linretarder(phase2); - A12 = mueller_linretarder(phase1+phase2); - R = A1*A2-A12; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test mode - phase = rand(1, 1); - A1 = mueller_linretarder(phase); - A2 = mueller_linretarder(phase*180/pi(), 'deg'); - A3 = mueller_linretarder(phase/(2*pi()), 'wav'); - R1 = A1-A2; - R2 = A1-A3; - assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); - -***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = mueller_linretarder(R); - csize = size(C); - assert(rsize == csize); - end -5 tests, 5 passed, 0 known failure, 0 skipped [inst/mueller_rotator.m] >>>>> /build/octave-optics-0.1.3/inst/mueller_rotator.m ***** test @@ -3175,19 +3678,19 @@ assert(rsize == csize); end 5 tests, 5 passed, 0 known failure, 0 skipped -[inst/stokes_lpvertical.m] ->>>>> /build/octave-optics-0.1.3/inst/stokes_lpvertical.m +[inst/stokes_lphorizontal.m] +>>>>> /build/octave-optics-0.1.3/inst/stokes_lphorizontal.m ***** test % test default return value - V = stokes_lpvertical(); - R = V-[1;-1;0;0]; + V = stokes_lphorizontal(); + R = V-[1;1;0;0]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value intensity = rand(1, 1); - V = stokes_lpvertical(intensity); - R = V-[1;-1;0;0]*intensity; + V = stokes_lphorizontal(intensity); + R = V-[1;1;0;0]*intensity; assert(norm(R,inf), 0, 1e-9); ***** test @@ -3199,35 +3702,53 @@ R = {R}; end rsize = size(R); - C = stokes_lpvertical(R); + C = stokes_lphorizontal(R); csize = size(C); assert(rsize == csize); end 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_absorber.m] ->>>>> /build/octave-optics-0.1.3/inst/mueller_absorber.m +[inst/mueller_homogeneous_elliptic_diattenuator.m] +>>>>> /build/octave-optics-0.1.3/inst/mueller_homogeneous_elliptic_diattenuator.m ***** test % test default return value - A = mueller_absorber(); + A = mueller_homogeneous_elliptic_diattenuator(); 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); - R = A1*A1-A2; + % 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 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; + % another test correct size of return values + t0 = rand(3,4,5); + d = rand(4,5,6); + azimuth = rand(5,4,3); + ellipticity = rand(6,5,4); + C = mueller_homogeneous_elliptic_diattenuator(t0,d,azimuth,ellipticity); + csize = size(C); + assert(csize == [6,5,6]); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/stokes_unpolarized.m] +>>>>> /build/octave-optics-0.1.3/inst/stokes_unpolarized.m +***** test + % test default return value + V = stokes_unpolarized(); + R = V-[1;0;0;0]; + 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; assert(norm(R,inf), 0, 1e-9); ***** test @@ -3239,24 +3760,24 @@ R = {R}; end rsize = size(R); - C = mueller_absorber(R); + C = stokes_unpolarized(R); csize = size(C); assert(rsize == csize); end -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/jones_lpvertical.m] ->>>>> /build/octave-optics-0.1.3/inst/jones_lpvertical.m +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/jones_lphorizontal.m] +>>>>> /build/octave-optics-0.1.3/inst/jones_lphorizontal.m ***** test % test default return value - V = jones_lpvertical(); - R = V-[0;1]; + V = jones_lphorizontal(); + R = V-[1;0]; assert(norm(R,inf), 0, 1e-9); ***** test % test return value amplitude = rand(1, 1); - V = jones_lpvertical(amplitude); - R = V-[0;1]*amplitude; + V = jones_lphorizontal(amplitude); + R = V-[1;0]*amplitude; assert(norm(R,inf), 0, 1e-9); ***** test @@ -3268,24 +3789,24 @@ R = {R}; end rsize = size(R); - C = jones_lpvertical(R); + C = jones_lphorizontal(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.3/inst/jones_linretarder.m +[inst/mueller_linretarder.m] +>>>>> /build/octave-optics-0.1.3/inst/mueller_linretarder.m ***** test % test default return value - A = jones_linretarder(); + 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 = jones_linretarder(phase); - A2 = jones_linretarder(phase*2); + A1 = mueller_linretarder(phase); + A2 = mueller_linretarder(phase*2); R = A1*A1-A2; assert(norm(R,inf), 0, 1e-9); @@ -3293,18 +3814,18 @@ % 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); + 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 = jones_linretarder(phase); - A2 = jones_linretarder(phase*180/pi(), 'deg'); - A3 = jones_linretarder(phase/(2*pi()), 'wav'); + 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); @@ -3318,271 +3839,19 @@ R = {R}; end rsize = size(R); - C = jones_linretarder(R); + C = mueller_linretarder(R); csize = size(C); assert(rsize == csize); end 5 tests, 5 passed, 0 known failure, 0 skipped -[inst/jones_waveplate.m] ->>>>> /build/octave-optics-0.1.3/inst/jones_waveplate.m -***** test - % test default return value - A = jones_waveplate(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); -***** test - % test serial application of absorptive elements - delay = rand(1, 1); - A1 = jones_waveplate(delay); - A2 = jones_waveplate(delay*2); - R = A1*A1-A2; - assert(norm(R,inf), 0, 1e-9); -***** test - % another test of serial application of absorptive elements - delay1 = rand(1, 1); - delay2 = rand(1, 1); - A1 = jones_waveplate(delay1); - A2 = jones_waveplate(delay2); - A12 = jones_waveplate(delay1+delay2); - R = A1*A2-A12; - assert(norm(R,inf), 0, 1e-9); -***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = jones_waveplate(R); - csize = size(C); - assert(csize, rsize); - end -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/jones_lindiattenuator.m] ->>>>> /build/octave-optics-0.1.3/inst/jones_lindiattenuator.m -***** test - % test default return value - A = jones_lindiattenuator(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test equality of providing diattenuation or kx and ky - d = rand(1, 1); - kx = 1; - ky = (1-d)./(1+d); - A1 = jones_lindiattenuator(d); - A2 = jones_lindiattenuator(kx, ky); - R = A1-A2; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test serial application of linear diattenuators - kx = rand(1, 1); - ky = rand(1, 1); - A1 = jones_lindiattenuator(kx,ky); - A2 = jones_lindiattenuator(kx*kx,ky*ky); - R = A1*A1-A2; - assert(norm(R,inf), 0, 1e-9); - -***** test - % another test of serial application of retarder elements - kx1 = rand(1, 1); - kx2 = rand(1, 1); - ky1 = rand(1, 1); - ky2 = rand(1, 1); - A1 = jones_lindiattenuator(kx1,ky1); - A2 = jones_lindiattenuator(kx2,ky2); - A12 = jones_lindiattenuator(kx1*kx2,ky1*ky2); - R = A1*A2-A12; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test mode - kx = rand(1, 1); - ky = rand(1, 1); - A1 = jones_lindiattenuator(kx,ky); - A2 = jones_lindiattenuator(kx,ky,'int'); - A3 = jones_lindiattenuator(sqrt(kx),sqrt(ky),'amp'); - R1 = A1-A2; - R2 = A1-A3; - assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); - -***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = jones_lindiattenuator(R); - csize = size(C); - assert(rsize == csize); - end - -***** test - % another test correct size of return values - kx = rand(3,4,5); - ky = rand(5,4,3); - C = jones_lindiattenuator(kx,ky); - csize = size(C); - assert(csize == [5,4,5]); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/stokes_cpright.m] ->>>>> /build/octave-optics-0.1.3/inst/stokes_cpright.m -***** test - % test default return value - V = stokes_cpright(); - R = V-[1;0;0;1]; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test return value - intensity = rand(1, 1); - V = stokes_cpright(intensity); - R = V-[1;0;0;1]*intensity; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = stokes_cpright(R); - csize = size(C); - assert(rsize == csize); - end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_waveplate.m] ->>>>> /build/octave-optics-0.1.3/inst/mueller_waveplate.m -***** test - % test default return value - A = mueller_waveplate(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test serial application of absorptive elements - delay = rand(1, 1); - A1 = mueller_waveplate(delay); - A2 = mueller_waveplate(delay*2); - R = A1*A1-A2; - assert(norm(R,inf), 0, 1e-9); - -***** test - % another test of serial application of absorptive elements - delay1 = rand(1, 1); - delay2 = rand(1, 1); - A1 = mueller_waveplate(delay1); - A2 = mueller_waveplate(delay2); - A12 = mueller_waveplate(delay1+delay2); - R = A1*A2-A12; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = mueller_waveplate(R); - csize = size(C); - assert(rsize == csize); - end -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/jones_mirror.m] ->>>>> /build/octave-optics-0.1.3/inst/jones_mirror.m -***** test - % test mirror that is its own inverted element - A = jones_mirror(); - R = (A-1\A); - assert(norm(R,inf), 0, 1e-9); - -***** test - % test direct size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - rsize = size(rand(asize)); - U = jones_mirror(rsize); - usize = size(U); - assert(usize == rsize); - end - -***** test - % test indirect size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - C = cell(asize); - csize = size(C); - U = jones_mirror(C); - usize = size(U); - assert(usize == csize); - end - -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jones_lpminus45.m] ->>>>> /build/octave-optics-0.1.3/inst/jones_lpminus45.m -***** test - % test default return value - V = jones_lpminus45(); - R = V-[1;-1]; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test return value - amplitude = rand(1, 1); - V = jones_lpminus45(amplitude); - R = V-[1;-1]*amplitude; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = jones_lpminus45(R); - csize = size(C); - assert(rsize == csize); - end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/zernike_polar.m] ->>>>> /build/octave-optics-0.1.3/inst/zernike_polar.m -***** test - r = 0.2; - phi = 1.23; - n = 4; - ret = zernike_polar (r, phi, n); - assert (ret, [1 r*cos(phi) r*sin(phi) 2*r^2-1], 5*eps) -***** test - r = [0.5 0.8]; - phi = [pi/4 pi/4]; - n = 4; - ret = zernike_polar (r, phi, n); - assert (ret, [1 r(1)*cos(phi(1)) r(1)*sin(phi(1)) 2*r(1)^2-1; 1 r(2)*cos(phi(2)) r(2)*sin(phi(2)) 2*r(2)^2-1], 5*eps) -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/mueller_checkmueller.m] ->>>>> /build/octave-optics-0.1.3/inst/mueller_checkmueller.m +[inst/mueller_ismueller.m] +>>>>> /build/octave-optics-0.1.3/inst/mueller_ismueller.m ***** test % test type check A1 = mueller_unity(); A2 = char(A1); - t1 = mueller_checkmueller(A1); - t2 = mueller_checkmueller(A2); + t1 = mueller_ismueller(A1); + t2 = mueller_ismueller(A2); assert(t1 && ~t2); ***** test @@ -3590,8 +3859,8 @@ A1 = mueller_unity(); A2 = A1; A2(5,5) = 1; - t1 = mueller_checkmueller(A1); - t2 = mueller_checkmueller(A2); + t1 = mueller_ismueller(A1); + t2 = mueller_ismueller(A2); assert(t1 && ~t2); ***** test @@ -3600,229 +3869,47 @@ A1{2,2,2} = 0; A2 = mueller_mirror([4,3,2]); A2{1,1,1} = 0; - t1 = mueller_checkmueller(A1); - t2 = mueller_checkmueller(A2); + t1 = mueller_ismueller(A1); + t2 = mueller_ismueller(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; + A1{2,2,2} = 0; A2 = mueller_mirror([4,3,2]); - A2{1,1,1} = ones(4,4)*1.01; - t1 = mueller_checkmueller(A1); - t2 = mueller_checkmueller(A2); + A2{1,1,1} = 0; + t1 = mueller_ismueller(A1); + t2 = mueller_ismueller(A2); assert(t1(1,1,1) && ~t1(2,2,2) && ~t2(1,1,1) && t2(2,2,2)); 4 tests, 4 passed, 0 known failure, 0 skipped -[inst/jones_unity.m] ->>>>> /build/octave-optics-0.1.3/inst/jones_unity.m -***** test - A = jones_unity(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - -***** test - for dim = 1:5 - asize = randi([1 4], 1, dim); - C = cell(asize); - csize = size(C); - U = jones_unity(C); - usize = size(U); - assert(usize == csize); - end - -***** test - for dim = 1:5 - asize = randi([1 4], 1, dim); - rsize = size(rand(asize)); - U = jones_unity(rsize); - usize = size(U); - assert(usize == rsize); - end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_linpolarizer.m] ->>>>> /build/octave-optics-0.1.3/inst/mueller_linpolarizer.m -***** test - % applying a linear polarizer twice is identical to - % apply it once! - A = mueller_linpolarizer(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test direct size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - rsize = size(rand(asize)); - U = mueller_linpolarizer(rsize); - usize = size(U); - assert(usize == rsize); - end - -***** test - % test indirect size parameter - for dim = 1:5 - asize = randi([1 4], 1, dim); - C = cell(asize); - csize = size(C); - U = mueller_linpolarizer(C); - usize = size(U); - assert(usize == csize); - end - -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_circdiattenuator.m] ->>>>> /build/octave-optics-0.1.3/inst/mueller_circdiattenuator.m -***** test - % test default return value - A = mueller_circdiattenuator(); - R = A*A-A; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test equality of providing diattenuation or kx and ky - d = rand(1, 1); - kr = 1; - kl = (1-d)./(1+d); - A1 = mueller_circdiattenuator(d); - A2 = mueller_circdiattenuator(kr, kl); - R = A1-A2; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test serial application of circular diattenuators - kr = rand(1, 1); - kl = rand(1, 1); - A1 = mueller_circdiattenuator(kr,kl); - A2 = mueller_circdiattenuator(kr*kr,kl*kl); - R = A1*A1-A2; - assert(norm(R,inf), 0, 1e-9); - -***** test - % another test of serial application of retarder elements - kr1 = rand(1, 1); - kr2 = rand(1, 1); - kl1 = rand(1, 1); - kl2 = rand(1, 1); - A1 = mueller_circdiattenuator(kr1,kl1); - A2 = mueller_circdiattenuator(kr2,kl2); - A12 = mueller_circdiattenuator(kr1*kr2,kl1*kl2); - R = A1*A2-A12; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test mode - kr = rand(1, 1); - kl = rand(1, 1); - A1 = mueller_circdiattenuator(kr,kl); - A2 = mueller_circdiattenuator(kr,kl,'int'); - A3 = mueller_circdiattenuator(sqrt(kr),sqrt(kl),'amp'); - R1 = A1-A2; - R2 = A1-A3; - assert(norm(R1,inf)+norm(R2,inf), 0, 1e-9); - -***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = mueller_circdiattenuator(R); - csize = size(C); - assert(rsize == csize); - end - -***** test - % another test correct size of return values - kr = rand(3,4,5); - kl = rand(5,4,3); - C = mueller_circdiattenuator(kr,kl); - csize = size(C); - assert(csize == [5,4,5]); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/jones_lphorizontal.m] ->>>>> /build/octave-optics-0.1.3/inst/jones_lphorizontal.m -***** test - % test default return value - V = jones_lphorizontal(); - R = V-[1;0]; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test return value - amplitude = rand(1, 1); - V = jones_lphorizontal(amplitude); - R = V-[1;0]*amplitude; - assert(norm(R,inf), 0, 1e-9); - -***** test - % test correct size of return values - for dim = 1:5 - asize = randi([1 4], 1, dim); - R = rand(asize); - if numel(R) == 1 - R = {R}; - end - rsize = size(R); - C = jones_lphorizontal(R); - csize = size(C); - assert(rsize == csize); - end -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/mueller_lindiattenuator.m] ->>>>> /build/octave-optics-0.1.3/inst/mueller_lindiattenuator.m +[inst/mueller_absorber.m] +>>>>> /build/octave-optics-0.1.3/inst/mueller_absorber.m ***** test % test default return value - A = mueller_lindiattenuator(); + A = mueller_absorber(); 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); + % 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 - kx1 = rand(1, 1); - kx2 = rand(1, 1); - ky1 = rand(1, 1); - ky2 = rand(1, 1); - A1 = mueller_lindiattenuator(kx1,ky1); - A2 = mueller_lindiattenuator(kx2,ky2); - A12 = mueller_lindiattenuator(kx1*kx2,ky1*ky2); + % another test of serial 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 - 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); @@ -3831,64 +3918,11 @@ R = {R}; end rsize = size(R); - C = mueller_lindiattenuator(R); + C = mueller_absorber(R); csize = size(C); assert(rsize == csize); end - -***** test - % another test correct size of return values - kx = rand(3,4,5); - ky = rand(5,4,3); - C = mueller_lindiattenuator(kx,ky); - csize = size(C); - assert(csize == [5,4,5]); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/zernike_R_poly.m] ->>>>> /build/octave-optics-0.1.3/inst/zernike_R_poly.m -***** assert (zernike_R_poly (0, 0), [1]) -***** assert (zernike_R_poly (1, 1), [1 0]) -***** assert (zernike_R_poly (0, 2), [2 0 -1]) -***** assert (zernike_R_poly (2, 2), [1 0 0]) -***** assert (zernike_R_poly (1, 3), [3 0 -2 0]) -***** assert (zernike_R_poly (3, 3), [1 0 0 0]) -***** assert (zernike_R_poly (0, 4), [6 0 -6 0 1]) -***** assert (zernike_R_poly (2, 4), [4 0 -3 0 0]) -***** assert (zernike_R_poly (4, 4), [1 0 0 0 0]) -***** assert (zernike_R_poly (1, 5), [10 0 -12 0 3 0]) -***** assert (zernike_R_poly (3, 5), [5 0 -4 0 0 0]) -***** assert (zernike_R_poly (5, 5), [1 0 0 0 0 0]) -***** assert (zernike_R_poly (0, 6), [20 0 -30 0 12 0 -1]) -***** assert (zernike_R_poly (2, 6), [15 0 -20 0 6 0 0]) -***** assert (zernike_R_poly (4, 6), [ 6 0 -5 0 0 0 0]) -***** assert (zernike_R_poly (6, 6), [ 1 0 0 0 0 0 0]) -16 tests, 16 passed, 0 known failure, 0 skipped -[inst/mueller_unity.m] ->>>>> /build/octave-optics-0.1.3/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 +4 tests, 4 passed, 0 known failure, 0 skipped Checking C++ files ... Summary: 205 tests, 205 passed, 0 known failures, 0 skipped dh_octave_substvar -O--buildsystem=octave @@ -3916,12 +3950,14 @@ dpkg-source --after-build . dpkg-buildpackage: info: binary-only upload (no source included) I: copying local configuration +I: user script /srv/workspace/pbuilder/23792/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/23792/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/22689 and its subdirectories -I: Current time: Mon Jul 19 05:01:53 -12 2021 -I: pbuilder-time-stamp: 1626714113 +I: removing directory /srv/workspace/pbuilder/23792 and its subdirectories +I: Current time: Wed Jun 17 00:48:51 +14 2020 +I: pbuilder-time-stamp: 1592304531