summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Fabbro <bicatali@gentoo.org>2016-03-22 18:09:58 +0000
committerSébastien Fabbro <bicatali@gentoo.org>2016-03-22 23:18:09 +0000
commit9b72b87082ff45e4fc74fac0132d7bc669a9fda0 (patch)
treebba618e92cf2fc2428c7562bc0c1dca8a18925c4 /sci-misc/fitscut/files/fitscut-1.4.4-fix-asinh.patch
parentsci-misc/fitsverify: fixed license, switched to EAPI6 and astronomy project (diff)
downloadgentoo-9b72b87082ff45e4fc74fac0132d7bc669a9fda0.tar.gz
gentoo-9b72b87082ff45e4fc74fac0132d7bc669a9fda0.tar.bz2
gentoo-9b72b87082ff45e4fc74fac0132d7bc669a9fda0.zip
sci-misc/fitscut: initial import
Package-Manager: portage-2.2.28
Diffstat (limited to 'sci-misc/fitscut/files/fitscut-1.4.4-fix-asinh.patch')
-rw-r--r--sci-misc/fitscut/files/fitscut-1.4.4-fix-asinh.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/sci-misc/fitscut/files/fitscut-1.4.4-fix-asinh.patch b/sci-misc/fitscut/files/fitscut-1.4.4-fix-asinh.patch
new file mode 100644
index 000000000000..be5c3a1c2309
--- /dev/null
+++ b/sci-misc/fitscut/files/fitscut-1.4.4-fix-asinh.patch
@@ -0,0 +1,33 @@
+Author: Ole Streicher <olebole@debian.org>
+Description: Avoid NaN in asinh calculation.
+ Also, ignore NaN in histogram creation.
+--- a/histogram.c
++++ b/histogram.c
+@@ -83,8 +83,10 @@
+ ind = 0;
+ else if (value > dmax)
+ ind = length-1;
+- else
++ else if (isfinite(value))
+ ind = ceil ((value-dmin) / binsize);
++ else
++ continue;
+ hist[ind] += 1.0;
+ }
+ }
+--- a/image_scale.c
++++ b/image_scale.c
+@@ -326,8 +326,11 @@
+ if (t > maxval)
+ maxval = t;
+ }
+-
+- weight = asinh (sum * nonlinearity) / (nonlinearity * sum);
++ if (sum * nonlinearity == 0.0) {
++ weight = 1.0;
++ } else {
++ weight = asinh (sum * nonlinearity) / (nonlinearity * sum);
++ }
+ for (k = 0; k < Image->channels; k++) {
+ if (Image->data[k] == NULL)
+ continue;