1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2019 by Amar Singh <nly@disroot.org>
6 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
7 ;;; Copyright © 2020 Guillaume Le Vaillant <glv@posteo.net>
8 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages astronomy)
26 #:use-module (guix packages)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module (guix utils)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages algebra)
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages curl)
36 #:use-module (gnu packages fontutils)
37 #:use-module (gnu packages gettext)
38 #:use-module (gnu packages gl)
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages gnome)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages image)
43 #:use-module (gnu packages lua)
44 #:use-module (gnu packages maths)
45 #:use-module (gnu packages netpbm)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages pretty-print)
49 #:use-module (gnu packages qt)
50 #:use-module (gnu packages version-control)
51 #:use-module (gnu packages xiph)
52 #:use-module (gnu packages xorg)
53 #:use-module (guix build-system cmake)
54 #:use-module (guix build-system gnu)
55 #:use-module (ice-9 match)
56 #:use-module (srfi srfi-1))
58 (define-public cfitsio
66 "http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/"
67 "cfitsio-" version ".tar.gz"))
69 (base32 "1cyl1qksnkl3cq1fzl4dmjvkd6329b57y9iqyv44wjakbh6s4rav"))))
70 (build-system gnu-build-system)
71 ;; XXX Building with curl currently breaks wcslib. It doesn't use
72 ;; pkg-config and hence won't link with -lcurl.
74 `(#:tests? #f ; no tests
76 (modify-phases %standard-phases
77 (add-after 'unpack 'patch-paths
79 (substitute* "Makefile.in" (("/bin/") ""))
81 (home-page "https://heasarc.gsfc.nasa.gov/fitsio/fitsio.html")
82 (synopsis "Library for reading and writing FITS files")
83 (description "CFITSIO provides simple high-level routines for reading and
84 writing @dfn{FITS} (Flexible Image Transport System) files that insulate the
85 programmer from the internal complexities of the FITS format. CFITSIO also
86 provides many advanced features for manipulating and filtering the information
88 (license (license:non-copyleft "file://License.txt"
89 "See License.txt in the distribution."))))
98 (uri (string-append "https://www.astromatic.net/download/eye/"
99 "eye-" version ".tar.gz"))
101 (base32 "092qhzcbrkcfidbx4bv9wz42w297n80jk7a6kwyi9a3fjfz81d7k"))))
102 (build-system gnu-build-system)
103 (home-page "https://www.astromatic.net/software/eye")
104 (synopsis "Small image feature detector using machine learning")
106 "In EyE (Enhance Your Extraction) an artificial neural network connected to
107 pixels of a moving window (retina) is trained to associate these input stimuli
108 to the corresponding response in one or several output image(s). The resulting
109 filter can be loaded in SExtractor to operate complex, wildly non-linear filters
110 on astronomical images. Typical applications of EyE include adaptive filtering,
111 feature detection and cosmetic corrections.")
112 (license license:cecill)))
114 (define-public wcslib
122 "ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib-" version
125 (base32 "003h23m6d5wcs29v2vbnl63f3z35k5x70lpsqlz5c9bp1bvizh8k"))))
127 `(("cfitsio" ,cfitsio)))
128 (build-system gnu-build-system)
131 (list (string-append "--with-cfitsiolib="
132 (assoc-ref %build-inputs "cfitsio") "/lib")
133 (string-append "--with-cfitsioinc="
134 (assoc-ref %build-inputs "cfitsio") "/include"))
136 (modify-phases %standard-phases
137 (add-before 'configure 'patch-/bin/sh
139 (substitute* "makedefs.in"
142 (delete 'install-license-files)) ; installed by ‘make install’
143 ;; Parallel execution of the test suite is not supported.
144 #:parallel-tests? #f))
145 (home-page "https://www.atnf.csiro.au/people/mcalabre/WCS")
146 (synopsis "Library which implements the FITS WCS standard")
147 (description "The FITS \"World Coordinate System\" (@dfn{WCS}) standard
148 defines keywords and usage that provide for the description of astronomical
149 coordinate systems in a @dfn{FITS} (Flexible Image Transport System) image
151 (license license:lgpl3+)))
153 (define-public gnuastro
160 (uri (string-append "mirror://gnu/gnuastro/gnuastro-"
164 "1xp6n42qxv0x6yigi2w2l5k8006smv27lhrcssysgsvzbydghzg5"))))
165 (build-system gnu-build-system)
167 '(#:configure-flags '("--disable-static")))
169 `(("cfitsio" ,cfitsio)
170 ("curl" ,curl-minimal)
173 ("libjpeg" ,libjpeg-turbo)
178 `(("libtool" ,libtool)
180 (home-page "https://www.gnu.org/software/gnuastro/")
181 (synopsis "Astronomy utilities")
182 (description "The GNU Astronomy Utilities (Gnuastro) is a suite of
183 programs for the manipulation and analysis of astronomical data.")
184 (license license:gpl3+)))
186 (define-public sextractor
194 (url "https://github.com/astromatic/sextractor")
196 (file-name (git-file-name name version))
198 (base32 "0q69n3nyal57h3ik2xirwzrxzljrwy9ivwraxzv9566vi3n4z5mw"))))
199 (build-system gnu-build-system)
200 ;; NOTE: (Sharlatan-20210124T103117+0000): Building with `atlas' is failing
201 ;; due to missing shared library which required on configure phase. Switch
202 ;; build to use `openblas' instead. It requires FFTW with single precision
209 "--with-openblas-libdir=" (assoc-ref %build-inputs "openblas") "/lib")
211 "--with-openblas-incdir=" (assoc-ref %build-inputs "openblas") "/include")
213 "--with-fftw-libdir=" (assoc-ref %build-inputs "fftw") "/lib")
215 "--with-fftw-incdir=" (assoc-ref %build-inputs "fftw") "/include"))))
217 `(("autoconf" ,autoconf)
218 ("automake" ,automake)
219 ("libtool" ,libtool)))
221 `(("openblas" ,openblas)
223 (home-page "http://www.astromatic.net/software/sextractor")
224 (synopsis "Extract catalogs of sources from astronomical images")
226 "SExtractor is a program that builds a catalogue of objects from an
227 astronomical image. Although it is particularly oriented towards reduction of
228 large scale galaxy-survey data, it can perform reasonably well on moderately
229 crowded star fields.")
230 (license license:gpl3+)))
232 (define-public stellarium
239 (uri (string-append "https://github.com/Stellarium/stellarium"
240 "/releases/download/v" version
241 "/stellarium-" version ".tar.gz"))
243 (base32 "1253zlr0mi4kdbj119spxk7spg4rkahb4rlpd0hz1d81mnv3n0v3"))))
244 (build-system cmake-build-system)
247 ("qtlocation" ,qtlocation)
248 ("qtmultimedia" ,qtmultimedia)
249 ("qtscript" ,qtscript)
250 ("qtserialport" ,qtserialport)
253 `(("gettext" ,gettext-minimal) ; xgettext is used at compile time
254 ("perl" ,perl) ; for pod2man
255 ("qtbase" ,qtbase) ; Qt MOC is needed at compile time
256 ("qttools" ,qttools)))
258 `(#:test-target "test"
259 #:configure-flags (list "-DENABLE_TESTING=1"
261 "-DCMAKE_CXX_FLAGS=-isystem "
262 (assoc-ref %build-inputs "qtserialport")
264 #:phases (modify-phases %standard-phases
265 (add-before 'check 'set-offscreen-display
267 ;; Make Qt render "offscreen", required for tests.
268 (setenv "QT_QPA_PLATFORM" "offscreen")
269 (setenv "HOME" "/tmp")
271 (home-page "https://stellarium.org/")
272 (synopsis "3D sky viewer")
273 (description "Stellarium is a planetarium. It shows a realistic sky in
274 3D, just like what you see with the naked eye, binoculars, or a telescope. It
275 can be used to control telescopes over a serial port for tracking celestial
277 (license license:gpl2+)))
279 (define-public celestia
280 (let ((commit "9dbdf29c4ac3d20afb2d9a80d3dff241ecf81dce"))
283 (version (git-version "1.6.1" "815" commit))
287 (url "https://github.com/celestiaproject/celestia")
289 (file-name (git-file-name name version))
292 "00xibg87l1arzifakgj7s828x9pszcgx7x7ij88a561ig49ryh78"))))
293 (build-system cmake-build-system)
297 ("pkg-config" ,pkg-config)
299 ("gettext" ,gettext-minimal)))
303 ("libtheora" ,libtheora)
304 ("libjpeg" ,libjpeg-turbo)
308 ;; optional: fmtlib, Eigen3;
311 ;; glut: for glut interface
312 ("freeglut" ,freeglut)))
316 `(#:configure-flags '("-DENABLE_GLUT=ON" "-DENABLE_QT=OFF")
317 #:tests? #f)) ;no tests
318 (home-page "https://celestia.space/")
319 (synopsis "Real-time 3D visualization of space")
321 "This simulation program lets you explore our universe in three
322 dimensions. Celestia simulates many different types of celestial objects.
323 From planets and moons to star clusters and galaxies, you can visit every
324 object in the expandable database and view it from any point in space and
325 time. The position and movement of solar system objects is calculated
326 accurately in real time at any rate desired.")
327 (license license:gpl2+))))
329 (define-public celestia-gtk
332 (name "celestia-gtk")
334 (append (alist-delete "freeglut" (package-inputs celestia))
336 ("gtkglext" ,gtkglext))))
338 `(#:configure-flags '("-DENABLE_GTK=ON" "-DENABLE_QT=OFF")
341 (define-public libnova
349 (url "https://git.code.sf.net/p/libnova/libnova.git")
350 (commit (string-append "v" version))))
351 (file-name (git-file-name name version))
354 "0icwylwkixihzni0kgl0j8dx3qhqvym6zv2hkw2dy6v9zvysrb1b"))))
355 (build-system gnu-build-system)
358 (modify-phases %standard-phases
359 (add-after 'unpack 'patch-git-version
361 (substitute* "./git-version-gen"
362 (("/bin/sh") (which "sh")))
365 `(("autoconf" ,autoconf)
366 ("automake" ,automake)
367 ("libtool" ,libtool)))
368 (synopsis "Celestial mechanics, astrometry and astrodynamics library")
369 (description "Libnova is a general purpose, double precision, Celestial
370 Mechanics, Astrometry and Astrodynamics library.")
371 (home-page "http://libnova.sourceforge.net/")
372 (license (list license:lgpl2.0+
373 license:gpl2+)))) ; examples/transforms.c & lntest/*.c
375 (define-public libpasastro
376 ;; NOTE: (Sharlatan-20210122T215921+0000): the version tag has a build
377 ;; error on spice which is resolved with the latest commit.
378 (let ((commit "e3c218d1502a18cae858c83a9a8812ab197fcb60")
382 (version (git-version "1.4.0" revision commit))
386 (url "https://github.com/pchev/libpasastro")
388 (file-name (git-file-name name version))
391 "0asp2sn34nds5va2ghppwc41vb6j3d1mf049j949rgrll817kx47"))))
392 (build-system gnu-build-system)
397 ,(match (or (%current-target-system) (%current-system))
398 ((or "aarch64-linux" "armhf-linux" "i686-linux" "x86_64-linux")
401 ,(match (or (%current-target-system) (%current-system))
402 ("i686-linux" "CPU_TARGET=i386")
403 ("x86_64-linux" "CPU_TARGET=x86_64")
404 ((or "armhf-linux" "aarch64-linux") "CPU_TARGET=armv7l")
406 (string-append "PREFIX=" (assoc-ref %outputs "out")))
408 (modify-phases %standard-phases
409 (delete 'configure))))
410 (home-page "https://github.com/pchev/libpasastro")
411 (synopsis "Interface to astronomy library for use from Pascal program")
413 "This package provides shared libraries to interface Pascal program with
414 standard astronomy libraries:
417 @item @code{libpasgetdss.so}: Interface with GetDSS to work with DSS images.
418 @item @code{libpasplan404.so}: Interface with Plan404 to compute planets position.
419 @item @code{libpaswcs.so}: Interface with libwcs to work with FITS WCS.
420 @item @code{libpasspice.so}: To work with NAIF/SPICE kernel.
422 (license license:gpl2+))))
424 (define-public missfits
431 (uri (string-append "https://www.astromatic.net/download/missfits/"
432 "missfits-" version ".tar.gz"))
434 (base32 "04jrd7fsvzr14vdmwgj2f6v97gdcfyjyz6jppml3ghr9xh12jxv5"))))
435 (build-system gnu-build-system)
436 (home-page "https://www.astromatic.net/software/missfits")
437 (synopsis "FITS files Maintenance program")
439 "MissFITS is a program that performs basic maintenance and packaging tasks
443 @item add/edit FITS header keywords
444 @item split/join Multi-Extension-FITS (MEF) files
445 @item unpack/pack FITS data-cubes
446 @item create/check/update FITS checksums, using R. Seaman's protocol
447 (see http://www.adass.org/adass/proceedings/adass94/seamanr.html)
449 (license license:gpl3+)))
451 (define-public xplanet
460 "mirror://sourceforge/xplanet/xplanet/"
461 version "/xplanet-" version ".tar.gz"))
463 (base32 "1rzc1alph03j67lrr66499zl0wqndiipmj99nqgvh9xzm1qdb023"))
466 "xplanet-1.3.1-cxx11-eof.patch"
467 "xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch"
468 "xplanet-1.3.1-libimage_gif.c.patch"
469 "xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch"))))
470 (build-system gnu-build-system)
472 `(("pkg-config" ,pkg-config)))
475 ("libxscrnsaver" ,libxscrnsaver)
477 ("freetype" ,freetype)
480 ("libjpeg" ,libjpeg-turbo)
487 (let ((netpbm (assoc-ref %build-inputs "netpbm")))
489 ;; Give correct path for pnm.h header to configure script
490 (string-append "CPPFLAGS=-I" netpbm "/include/netpbm")
491 ;; no nasa jpl cspice support
492 "--without-cspice" )))))
493 (home-page "http://xplanet.sourceforge.net/")
494 (synopsis "Planetary body renderer")
496 "Xplanet renders an image of a planet into an X window or file.
497 All of the major planets and most satellites can be drawn and different map
498 projections are also supported, including azimuthal, hemisphere, Lambert,
499 Mercator, Mollweide, Peters, polyconic, orthographic and rectangular.")
500 (license license:gpl2+)))
502 (define-public gpredict
509 (uri (string-append "https://github.com/csete/gpredict/releases"
510 "/download/v" version
511 "/gpredict-" version ".tar.bz2"))
513 (base32 "0hwf97kng1zy8rxyglw04x89p0bg07zq30hgghm20yxiw2xc8ng7"))))
514 (build-system gnu-build-system)
516 `(("intltool" ,intltool)
517 ("gettext" ,gettext-minimal)
518 ("pkg-config" ,pkg-config)))
522 ("goocanvas" ,goocanvas)
526 (modify-phases %standard-phases
527 (add-after 'unpack 'fix-tests
529 ;; Remove reference to non-existent file.
530 (substitute* "po/POTFILES.in"
531 (("src/gtk-sat-tree\\.c")
534 (synopsis "Satellite tracking and orbit prediction application")
536 "Gpredict is a real-time satellite tracking and orbit prediction
537 application. It can track a large number of satellites and display their
538 position and other data in lists, tables, maps, and polar plots (radar view).
539 Gpredict can also predict the time of future passes for a satellite, and
540 provide you with detailed information about each pass.")
541 (home-page "http://gpredict.oz9aec.net/index.php")
542 (license license:gpl2+)))