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
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')
-rw-r--r--sci-misc/fitscut/Manifest1
-rw-r--r--sci-misc/fitscut/files/fitscut-1.4.4-fix-asinh.patch33
-rw-r--r--sci-misc/fitscut/fitscut-1.4.4.ebuild39
-rw-r--r--sci-misc/fitscut/metadata.xml14
4 files changed, 87 insertions, 0 deletions
diff --git a/sci-misc/fitscut/Manifest b/sci-misc/fitscut/Manifest
new file mode 100644
index 000000000000..3c69b472149a
--- /dev/null
+++ b/sci-misc/fitscut/Manifest
@@ -0,0 +1 @@
+DIST fitscut-1.4.4.tar.gz 163663 SHA256 1df936af9cd36bf1cd1e3a095ecc8bec68a6974525e0f4fd0e9cccb9633728bb SHA512 1d80671efeebfb07e7e2714d9cdbdd445a2e7644119d5b82ba4a8f033b36e773d13f87998ece45091f4a127beca374021e8c5afd88f649c9405fb329cd1ee97f WHIRLPOOL fa2a7ac7306988b574dd9155fe1062bd86fea8cf1bd45cfb8a05795d7ef305cd5de9d9061fe00b2d7e9f25c263f8db4bed252bf171082943b7c9d82684c0dcd4
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;
diff --git a/sci-misc/fitscut/fitscut-1.4.4.ebuild b/sci-misc/fitscut/fitscut-1.4.4.ebuild
new file mode 100644
index 000000000000..49af77e4dbb1
--- /dev/null
+++ b/sci-misc/fitscut/fitscut-1.4.4.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools
+
+DESCRIPTION="Extract cutouts from FITS image files"
+HOMEPAGE="http://acs.pha.jhu.edu/general/software/fitscut/"
+SRC_URI="${HOMEPAGE}/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ sci-libs/cfitsio:0=
+ sci-astronomy/wcstools:0=
+ media-libs/libpng:0=
+ virtual/jpeg:0="
+DEPEND="${RDEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-fix-asinh.patch" )
+
+src_prepare() {
+ default
+ # gentoo wcs is called wcstools to avoid conflict with wcslib
+ sed -e 's/libwcs/wcs/g' \
+ -i wcs*.c fitscut.c || die
+ # cfitsio/fitsio.h might conflict with host on prefix
+ sed -e 's/LIB(wcs,/LIB(wcstools,/' \
+ -e 's/-lwcs/-lwcstools/' \
+ -e '/cfitsio\/fitsio.h/d' \
+ configure.in > configure.ac || die
+ rm configure.in
+ eautoreconf
+}
diff --git a/sci-misc/fitscut/metadata.xml b/sci-misc/fitscut/metadata.xml
new file mode 100644
index 000000000000..cc63d596cc37
--- /dev/null
+++ b/sci-misc/fitscut/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-astronomy@gentoo.org</email>
+ <name>Gentoo Astronomy Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ fitscut is designed to extract cutouts from FITS image format
+ files. FITS, PNG, and JPEG output types are supported.
+ When multiple input files are specified and the output type is PNG or
+ JPEG the resulting image is an RGB color image.
+</longdescription>
+</pkgmetadata>