gnu: Add python-astroalign.
[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 check)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages curl)
37 #:use-module (gnu packages fontutils)
38 #:use-module (gnu packages gettext)
39 #:use-module (gnu packages gl)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gnome)
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages image)
44 #:use-module (gnu packages libusb)
45 #:use-module (gnu packages lua)
46 #:use-module (gnu packages maths)
47 #:use-module (gnu packages netpbm)
48 #:use-module (gnu packages perl)
49 #:use-module (gnu packages pkg-config)
50 #:use-module (gnu packages pretty-print)
51 #:use-module (gnu packages python-check)
52 #:use-module (gnu packages python-crypto)
53 #:use-module (gnu packages python-science)
54 #:use-module (gnu packages python-xyz)
55 #:use-module (gnu packages qt)
56 #:use-module (gnu packages version-control)
57 #:use-module (gnu packages xiph)
58 #:use-module (gnu packages xorg)
59 #:use-module (guix build-system cmake)
60 #:use-module (guix build-system gnu)
61 #:use-module (guix build-system python)
62 #:use-module (ice-9 match)
63 #:use-module (srfi srfi-1))
64
65 (define-public cfitsio
66 (package
67 (name "cfitsio")
68 (version "3.49")
69 (source
70 (origin
71 (method url-fetch)
72 (uri (string-append
73 "http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/"
74 "cfitsio-" version ".tar.gz"))
75 (sha256
76 (base32 "1cyl1qksnkl3cq1fzl4dmjvkd6329b57y9iqyv44wjakbh6s4rav"))))
77 (build-system gnu-build-system)
78 ;; XXX Building with curl currently breaks wcslib. It doesn't use
79 ;; pkg-config and hence won't link with -lcurl.
80 (arguments
81 `(#:tests? #f ; no tests
82 #:phases
83 (modify-phases %standard-phases
84 (add-after 'unpack 'patch-paths
85 (lambda _
86 (substitute* "Makefile.in" (("/bin/") ""))
87 #t)))))
88 (home-page "https://heasarc.gsfc.nasa.gov/fitsio/fitsio.html")
89 (synopsis "Library for reading and writing FITS files")
90 (description "CFITSIO provides simple high-level routines for reading and
91 writing @dfn{FITS} (Flexible Image Transport System) files that insulate the
92 programmer from the internal complexities of the FITS format. CFITSIO also
93 provides many advanced features for manipulating and filtering the information
94 in FITS files.")
95 (license (license:non-copyleft "file://License.txt"
96 "See License.txt in the distribution."))))
97
98 (define-public qfits
99 (package
100 (name "qfits")
101 (version "6.2.0")
102 (source
103 (origin
104 (method url-fetch)
105 (uri
106 (string-append "ftp://ftp.eso.org/pub/qfits/qfits-" version ".tar.gz"))
107 (sha256
108 (base32 "0m2b21mim3a7wgfg3ph2w5hv7mdvr03jmmhzipc0wcahijglcw9j"))))
109 (build-system gnu-build-system)
110 (home-page "https://www.eso.org/sci/software/eclipse/qfits/")
111 (synopsis "C library offering access to astronomical FITS files")
112 (description
113 "@code{qfits} is a C library giving access to FITS file internals, both
114 for reading and writing.")
115 (license license:gpl2+)))
116
117 (define-public erfa
118 (package
119 (name "erfa")
120 (version "1.7.2")
121 (source
122 (origin
123 (method git-fetch)
124 (uri (git-reference
125 (url "https://github.com/liberfa/erfa")
126 (commit (string-append "v" version))))
127 (file-name (git-file-name name version))
128 (sha256
129 (base32 "1vsqwvzlk7r8q7nwyb7i710blcfdl5kwcm2va9km07a820nsp84a"))))
130 (build-system gnu-build-system)
131 (native-inputs
132 `(("automake" ,automake)
133 ("autoreconf" ,autoconf)
134 ("libtool" ,libtool)
135 ("pkg-config" ,pkg-config)))
136 (home-page "https://github.com/liberfa/erfa")
137 (synopsis "Essential Routines for Fundamental Astronomy")
138 (description
139 "ERFA is a C library containing key algorithms for astronomy, and is based
140 on the SOFA library published by the International Astronomical Union (IAU).")
141 (license license:bsd-3)))
142
143 (define-public eye
144 (package
145 (name "eye")
146 (version "1.4.1")
147 (source
148 (origin
149 (method url-fetch)
150 (uri (string-append "https://www.astromatic.net/download/eye/"
151 "eye-" version ".tar.gz"))
152 (sha256
153 (base32 "092qhzcbrkcfidbx4bv9wz42w297n80jk7a6kwyi9a3fjfz81d7k"))))
154 (build-system gnu-build-system)
155 (home-page "https://www.astromatic.net/software/eye")
156 (synopsis "Small image feature detector using machine learning")
157 (description
158 "In EyE (Enhance Your Extraction) an artificial neural network connected to
159 pixels of a moving window (retina) is trained to associate these input stimuli
160 to the corresponding response in one or several output image(s). The resulting
161 filter can be loaded in SExtractor to operate complex, wildly non-linear filters
162 on astronomical images. Typical applications of EyE include adaptive filtering,
163 feature detection and cosmetic corrections.")
164 (license license:cecill)))
165
166 (define-public wcslib
167 (package
168 (name "wcslib")
169 (version "6.4")
170 (source
171 (origin
172 (method url-fetch)
173 (uri (string-append
174 "ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib-" version
175 ".tar.bz2"))
176 (sha256
177 (base32 "003h23m6d5wcs29v2vbnl63f3z35k5x70lpsqlz5c9bp1bvizh8k"))))
178 (inputs
179 `(("cfitsio" ,cfitsio)))
180 (build-system gnu-build-system)
181 (arguments
182 `(#:configure-flags
183 (list (string-append "--with-cfitsiolib="
184 (assoc-ref %build-inputs "cfitsio") "/lib")
185 (string-append "--with-cfitsioinc="
186 (assoc-ref %build-inputs "cfitsio") "/include"))
187 #:phases
188 (modify-phases %standard-phases
189 (add-before 'configure 'patch-/bin/sh
190 (lambda _
191 (substitute* "makedefs.in"
192 (("/bin/sh") "sh"))
193 #t))
194 (delete 'install-license-files)) ; installed by ‘make install’
195 ;; Parallel execution of the test suite is not supported.
196 #:parallel-tests? #f))
197 (home-page "https://www.atnf.csiro.au/people/mcalabre/WCS")
198 (synopsis "Library which implements the FITS WCS standard")
199 (description "The FITS \"World Coordinate System\" (@dfn{WCS}) standard
200 defines keywords and usage that provide for the description of astronomical
201 coordinate systems in a @dfn{FITS} (Flexible Image Transport System) image
202 header.")
203 (license license:lgpl3+)))
204
205 (define-public weightwatcher
206 (package
207 (name "weightwatcher")
208 (version "1.12")
209 (source
210 (origin
211 (method url-fetch)
212 (uri (string-append "https://www.astromatic.net/download/weightwatcher/"
213 "weightwatcher-" version ".tar.gz"))
214 (sha256
215 (base32 "1zaqd8d9rpgcwjsp92q3lkfaa22i20gppb91dz34ym54swisjc2p"))))
216 (build-system gnu-build-system)
217 (home-page "https://www.astromatic.net/software/weightwatcher")
218 (synopsis "Weight-map/flag-map multiplexer and rasteriser")
219 (description
220 "Weightwatcher is a program hat combines weight-maps, flag-maps and
221 polygon data in order to produce control maps which can directly be used in
222 astronomical image-processing packages like Drizzle, Swarp or SExtractor.")
223 (license license:gpl3+)))
224
225 (define-public gnuastro
226 (package
227 (name "gnuastro")
228 (version "0.14")
229 (source
230 (origin
231 (method url-fetch)
232 (uri (string-append "mirror://gnu/gnuastro/gnuastro-"
233 version ".tar.lz"))
234 (sha256
235 (base32
236 "1xp6n42qxv0x6yigi2w2l5k8006smv27lhrcssysgsvzbydghzg5"))))
237 (build-system gnu-build-system)
238 (arguments
239 '(#:configure-flags '("--disable-static")))
240 (inputs
241 `(("cfitsio" ,cfitsio)
242 ("curl" ,curl-minimal)
243 ("gsl" ,gsl)
244 ("libgit2" ,libgit2)
245 ("libjpeg" ,libjpeg-turbo)
246 ("libtiff" ,libtiff)
247 ("wcslib" ,wcslib)
248 ("zlib" ,zlib)))
249 (native-inputs
250 `(("libtool" ,libtool)
251 ("lzip" ,lzip)))
252 (home-page "https://www.gnu.org/software/gnuastro/")
253 (synopsis "Astronomy utilities")
254 (description "The GNU Astronomy Utilities (Gnuastro) is a suite of
255 programs for the manipulation and analysis of astronomical data.")
256 (license license:gpl3+)))
257
258 (define-public sextractor
259 (package
260 (name "sextractor")
261 (version "2.25.0")
262 (source
263 (origin
264 (method git-fetch)
265 (uri (git-reference
266 (url "https://github.com/astromatic/sextractor")
267 (commit version)))
268 (file-name (git-file-name name version))
269 (sha256
270 (base32 "0q69n3nyal57h3ik2xirwzrxzljrwy9ivwraxzv9566vi3n4z5mw"))))
271 (build-system gnu-build-system)
272 ;; NOTE: (Sharlatan-20210124T103117+0000): Building with `atlas' is failing
273 ;; due to missing shared library which required on configure phase. Switch
274 ;; build to use `openblas' instead. It requires FFTW with single precision
275 ;; `fftwf'.
276 (arguments
277 `(#:configure-flags
278 (list
279 "--enable-openblas"
280 (string-append
281 "--with-openblas-libdir=" (assoc-ref %build-inputs "openblas") "/lib")
282 (string-append
283 "--with-openblas-incdir=" (assoc-ref %build-inputs "openblas") "/include")
284 (string-append
285 "--with-fftw-libdir=" (assoc-ref %build-inputs "fftw") "/lib")
286 (string-append
287 "--with-fftw-incdir=" (assoc-ref %build-inputs "fftw") "/include"))))
288 (native-inputs
289 `(("autoconf" ,autoconf)
290 ("automake" ,automake)
291 ("libtool" ,libtool)))
292 (inputs
293 `(("openblas" ,openblas)
294 ("fftw" ,fftwf)))
295 (home-page "http://www.astromatic.net/software/sextractor")
296 (synopsis "Extract catalogs of sources from astronomical images")
297 (description
298 "SExtractor is a program that builds a catalogue of objects from an
299 astronomical image. Although it is particularly oriented towards reduction of
300 large scale galaxy-survey data, it can perform reasonably well on moderately
301 crowded star fields.")
302 (license license:gpl3+)))
303
304 (define-public skymaker
305 (package
306 (name "skymaker")
307 (version "3.10.5")
308 (source
309 (origin
310 (method url-fetch)
311 (uri (string-append "https://www.astromatic.net/download/skymaker/"
312 "skymaker-" version ".tar.gz"))
313 (sha256
314 (base32 "03zvx7c89plp9559niqv5532r233kza3ir992rg3nxjksqmrqvx1"))))
315 (build-system gnu-build-system)
316 (arguments
317 `(#:configure-flags
318 (list
319 (string-append
320 "--with-fftw-libdir=" (assoc-ref %build-inputs "fftw") "/lib")
321 (string-append
322 "--with-fftw-incdir=" (assoc-ref %build-inputs "fftw") "/include"))))
323 (inputs
324 `(("fftw" ,fftwf)))
325 (home-page "https://www.astromatic.net/software/skymaker")
326 (synopsis "Astronomical image simulator")
327 (description
328 "SkyMaker is a program that simulates astronomical images. It accepts
329 object lists in ASCII generated by the Stuff program to produce realistic
330 astronomical fields. SkyMaker is part of the EFIGI
331 (@url{https://www.astromatic.net/projects/efigi}) development project.")
332 (license license:gpl3+)))
333
334 (define-public stellarium
335 (package
336 (name "stellarium")
337 (version "0.20.4")
338 (source
339 (origin
340 (method url-fetch)
341 (uri (string-append "https://github.com/Stellarium/stellarium"
342 "/releases/download/v" version
343 "/stellarium-" version ".tar.gz"))
344 (sha256
345 (base32 "1253zlr0mi4kdbj119spxk7spg4rkahb4rlpd0hz1d81mnv3n0v3"))))
346 (build-system cmake-build-system)
347 (inputs
348 `(("qtbase" ,qtbase)
349 ("qtlocation" ,qtlocation)
350 ("qtmultimedia" ,qtmultimedia)
351 ("qtscript" ,qtscript)
352 ("qtserialport" ,qtserialport)
353 ("zlib" ,zlib)))
354 (native-inputs
355 `(("gettext" ,gettext-minimal) ; xgettext is used at compile time
356 ("perl" ,perl) ; for pod2man
357 ("qtbase" ,qtbase) ; Qt MOC is needed at compile time
358 ("qttools" ,qttools)))
359 (arguments
360 `(#:test-target "test"
361 #:configure-flags (list "-DENABLE_TESTING=1"
362 (string-append
363 "-DCMAKE_CXX_FLAGS=-isystem "
364 (assoc-ref %build-inputs "qtserialport")
365 "/include/qt5"))
366 #:phases (modify-phases %standard-phases
367 (add-before 'check 'set-offscreen-display
368 (lambda _
369 ;; Make Qt render "offscreen", required for tests.
370 (setenv "QT_QPA_PLATFORM" "offscreen")
371 (setenv "HOME" "/tmp")
372 #t)))))
373 (home-page "https://stellarium.org/")
374 (synopsis "3D sky viewer")
375 (description "Stellarium is a planetarium. It shows a realistic sky in
376 3D, just like what you see with the naked eye, binoculars, or a telescope. It
377 can be used to control telescopes over a serial port for tracking celestial
378 objects.")
379 (license license:gpl2+)))
380
381 (define-public stuff
382 (package
383 (name "stuff")
384 (version "1.26.0")
385 (source
386 (origin
387 (method url-fetch)
388 (uri (string-append "https://www.astromatic.net/download/stuff/"
389 "stuff-" version ".tar.gz"))
390 (sha256
391 (base32 "1syibi3b86z9pikhicvkkmgxm916j732fdiw0agw0lq6z13fdcjm"))))
392 (build-system gnu-build-system)
393 (home-page "https://www.astromatic.net/software/stuff")
394 (synopsis "Astronomical catalogue simulation")
395 (description
396 "Stuff is a program that simulates \"perfect\" astronomical catalogues.
397 It generates object lists in ASCII which can read by the SkyMaker program to
398 produce realistic astronomical fields. Stuff is part of the EFIGI development
399 project.")
400 (license license:gpl3+)))
401
402 (define-public swarp
403 (package
404 (name "swarp")
405 (version "2.38.0")
406 (source
407 (origin
408 (method url-fetch)
409 (uri (string-append "https://www.astromatic.net/download/swarp/"
410 "swarp-" version ".tar.gz"))
411 (sha256
412 (base32 "1i670waqp54vin1cn08mqckcggm9zqd69nk7yya2vvqpdizn6jpm"))))
413 (build-system gnu-build-system)
414 (home-page "https://www.astromatic.net/software/swarp")
415 (synopsis "FITS image resampling and co-addition")
416 (description
417 "SWarp is a program that resamples and co-adds together FITS images using
418 any arbitrary astrometric projection defined in the WCS standard.")
419 (license license:gpl3+)))
420
421 (define-public celestia
422 (let ((commit "9dbdf29c4ac3d20afb2d9a80d3dff241ecf81dce"))
423 (package
424 (name "celestia")
425 (version (git-version "1.6.1" "815" commit))
426 (source (origin
427 (method git-fetch)
428 (uri (git-reference
429 (url "https://github.com/celestiaproject/celestia")
430 (commit commit)))
431 (file-name (git-file-name name version))
432 (sha256
433 (base32
434 "00xibg87l1arzifakgj7s828x9pszcgx7x7ij88a561ig49ryh78"))))
435 (build-system cmake-build-system)
436 (native-inputs
437 `(("perl" ,perl)
438 ("libgit2" ,libgit2)
439 ("pkg-config" ,pkg-config)
440 ("libtool" ,libtool)
441 ("gettext" ,gettext-minimal)))
442 (inputs
443 `(("glu" ,glu)
444 ("glew" ,glew)
445 ("libtheora" ,libtheora)
446 ("libjpeg" ,libjpeg-turbo)
447 ("libpng" ,libpng)
448 ;; maybe required?
449 ("mesa" ,mesa)
450 ;; optional: fmtlib, Eigen3;
451 ("fmt" ,fmt)
452 ("eigen" ,eigen)
453 ;; glut: for glut interface
454 ("freeglut" ,freeglut)))
455 (propagated-inputs
456 `(("lua" ,lua)))
457 (arguments
458 `(#:configure-flags '("-DENABLE_GLUT=ON" "-DENABLE_QT=OFF")
459 #:tests? #f)) ;no tests
460 (home-page "https://celestia.space/")
461 (synopsis "Real-time 3D visualization of space")
462 (description
463 "This simulation program lets you explore our universe in three
464 dimensions. Celestia simulates many different types of celestial objects.
465 From planets and moons to star clusters and galaxies, you can visit every
466 object in the expandable database and view it from any point in space and
467 time. The position and movement of solar system objects is calculated
468 accurately in real time at any rate desired.")
469 (license license:gpl2+))))
470
471 (define-public celestia-gtk
472 (package
473 (inherit celestia)
474 (name "celestia-gtk")
475 (inputs
476 (append (alist-delete "freeglut" (package-inputs celestia))
477 `(("gtk2" ,gtk+-2)
478 ("gtkglext" ,gtkglext))))
479 (arguments
480 `(#:configure-flags '("-DENABLE_GTK=ON" "-DENABLE_QT=OFF")
481 #:tests? #f))))
482
483 (define-public libnova
484 (package
485 (name "libnova")
486 (version "0.16")
487 (source
488 (origin
489 (method git-fetch)
490 (uri (git-reference
491 (url "https://git.code.sf.net/p/libnova/libnova.git")
492 (commit (string-append "v" version))))
493 (file-name (git-file-name name version))
494 (sha256
495 (base32
496 "0icwylwkixihzni0kgl0j8dx3qhqvym6zv2hkw2dy6v9zvysrb1b"))))
497 (build-system gnu-build-system)
498 (arguments
499 `(#:phases
500 (modify-phases %standard-phases
501 (add-after 'unpack 'patch-git-version
502 (lambda _
503 (substitute* "./git-version-gen"
504 (("/bin/sh") (which "sh")))
505 #t)))))
506 (native-inputs
507 `(("autoconf" ,autoconf)
508 ("automake" ,automake)
509 ("libtool" ,libtool)))
510 (synopsis "Celestial mechanics, astrometry and astrodynamics library")
511 (description "Libnova is a general purpose, double precision, Celestial
512 Mechanics, Astrometry and Astrodynamics library.")
513 (home-page "http://libnova.sourceforge.net/")
514 (license (list license:lgpl2.0+
515 license:gpl2+)))) ; examples/transforms.c & lntest/*.c
516
517 (define-public libpasastro
518 ;; NOTE: (Sharlatan-20210122T215921+0000): the version tag has a build
519 ;; error on spice which is resolved with the latest commit.
520 (let ((commit "e3c218d1502a18cae858c83a9a8812ab197fcb60")
521 (revision "1"))
522 (package
523 (name "libpasastro")
524 (version (git-version "1.4.0" revision commit))
525 (source (origin
526 (method git-fetch)
527 (uri (git-reference
528 (url "https://github.com/pchev/libpasastro")
529 (commit commit)))
530 (file-name (git-file-name name version))
531 (sha256
532 (base32
533 "0asp2sn34nds5va2ghppwc41vb6j3d1mf049j949rgrll817kx47"))))
534 (build-system gnu-build-system)
535 (arguments
536 `(#:tests? #f
537 #:make-flags
538 (list
539 ,(match (or (%current-target-system) (%current-system))
540 ((or "aarch64-linux" "armhf-linux" "i686-linux" "x86_64-linux")
541 "OS_TARGET=linux")
542 (_ #f))
543 ,(match (or (%current-target-system) (%current-system))
544 ("i686-linux" "CPU_TARGET=i386")
545 ("x86_64-linux" "CPU_TARGET=x86_64")
546 ((or "armhf-linux" "aarch64-linux") "CPU_TARGET=armv7l")
547 (_ #f))
548 (string-append "PREFIX=" (assoc-ref %outputs "out")))
549 #:phases
550 (modify-phases %standard-phases
551 (delete 'configure))))
552 (home-page "https://github.com/pchev/libpasastro")
553 (synopsis "Interface to astronomy library for use from Pascal program")
554 (description
555 "This package provides shared libraries to interface Pascal program with
556 standard astronomy libraries:
557
558 @itemize
559 @item @code{libpasgetdss.so}: Interface with GetDSS to work with DSS images.
560 @item @code{libpasplan404.so}: Interface with Plan404 to compute planets position.
561 @item @code{libpaswcs.so}: Interface with libwcs to work with FITS WCS.
562 @item @code{libpasspice.so}: To work with NAIF/SPICE kernel.
563 @end itemize\n")
564 (license license:gpl2+))))
565
566 (define-public missfits
567 (package
568 (name "missfits")
569 (version "2.8.0")
570 (source
571 (origin
572 (method url-fetch)
573 (uri (string-append "https://www.astromatic.net/download/missfits/"
574 "missfits-" version ".tar.gz"))
575 (sha256
576 (base32 "04jrd7fsvzr14vdmwgj2f6v97gdcfyjyz6jppml3ghr9xh12jxv5"))))
577 (build-system gnu-build-system)
578 (home-page "https://www.astromatic.net/software/missfits")
579 (synopsis "FITS files Maintenance program")
580 (description
581 "MissFITS is a program that performs basic maintenance and packaging tasks
582 on FITS files:
583
584 @itemize
585 @item add/edit FITS header keywords
586 @item split/join Multi-Extension-FITS (MEF) files
587 @item unpack/pack FITS data-cubes
588 @item create/check/update FITS checksums, using R. Seaman's protocol
589 (see http://www.adass.org/adass/proceedings/adass94/seamanr.html)
590 @end itemize\n")
591 (license license:gpl3+)))
592
593 (define-public xplanet
594 (package
595 (name "xplanet")
596 (version "1.3.1")
597 (source
598 (origin
599 (method url-fetch)
600 (uri
601 (string-append
602 "mirror://sourceforge/xplanet/xplanet/"
603 version "/xplanet-" version ".tar.gz"))
604 (sha256
605 (base32 "1rzc1alph03j67lrr66499zl0wqndiipmj99nqgvh9xzm1qdb023"))
606 (patches
607 (search-patches
608 "xplanet-1.3.1-cxx11-eof.patch"
609 "xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch"
610 "xplanet-1.3.1-libimage_gif.c.patch"
611 "xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch"))))
612 (build-system gnu-build-system)
613 (native-inputs
614 `(("pkg-config" ,pkg-config)))
615 (inputs
616 `(("libx11" ,libx11)
617 ("libxscrnsaver" ,libxscrnsaver)
618 ("libice" ,libice)
619 ("freetype" ,freetype)
620 ("pango" ,pango)
621 ("giflib" ,giflib)
622 ("libjpeg" ,libjpeg-turbo)
623 ("libpng" ,libpng)
624 ("libtiff" ,libtiff)
625 ("netpbm" ,netpbm)
626 ("zlib" ,zlib)))
627 (arguments
628 `(#:configure-flags
629 (let ((netpbm (assoc-ref %build-inputs "netpbm")))
630 (append (list
631 ;; Give correct path for pnm.h header to configure script
632 (string-append "CPPFLAGS=-I" netpbm "/include/netpbm")
633 ;; no nasa jpl cspice support
634 "--without-cspice" )))))
635 (home-page "http://xplanet.sourceforge.net/")
636 (synopsis "Planetary body renderer")
637 (description
638 "Xplanet renders an image of a planet into an X window or file.
639 All of the major planets and most satellites can be drawn and different map
640 projections are also supported, including azimuthal, hemisphere, Lambert,
641 Mercator, Mollweide, Peters, polyconic, orthographic and rectangular.")
642 (license license:gpl2+)))
643
644 (define-public gpredict
645 (package
646 (name "gpredict")
647 (version "2.2.1")
648 (source
649 (origin
650 (method url-fetch)
651 (uri (string-append "https://github.com/csete/gpredict/releases"
652 "/download/v" version
653 "/gpredict-" version ".tar.bz2"))
654 (sha256
655 (base32 "0hwf97kng1zy8rxyglw04x89p0bg07zq30hgghm20yxiw2xc8ng7"))))
656 (build-system gnu-build-system)
657 (native-inputs
658 `(("intltool" ,intltool)
659 ("gettext" ,gettext-minimal)
660 ("pkg-config" ,pkg-config)))
661 (inputs
662 `(("curl" ,curl)
663 ("glib" ,glib)
664 ("goocanvas" ,goocanvas)
665 ("gtk+" ,gtk+)))
666 (arguments
667 `(#:phases
668 (modify-phases %standard-phases
669 (add-after 'unpack 'fix-tests
670 (lambda _
671 ;; Remove reference to non-existent file.
672 (substitute* "po/POTFILES.in"
673 (("src/gtk-sat-tree\\.c")
674 ""))
675 #t)))))
676 (synopsis "Satellite tracking and orbit prediction application")
677 (description
678 "Gpredict is a real-time satellite tracking and orbit prediction
679 application. It can track a large number of satellites and display their
680 position and other data in lists, tables, maps, and polar plots (radar view).
681 Gpredict can also predict the time of future passes for a satellite, and
682 provide you with detailed information about each pass.")
683 (home-page "http://gpredict.oz9aec.net/index.php")
684 (license license:gpl2+)))
685
686 (define-public indi
687 (package
688 (name "indi")
689 (version "1.8.8")
690 (source
691 (origin
692 (method git-fetch)
693 (uri (git-reference
694 (url "https://github.com/indilib/indi")
695 (commit (string-append "v" version))))
696 (file-name (git-file-name name version))
697 (sha256
698 (base32 "19gm7rbnm3295g2i8mdzfslpz0vrcgfmbl59311qpszvlxbmyd2r"))))
699 (build-system cmake-build-system)
700 (arguments
701 `(#:configure-flags
702 (let ((out (assoc-ref %outputs "out")))
703 (list
704 "-DINDI_BUILD_UNITTESTS=ON"
705 "-DCMAKE_BUILD_TYPE=Release"
706 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
707 (string-append "-DUDEVRULES_INSTALL_DIR=" out "/lib/udev/rules.d")))
708 #:phases
709 (modify-phases %standard-phases
710 (replace 'check
711 (lambda _
712 (chdir "test")
713 (invoke "ctest")
714 (chdir "..")
715 #t))
716 (add-before 'install 'set-install-directories
717 (lambda* (#:key outputs #:allow-other-keys)
718 (let ((out (assoc-ref outputs "out")))
719 (mkdir-p (string-append out "/lib/udev/rules.d")))
720 #t)))))
721 (native-inputs
722 `(("googletest" ,googletest)))
723 (inputs
724 `(("cfitsio" ,cfitsio)
725 ("curl" ,curl)
726 ("fftw" ,fftw)
727 ("gsl" ,gsl)
728 ("libjpeg-turbo" ,libjpeg-turbo)
729 ("libnova" ,libnova)
730 ("libtiff" ,libtiff)
731 ("libusb" ,libusb)
732 ("zlib" ,zlib)))
733 (home-page "https://www.indilib.org")
734 (synopsis "Library for astronimical intrumentation control")
735 (description
736 "INDI (Instrument-Neutral Device Interface) is a distributed XML-based
737 control protocol designed to operate astronomical instrumentation. INDI is
738 small, flexible, easy to parse, scalable, and stateless. It supports common
739 DCS functions such as remote control, data acquisition, monitoring, and a lot
740 more.")
741 (license (list license:bsd-3
742 license:gpl2+
743 license:lgpl2.0+
744 license:lgpl2.1+))))
745
746 (define-public python-jplephem
747 (package
748 (name "python-jplephem")
749 (version "2.15")
750 (source
751 (origin
752 (method url-fetch)
753 (uri (pypi-uri "jplephem" version))
754 (sha256
755 (base32 "1ca3dswsslij79qg6dcijjz4l0fj6nzmxld8z93v45ahlkhps0g0"))))
756 (build-system python-build-system)
757 (arguments
758 `(#:phases
759 (modify-phases %standard-phases
760 (replace 'check
761 (lambda* (#:key outputs #:allow-other-keys)
762 (let ((out (assoc-ref outputs "out")))
763 (setenv "PYTHONPATH"
764 (string-append "./build/lib:"
765 (getenv "PYTHONPATH")))
766 (setenv "PATH" (string-append out "/bin:"
767 (getenv "PATH")))
768 (invoke "python" "-m" "unittest" "discover" "-s" "test")))))))
769 (inputs
770 `(("python-numpy" ,python-numpy)))
771 (home-page "https://github.com/brandon-rhodes/python-jplephem")
772 (synopsis "Python version of NASA DE4xx ephemerides")
773 (description
774 "The package is a Python implementation of the mathematics that standard
775 JPL ephemerides use to predict raw (x,y,z) planetary positions.")
776 (license license:expat)))
777
778 (define-public python-pyerfa
779 (package
780 (name "python-pyerfa")
781 (version "1.7.2")
782 (source
783 (origin
784 (method url-fetch)
785 (uri (pypi-uri "pyerfa" version))
786 (sha256
787 (base32 "1s78mdyrxha2jcckfs0wg5ynkf0pwh1bw9mmh99vprinxh9n4xri"))
788 (modules '((guix build utils)))
789 (snippet
790 '(begin
791 ;; Remove bundled submodule library.
792 (delete-file-recursively "liberfa")
793 #t))))
794 (build-system python-build-system)
795 (arguments
796 `(#:phases
797 (modify-phases %standard-phases
798 (add-before 'build 'use-system-liberfa
799 (lambda _
800 (setenv "PYERFA_USE_SYSTEM_LIBERFA" "1")
801 #t)))))
802 (native-inputs
803 `(("pytest" ,python-pytest)
804 ("setuptools-scm" ,python-setuptools-scm)
805 ("pytest-doctestplus" ,python-pytest-doctestplus)))
806 (inputs
807 `(("liberfa" ,erfa)
808 ("numpy" ,python-numpy)))
809 (home-page "https://github.com/liberfa/pyerfa")
810 (synopsis "Python bindings for ERFA")
811 (description
812 "PyERFA is the Python wrapper for the ERFA library (Essential
813 Routines for Fundamental Astronomy), a C library containing key algorithms for
814 astronomy, which is based on the SOFA library published by the International
815 Astronomical Union (IAU). All C routines are wrapped as Numpy universal
816 functions, so that they can be called with scalar or array inputs.")
817 (license license:bsd-3)))
818
819 (define-public python-sep
820 (package
821 (name "python-sep")
822 (version "1.1.1")
823 (source
824 (origin
825 (method url-fetch)
826 (uri (pypi-uri "sep" version))
827 (sha256
828 (base32 "0wxdqn92q1grv8k7xi7h88ac6wnznw4xh5bdlz1vz6za2dgsyj4m"))))
829 (build-system python-build-system)
830 (native-inputs
831 `(("cython" ,python-cython)
832 ("pytest" ,python-pytest)))
833 (inputs
834 `(("numpy" ,python-numpy)))
835 (home-page "https://github.com/kbarbary/sep")
836 (synopsis "Astronomical source extraction and photometry library")
837 (description
838 "SEP makes the core algorithms of Source Extractor available as a library
839 of stand-alone functions and classes.")
840 (license (list license:bsd-3
841 license:expat
842 license:lgpl3+))))
843
844 (define-public python-astroalign
845 (package
846 (name "python-astroalign")
847 (version "2.3.1")
848 (source
849 (origin
850 (method url-fetch)
851 (uri (pypi-uri "astroalign" version))
852 (sha256
853 (base32 "19qzv3552lgrd9qmj0rxs51wmx485hw04cbf76ds5pin85kfaiy1"))))
854 (build-system python-build-system)
855 (arguments
856 ;; TODO: (Sharlatan-20210213T162940+0000): I could not make tests run
857 `(#:tests? #f))
858 (inputs
859 `(("numpy" ,python-numpy)
860 ("scikit-image" ,python-scikit-image)
861 ("scipy" ,python-scipy)
862 ("sep" ,python-sep)))
863 (home-page "https://astroalign.readthedocs.io/")
864 (synopsis "Astrometric Alignment of Images")
865 (description
866 "ASTROALIGN is a python module that will try to align two stellar
867 astronomical images, especially when there is no WCS information available.")
868 (license license:expat)))
869
870 (define-public python-skyfield
871 (package
872 (name "python-skyfield")
873 (version "1.36")
874 (source
875 (origin
876 (method url-fetch)
877 (uri (pypi-uri "skyfield" version))
878 (sha256
879 (base32 "1dm1327a4qv3klj9blrvddbhl72v1fqz52ym9km8qjj9vdkpywh6"))))
880 (build-system python-build-system)
881 (arguments
882 ;; NOTE: (Sharlatan-20210207T163305+0000): tests depend on custom test
883 ;; framework https://github.com/brandon-rhodes/assay
884 `(#:tests? #f))
885 (inputs
886 `(("certifi" ,python-certifi)
887 ("jplephem" ,python-jplephem)
888 ("numpy" ,python-numpy)
889 ("sgp4" ,python-sgp4)))
890 (home-page "https://rhodesmill.org/skyfield/")
891 (synopsis "Astronomy for Python")
892 (description
893 "Skyfield computes positions for the stars, planets, and satellites in
894 orbit around the Earth.")
895 (license license:expat)))