Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Please unblock package yorick-mira

Dear release team,

This upload fixes #856835 (important):
ymira crashes when trying to fit several wavelengths
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856835

Due to this bugs, users of multi-wavelength interferometric instruments cannot
use the high-level wrapper `ymira' to reconstruct images from their
interferometric measuremetns, but need to know enough of the Yorick language to
load their data into a Yorick interactive session launch the image
reconstruction from there.

In other words, this bug is not RC but has a serious impact on the usability of
the package for most users.

The fix is backported from upstream's latest release (1.1.1).

A source debdiff is attached.

Kind regards, Thibaut.

unblock yorick-mira/1.1.0+git20170124.3bd1c3~dfsg1-2

-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (900, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
diff -Nru yorick-mira-1.1.0+git20170124.3bd1c3~dfsg1/debian/changelog 
yorick-mira-1.1.0+git20170124.3bd1c3~dfsg1/debian/changelog
--- yorick-mira-1.1.0+git20170124.3bd1c3~dfsg1/debian/changelog 2017-01-25 
12:30:39.000000000 +0100
+++ yorick-mira-1.1.0+git20170124.3bd1c3~dfsg1/debian/changelog 2017-03-05 
11:43:23.000000000 +0100
@@ -1,3 +1,10 @@
+yorick-mira (1.1.0+git20170124.3bd1c3~dfsg1-2) unstable; urgency=low
+
+  * Bug fix: "ymira crashes when trying to fit several wavelengths"
+    (Closes: #856835).
+
+ -- Thibaut Paumard <thib...@debian.org>  Sun, 05 Mar 2017 11:43:23 +0100
+
 yorick-mira (1.1.0+git20170124.3bd1c3~dfsg1-1) unstable; urgency=low
 
   * New upstream version 1.1.0+git20170124.3bd1c3~dfsg1
diff -Nru 
yorick-mira-1.1.0+git20170124.3bd1c3~dfsg1/debian/patches/monochromatic-doesnt-work
 
yorick-mira-1.1.0+git20170124.3bd1c3~dfsg1/debian/patches/monochromatic-doesnt-work
--- 
yorick-mira-1.1.0+git20170124.3bd1c3~dfsg1/debian/patches/monochromatic-doesnt-work
 1970-01-01 01:00:00.000000000 +0100
+++ 
yorick-mira-1.1.0+git20170124.3bd1c3~dfsg1/debian/patches/monochromatic-doesnt-work
 2017-03-05 11:42:15.000000000 +0100
@@ -0,0 +1,267 @@
+Description: ymira crashes when using several wavelengths
+Origin: upstream
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856835
+Applied-Upstream: c0a8a9c73d6a032979e9c96cb93bf78d5d9f6cea 
+Reviewed-by: Thibaut Paumard <thib...@debian.org>
+Last-Update: 2017-03-05
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/mira-batch.i
++++ b/src/mira-batch.i
+@@ -193,7 +193,6 @@
+   /* Constants and shortcuts. */
+   FALSE = 0n;
+   TRUE = 1n;
+-  monochromatic = TRUE;
+   format = mira_format;
+ 
+   opt = opt_parse(_MIRA_OPTIONS, argv);
+@@ -350,13 +349,11 @@
+     naxis2 = img.naxis2;
+     naxis3 = (naxis >= 3 ? img.naxis3 : 1);
+     eq_nocopy, initial, img.arr;
+-    if (monochromatic) {
+-      if (naxis == 3) {
++    if (naxis == 3) {
+         if (naxis3 != 1) {
+           opt_error, "expecting a 2D initial image";
+         }
+         initial = initial(,,avg);
+-      }
+     }
+     // FIXME: only the pixel size is considered...
+ 
+@@ -427,7 +424,6 @@
+                     eff_band = opt.effband,
+                     wavemin = opt.wavemin,
+                     wavemax = opt.wavemax,
+-                    monochromatic = monochromatic,
+                     quiet = opt.quiet);
+ 
+   mira_config, master, dim=dim, pixelsize=pixelsize, xform=opt.xform;
+--- a/src/mira.i
++++ b/src/mira.i
+@@ -289,8 +289,6 @@
+  *   MASTER.vis - complex visibility data (see below for layout)
+  *   MASTER.vis2 - powerspectrum data (see below for layout)
+  *   MASTER.vis3 - bispectrum data (see below for layout)
+- *   MASTER.monochromatic - monochromatic or gray case?
+- *   MASTER.monochromatic_option - monochromatic option as set by user
+  *   MASTER.u - list of measured spatial frequencies
+  *   MASTER.v - list of measured spatial frequencies
+  *   MASTER.w - list of measured wavelenghts
+@@ -375,7 +373,7 @@
+  *
+  *     DB.u ~ MASTER.u(DB.idx)*DB.sgn
+  *     DB.v ~ MASTER.v(DB.idx)*DB.sgn
+- *     DB.w ~ MASTER.w(DB.idx)            // not in monochromatic mode
++ *     DB.w ~ MASTER.w(DB.idx)
+  *
+  *   where MASTER is the parent of datablock DB
+  *
+@@ -383,7 +381,7 @@
+ 
+ func mira_new(.., wavemin=, wavemax=,
+               eff_wave=, eff_band=, wave_tol=,
+-              quiet=, base_tol=, monochromatic=,
++              quiet=, base_tol=,
+               noise_method=, noise_level=,
+               cleanup_bad_data=, target=, goodman=,
+               no_t3=, no_vis=, no_vis2=)
+@@ -401,6 +399,10 @@
+        EFF_BAND = Effective spectral bandwidth (units: meters), default value
+            is 1e-7 (0.1 micron).
+ 
++       WAVEMIN = Lower bound for the selected wavelength range (in meters).
++
++       WAVEMAX = Upper bound for the selected wavelength range (in meters).
++
+        WAVE_TOL = Tolerance for wavelength grouping (units: meters).  Default
+            value is 1e-10 (1 Ångström).  This tolerance is used to decide
+            whether different wavelengths correspond to the same one.
+@@ -409,9 +411,6 @@
+            value is 1e-3 (1 millimeter).  This tolerance is used to decide
+            whether different positions correspond to the same baseline.
+ 
+-       MONOCHROMATIC = True if a monochromatic (gray) model of the object
+-           brightness distribution is to be reconstructed.
+-
+        NO_VIS = True to not use complex visibilities (OI_VIS data-blocks).
+ 
+        NO_VIS2 = True to not use powerspectrum data (OI_VIS2 data-blocks).
+@@ -460,7 +459,6 @@
+  */
+ {
+   if (is_void(quiet)) quiet = 0;
+-  if (is_void(monochromatic)) monochromatic = 1n;
+ 
+   /* Get spectral bandwidth parameters (in meters). */
+   choice = ((is_void(wavemin)  ? 0 : 1) |
+@@ -511,7 +509,6 @@
+                  eff_band = eff_band,
+                  wave_tol = wave_tol,
+                  base_tol = base_tol,
+-                 monochromatic_option = monochromatic,
+                  flags = 0,
+                  flux_weight = 0.0,
+                  flux_mean = 1.0,
+@@ -916,90 +913,71 @@
+     return;
+   }
+ 
+-  /* Figure out whether or not we are in "monochromatic" mode. */
+-  w_digit = mira_digitize(master.w, master.wave_tol);
+-  number_of_wavelengths = numberof(w_digit.value);
+-  if (number_of_wavelengths > 1) {
+-    monochromatic = (master.monochromatic_option ? 1n : 0n);
+-    w = w_digit.value;
+-  } else {
+-    monochromatic = 1n;
+-    w = w_digit.value(1);
+-  }
+-  h_set, master, w = w, monochromatic = monochromatic;
+-
+-
+   /*
+   ** Make a list of "unique" coordinates using a *slow* O(N^2) algorithm.
+   */
+ 
+-  if (monochromatic) {
+-
+-    local u_inp, v_inp;
+-    eq_nocopy, u_inp, master.u;
+-    eq_nocopy, v_inp, master.v;
+-    number = numberof(u_inp);
+-    u_out = array(double, number); /* maximum size */
+-    v_out = array(double, number); /* maximum size */
+-    n_out = array(long, number); /* maximum size */
+-    idx = array(long, number);
+-    sgn = array(long, number);
+-    mid_wavelength = 0.5*(max(master.w) + min(master.w));
+-    freq_tol = master.base_tol/mid_wavelength;
+-
+-    j = k = 1;
+-    u_out(k) = u_inp(j);
+-    v_out(k) = v_inp(j);
+-    n_out(k) = 1;
+-    idx(j) = k;
+-    sgn(j) = 1;
+-    while (++j <= number) {
+-
+-      /* Get j-th position. */
+-      u = u_inp(j);
+-      v = v_inp(j);
+-
+-      /* Search +/-position among list of positions. */
+-      u_tmp = u_out(1:k);
+-      v_tmp = v_out(1:k);
+-      rp = (temp = u - u_tmp)*temp + (temp = v - v_tmp)*temp;
+-      rn = (temp = u + u_tmp)*temp + (temp = v + v_tmp)*temp;
+-      rp_min = min(rp);
+-      rn_min = min(rn);
+-      if (min(rp_min, rn_min) > freq_tol) {
+-        /* Got a new position. */
+-        idx(j) = ++k;
+-        sgn(j) = 1;
+-        u_out(k) = u;
+-        v_out(k) = v;
+-        n_out(k) = 1;
+-      } else if (rp_min <= rn_min) {
+-        idx(j) = (kp = rp(mnx));
+-        sgn(j) = 1;
+-        np1 = (n = n_out(kp)) + 1;
+-        u_out(kp) = (n*u_out(kp) + u)/np1;
+-        v_out(kp) = (n*v_out(kp) + v)/np1;
+-        n_out(kp) = np1;
+-      } else {
+-        idx(j) = (kp = rn(mnx));
+-        sgn(j) = 1;
+-        np1 = (n = n_out(kp)) + 1;
+-        u_out(kp) = (n*u_out(kp) - u)/np1;
+-        v_out(kp) = (n*v_out(kp) - v)/np1;
+-        n_out(kp) = np1;
+-      }
+-    }
+-    if (k < number) {
+-      u_out = u_out(1:k);
+-      v_out = v_out(1:k);
+-      n_out = n_out(1:k);
++  local u_inp, v_inp;
++  eq_nocopy, u_inp, master.u;
++  eq_nocopy, v_inp, master.v;
++  number = numberof(u_inp);
++  u_out = array(double, number); /* maximum size */
++  v_out = array(double, number); /* maximum size */
++  n_out = array(long, number); /* maximum size */
++  idx = array(long, number);
++  sgn = array(long, number);
++  mid_wavelength = 0.5*(max(master.w) + min(master.w));
++  freq_tol = master.base_tol/mid_wavelength;
++
++  j = k = 1;
++  u_out(k) = u_inp(j);
++  v_out(k) = v_inp(j);
++  n_out(k) = 1;
++  idx(j) = k;
++  sgn(j) = 1;
++  while (++j <= number) {
++
++    /* Get j-th position. */
++    u = u_inp(j);
++    v = v_inp(j);
++
++    /* Search +/-position among list of positions. */
++    u_tmp = u_out(1:k);
++    v_tmp = v_out(1:k);
++    rp = (temp = u - u_tmp)*temp + (temp = v - v_tmp)*temp;
++    rn = (temp = u + u_tmp)*temp + (temp = v + v_tmp)*temp;
++    rp_min = min(rp);
++    rn_min = min(rn);
++    if (min(rp_min, rn_min) > freq_tol) {
++      /* Got a new position. */
++      idx(j) = ++k;
++      sgn(j) = 1;
++      u_out(k) = u;
++      v_out(k) = v;
++      n_out(k) = 1;
++    } else if (rp_min <= rn_min) {
++      idx(j) = (kp = rp(mnx));
++      sgn(j) = 1;
++      np1 = (n = n_out(kp)) + 1;
++      u_out(kp) = (n*u_out(kp) + u)/np1;
++      v_out(kp) = (n*v_out(kp) + v)/np1;
++      n_out(kp) = np1;
++    } else {
++      idx(j) = (kp = rn(mnx));
++      sgn(j) = 1;
++      np1 = (n = n_out(kp)) + 1;
++      u_out(kp) = (n*u_out(kp) - u)/np1;
++      v_out(kp) = (n*v_out(kp) - v)/np1;
++      n_out(kp) = np1;
+     }
+-    write, format="There are %d sampled frequencies out of %d 
measurements.\n",
+-        k, number;
+-
+-  } else {
+-    error, "only monochromatic mode is implemented by MiRA";
+   }
++  if (k < number) {
++    u_out = u_out(1:k);
++    v_out = v_out(1:k);
++    n_out = n_out(1:k);
++  }
++  write, format="There are %d sampled frequencies out of %d measurements.\n",
++    k, number;
+ 
+ 
+   /*
+@@ -4002,6 +3980,9 @@
+     w = mira_get_w(dat);
+     x = mira_get_x(dat);
+     y = mira_get_y(dat);
++    if (naxis3 == 1) {
++      w = median(w);
++    }
+     if (naxis1 != numberof(x) ||
+         naxis2 != numberof(y) ||
+         naxis3 != numberof(w)) {
diff -Nru yorick-mira-1.1.0+git20170124.3bd1c3~dfsg1/debian/patches/series 
yorick-mira-1.1.0+git20170124.3bd1c3~dfsg1/debian/patches/series
--- yorick-mira-1.1.0+git20170124.3bd1c3~dfsg1/debian/patches/series    
2017-01-25 12:30:39.000000000 +0100
+++ yorick-mira-1.1.0+git20170124.3bd1c3~dfsg1/debian/patches/series    
2017-03-05 10:54:17.000000000 +0100
@@ -3,3 +3,4 @@
 rgl_needs_yeti
 bin-mira-path
 demo-maxeval
+monochromatic-doesnt-work

Reply via email to