gnu: Add skymaker.
[jackhill/guix/guix.git] / gnu / packages / astronomy.scm
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>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
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.
16 ;;;
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.
21 ;;;
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/>.
24
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))
57
58 (define-public cfitsio
59 (package
60 (name "cfitsio")
61 (version "3.49")
62 (source
63 (origin
64 (method url-fetch)
65 (uri (string-append
66 "http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/"
67 "cfitsio-" version ".tar.gz"))
68 (sha256
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.
73 (arguments
74 `(#:tests? #f ; no tests
75 #:phases
76 (modify-phases %standard-phases
77 (add-after 'unpack 'patch-paths
78 (lambda _
79 (substitute* "Makefile.in" (("/bin/") ""))
80 #t)))))
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
87 in FITS files.")
88 (license (license:non-copyleft "file://License.txt"
89 "See License.txt in the distribution."))))
90
91 (define-public eye
92 (package
93 (name "eye")
94 (version "1.4.1")
95 (source
96 (origin
97 (method url-fetch)
98 (uri (string-append "https://www.astromatic.net/download/eye/"
99 "eye-" version ".tar.gz"))
100 (sha256
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")
105 (description
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)))
113
114 (define-public wcslib
115 (package
116 (name "wcslib")
117 (version "6.4")
118 (source
119 (origin
120 (method url-fetch)
121 (uri (string-append
122 "ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib-" version
123 ".tar.bz2"))
124 (sha256
125 (base32 "003h23m6d5wcs29v2vbnl63f3z35k5x70lpsqlz5c9bp1bvizh8k"))))
126 (inputs
127 `(("cfitsio" ,cfitsio)))
128 (build-system gnu-build-system)
129 (arguments
130 `(#:configure-flags
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"))
135 #:phases
136 (modify-phases %standard-phases
137 (add-before 'configure 'patch-/bin/sh
138 (lambda _
139 (substitute* "makedefs.in"
140 (("/bin/sh") "sh"))
141 #t))
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
150 header.")
151 (license license:lgpl3+)))
152
153 (define-public gnuastro
154 (package
155 (name "gnuastro")
156 (version "0.14")
157 (source
158 (origin
159 (method url-fetch)
160 (uri (string-append "mirror://gnu/gnuastro/gnuastro-"
161 version ".tar.lz"))
162 (sha256
163 (base32
164 "1xp6n42qxv0x6yigi2w2l5k8006smv27lhrcssysgsvzbydghzg5"))))
165 (build-system gnu-build-system)
166 (arguments
167 '(#:configure-flags '("--disable-static")))
168 (inputs
169 `(("cfitsio" ,cfitsio)
170 ("curl" ,curl-minimal)
171 ("gsl" ,gsl)
172 ("libgit2" ,libgit2)
173 ("libjpeg" ,libjpeg-turbo)
174 ("libtiff" ,libtiff)
175 ("wcslib" ,wcslib)
176 ("zlib" ,zlib)))
177 (native-inputs
178 `(("libtool" ,libtool)
179 ("lzip" ,lzip)))
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+)))
185
186 (define-public sextractor
187 (package
188 (name "sextractor")
189 (version "2.25.0")
190 (source
191 (origin
192 (method git-fetch)
193 (uri (git-reference
194 (url "https://github.com/astromatic/sextractor")
195 (commit version)))
196 (file-name (git-file-name name version))
197 (sha256
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
203 ;; `fftwf'.
204 (arguments
205 `(#:configure-flags
206 (list
207 "--enable-openblas"
208 (string-append
209 "--with-openblas-libdir=" (assoc-ref %build-inputs "openblas") "/lib")
210 (string-append
211 "--with-openblas-incdir=" (assoc-ref %build-inputs "openblas") "/include")
212 (string-append
213 "--with-fftw-libdir=" (assoc-ref %build-inputs "fftw") "/lib")
214 (string-append
215 "--with-fftw-incdir=" (assoc-ref %build-inputs "fftw") "/include"))))
216 (native-inputs
217 `(("autoconf" ,autoconf)
218 ("automake" ,automake)
219 ("libtool" ,libtool)))
220 (inputs
221 `(("openblas" ,openblas)
222 ("fftw" ,fftwf)))
223 (home-page "http://www.astromatic.net/software/sextractor")
224 (synopsis "Extract catalogs of sources from astronomical images")
225 (description
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+)))
231
232 (define-public skymaker
233 (package
234 (name "skymaker")
235 (version "3.10.5")
236 (source
237 (origin
238 (method url-fetch)
239 (uri (string-append "https://www.astromatic.net/download/skymaker/"
240 "skymaker-" version ".tar.gz"))
241 (sha256
242 (base32 "03zvx7c89plp9559niqv5532r233kza3ir992rg3nxjksqmrqvx1"))))
243 (build-system gnu-build-system)
244 (arguments
245 `(#:configure-flags
246 (list
247 (string-append
248 "--with-fftw-libdir=" (assoc-ref %build-inputs "fftw") "/lib")
249 (string-append
250 "--with-fftw-incdir=" (assoc-ref %build-inputs "fftw") "/include"))))
251 (inputs
252 `(("fftw" ,fftwf)))
253 (home-page "https://www.astromatic.net/software/skymaker")
254 (synopsis "Astronomical image simulator")
255 (description
256 "SkyMaker is a program that simulates astronomical images. It accepts
257 object lists in ASCII generated by the Stuff program to produce realistic
258 astronomical fields. SkyMaker is part of the EFIGI
259 (@url{https://www.astromatic.net/projects/efigi}) development project.")
260 (license license:gpl3+)))
261
262 (define-public stellarium
263 (package
264 (name "stellarium")
265 (version "0.20.4")
266 (source
267 (origin
268 (method url-fetch)
269 (uri (string-append "https://github.com/Stellarium/stellarium"
270 "/releases/download/v" version
271 "/stellarium-" version ".tar.gz"))
272 (sha256
273 (base32 "1253zlr0mi4kdbj119spxk7spg4rkahb4rlpd0hz1d81mnv3n0v3"))))
274 (build-system cmake-build-system)
275 (inputs
276 `(("qtbase" ,qtbase)
277 ("qtlocation" ,qtlocation)
278 ("qtmultimedia" ,qtmultimedia)
279 ("qtscript" ,qtscript)
280 ("qtserialport" ,qtserialport)
281 ("zlib" ,zlib)))
282 (native-inputs
283 `(("gettext" ,gettext-minimal) ; xgettext is used at compile time
284 ("perl" ,perl) ; for pod2man
285 ("qtbase" ,qtbase) ; Qt MOC is needed at compile time
286 ("qttools" ,qttools)))
287 (arguments
288 `(#:test-target "test"
289 #:configure-flags (list "-DENABLE_TESTING=1"
290 (string-append
291 "-DCMAKE_CXX_FLAGS=-isystem "
292 (assoc-ref %build-inputs "qtserialport")
293 "/include/qt5"))
294 #:phases (modify-phases %standard-phases
295 (add-before 'check 'set-offscreen-display
296 (lambda _
297 ;; Make Qt render "offscreen", required for tests.
298 (setenv "QT_QPA_PLATFORM" "offscreen")
299 (setenv "HOME" "/tmp")
300 #t)))))
301 (home-page "https://stellarium.org/")
302 (synopsis "3D sky viewer")
303 (description "Stellarium is a planetarium. It shows a realistic sky in
304 3D, just like what you see with the naked eye, binoculars, or a telescope. It
305 can be used to control telescopes over a serial port for tracking celestial
306 objects.")
307 (license license:gpl2+)))
308
309 (define-public celestia
310 (let ((commit "9dbdf29c4ac3d20afb2d9a80d3dff241ecf81dce"))
311 (package
312 (name "celestia")
313 (version (git-version "1.6.1" "815" commit))
314 (source (origin
315 (method git-fetch)
316 (uri (git-reference
317 (url "https://github.com/celestiaproject/celestia")
318 (commit commit)))
319 (file-name (git-file-name name version))
320 (sha256
321 (base32
322 "00xibg87l1arzifakgj7s828x9pszcgx7x7ij88a561ig49ryh78"))))
323 (build-system cmake-build-system)
324 (native-inputs
325 `(("perl" ,perl)
326 ("libgit2" ,libgit2)
327 ("pkg-config" ,pkg-config)
328 ("libtool" ,libtool)
329 ("gettext" ,gettext-minimal)))
330 (inputs
331 `(("glu" ,glu)
332 ("glew" ,glew)
333 ("libtheora" ,libtheora)
334 ("libjpeg" ,libjpeg-turbo)
335 ("libpng" ,libpng)
336 ;; maybe required?
337 ("mesa" ,mesa)
338 ;; optional: fmtlib, Eigen3;
339 ("fmt" ,fmt)
340 ("eigen" ,eigen)
341 ;; glut: for glut interface
342 ("freeglut" ,freeglut)))
343 (propagated-inputs
344 `(("lua" ,lua)))
345 (arguments
346 `(#:configure-flags '("-DENABLE_GLUT=ON" "-DENABLE_QT=OFF")
347 #:tests? #f)) ;no tests
348 (home-page "https://celestia.space/")
349 (synopsis "Real-time 3D visualization of space")
350 (description
351 "This simulation program lets you explore our universe in three
352 dimensions. Celestia simulates many different types of celestial objects.
353 From planets and moons to star clusters and galaxies, you can visit every
354 object in the expandable database and view it from any point in space and
355 time. The position and movement of solar system objects is calculated
356 accurately in real time at any rate desired.")
357 (license license:gpl2+))))
358
359 (define-public celestia-gtk
360 (package
361 (inherit celestia)
362 (name "celestia-gtk")
363 (inputs
364 (append (alist-delete "freeglut" (package-inputs celestia))
365 `(("gtk2" ,gtk+-2)
366 ("gtkglext" ,gtkglext))))
367 (arguments
368 `(#:configure-flags '("-DENABLE_GTK=ON" "-DENABLE_QT=OFF")
369 #:tests? #f))))
370
371 (define-public libnova
372 (package
373 (name "libnova")
374 (version "0.16")
375 (source
376 (origin
377 (method git-fetch)
378 (uri (git-reference
379 (url "https://git.code.sf.net/p/libnova/libnova.git")
380 (commit (string-append "v" version))))
381 (file-name (git-file-name name version))
382 (sha256
383 (base32
384 "0icwylwkixihzni0kgl0j8dx3qhqvym6zv2hkw2dy6v9zvysrb1b"))))
385 (build-system gnu-build-system)
386 (arguments
387 `(#:phases
388 (modify-phases %standard-phases
389 (add-after 'unpack 'patch-git-version
390 (lambda _
391 (substitute* "./git-version-gen"
392 (("/bin/sh") (which "sh")))
393 #t)))))
394 (native-inputs
395 `(("autoconf" ,autoconf)
396 ("automake" ,automake)
397 ("libtool" ,libtool)))
398 (synopsis "Celestial mechanics, astrometry and astrodynamics library")
399 (description "Libnova is a general purpose, double precision, Celestial
400 Mechanics, Astrometry and Astrodynamics library.")
401 (home-page "http://libnova.sourceforge.net/")
402 (license (list license:lgpl2.0+
403 license:gpl2+)))) ; examples/transforms.c & lntest/*.c
404
405 (define-public libpasastro
406 ;; NOTE: (Sharlatan-20210122T215921+0000): the version tag has a build
407 ;; error on spice which is resolved with the latest commit.
408 (let ((commit "e3c218d1502a18cae858c83a9a8812ab197fcb60")
409 (revision "1"))
410 (package
411 (name "libpasastro")
412 (version (git-version "1.4.0" revision commit))
413 (source (origin
414 (method git-fetch)
415 (uri (git-reference
416 (url "https://github.com/pchev/libpasastro")
417 (commit commit)))
418 (file-name (git-file-name name version))
419 (sha256
420 (base32
421 "0asp2sn34nds5va2ghppwc41vb6j3d1mf049j949rgrll817kx47"))))
422 (build-system gnu-build-system)
423 (arguments
424 `(#:tests? #f
425 #:make-flags
426 (list
427 ,(match (or (%current-target-system) (%current-system))
428 ((or "aarch64-linux" "armhf-linux" "i686-linux" "x86_64-linux")
429 "OS_TARGET=linux")
430 (_ #f))
431 ,(match (or (%current-target-system) (%current-system))
432 ("i686-linux" "CPU_TARGET=i386")
433 ("x86_64-linux" "CPU_TARGET=x86_64")
434 ((or "armhf-linux" "aarch64-linux") "CPU_TARGET=armv7l")
435 (_ #f))
436 (string-append "PREFIX=" (assoc-ref %outputs "out")))
437 #:phases
438 (modify-phases %standard-phases
439 (delete 'configure))))
440 (home-page "https://github.com/pchev/libpasastro")
441 (synopsis "Interface to astronomy library for use from Pascal program")
442 (description
443 "This package provides shared libraries to interface Pascal program with
444 standard astronomy libraries:
445
446 @itemize
447 @item @code{libpasgetdss.so}: Interface with GetDSS to work with DSS images.
448 @item @code{libpasplan404.so}: Interface with Plan404 to compute planets position.
449 @item @code{libpaswcs.so}: Interface with libwcs to work with FITS WCS.
450 @item @code{libpasspice.so}: To work with NAIF/SPICE kernel.
451 @end itemize\n")
452 (license license:gpl2+))))
453
454 (define-public missfits
455 (package
456 (name "missfits")
457 (version "2.8.0")
458 (source
459 (origin
460 (method url-fetch)
461 (uri (string-append "https://www.astromatic.net/download/missfits/"
462 "missfits-" version ".tar.gz"))
463 (sha256
464 (base32 "04jrd7fsvzr14vdmwgj2f6v97gdcfyjyz6jppml3ghr9xh12jxv5"))))
465 (build-system gnu-build-system)
466 (home-page "https://www.astromatic.net/software/missfits")
467 (synopsis "FITS files Maintenance program")
468 (description
469 "MissFITS is a program that performs basic maintenance and packaging tasks
470 on FITS files:
471
472 @itemize
473 @item add/edit FITS header keywords
474 @item split/join Multi-Extension-FITS (MEF) files
475 @item unpack/pack FITS data-cubes
476 @item create/check/update FITS checksums, using R. Seaman's protocol
477 (see http://www.adass.org/adass/proceedings/adass94/seamanr.html)
478 @end itemize\n")
479 (license license:gpl3+)))
480
481 (define-public xplanet
482 (package
483 (name "xplanet")
484 (version "1.3.1")
485 (source
486 (origin
487 (method url-fetch)
488 (uri
489 (string-append
490 "mirror://sourceforge/xplanet/xplanet/"
491 version "/xplanet-" version ".tar.gz"))
492 (sha256
493 (base32 "1rzc1alph03j67lrr66499zl0wqndiipmj99nqgvh9xzm1qdb023"))
494 (patches
495 (search-patches
496 "xplanet-1.3.1-cxx11-eof.patch"
497 "xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch"
498 "xplanet-1.3.1-libimage_gif.c.patch"
499 "xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch"))))
500 (build-system gnu-build-system)
501 (native-inputs
502 `(("pkg-config" ,pkg-config)))
503 (inputs
504 `(("libx11" ,libx11)
505 ("libxscrnsaver" ,libxscrnsaver)
506 ("libice" ,libice)
507 ("freetype" ,freetype)
508 ("pango" ,pango)
509 ("giflib" ,giflib)
510 ("libjpeg" ,libjpeg-turbo)
511 ("libpng" ,libpng)
512 ("libtiff" ,libtiff)
513 ("netpbm" ,netpbm)
514 ("zlib" ,zlib)))
515 (arguments
516 `(#:configure-flags
517 (let ((netpbm (assoc-ref %build-inputs "netpbm")))
518 (append (list
519 ;; Give correct path for pnm.h header to configure script
520 (string-append "CPPFLAGS=-I" netpbm "/include/netpbm")
521 ;; no nasa jpl cspice support
522 "--without-cspice" )))))
523 (home-page "http://xplanet.sourceforge.net/")
524 (synopsis "Planetary body renderer")
525 (description
526 "Xplanet renders an image of a planet into an X window or file.
527 All of the major planets and most satellites can be drawn and different map
528 projections are also supported, including azimuthal, hemisphere, Lambert,
529 Mercator, Mollweide, Peters, polyconic, orthographic and rectangular.")
530 (license license:gpl2+)))
531
532 (define-public gpredict
533 (package
534 (name "gpredict")
535 (version "2.2.1")
536 (source
537 (origin
538 (method url-fetch)
539 (uri (string-append "https://github.com/csete/gpredict/releases"
540 "/download/v" version
541 "/gpredict-" version ".tar.bz2"))
542 (sha256
543 (base32 "0hwf97kng1zy8rxyglw04x89p0bg07zq30hgghm20yxiw2xc8ng7"))))
544 (build-system gnu-build-system)
545 (native-inputs
546 `(("intltool" ,intltool)
547 ("gettext" ,gettext-minimal)
548 ("pkg-config" ,pkg-config)))
549 (inputs
550 `(("curl" ,curl)
551 ("glib" ,glib)
552 ("goocanvas" ,goocanvas)
553 ("gtk+" ,gtk+)))
554 (arguments
555 `(#:phases
556 (modify-phases %standard-phases
557 (add-after 'unpack 'fix-tests
558 (lambda _
559 ;; Remove reference to non-existent file.
560 (substitute* "po/POTFILES.in"
561 (("src/gtk-sat-tree\\.c")
562 ""))
563 #t)))))
564 (synopsis "Satellite tracking and orbit prediction application")
565 (description
566 "Gpredict is a real-time satellite tracking and orbit prediction
567 application. It can track a large number of satellites and display their
568 position and other data in lists, tables, maps, and polar plots (radar view).
569 Gpredict can also predict the time of future passes for a satellite, and
570 provide you with detailed information about each pass.")
571 (home-page "http://gpredict.oz9aec.net/index.php")
572 (license license:gpl2+)))