diff -Nru yorick-yao-4.9.0/aoutil.i yorick-yao-4.9.1/aoutil.i --- yorick-yao-4.9.0/aoutil.i 2012-03-27 00:09:42.000000000 +0000 +++ yorick-yao-4.9.1/aoutil.i 2012-05-04 07:10:40.000000000 +0000 @@ -557,6 +557,12 @@ } } + if (wfs(ns).type == "pyramid") { + if ((wfs(ns).pyr_mod_loc!="after") && (wfs(ns).pyr_mod_loc!="before")) { + write,format="wfs(%d).pyr_mod_loc is not set, setting to \"after\"",ns; + } + } + wfs.ron = float(wfs.ron); } diff -Nru yorick-yao-4.9.0/debian/changelog yorick-yao-4.9.1/debian/changelog --- yorick-yao-4.9.0/debian/changelog 2012-04-01 12:54:34.000000000 +0000 +++ yorick-yao-4.9.1/debian/changelog 2012-06-28 14:52:01.000000000 +0000 @@ -1,3 +1,18 @@ +yorick-yao (4.9.1-2) unstable; urgency=low + + * Fortify (don't rely on Yorick to pass the right flags) + + -- Thibaut Paumard Thu, 28 Jun 2012 16:52:01 +0200 + +yorick-yao (4.9.1-1) unstable; urgency=low + + * New upstream release + * Comply with Debian Science Policy + * Configure by patching Makefile + * Minimize rules + + -- Thibaut Paumard Wed, 27 Jun 2012 17:45:49 +0200 + yorick-yao (4.9.0-1) unstable; urgency=low * New upstream release diff -Nru yorick-yao-4.9.0/debian/control yorick-yao-4.9.1/debian/control --- yorick-yao-4.9.0/debian/control 2012-04-01 12:45:11.000000000 +0000 +++ yorick-yao-4.9.1/debian/control 2012-06-27 15:27:34.000000000 +0000 @@ -1,10 +1,13 @@ Source: yorick-yao Section: science -Priority: optional -Maintainer: Thibaut Paumard -Build-Depends: debhelper (>= 5.0.0), yorick-dev (>= 2.1.05), libfftw3-dev, quilt +Priority: extra +Maintainer: Debian Science Maintainers +Uploaders: Thibaut Paumard +Build-Depends: debhelper (>= 7.0.50~), yorick-dev (>= 2.1.05), libfftw3-dev, quilt Standards-Version: 3.9.3 Homepage: http://www.maumae.net/yao/ +Vcs-Git: git://git.debian.org/git/debian-science/packages/yorick-yao.git +Vcs-Browser: http://git.debian.org/?p=debian-science/packages/yorick-yao.git DM-Upload-Allowed: yes Package: yorick-yao diff -Nru yorick-yao-4.9.0/debian/copyright yorick-yao-4.9.1/debian/copyright --- yorick-yao-4.9.0/debian/copyright 2010-04-06 16:37:01.000000000 +0000 +++ yorick-yao-4.9.1/debian/copyright 2012-06-27 15:29:53.000000000 +0000 @@ -1,30 +1,22 @@ -X-Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat -X-Debianized-By: Thibaut Paumard -X-Debianized-Date: Wed, 16 Jan 2008 16:56:57 +0100 -X-Source-Downloaded-From: - http://www.maumae.net/yorick/packages/src/yao-4.2.3-src.tgz -X-Comment: yaopy.i and yao.glade were updated from CVS on - Fri, 18 Jan 2008 14:32:41 +0100 -X-Upstream-Author: François Rigaut - (Gemini Observatory, 670 N A'Ohoku Place, HILO HI-96720) +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Contact: François Rigaut +Source: https://github.com/frigaut/yao/tarball/4.9.1 Files: * -Copyright: © 2002-2007, François Rigaut +Copyright: © 2007-2012, François Rigaut + © 2008-2012, Thibaut Paumard License: GPL-2+ - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details (to receive a copy of the GNU - * General Public License, write to the Free Software Foundation, Inc., 51 - * Franklin St, Fifth Floor, Boston, MA 02110-1301, USA). -X-Comment: On Debian systems, the complete text of the GNU General + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + . + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details (to receive a copy of the GNU + General Public License, write to the Free Software Foundation, Inc., 51 + Franklin St, Fifth Floor, Boston, MA 02110-1301, USA). + . + On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. - -Files: debian/* -Copyright: © 2008, Thibaut Paumard -License: GPL-2+ diff -Nru yorick-yao-4.9.0/debian/lintian-overrides.d/yorick-yao yorick-yao-4.9.1/debian/lintian-overrides.d/yorick-yao --- yorick-yao-4.9.0/debian/lintian-overrides.d/yorick-yao 2010-04-06 16:37:01.000000000 +0000 +++ yorick-yao-4.9.1/debian/lintian-overrides.d/yorick-yao 2012-06-28 14:51:30.000000000 +0000 @@ -1,3 +1,4 @@ +# The icons are in yorick-data, on which yorick "depends". yorick-yao: menu-icon-missing yorick32x32.xpm -yorick-yao: menu-icon-missing yorick16x16.xpm # The icons are in yorick-data, on which yorick "depends". +yorick-yao: menu-icon-missing yorick16x16.xpm diff -Nru yorick-yao-4.9.0/debian/patches/configure yorick-yao-4.9.1/debian/patches/configure --- yorick-yao-4.9.0/debian/patches/configure 1970-01-01 00:00:00.000000000 +0000 +++ yorick-yao-4.9.1/debian/patches/configure 2012-06-27 15:31:43.000000000 +0000 @@ -0,0 +1,21 @@ +Description: configure this package + Yorick packages are usually configured by running yorick -batch make.i + which modifies Makefile. Modifying source files at build time is not + very well supported in the quilt / git workflow, so let's just patch + Makefile and not run yorick -batch make.i at build time. +Author: Thibaut Paumard +Origin: Vendor +Forwarded: not-needed +Last-Update: 2012-06-27 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/Makefile ++++ b/Makefile +@@ -4,6 +4,7 @@ + Y_EXE_PKGS= + Y_EXE_HOME=/usr/lib/yorick + Y_EXE_SITE=/usr/lib/yorick ++Y_HOME_PKG= + + # ----------------------------------------------------- optimization flags + diff -Nru yorick-yao-4.9.0/debian/patches/series yorick-yao-4.9.1/debian/patches/series --- yorick-yao-4.9.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ yorick-yao-4.9.1/debian/patches/series 2012-06-27 15:38:15.000000000 +0000 @@ -0,0 +1 @@ +configure diff -Nru yorick-yao-4.9.0/debian/rules yorick-yao-4.9.1/debian/rules --- yorick-yao-4.9.0/debian/rules 2012-04-01 12:52:27.000000000 +0000 +++ yorick-yao-4.9.1/debian/rules 2012-06-28 14:49:44.000000000 +0000 @@ -1,65 +1,22 @@ #!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -Makefile.deborig: - dh_testdir - cp -a Makefile Makefile.deborig - -configure: configure-stamp -configure-stamp: Makefile.deborig - dh_testdir - yorick -batch make.i - touch configure-stamp - -build: build-indep build-arch -build-indep build-arch: build-stamp -build-stamp: configure-stamp - dh_testdir - $(MAKE) - touch build-stamp - -# package has to be configured for the upstream distclean target to work -clean: configure-stamp - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - $(MAKE) distclean - [ ! -e Makefile.deborig ] || mv Makefile.deborig Makefile - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - -binary-indep: build install - -binary-arch: build install - dh_testdir - dh_testroot + +DPKG_EXPORT_BUILDFLAGS = 1 +-include /usr/share/dpkg/buildflags.mk + +%: + dh $@ + +override_dh_auto_build: + $(MAKE) COPT_DEFAULT="" \ + Y_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \ + Y_LDFLAGS="$(LDFLAGS)" + +override_dh_auto_install-arch: dh_installyorick --no-make-install - dh_installchangelogs - dh_installexamples - dh_installmenu - dh_install - dh_installdocs - dh_installman - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install +override_dh_auto_clean: + $(MAKE) Y_MAKEDIR=/usr/lib/yorick Y_EXE=/usr/bin/yorick clean + +# disable tests: they take too long, write in $HOME and display on screen. +# need some time to write reasonable, headless tests. +override_dh_auto_test: diff -Nru yorick-yao-4.9.0/yao_structures.i yorick-yao-4.9.1/yao_structures.i --- yorick-yao-4.9.0/yao_structures.i 2012-03-27 00:09:42.000000000 +0000 +++ yorick-yao-4.9.1/yao_structures.i 2012-05-04 07:10:40.000000000 +0000 @@ -165,8 +165,8 @@ long pyr_padding; // Pad the pupil image to reduce spatial aliasing [unitless] // A pad of 1 means adding wfs.npixpersub pixels // on each side of the pupil image. Typical 0 to 4. - string pyr_mod_loc; // Location of modulation (before/after the field stop. - // valid value are "before" or "after" + string pyr_mod_loc; // Location of modulation, before/after the field stop. + // valid value are "before" or "after" (default "after") // Shack-Hartmann WFS only keywords: long shmethod; // 1 = simple gradient average, 2=full propagation. Required [none] @@ -197,7 +197,8 @@ long centGainOpt; // Centroid Gain optimization flag. only for LGS (correctupTT and // filtertilt must be set). Optional [0] int rayleighflag; // set to one to take rayleigh into account - // zernike wfs only + + // zernike wfs only int nzer; // # of zernike sensed // DH wfs only diff -Nru yorick-yao-4.9.0/yao_util.i yorick-yao-4.9.1/yao_util.i --- yorick-yao-4.9.0/yao_util.i 2012-03-27 00:09:42.000000000 +0000 +++ yorick-yao-4.9.1/yao_util.i 2012-05-04 07:10:40.000000000 +0000 @@ -911,57 +911,54 @@ /* DOCUMENT psd(s, length, step=, filter=, samp=, db=,noplot=,overplot=, * sqrt=,roddier=,xtitre=,ytitre=) * Procedure PSD : Compute the Power Spectral Density of a vector - * s = variable on which the PSD has to be computed - * length = length of the subsample for FFTs - * step = shift in pixels between subsamples - * filter = apodization function as in apod.pro (usually 6) - * samp = sampling time - * db = plots in dB :10*alog10(dsp) - * noplot = do not plot - * overplot= over plot - * sqroot = returns the sqrt of the dsp - * roddier = plots the psd roddier style + * s : variable on which the PSD has to be computed + * length : length of the subsample for FFTs + * step = shift in pixels between subsamples + * filter = apodization function as in apod.pro (usually 6) + * samp = sampling time + * db = plots in dB :10*alog10(dsp) + * noplot = do not plot + * overplot = over plot + * sqroot = returns the sqrt of the dsp + * roddier = plots the psd roddier style + * xtitre = X axis title + * ytitre = Y axis title + * silent = be quiet * SEE ALSO: */ { extern psdnumberofoverplots; - if (is_void(s)) { - write,"psd,data,FFTlength,step=, filter=, samp=, db=,noplot=,overplot=,sqrt=,roddier=,xtitre=,ytitre=,silent="; - exit;} - if (is_void(step)) { step = length/2;} - if (is_void(filter)) { filter = 0;} - if (is_void(samp)) { samp = 1;} - if (is_void(noplot)) { noplot = 0;} - if (is_void(xtitre)) { xtitre = "Frequency";} - if (is_void(ytitre)) { ytitre = "";} - if (is_set(roddier)) { ytitre = ytitre+"[freq * PSD]";} else {ytitle = ytitre+"[PSD]";} + + if (is_void(s)) error,"No data"; + if (is_void(step)) { step = length/2; } + if (is_void(filter)) { filter = 0; } + if (is_void(samp)) { samp = 1; } + if (is_void(noplot)) { noplot = 0; } + if (is_void(xtitre)) { xtitre = "Frequency"; } + if (is_void(ytitre)) { ytitre = ""; } + if (is_set(roddier)) { ytitre = ytitre+"[freq * PSD]"; } else { ytitle = ytitre+"[PSD]"; } - if (length > numberof(s)) - {error,"length > number of element in vector!!!";} + if (length > numberof(s)) error,"length > number of element in vector!!!"; - if (!is_set(silent)) - {print,"Stdev of input PSD vector (in psd.i) : ",s(rms);} + if (!is_set(silent)) write,format="Stdev of input PSD vector : %f\n",s(rms); nb = long((numberof(s) - length)/step)+1; - if (!is_set(silent)) - {write,format="Averaging %2d sample of length %5d shifted by %5d\n", - nb,length,step;} + if (!is_set(silent)) { + write,format="Averaging %2d sample of length %5d shifted by %5d\n", + nb,length,step; + } dsp = array(double,length); - if (filter == -1) { - fil = array(1.,length); - } else { - fil = apod(length,filter); - } + if (filter == -1) fil = array(1.,length); \ + else fil = apod(length,filter); fn = sum(abs(fft(fil,1))^2.)/length^2.; - for (i=0;i<=nb-1;i++) - { - tmp = s(i*step+1:i*step+length); - tmp = tmp-avg(tmp); - dsp = dsp + abs(fft(tmp*fil,1))^2./length/fn; - } + for (i=0;i<=nb-1;i++) { + tmp = s(i*step+1:i*step+length); + tmp = tmp-avg(tmp); + dsp = dsp + abs(fft(tmp*fil,1))^2./length/fn; + } dsp = dsp/nb; dsp = dsp(1:length/2); @@ -969,40 +966,36 @@ f = (indgen(length/2)-1.)/samp/2./(length/2-1.); f = (indgen(length/2)-1.)/samp/2./(length/2); - if (!is_set(silent)) { write,format="Freq. Max = %8.6e\n",max(f);} + if (!is_set(silent)) write,format="Freq. Max = %8.6e\n",max(f); dsp = dsp*2.; // x2 because negative part omitted dsp = dsp/length*(length/2./max(f)); // to get in unit^2/Hz - if (!is_void(sqroot)) { dsp = sqrt(dsp); } + if (!is_void(sqroot)) dsp = sqrt(dsp); - if (db) { dsp = 10.*log10(dsp); } - if (roddier) { dsp = f*dsp;} + if (db) dsp = 10.*log10(dsp); \ + else if (roddier) dsp = f*dsp; - if (!noplot) - { - if (!overplot) { - fma; - plg,dsp(2:),f(2:); - psdnumberofoverplots=0; - } - - if (overplot) { - psdnumberofoverplots++; - cols = ["red","blue","green","magenta","yellow"]; - plg,dsp(2:),f(2:),color=cols(psdnumberofoverplots); - } - myxytitles,xtitre,ytitre; - - limits; limits(); - if (roddier) { - logxy,1,0; - } else if (db) { - logxy,1,0; - } else { - logxy,1,1; - } + if (!noplot) { + + if (!overplot) { + fma; + plg,dsp(2:),f(2:); + psdnumberofoverplots=0; } + + if (overplot) { + psdnumberofoverplots++; + cols = ["red","blue","green","magenta","yellow"]; + plg,dsp(2:),f(2:),color=cols(psdnumberofoverplots); + } + myxytitles,xtitre,ytitre; + + limits; + if (roddier) logxy,1,0; + else if (db) logxy,1,0; + else logxy,1,1; + } return [f,dsp]; } diff -Nru yorick-yao-4.9.0/yao_wfs.i yorick-yao-4.9.1/yao_wfs.i --- yorick-yao-4.9.0/yao_wfs.i 2012-03-27 00:09:42.000000000 +0000 +++ yorick-yao-4.9.1/yao_wfs.i 2012-05-04 07:10:40.000000000 +0000 @@ -1116,7 +1116,7 @@ // let's save pyr_focmask whatever the method is, as we will // use it for photometry calculation: pyr_focmask = roll(focmask); - if (pyr_mod_location!="after") { + if (wfs(ns).pyr_mod_loc!="after") { tmp = array(0,[3,pyr_npix,pyr_npix,4]); tmp(,,1) = pyr_focmask(npup-pyr_npix+1:,npup-pyr_npix+1:); tmp(,,2) = tmp(,,1)(::-1,); @@ -1180,7 +1180,7 @@ phot_norm_factor = sum(tmp*pyr_focmask)/sum(tmp); // apply field stop if needed: - if (pyr_mod_location=="after") complex_amplitude *= *wfs(ns)._submask; + if (wfs(ns).pyr_mod_loc=="after") complex_amplitude *= *wfs(ns)._submask; reimaged_pupil = array(double,[3,pyr_npix,pyr_npix,4]); @@ -1228,7 +1228,7 @@ // extract subimage from large image complex amplitude array: ca = roll(complex_amplitude,[cx(k)+xoffset(i),cy(k)+yoffset(i)]); - if (pyr_mod_location!="after") { + if (wfs(ns).pyr_mod_loc!="after") { small_comp_amp = ca(1:pyr_npix,1:pyr_npix)*(*wfs(ns)._submask)(,,i); roll,small_comp_amp; } else small_comp_amp = roll(ca(1:pyr_npix,1:pyr_npix)); @@ -1358,9 +1358,14 @@ // the phase at the input (call from multwfs) is in microns. // I have chosen to return coefficients of zernikes in nm (rms) - extern wfs_zer,wfs_wzer,zn12; + extern pwfs_zer,pwfs_wzer,pzn12; if (init) { + if ((pwfs_zer==[])||(numberof(pwfs_zer)!=nwfs)) { + pwfs_zer = array(pointer,nwfs); + pwfs_wzer = array(pointer,nwfs); + pzn12 = array(pointer,nwfs); + } pupd = sim.pupildiam; size = sim._size; nzer = wfs(ns).nzer(1); @@ -1374,10 +1379,17 @@ // wfs_zer(nzer,npt in pupil) tmp = where(zernike(1)(avg,)); zn12 = minmax(tmp); + pwfs_zer(ns) = &wfs_zer; + pwfs_wzer(ns) = &wfs_wzer; + pzn12(ns) = &zn12; if (sim.verbose>=1) write,"Zernike wfs initialized"; return; } + zn12 = *pzn12(ns); + wfs_zer = *pwfs_zer(ns); + wfs_wzer = *pwfs_wzer(ns); + wfs(ns)._fimage = wfs(ns)._dispimage = \ &((phase*pupsh)(zn12(1):zn12(2),zn12(1):zn12(2))); mes = wfs_zer(,+)*phase(*)(wfs_wzer)(+);