Skip to content

Instantly share code, notes, and snippets.

@wedesoft
Last active July 3, 2024 19:33
Show Gist options
  • Save wedesoft/dc3168120d854e9fd6c542efc79723a7 to your computer and use it in GitHub Desktop.
Save wedesoft/dc3168120d854e9fd6c542efc79723a7 to your computer and use it in GitHub Desktop.
Using NASA SPK format to interpolate planet ephemerides (translating jplephem code to Clojure)
{:deps {org.clojure/clojure {:mvn/version "1.11.3"}
instaparse/instaparse {:mvn/version "1.5.0"}
org.clj-commons/gloss {:mvn/version "0.3.6"}
generateme/fastmath {:mvn/version "2.4.0" :exclusions [com.github.haifengl/smile-mkl org.bytedeco/openblas]}
org.lwjgl/lwjgl {:mvn/version "3.3.3"}
org.lwjgl/lwjgl$natives-linux {:mvn/version "3.3.3"}}
:paths ["."]}
[[-172064161.0 -174666.0 33386.0]
[-13170906.0 -1675.0 -13696.0]
[-2276413.0 -234.0 2796.0]
[2074554.0 207.0 -698.0]
[1475877.0 -3633.0 11817.0]
[-516821.0 1226.0 -524.0]
[711159.0 73.0 -872.0]
[-387298.0 -367.0 380.0]
[-301461.0 -36.0 816.0]
[215829.0 -494.0 111.0]
[128227.0 137.0 181.0]
[123457.0 11.0 19.0]
[156994.0 10.0 -168.0]
[63110.0 63.0 27.0]
[-57976.0 -63.0 -189.0]
[-59641.0 -11.0 149.0]
[-51613.0 -42.0 129.0]
[45893.0 50.0 31.0]
[63384.0 11.0 -150.0]
[-38571.0 -1.0 158.0]
[32481.0 0.0 0.0]
[-47722.0 0.0 -18.0]
[-31046.0 -1.0 131.0]
[28593.0 0.0 -1.0]
[20441.0 21.0 10.0]
[29243.0 0.0 -74.0]
[25887.0 0.0 -66.0]
[-14053.0 -25.0 79.0]
[15164.0 10.0 11.0]
[-15794.0 72.0 -16.0]
[21783.0 0.0 13.0]
[-12873.0 -10.0 -37.0]
[-12654.0 11.0 63.0]
[-10204.0 0.0 25.0]
[16707.0 -85.0 -10.0]
[-7691.0 0.0 44.0]
[-11024.0 0.0 -14.0]
[7566.0 -21.0 -11.0]
[-6637.0 -11.0 25.0]
[-7141.0 21.0 8.0]
[-6302.0 -11.0 2.0]
[5800.0 10.0 2.0]
[6443.0 0.0 -7.0]
[-5774.0 -11.0 -15.0]
[-5350.0 0.0 21.0]
[-4752.0 -11.0 -3.0]
[-4940.0 -11.0 -21.0]
[7350.0 0.0 -8.0]
[4065.0 0.0 6.0]
[6579.0 0.0 -24.0]
[3579.0 0.0 5.0]
[4725.0 0.0 -6.0]
[-3075.0 0.0 -2.0]
[-2904.0 0.0 15.0]
[4348.0 0.0 -10.0]
[-2878.0 0.0 8.0]
[-4230.0 0.0 5.0]
[-2819.0 0.0 7.0]
[-4056.0 0.0 5.0]
[-2647.0 0.0 11.0]
[-2294.0 0.0 -10.0]
[2481.0 0.0 -7.0]
[2179.0 0.0 -2.0]
[3276.0 0.0 1.0]
[-3389.0 0.0 5.0]
[3339.0 0.0 -13.0]
[-1987.0 0.0 -6.0]
[-1981.0 0.0 0.0]
[4026.0 0.0 -353.0]
[1660.0 0.0 -5.0]
[-1521.0 0.0 9.0]
[1314.0 0.0 0.0]
[-1283.0 0.0 0.0]
[-1331.0 0.0 8.0]
[1383.0 0.0 -2.0]
[1405.0 0.0 4.0]
[1290.0 0.0 0.0]
[-1214.0 0.0 5.0]
[1146.0 0.0 -3.0]
[1019.0 0.0 -1.0]
[-1100.0 0.0 9.0]
[-970.0 0.0 2.0]
[1575.0 0.0 -6.0]
[934.0 0.0 -3.0]
[922.0 0.0 -1.0]
[815.0 0.0 -1.0]
[834.0 0.0 2.0]
[1248.0 0.0 0.0]
[1338.0 0.0 -5.0]
[716.0 0.0 -2.0]
[1282.0 0.0 -3.0]
[742.0 0.0 1.0]
[1020.0 0.0 -25.0]
[715.0 0.0 -4.0]
[-666.0 0.0 -3.0]
[-667.0 0.0 1.0]
[-704.0 0.0 0.0]
[-694.0 0.0 5.0]
[-1014.0 0.0 -1.0]
[-585.0 0.0 -2.0]
[-949.0 0.0 1.0]
[-595.0 0.0 0.0]
[528.0 0.0 0.0]
[-590.0 0.0 4.0]
[570.0 0.0 -2.0]
[-502.0 0.0 3.0]
[-875.0 0.0 1.0]
[-492.0 0.0 -3.0]
[535.0 0.0 -2.0]
[-467.0 0.0 1.0]
[591.0 0.0 0.0]
[-453.0 0.0 -1.0]
[766.0 0.0 1.0]
[-446.0 0.0 2.0]
[-488.0 0.0 2.0]
[-468.0 0.0 0.0]
[-421.0 0.0 1.0]
[463.0 0.0 0.0]
[-673.0 0.0 2.0]
[658.0 0.0 0.0]
[-438.0 0.0 0.0]
[-390.0 0.0 0.0]
[639.0 -11.0 -2.0]
[412.0 0.0 -2.0]
[-361.0 0.0 0.0]
[360.0 0.0 -1.0]
[588.0 0.0 -3.0]
[-578.0 0.0 1.0]
[-396.0 0.0 0.0]
[565.0 0.0 -1.0]
[-335.0 0.0 -1.0]
[357.0 0.0 1.0]
[321.0 0.0 1.0]
[-301.0 0.0 -1.0]
[-334.0 0.0 0.0]
[493.0 0.0 -2.0]
[494.0 0.0 -2.0]
[337.0 0.0 -1.0]
[280.0 0.0 -1.0]
[309.0 0.0 1.0]
[-263.0 0.0 2.0]
[253.0 0.0 1.0]
[245.0 0.0 0.0]
[416.0 0.0 -2.0]
[-229.0 0.0 0.0]
[231.0 0.0 0.0]
[-259.0 0.0 2.0]
[375.0 0.0 -1.0]
[252.0 0.0 0.0]
[-245.0 0.0 1.0]
[243.0 0.0 -1.0]
[208.0 0.0 1.0]
[199.0 0.0 0.0]
[-208.0 0.0 1.0]
[335.0 0.0 -2.0]
[-325.0 0.0 1.0]
[-187.0 0.0 0.0]
[197.0 0.0 -1.0]
[-192.0 0.0 2.0]
[-188.0 0.0 0.0]
[276.0 0.0 0.0]
[-286.0 0.0 1.0]
[186.0 0.0 -1.0]
[-219.0 0.0 0.0]
[276.0 0.0 0.0]
[-153.0 0.0 -1.0]
[-156.0 0.0 0.0]
[-154.0 0.0 1.0]
[-174.0 0.0 1.0]
[-163.0 0.0 2.0]
[-228.0 0.0 0.0]
[91.0 0.0 -4.0]
[175.0 0.0 0.0]
[-159.0 0.0 0.0]
[141.0 0.0 0.0]
[147.0 0.0 0.0]
[-132.0 0.0 0.0]
[159.0 0.0 -28.0]
[213.0 0.0 0.0]
[123.0 0.0 0.0]
[-118.0 0.0 -1.0]
[144.0 0.0 -1.0]
[-121.0 0.0 1.0]
[-134.0 0.0 1.0]
[-105.0 0.0 0.0]
[-102.0 0.0 0.0]
[120.0 0.0 0.0]
[101.0 0.0 0.0]
[-113.0 0.0 0.0]
[-106.0 0.0 0.0]
[-129.0 0.0 1.0]
[-114.0 0.0 0.0]
[113.0 0.0 -1.0]
[-102.0 0.0 0.0]
[-94.0 0.0 0.0]
[-100.0 0.0 -1.0]
[87.0 0.0 0.0]
[161.0 0.0 0.0]
[96.0 0.0 0.0]
[151.0 0.0 -1.0]
[-104.0 0.0 0.0]
[-110.0 0.0 0.0]
[-100.0 0.0 1.0]
[92.0 0.0 -5.0]
[82.0 0.0 0.0]
[82.0 0.0 0.0]
[-78.0 0.0 0.0]
[-77.0 0.0 0.0]
[2.0 0.0 0.0]
[94.0 0.0 0.0]
[-93.0 0.0 0.0]
[-83.0 0.0 10.0]
[83.0 0.0 0.0]
[-91.0 0.0 0.0]
[128.0 0.0 0.0]
[-79.0 0.0 0.0]
[-83.0 0.0 0.0]
[84.0 0.0 0.0]
[83.0 0.0 0.0]
[91.0 0.0 0.0]
[-77.0 0.0 0.0]
[84.0 0.0 0.0]
[-92.0 0.0 1.0]
[-92.0 0.0 1.0]
[-94.0 0.0 0.0]
[68.0 0.0 0.0]
[-61.0 0.0 0.0]
[71.0 0.0 0.0]
[62.0 0.0 0.0]
[-63.0 0.0 0.0]
[-73.0 0.0 0.0]
[115.0 0.0 0.0]
[-103.0 0.0 0.0]
[63.0 0.0 0.0]
[74.0 0.0 0.0]
[-103.0 0.0 -3.0]
[-69.0 0.0 0.0]
[57.0 0.0 0.0]
[94.0 0.0 0.0]
[64.0 0.0 0.0]
[-63.0 0.0 0.0]
[-38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.0]
[5.0 0.0 0.0]
[-6.0 0.0 0.0]
[4.0 0.0 0.0]
[3.0 0.0 0.0]
[5.0 0.0 0.0]
[-4.0 0.0 0.0]
[-4.0 0.0 0.0]
[-3.0 0.0 0.0]
[4.0 0.0 0.0]
[3.0 0.0 0.0]
[-3.0 0.0 0.0]
[-3.0 0.0 0.0]
[-3.0 0.0 0.0]]
[[92052331.0 9086.0 15377.0]
[5730336.0 -3015.0 -4587.0]
[978459.0 -485.0 1374.0]
[-897492.0 470.0 -291.0]
[73871.0 -184.0 -1924.0]
[224386.0 -677.0 -174.0]
[-6750.0 0.0 358.0]
[200728.0 18.0 318.0]
[129025.0 -63.0 367.0]
[-95929.0 299.0 132.0]
[-68982.0 -9.0 39.0]
[-53311.0 32.0 -4.0]
[-1235.0 0.0 82.0]
[-33228.0 0.0 -9.0]
[31429.0 0.0 -75.0]
[25543.0 -11.0 66.0]
[26366.0 0.0 78.0]
[-24236.0 -10.0 20.0]
[-1220.0 0.0 29.0]
[16452.0 -11.0 68.0]
[-13870.0 0.0 0.0]
[477.0 0.0 -25.0]
[13238.0 -11.0 59.0]
[-12338.0 10.0 -3.0]
[-10758.0 0.0 -3.0]
[-609.0 0.0 13.0]
[-550.0 0.0 11.0]
[8551.0 -2.0 -45.0]
[-8001.0 0.0 -1.0]
[6850.0 -42.0 -5.0]
[-167.0 0.0 13.0]
[6953.0 0.0 -14.0]
[6415.0 0.0 26.0]
[5222.0 0.0 15.0]
[168.0 -1.0 10.0]
[3268.0 0.0 19.0]
[104.0 0.0 2.0]
[-3250.0 0.0 -5.0]
[3353.0 0.0 14.0]
[3070.0 0.0 4.0]
[3272.0 0.0 4.0]
[-3045.0 0.0 -1.0]
[-2768.0 0.0 -4.0]
[3041.0 0.0 -5.0]
[2695.0 0.0 12.0]
[2719.0 0.0 -3.0]
[2720.0 0.0 -9.0]
[-51.0 0.0 4.0]
[-2206.0 0.0 1.0]
[-199.0 0.0 2.0]
[-1900.0 0.0 1.0]
[-41.0 0.0 3.0]
[1313.0 0.0 -1.0]
[1233.0 0.0 7.0]
[-81.0 0.0 2.0]
[1232.0 0.0 4.0]
[-20.0 0.0 -2.0]
[1207.0 0.0 3.0]
[40.0 0.0 -2.0]
[1129.0 0.0 5.0]
[1266.0 0.0 -4.0]
[-1062.0 0.0 -3.0]
[-1129.0 0.0 -2.0]
[-9.0 0.0 0.0]
[35.0 0.0 -2.0]
[-107.0 0.0 1.0]
[1073.0 0.0 -2.0]
[854.0 0.0 0.0]
[-553.0 0.0 -139.0]
[-710.0 0.0 -2.0]
[647.0 0.0 4.0]
[-700.0 0.0 0.0]
[672.0 0.0 0.0]
[663.0 0.0 4.0]
[-594.0 0.0 -2.0]
[-610.0 0.0 2.0]
[-556.0 0.0 0.0]
[518.0 0.0 2.0]
[-490.0 0.0 -1.0]
[-527.0 0.0 -1.0]
[465.0 0.0 4.0]
[496.0 0.0 1.0]
[-50.0 0.0 0.0]
[-399.0 0.0 -1.0]
[-395.0 0.0 -1.0]
[-422.0 0.0 -1.0]
[-440.0 0.0 1.0]
[-170.0 0.0 1.0]
[-39.0 0.0 0.0]
[-389.0 0.0 -1.0]
[-23.0 0.0 1.0]
[-391.0 0.0 0.0]
[-495.0 0.0 -10.0]
[-326.0 0.0 2.0]
[369.0 0.0 -1.0]
[346.0 0.0 1.0]
[304.0 0.0 0.0]
[294.0 0.0 2.0]
[4.0 0.0 -1.0]
[316.0 0.0 -1.0]
[8.0 0.0 -1.0]
[258.0 0.0 0.0]
[-279.0 0.0 0.0]
[252.0 0.0 2.0]
[-244.0 0.0 -1.0]
[250.0 0.0 2.0]
[29.0 0.0 0.0]
[275.0 0.0 -1.0]
[-228.0 0.0 -1.0]
[240.0 0.0 1.0]
[-253.0 0.0 0.0]
[244.0 0.0 -1.0]
[9.0 0.0 0.0]
[225.0 0.0 1.0]
[207.0 0.0 1.0]
[201.0 0.0 0.0]
[216.0 0.0 1.0]
[-200.0 0.0 0.0]
[14.0 0.0 0.0]
[-2.0 0.0 0.0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2 6 1]
[ 2 0 0 4 1]
[ 2 0 0 4 0]
[ 2 -2 2 2 2]
[ 0 0 2 4 0]
[ 1 0 2 3 2]
[ 4 0 0 2 0]
[ 2 0 2 2 0]
[ 0 0 4 2 2]
[ 4 -1 2 0 2]
[ 3 0 2 1 2]
[ 2 1 2 2 1]
[ 4 1 2 0 2]
[-1 -1 2 6 2]
[-1 0 2 6 1]
[ 1 -1 2 4 1]
[ 1 1 2 4 2]
[ 3 1 2 2 2]
[ 5 0 2 0 1]
[ 2 -1 2 4 2]
[ 2 0 2 4 1]]
START = <HEAD> ( DATA | <TEXT> )*
HEAD = MAGIC LINE*
<DATA> = <BEGINDATA> (ASSIGNMENT | <WHITESPACE> | <NEWLINE>)*
TEXT = <BEGINTEXT> LINE*
ASSIGNMENT = IDENTIFIER <WHITESPACE?> OPERATOR <WHITESPACE?> VALUE
<VALUE> = VECTOR | STRING | ( NUMBER / DECIMAL )
<OPERATOR> = EQUALS
MAGIC = #'KPL/(FK|PCK)\n'
BEGINDATA = WHITESPACE? '\\begindata' WHITESPACE? NEWLINE
BEGINTEXT = '\\begintext' WHITESPACE? NEWLINE
LINE = !BEGINDATA #'.*\n'
NUMBER = #'[-+]?[0-9]+'
DECIMAL = #'[-+]?[0-9]+(\.[0-9]*([DE][+-]?[0-9]+)?|[DE][+-]?[0-9]+)'
<STRING> = <'\''> #'[^\']*' <'\''>
EQUALS = <'='>
VECTOR = <'('> (<WHITESPACE> | <NEWLINE> | VALUE)* <')'>
<IDENTIFIER> = #'[a-zA-Z_0-9]+'
WHITESPACE = #'[,\ \t]+'
NEWLINE = '\n'
; https://spiftp.esac.esa.int/workshops/2006_06_ESTEC_TUTORAL/SPICE_Tutorials_PDF/38_making_an_spk.pdf
; https://rhodesmill.org/skyfield/
(require '[fastmath.vector :refer (vec3 add mult sub div mag)])
(require '[fastmath.matrix :refer (mat3x3 mulm mulv inverse transpose)])
(require '[clojure.math :refer (cos sin PI floor to-degrees atan2 hypot)])
(import '[java.nio ByteOrder])
(import '[java.nio.channels FileChannel])
(import '[java.nio.file Paths StandardOpenOption])
(import '[java.nio.charset StandardCharsets])
(import '[org.lwjgl BufferUtils])
(def ASEC360 1296000.0)
(def ASEC2RAD 4.848136811095359935899141e-6)
(def TENTH-USEC-2-RAD (/ ASEC2RAD 1e7))
(def T0 2451545.0)
(def s-per-day 86400.0)
(def AU-KM 149597870.700)
(def DAY-S 86400.0)
; parse file with sun, planet, and moon position vectors
(def filename "data/de430_1850-2150.bsp")
(def option-read (into-array StandardOpenOption [StandardOpenOption/READ]))
(def path (Paths/get filename (make-array String 0)))
(def channel (FileChannel/open path option-read))
(def buffer (BufferUtils/createByteBuffer (.size channel)))
(.read channel buffer)
(.flip buffer)
(def id (byte-array 8))
(.get buffer id)
(String. id StandardCharsets/US_ASCII)
(def num-doubles (.getInt buffer))
(def num-integers (.getInt buffer))
(def loc (byte-array 60))
(.get buffer loc)
(String. loc StandardCharsets/US_ASCII)
(def forward (.getInt buffer))
(def backward (.getInt buffer))
(def free (.getInt buffer))
(def fmt (byte-array 8))
(.get buffer fmt)
(String. fmt StandardCharsets/US_ASCII)
(def prenul (byte-array 603))
(.get buffer prenul)
(def ftpstr (byte-array 28))
(.get buffer ftpstr)
(String. ftpstr StandardCharsets/US_ASCII)
(def pstnul (byte-array 297))
(.get buffer pstnul)
buffer
(def endian ({"LTL-IEEE" ByteOrder/LITTLE_ENDIAN "BIG-IEEE" ByteOrder/BIG_ENDIAN} (String. fmt StandardCharsets/US_ASCII)))
(.order buffer endian) ; unpack record again
(def comment-line (byte-array 1000))
(def comment-lines (map (fn [index] (.get buffer comment-line) (.get buffer (byte-array 24)) (String. comment-line StandardCharsets/US_ASCII)) (range 2 forward)))
(def block (apply str comment-lines))
(def preamble (clojure.string/replace (subs block 0 (clojure.string/index-of block \o004)) \o000 \newline))
(println (subs preamble 0 656))
(def record-size 1024)
(* (dec forward) record-size)
(.position buffer)
(def summary-length (+ (* 8 num-doubles) (* 4 num-integers)))
(def summary-step (+ summary-length (mod (- summary-length) 8)))
(def summaries-per-record (quot (- record-size (* 8 3)) summary-step))
(def summary-control-size (* 3 8))
(defn seek-record [n]
(.position buffer (* (dec n) record-size)))
(defn seek-summary [n s]
(.position buffer (+ (* (dec n) record-size) summary-control-size (* s summary-step))))
(defn seek-name [n s]
(.position buffer (+ (* (dec n) record-size) (* s summary-step))))
(def record-number forward)
(seek-record record-number)
(def next-number (int (.getDouble buffer)))
(def previous-number (int (.getDouble buffer)))
(def n-summaries (int (.getDouble buffer)))
(def name-data (byte-array summary-step))
(def descriptors
(doall
(for [s (range n-summaries)]
(do
(seek-name (inc record-number) s)
(.get buffer name-data)
(let [source (clojure.string/trim (String. name-data StandardCharsets/US_ASCII))]
(seek-summary record-number s)
(let [descriptors (vec (concat (for [_i (range num-doubles)] (.getDouble buffer))
(for [_i (range num-integers)] (.getInt buffer))))]
[source descriptors]))))))
(clojure.pprint/pprint descriptors)
(def lookup (reduce (fn [h i] (let [descriptor (second (nth descriptors i))] (assoc h [(nth descriptor 3) (nth descriptor 2)] i))) {} (range (count descriptors))))
(defn position [center target tdb]
(let [index (lookup [center target])
descriptor (second (nth descriptors index))
start-second (nth descriptor 0)
end-second (nth descriptor 1)
target (nth descriptor 2)
center (nth descriptor 3)
frame (nth descriptor 4)
data-type (nth descriptor 5)
start-i (nth descriptor 6)
end-i (nth descriptor 7)
; Segment._data, DAF.read_array
component-count ({2 3 3 6} data-type)
start (- end-i 3)
end end-i
length (- (inc end) start)
_ (.position buffer (* 8 (- start 1)))
init (.getDouble buffer)
intlen (.getDouble buffer)
rsize (.getDouble buffer)
n (.getDouble buffer) ; is this correct?
coefficient-count (int (/ (- rsize 2) component-count))
start start-i
end (- end-i 4)
_ (.position buffer (* 8 (dec start)))
map-array (.asDoubleBuffer buffer)
_ (.limit map-array (- (inc end) start))
; Segment.generate
t (- (* (- tdb T0) s-per-day) init)
index (quot t intlen)
offset (rem t intlen); TODO: clip index and change offset if required
coefficients (double-array (int rsize))
_ (.position map-array (int (* rsize index)))
_ (.get map-array coefficients)
s (- (/ (* 2 offset) intlen) 1.0)
s2 (* 2 s)
coeffs (reverse (apply map vec3 (partition coefficient-count (drop 2 coefficients))))
[w0 w1] (reduce (fn [[w0 w1] coeff] [(add coeff (sub (mult w0 s2) w1)) w0]) [(vec3 0 0 0) (vec3 0 0 0)] (butlast coeffs))
components (add (last coeffs) (sub (mult w0 s) w1))]
(apply vec3 components))); International Celestical Reference Frame (ICRF)
; Conversion matrix from ICRS to J2000 (see framelib.ICRS_to_J2000)
(defn build_matrix []
(let [xi0 (* -0.0166170 ASEC2RAD)
eta0 (* -0.0068192 ASEC2RAD)
da0 (* -0.01460 ASEC2RAD)
yx (- da0)
zx xi0
xy da0
zy eta0
xz (- xi0)
yz (- eta0)
xx (- 1.0 (* 0.5 (+ (* yx yx) (* zx zx))))
yy (- 1.0 (* 0.5 (+ (* yx yx) (* zy zy))))
zz (- 1.0 (* 0.5 (+ (* zy zy) (* zx zx))))]
(mat3x3 xx xy xz, yx yy yz, zx zy zz)))
(def ICRS-to-J2000 (build_matrix))
(defn r1 [theta] (let [c (cos theta) s (sin theta)] (mat3x3 1 0 0 0 c (- s) 0 s c)))
(defn r2 [theta] (let [c (cos theta) s (sin theta)] (mat3x3 c 0 s 0 1 0 (- s) 0 c)))
(defn r3 [theta] (let [c (cos theta) s (sin theta)] (mat3x3 c (- s) 0 s c 0 0 0 1)))
; Compute Earth precession matrix (see precessionlib.compute_precession)
(defn compute-precession [jd-tdb]
(let [eps0 84381.406
t (/ (- jd-tdb T0) 36525.0)
psia (-> t (* -0.0000000951) (+ 0.000132851) (* t) (- 0.00114045) (* t) (- 1.0790069) (* t) (+ 5038.481507) (* t))
omegaa (-> t (* 0.0000003337) (- 0.000000467) (* t) (- 0.00772503) (* t) (+ 0.0512623) (* t) (- 0.025754) (* t) (+ eps0))
chia (-> t (* -0.0000000560) (+ 0.000170663) (* t) (- 0.00121197) (* t) (- 2.3814292) (* t) (+ 10.556403) (* t))
r3-chia (r3 (* (- chia) ASEC2RAD))
r1-omegaa (r1 (* omegaa ASEC2RAD))
r3-psia (r3 (* psia ASEC2RAD))
r1-eps0 (r1 (* (- eps0) ASEC2RAD))]
(mulm r3-chia (mulm r1-omegaa (mulm r3-psia r1-eps0)))))
; Compute Greenwich mean sidereal time
(defn earth-rotation-angle [jd-ut fraction-ut]
(let [th (+ 0.7790572732640 (* 0.00273781191135448 (+ (- jd-ut T0) fraction-ut)))]
(mod (+ (mod th 1.0) (mod jd-ut 1.0) fraction-ut) 1.0)))
(earth-rotation-angle 2460461.0 0.5)
(defn sidereal-time [ut]
(let [jd-ut (floor ut)
fraction-ut (- ut jd-ut)
theta (earth-rotation-angle jd-ut fraction-ut)
t (/ (- ut T0) 36525.0)
st (-> t (* -0.0000000368) (- 0.000029956) (* t) (- 0.00000044) (* t) (+ 1.3915817) (* t) (+ 4612.156534) (* t) (+ 0.014506))]
(mod (+ (/ st 54000.0) (* theta 24.0)) 24.0)))
(def ut (+ 2460461.0 0.4991990864999223))
(sidereal-time ut)
; Compute Earth nutation matrix (see skyfield.nutationlib)
(def fa0 [485868.249036 1287104.79305 335779.526232 1072260.70369 450160.398036])
(def fa1 [1717915923.2178 129596581.0481 1739527262.8478 1602961601.2090 -6962890.5431])
(def fa2 [31.8792 -0.5532 -12.7512 -6.3706 7.4722])
(def fa3 [0.051635 0.000136 -0.001037 0.006593 0.007702])
(def fa4 [-0.00024470 -0.00001149 0.00000417 -0.00003169 -0.00005939])
(defn fundamental-arguments [t]
(let [a (reduce (fn [a fa-i] (map #(+ (* t %1) %2) a fa-i)) [fa4 fa3 fa2 fa1 fa0])]
(map #(* (rem % ASEC360) ASEC2RAD) a)))
(def nals-t (clojure.edn/read-string (slurp "../spk/nals-t.edn")))
(def lunisolar-longitude-coefficients (clojure.edn/read-string (slurp "../spk/lunisolar-longitude-coefficients.edn")))
(def lunisolar-obliquity-coefficients (clojure.edn/read-string (slurp "../spk/lunisolar-obliquity-coefficients.edn")))
(defn iau2000a [jd-tt]
(let [t (/ (- jd-tt T0) 36525.0)
a (fundamental-arguments t)
arg (map #(reduce + (map * a %)) nals-t)
sarg (map sin arg)
carg (map cos arg)
dpsi (reduce + (map (fn [s c v] (reduce + (map * [s (* s t) c] v))) sarg carg lunisolar-longitude-coefficients))
deps (reduce + (map (fn [s c v] (reduce + (map * [c (* c t) s] v))) sarg carg lunisolar-obliquity-coefficients))]
[dpsi deps]))
(defn iau2000a-radians [jd-tt]
(let [[d-psi d-eps] (iau2000a jd-tt)]
[(* d-psi TENTH-USEC-2-RAD) (* d-eps TENTH-USEC-2-RAD)]))
(defn mean-obliquity-radians [jd-tt]
(let [t (/ (- jd-tt T0) 36525.0)
epsilon (-> t (* -0.0000000434) (- 0.000000576) (* t) (+ 0.00200340) (* t) (- 0.0001831) (* t) (- 46.836769) (* t) (+ 84381.406))]
(* epsilon ASEC2RAD)))
(defn build-nutation-matrix [mean-obliquity true-obliquity psi]
(let [cobm (cos mean-obliquity)
sobm (sin mean-obliquity)
cobt (cos true-obliquity)
sobt (sin true-obliquity)
cpsi (cos psi)
spsi (sin psi)]
(mat3x3 cpsi (- (* spsi cobm)) (- (* spsi sobm)),
(* spsi cobt) (+ (* cpsi cobm cobt) (* sobm sobt)) (- (* cpsi sobm cobt) (* cobm sobt)),
(* spsi sobt) (- (* cpsi cobm sobt) (* sobm cobt)) (+ (* cpsi sobm sobt) (* cobm cobt)))))
(defn nutation-matrix [jd-tt]
(let [[d-psi d-eps] (iau2000a-radians jd-tt)
mean-obliquity (mean-obliquity-radians jd-tt)
true-obliquity (+ mean-obliquity d-eps)]
(build-nutation-matrix mean-obliquity true-obliquity d-psi)))
(def sun (position 0 10 (- tdb (+ (/ 8 1440) (/ 20 86400)))))
(def earth (add (position 0 3 tdb) (position 3 399 tdb)))
(div earth AU-KM)
(def v (div (sub sun earth) AU-KM))
(def icrs-to-now (mulm (nutation-matrix tdb) (mulm (compute-precession tdb) ICRS-to-J2000)))
(def vv (mulv icrs-to-now v))
(def r (mag vv))
(def phi (/ (to-degrees (atan2 (.y vv) (.x vv))) 15))
(def theta (to-degrees (atan2 (.z vv) (hypot (.x vv) (.y vv)))))
[phi theta r]
(def tdb (- 2460471.0 (* 365.2425 10)))
(def ut1 2456818.5742190727)
(def t (/ (- tdb T0) 36525.0))
(def icrs-to-now (mulm (nutation-matrix tdb) (mulm (compute-precession tdb) ICRS-to-J2000)))
(def x (vec3 6378.2 0.0 0.0))
(def earth-to-icrs (mulm (inverse icrs-to-now) (r3 (* 2 PI (/ (sidereal-time ut1) 24.0)))))
(mulv earth-to-icrs x)
(def tt-minus-tai (/ 32.184 DAY-S))
(def tdb-minus-ut1 (/ 69.1450574 DAY-S))
; Date conversions
(defn julian-day [year month day]
(let [janfeb (<= month 2)
g (- (+ year 4716) (if janfeb 1 0))
f (mod (+ month 9) 12)
e (- (+ (quot (* 1461 g) 4) day) 1402)
J (+ e (quot (+ (* 153 f) 2) 5))]
(+ J (- 38 (quot (* (quot (+ g 184) 100) 3) 4)))))
(defn compute-calendar-date [jd]
(let [f (+ jd 1401)
f (+ f (- (quot (* (quot (+ (* 4 jd) 274277) 146097) 3) 4) 38))
e (+ (* 4 f) 3)
g (quot (mod e 1461) 4)
h (+ (* 5 g) 2)
day (inc (quot (mod h 153) 5))
month (inc (mod (+ (quot h 153) 2) 12))
year (+ (- (quot e 1461) 4716) (quot (- (+ 12 2) month) 12))]
[year month day]))
(compute-calendar-date (julian-day 2024 6 11))
(require '[instaparse.core :as insta])
(def tf-parser (insta/parser (slurp "../spk/pck.bnf")))
(tf-parser (slurp "moon_080317.tf"))
(tf-parser (slurp "pck00008.tpc"))
(count (insta/parses tf-parser (slurp "moon_080317.tf")))
(count (insta/parses tf-parser (slurp "pck00008.tpc")))
(defn assign [environment [identifier operator value]]
(assoc environment identifier value))
(defn tf-transform [string]
(instaparse.transform/transform
{:START (fn [& assignments] (reduce assign {} assignments))
:ASSIGNMENT vector
:VECTOR vector
:NUMBER #(Integer/parseInt %)
:DECIMAL (comp #(Double/parseDouble %) #(clojure.string/replace % \D \E))
:EQUALS (constantly :=)}
(tf-parser string)))
(def moon (tf-transform (slurp "moon_080317.tf")))
(def pck (tf-transform (slurp "pck00008.tpc")))
; TODO: get moon reference frame (jplephem/daf.py, jplephem/pck.py)
; as above
(def filename "moon_pa_de421_1900-2050.bpc")
(def option-read (into-array StandardOpenOption [StandardOpenOption/READ]))
(def path (Paths/get filename (make-array String 0)))
(def channel (FileChannel/open path option-read))
(def buffer (BufferUtils/createByteBuffer (.size channel)))
(.read channel buffer)
(.flip buffer)
; as above
(def id (byte-array 8))
(.get buffer id)
(String. id StandardCharsets/US_ASCII)
(def num-doubles (.getInt buffer))
(def num-integers (.getInt buffer))
(def loc (byte-array 60))
(.get buffer loc)
(String. loc StandardCharsets/US_ASCII)
(def forward (.getInt buffer))
(def backward (.getInt buffer))
(def free (.getInt buffer))
(def fmt (byte-array 8))
(.get buffer fmt)
(String. fmt StandardCharsets/US_ASCII)
(def prenul (byte-array 603))
(.get buffer prenul)
(def ftpstr (byte-array 28))
(.get buffer ftpstr)
(String. ftpstr StandardCharsets/US_ASCII)
(def pstnul (byte-array 297))
(.get buffer pstnul)
buffer
; as above
(def endian ({"LTL-IEEE" ByteOrder/LITTLE_ENDIAN "BIG-IEEE" ByteOrder/BIG_ENDIAN} (String. fmt StandardCharsets/US_ASCII)))
(.order buffer endian) ; unpack record again
(def comment-line (byte-array 1000))
(def comment-lines (map (fn [index] (.get buffer comment-line) (.get buffer (byte-array 24)) (String. comment-line StandardCharsets/US_ASCII)) (range 2 forward)))
(def block (apply str comment-lines))
(def preamble (clojure.string/replace (subs block 0 (clojure.string/index-of block \o004)) \o000 \newline))
(println preamble)
(def summary-length (+ (* 8 num-doubles) (* 4 num-integers)))
(def summary-step (+ summary-length (mod (- summary-length) 8)))
(def summaries-per-record (quot (- record-size (* 8 3)) summary-step))
(def summary-control-size (* 3 8))
(def record-number forward)
(seek-record record-number)
(def next-number (int (.getDouble buffer)))
(def previous-number (int (.getDouble buffer)))
(def n-summaries (int (.getDouble buffer)))
(def name-data (byte-array summary-step))
(def descriptors
(for [s (range n-summaries)]
(do
(seek-name (inc record-number) s)
(.get buffer name-data)
(let [source (clojure.string/trim (String. name-data StandardCharsets/US_ASCII))]
(seek-summary record-number s)
(let [descriptors (vec (concat (for [_i (range num-doubles)] (.getDouble buffer))
(for [_i (range num-integers)] (.getInt buffer))))]
[source descriptors])))))
(def tdb 2458837.9618055606)
; PlanetaryConstant.build_frame_named
(def integer (moon "FRAME_MOON_ME_DE421"))
(def center (moon (format "FRAME_%d_CENTER" integer)))
(def spec (moon (format "TKFRAME_%d_SPEC" integer)))
(def angles (moon (format "TKFRAME_%d_ANGLES" integer)))
(def axes (moon (format "TKFRAME_%d_AXES" integer)))
(def units (moon (format "TKFRAME_%d_UNITS" integer)))
(def scale ({"ARCSECONDS" ASEC2RAD} units))
(def rotations [r1 r2 r3])
(def matrix (reduce (fn [m r] (mulm r m)) (map (fn [angle axis] ((rotations (dec axis)) (* scale angle))) angles axes)))
; PCK._load
(def descriptor (second (nth descriptors 0)))
(def start-second (nth descriptor 0))
(def end-second (nth descriptor 1))
(def target (nth descriptor 2))
; no center variable in contrast to above!
(def frame (nth descriptor 3))
(def data-type (nth descriptor 4))
(def start-i (nth descriptor 5))
(def end-i (nth descriptor 6))
(def start (- end-i 3))
(def end end-i)
(def component-count ({2 3} data-type))
(.position buffer (* 8 (- start 1)))
(def init (.getDouble buffer))
(def intlen (.getDouble buffer))
(def rsize (.getDouble buffer))
(def n (.getDouble buffer)) ; is this correct?
(def coefficient-count (int (/ (- rsize 2) component-count)))
(def start start-i)
(def end (- end-i 4))
(.position buffer (* 8 (dec start)))
(def map-array (.asDoubleBuffer buffer))
(.limit map-array (- (inc end) start))
(def t (- (* (- tdb T0) s-per-day) init))
(def index (quot t intlen))
(def offset (rem t intlen)) ; TODO: clip index and change offset if required
(def coefficients (double-array (int rsize)))
(.position map-array (int (* rsize index)))
(.get map-array coefficients)
(def s (- (/ (* 2 offset) intlen) 1.0))
(def s2 (* 2 s))
(def coeffs (reverse (apply map vec3 (partition coefficient-count (drop 2 coefficients)))))
(def w0-w1 (reduce (fn [[w0 w1] coeff] [(add coeff (sub (mult w0 s2) w1)) w0]) [(vec3 0 0 0) (vec3 0 0 0)] (butlast coeffs)))
(def w0 (first w0-w1))
(def w1 (second w0-w1))
(def components (add (last coeffs) (sub (mult w0 s) w1)))
(def ra (.x components))
(def decl (.y components))
(def w (.z components))
(def R (mulm matrix (mulm (r3 (- w)) (mulm (r1 (- decl)) (r3 (- ra))))))
(mulv (transpose R) (vec3 1737.4 0 0))
(require '[gloss.core :refer (compile-frame ordered-map string finite-block finite-frame repeated sizeof nil-frame)])
(require '[gloss.io :refer (encode decode encode-all decode-all)])
(import '[java.nio ByteOrder])
(import '[java.nio.charset Charset])
(def f (compile-frame (ordered-map :a :int16-le)))
(def buffer (first (encode f {:a 123})))
(.order buffer ByteOrder/LITTLE_ENDIAN)
(.getShort buffer)
(.flip buffer)
(decode f buffer)
(def f (compile-frame :float32))
(encode-all f [1.0 2.0])
(def f (compile-frame (string :us-ascii :length 8)))
(decode f (first (encode f "LTL-IEEE")))
(def f [:a :int16 :b :int16])
(decode f (first (encode f [1 2])))
(def f (compile-frame [(string :utf-8 :delimiters ["\004"]) :byte]))
(def buffer (.encode (Charset/forName "UTF-8") "test\004x"))
(decode f buffer)
(def f (compile-frame (finite-block 8)))
(def buffer (.encode (Charset/forName "US-ASCII") "testtest"))
(decode f buffer)
(def f (compile-frame (finite-frame 8 (repeated :byte :prefix :none))))
(def buffer (.encode (Charset/forName "US-ASCII") "testtest"))
(decode f buffer)
(def f (compile-frame (finite-frame 8 (repeated [:byte :byte] :prefix :none))))
(def buffer (.encode (Charset/forName "US-ASCII") "testtest"))
(decode f buffer)
(def f (compile-frame [:byte]))
(decode f (encode f [2]) false)
(defn cheb [coeffs s zero]
(let [s2 (* 2 s)
[w0 w1] (reduce (fn [[w0 w1] coeff] [(add coeff (sub (mult w0 s2) w1)) w0]) [zero zero] (butlast coeffs))]
(add (last coeffs) (sub (mult w0 s) w1))))
from jplephem.spk import SPK
kernel = SPK.open('de430_1850-2150.bsp')
kernel[0, 10].start_second
for segment in kernel.segments:
print(segment.describe())
segment = kernel[0, 10]
T0 = 2451545.0
S_PER_DAY = 86400.0
AU_KM = 149597870.700
tdb2 = 0
segment.compute(t.tdb) # !!!
next(segment.generate(tdb, 0.0))
daf = segment.daf
init, intlen, coefficients = segment._data
index1, offset1 = divmod((tdb - T0) * S_PER_DAY - init, intlen)
index2, offset2 = divmod(tdb2 * S_PER_DAY, intlen)
index3, offset = divmod(offset1 + offset2, intlen)
index = (index1 + index2 + index3).astype(int)
coefficients = coefficients[:,:,index]
from skyfield.precessionlib import compute_precession
compute_precession(tdb)
from skyfield.nutationlib import compute_nutation
compute_nutation(t)
from skyfield.api import load, wgs84, N, S, W, E
from skyfield.constants import T0
planets = load('de430_1850-2150.bsp')
earth, sun = planets['earth'], planets['sun']
from skyfield.earthlib import sidereal_time, earth_rotation_angle
tdb = 2460471.0 - 365.2425 * 10
tdb + ts.delta_t_function(tdb) / S_PER_DAY
t = ts.tt_jd(tdb)
earth_rotation_angle(t.whole, 0.5)
sidereal_time(t)
wgs84.latlon(0, 0, elevation_m=0).at(t).xyz.km
boston = earth + wgs84.latlon(42.3583 * N, 71.0603 * W, elevation_m=43)
alt, az, dist = boston.at(t).observe(sun).apparent().altaz()
(alt.degrees, az.degrees, dist.km)
ts = load.timescale()
# t = ts.now()
t = ts.tt_jd(tdb)
position = earth.at(t).observe(sun)
ra, dec, distance = position.radec()
(ra, dec, distance)
(ra.hours, dec, distance)
Time(None, tdb).M
from skyfield.nutationlib import fundamental_arguments, nals_t, lunisolar_longitude_coefficients, lunisolar_obliquity_coefficients, iau2000a
fundamental_argument_terms=5
lunisolar_terms=687
planetary_terms=687
a = fundamental_arguments(t, fundamental_argument_terms)
cutoff = lunisolar_terms
arg = nals_t[:cutoff].dot(a).T
iau2000a(tdb, 5, 687, 0)
t._nutation_angles_radians
t.nutation_matrix()
ts = load.timescale()
t = ts.tt_jd(tdb)
ra, dec, r = earth.at(t).observe(sun).radec(epoch=t)
(ra.hours, dec.degrees, r)
from skyfield.api import load
ts = load.timescale()
from skyfield.timelib import Timescale
tt_minus_tai = 32.184 / S_PER_DAY
(ts.ut1_jd(T0).tt - ts.tdb_jd(T0).tt) * S_PER_DAY
ts.leap_dates
ts.leap_offsets
ts._leap_utc
ts._leap_offsets
(ts.ut1_jd(ts.leap_dates[0]).tt - ts.tdb_jd(ts.leap_dates[0]).tt) * S_PER_DAY + tt_minus_tai
(ts._utc((2024, 6, 11, 0, 0, 0)).tt - 2460472.5) * S_PER_DAY
import numpy as np
seconds = (T0 - 0.5) * S_PER_DAY
leap = np.interp(seconds, ts._leap_utc, ts._leap_offsets)
T0 + leap / S_PER_DAY + tt_minus_tai
ts.ut1_jd(T0).tt
T0 + ts.delta_t_function(T0) / S_PER_DAY
from skyfield.timelib import julian_day
from skyfield.api import PlanetaryConstants, load
ts = load.timescale()
t = ts.tdb(2019, 12, 20, 11, 5)
eph = load('de421.bsp')
earth, moon = eph['earth'], eph['moon']
pc = PlanetaryConstants()
pc.read_text(load('moon_080317.tf'))
pc.read_text(load('pck00008.tpc'))
pc.read_binary(load('moon_pa_de421_1900-2050.bpc'))
frame = pc.build_frame_named('MOON_ME_DE421')
test = moon + pc.build_latlon_degrees(frame, 0, 0)
earth.at(t).observe(test).xyz.km
moon.at(t).observe(test).xyz.km
frame._matrix
segment = pc._segment_map[31006]
segment.initial_second
segment.final_second
frame.rotation_at(t)
np.dot(frame.rotation_at(t), [1737.4, 0, 0])
np.dot(np.transpose(frame.rotation_and_rate_at(t)[0]), [1737.4, 0, 0])
pc.build_latlon_degrees(frame, 0, 0)._position_au * AU_KM
pc.build_latlon_degrees(frame, 0, 0)._at(t)[0] * AU_KM
frame.rotation_and_rate_at(t)[0]
from skyfield.framelib import ICRS_to_J2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment