Commit f0472919 authored by Liam M. Healy's avatar Liam M. Healy
Browse files

Separate, add systems input-output, math-high, mathematics

Separate, add systems new systems that were in the old monolithic
antik.asd: input-output, math-high, mathematics. Make the retrieval of
earth orientation parameters (for calibrating UT1 timescale) a
connected system when Drakma is loaded.
parent 514bbac1
;; Foreign array system definition
;; Liam Healy 2012-03-23 19:06:29EDT foreign-array.asd
;; Time-stamp: <2012-03-23 19:19:25EDT foreign-array.asd>
;; Time-stamp: <2013-11-24 13:38:06EST foreign-array.asd>
;; Copyright 2012 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -24,7 +24,7 @@
(asdf:defsystem #:foreign-array
:name "Foreign-Array"
:description "A library providing generalized arrays."
:description "A library providing access to foreign (i.e., C) arrays."
:author "Liam M. Healy"
:license "GPL v3"
:serial t
......@@ -55,3 +55,27 @@
((:file "aref")
(:file "lisp-unit-extension")
(:file "compose")))))))
;;; High level mathematics built on libraries.
(asdf:defsystem-connection #:math-high
:serial t
:requires (#:foreign-array #:gsll)
:components
((:module optimize
:components
((:file "one-dim")
(:file "least-squares")))
(:module linear-algebra
:components
((:file "linear-algebra")))
(:module sample
:components
((:file "low-discrepancy-sequence")))))
(asdf:defsystem-connection #:math-high-tests
:serial t
:requires (#:math-high #:lisp-unit)
:components
((:module linear-algebra
:components
((:file "linear-algebra-tests")))))
;; Antik system definition
;; Liam Healy 2010-12-24 09:43:28EST antik.asd
;; Time-stamp: <2013-11-23 11:39:42EST grid.asd>
;; Time-stamp: <2013-11-24 12:25:02EST grid.asd>
;; Copyright 2011, 2012, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -19,10 +19,6 @@
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Antik is a system for doing scientific, engineering, and computational mathematics.
;;; The following systems are required:
;;; cffi, alexandria, split-sequence, cl-ppcre, trivial-garbage, drakma
;;; The following are optional:
;;; static-vectors, lisp-unit, gsll, cl-unicode
(asdf:defsystem #:grid
:name "Grid"
......@@ -31,8 +27,7 @@
:license "GPL v3"
:serial t
:defsystem-depends-on (#:asdf-system-connections)
:depends-on (#:antik-base #:alexandria #:trivial-garbage
#:split-sequence #:cl-ppcre)
:depends-on (#:antik-base #:alexandria #:trivial-garbage #:split-sequence)
:components
((:module grid
:components
......@@ -55,16 +50,7 @@
(:file "mathematics" :depends-on ("map"))
(:module tests
:components
((:file "grids")))))
(:module input-output
:serial t
:components
((:file "parameters")
(:file "format-output")
(:file "float")
(:file "matlab")
(:file "read") ; cl-ppcre
(:file "indexed")))))
((:file "grids")))))))
(asdf:defsystem-connection #:grid-tests
:serial t
......
;; Symbols defined in physical-dimension and GSLL that would conflict in Antik user packages
;; Liam Healy 2013-11-24 19:04:51EST pd-shadow-symbols.lisp
;; Time-stamp: <2013-11-24 19:22:58EST pd-shadow-symbols.lisp>
(in-package :antik)
(setf
antik::*antik-user-shadow-symbols*
(append antik::*antik-user-shadow-symbols*
;; Where there is a symbol conflict between GSLL and other packages,
'(antik::polar-to-rectangular ; GSLL's doesn't use vectors
antik::rectangular-to-polar ; GSLL's doesn't use vectors
;; antik:acceleration refers to the time derivative of velocity vs. object 'gsl:acceleration.
antik::acceleration
;; No actual conflict due to different usage of symbols:
;; antik:psi means "pounds per square inch" vs. function #'gsl:psi
;; antik:knots means "nautical miles per hour" vs. function #'gsl:knots
antik::psi
antik::knots)))
(antik:make-user-package :antik-user) ; Add the new use package and shadow symbols to :antik-user
;; Input-output system definition
;; Liam Healy 2012-02-20 10:14:49EST physical-dimension.asd
;; Time-stamp: <2013-11-24 13:02:40EST input-output.asd>
;; Copyright 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;
(in-package :cl-user)
(asdf:defsystem #:input-output
:name "Input Output"
:description "A library to provide convenient input, output and usage of global data, primarily numerical."
:author "Liam M. Healy"
:license "GPL v3"
:serial t
:defsystem-depends-on (#:asdf-system-connections)
:depends-on (#:grid #:cl-ppcre #:split-sequence)
:components
((:module input-output
:serial t
:components
((:file "parameters")
(:file "format-output")
(:file "float")
(:file "matlab")
(:file "read") ; cl-ppcre
(:file "indexed")))))
;;
;; Liam Healy 2012-02-20 10:14:49EST physical-dimension.asd
;; Time-stamp: <2013-11-24 19:29:57EST mathematics.asd>
;; Copyright 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;
(in-package :cl-user)
(asdf:defsystem #:mathematics
:name "Mathematics"
:description "A library of miscellaneous small mathematical computations."
:author "Liam M. Healy"
:license "GPL v3"
:serial t
:defsystem-depends-on (#:asdf-system-connections)
:depends-on (#:antik-base)
:components
((:module mathematics
:serial t
:components
((:file "integers")
(:file "trigonometry")))))
;; Physical dimension system definition
;; Liam Healy 2012-02-20 10:14:49EST physical-dimension.asd
;; Time-stamp: <2013-11-23 14:47:21EST physical-dimension.asd>
;; Time-stamp: <2013-11-24 19:24:00EST physical-dimension.asd>
;; Copyright 2012, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -17,32 +17,24 @@
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;
(in-package :cl-user)
(asdf:defsystem #:physical-dimension
:name "Physical Dimension"
:description "Computations with physical dimension, i.e. units."
:description "A library to provide computations with physical dimension, i.e. units."
:author "Liam M. Healy"
:license "GPL v3"
:serial t
:defsystem-depends-on (#:asdf-system-connections)
:depends-on (#:grid #:drakma)
:depends-on (#:grid #:input-output #:split-sequence)
:components
((:module input-output
((:module init
:serial t
:components
((:file "parameters")
(:file "format-output")
(:file "org-mode")
(:file "float")
(:file "matlab")
(:file "read") ; cl-ppcre
(:file "indexed")))
((:file "pd-shadow-symbols")))
(:module physical-quantities
:serial t
:depends-on (input-output)
:components
((:file "format-output")
(:file "units")
......@@ -90,7 +82,7 @@
(asdf:defsystem-connection #:pq-grid-tests
:serial t
:requires (#:physical-dimension #:foreign-array)
:requires (#:physical-dimension #:foreign-array #:lisp-unit)
:components
((:module tests
:serial t
......@@ -99,8 +91,16 @@
(asdf:defsystem-connection #:degree-symbol
:serial t
:requires (#:antik #:cl-unicode)
:requires (#:physical-dimension #:cl-unicode)
:components
((:module physical-quantities
:components
((:file "degree-symbol")))))
(asdf:defsystem-connection #:remote-phys-dim-data
:serial t
:requires (#:physical-dimension #:drakma)
:components
((:module physical-quantities
:components
((:file "eop")))))
;; Convert time scales
;; Liam Healy Sat Feb 4 2006 - 18:00
;; Time-stamp: <2011-03-23 22:53:17EDT convert-timescale.lisp>
;; Time-stamp: <2013-11-24 12:54:20EST convert-timescale.lisp>
;; Copyright 2011 Liam M. Healy
;; Copyright 2011, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -196,36 +196,44 @@
"First estimated UT1-UTC value in *ut1-utc-table*.
This serves as a marker for the age of the eop.dat file.")
(defparameter *eop-data-fetch* nil)
(defun read-eop-file ()
"Read the earth orientation parameters from USNO."
(unless *eop-data-fetch*
#+quicklisp
(progn
(cerror "Load drakma" "To fetch earth orientation data, drakma system needs to be loaded.")
(ql:quickload "drakma"))
#-quicklisp
(error "To fetch earth orientation data, drakma system needs to be loaded."))
(warn "Downloading earth orientation data; please wait.")
(with-input-from-string
(stream
(drakma:http-request "http://maia.usno.navy.mil/ser7/finals.all"))
(stream (funcall *eop-data-fetch*))
(loop for line cl:= (read-line stream nil nil)
with table cl:= (make-hash-table :test #'eql :size 2000)
and estimated and date
while line
do
(setf
date
(make-timepoint
:timeparse
(list 0 0 0
;; see ftp://maia.usno.navy.mil/ser7/readme.finals
;; for column description
(read-from-string line nil nil :start 4 :end 6)
(read-from-string line nil nil :start 2 :end 4)
(convert-two-digit-year
(read-from-string line nil nil :start 0 :end 2)))
:scale :utc
:day-only t)
(gethash (cl:+ 1/2 (datime-j2000day date)) table)
;; see ftp://maia.usno.navy.mil/ser7/readme.finals
;; for column description
(read-from-string line nil nil :start 58 :end 68))
(if (and (not estimated) (equal (subseq line 79 86) " "))
(setf estimated date))
(setf
date
(make-timepoint
:timeparse
(list 0 0 0
;; see ftp://maia.usno.navy.mil/ser7/readme.finals
;; for column description
(read-from-string line nil nil :start 4 :end 6)
(read-from-string line nil nil :start 2 :end 4)
(convert-two-digit-year
(read-from-string line nil nil :start 0 :end 2)))
:scale :utc
:day-only t)
(gethash (cl:+ 1/2 (datime-j2000day date)) table)
;; see ftp://maia.usno.navy.mil/ser7/readme.finals
;; for column description
(read-from-string line nil nil :start 58 :end 68))
(if (and (not estimated) (equal (subseq line 79 86) " "))
(setf estimated date))
finally (setf *ut1-utc-table* table
*ut1-utc-first-estimated* estimated))
*ut1-utc-table*))
......
;; Thunk to retrieve earth orientation parameters from the web
;; Liam Healy 2013-11-24 12:51:55EST eop.lisp
;; Time-stamp: <2013-11-24 12:57:42EST eop.lisp>
;; Copyright 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(in-package :antik)
(setf *eop-data-fetch* (drakma:http-request "http://maia.usno.navy.mil/ser7/finals.all"))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment