astronomy.scm 39 KB

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