Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove JLD dependency #12

Merged
merged 46 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
29568e2
WIP: remove JLD dependency
PerezHz May 28, 2023
438685f
Update Artifacts.toml
PerezHz May 29, 2023
062f284
Update artifacts generation script
PerezHz May 29, 2023
4acbb70
Bring back JPL DE430 TT-TDB ephemeris artifact
PerezHz May 29, 2023
96c39aa
Use solution a la PlatformEngines.jl to handle failing downloads
PerezHz May 29, 2023
05e822a
Remove dummy recompilation trigger
PerezHz May 29, 2023
f114278
Remove StaticArrays dep; add StaticArraysCore dep
PerezHz May 29, 2023
410681a
Update StatsBase compat entry
LuEdRaMo May 29, 2023
f1a6b61
Remove StaticArraysCore dep
PerezHz May 31, 2023
720ccc3
Update NEOs.jl
PerezHz May 31, 2023
18a5859
Add bwdfwdeph function
PerezHz May 31, 2023
748ca11
Add residuals method for Vector{RadarJPL}
PerezHz May 31, 2023
dd8af7f
Update radar_jpl.jl
PerezHz May 31, 2023
f17aace
Update process_radec.jl
PerezHz May 31, 2023
9dbb0e0
Update ObsCodes.txt
PerezHz May 31, 2023
d284978
Update Project.toml
PerezHz Jun 4, 2023
7feb698
Add 2023DW observation data file for tests
PerezHz Jun 4, 2023
eab9e1a
Test only on julia 1.9+
PerezHz Jun 4, 2023
7a10dee
Update src/NEOs.jl
PerezHz Jun 4, 2023
3af543e
Set niter=5 by default, and remove eo kwarg
PerezHz Jun 4, 2023
51ea39b
Update src/observations/process_radar.jl
PerezHz Jun 4, 2023
4c93057
Update src/observations/topocentric.jl
PerezHz Jun 4, 2023
80d6dee
Minor updates in units.jl
PerezHz Jun 4, 2023
cc6d557
Minor fix in bwdfwdeph
PerezHz Jun 4, 2023
8863c0e
Update Apophis scripts
PerezHz Jun 4, 2023
1aa6745
Update tests
PerezHz Jun 4, 2023
1a70632
Fix deprecation warning
LuEdRaMo Jun 4, 2023
a33808b
Move Tholen et al. (2013) astrometry file to test/data; Remove compat…
PerezHz Jun 4, 2023
2ded002
Remove Tholen et al. (2013) astrometry data file from previous location
PerezHz Jun 4, 2023
6121805
Add mean anomaly to osculating elements
PerezHz Jun 4, 2023
be8e8e4
Add Keplerian osculating elements tests
PerezHz Jun 4, 2023
41df006
Add Apophis radar astrometry data file
PerezHz Jun 4, 2023
07bc8cc
Import meananomaly, meanmotion from PE
PerezHz Jun 4, 2023
e7b3426
Small comment fix
PerezHz Jun 4, 2023
9275378
Add missing ST. prefix
PerezHz Jun 4, 2023
ff85049
Update tests
PerezHz Jun 4, 2023
a66d6d3
Remove comment
PerezHz Jun 4, 2023
b71d5fa
Add radar astrometry residuals tests
PerezHz Jun 5, 2023
e0ea25d
Fix missing comma
PerezHz Jun 5, 2023
fcf8934
Fix tests
PerezHz Jun 5, 2023
361544b
Minor fixes; update tests
PerezHz Jun 5, 2023
46f0048
Update propagation tests
PerezHz Jun 5, 2023
6c19d29
Avoid use of ::Function throughout; pass `niters` as a kwarg in proce…
PerezHz Jun 6, 2023
e57f43a
Update README.md
PerezHz Jun 6, 2023
75c987e
Update observational models
PerezHz Jun 6, 2023
050083e
Update Project.toml
PerezHz Jun 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1'
- '1.9'
# - '1'
- 'nightly'
os:
- ubuntu-latest
Expand Down
32 changes: 12 additions & 20 deletions Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ git-tree-sha1 = "de3fba2237359dc941a057d492c305afeccba133"
lazy = true

[[TTmTDBde430.download]]
sha256 = "c599efe597200055c27cec38ddc769f5d3b3e301a481b9dcd8b9640d745508a1"
url = "https://raw.githubusercontent.com/PerezHz/jpleph/main/TTmTDBde430.tar.gz"
sha256 = "a8e09c3d2f68f77c641eed0b41d2441b11a7b4f12daed8144638fdca02eb4d5d"
url = "https://ssd.jpl.nasa.gov/ftp/eph/planets/bsp/TTmTDB.de430.19feb2015.bsp"

[a99942]
git-tree-sha1 = "7cdf1265a22c52329651c4a71a9835d1b90f568e"
Expand All @@ -19,61 +19,53 @@ git-tree-sha1 = "db3e3a765712a792a7f4a73634213d53fc0561ec"
lazy = true

[[de430.download]]
sha256 = "25458f6fc0219be7ff9fbd893a4cd6ed9927316824cb5c4062b642414884790d"
url = "https://raw.githubusercontent.com/PerezHz/jpleph/main/de430.tar.gz"
sha256 = "b70b72fde86923475fac6cec1e0887040bb80ffe159f153aab647cdfdf897351"
url = "https://ssd.jpl.nasa.gov/ftp/eph/planets/bsp/de430_1850-2150.bsp"

[debias]
git-tree-sha1 = "cfd0d2615770087d3c564b7f6143f01930ccb45e"
lazy = true

[[debias.download]]
sha256 = "8b107db9506ec45c8cad78d0981c48693c6e5957912df95f4a3df826c7736227"
url = "ftp://ssd.jpl.nasa.gov/pub/ssd/debias/debias.tgz"
url = "https://ssd.jpl.nasa.gov/ftp/ssd/debias/debias.tgz"

[debias_2014]
git-tree-sha1 = "1b6a82575ac74386b893f8c51361d19d350bd234"
lazy = true

[[debias_2014.download]]
sha256 = "1d44c6443d08f83c79017afd218c3b4e326c573d84842c88713e4b6c8d6d5b03"
url = "ftp://ssd.jpl.nasa.gov/pub/ssd/debias/debias_2014.tgz"
url = "https://ssd.jpl.nasa.gov/ftp/ssd/debias/debias_2014.tgz"

[debias_2018]
git-tree-sha1 = "ea7915a243ea4c8e0960817f50677598076beeaa"
lazy = true

[[debias_2018.download]]
sha256 = "288132cefea7f1bdf0989782db1173948dd7dfef7da31910be90b16b73cfea6c"
url = "ftp://ssd.jpl.nasa.gov/pub/ssd/debias/debias_2018.tgz"
url = "https://ssd.jpl.nasa.gov/ftp/ssd/debias/debias_2018.tgz"

[debias_hires2018]
git-tree-sha1 = "cebf83360f68870a628805aea9b4261d0d6b4545"
lazy = true

[[debias_hires2018.download]]
sha256 = "2b292fc79c202d38dfab386783fee10d422f6919afc58348c72059710dd6cd92"
url = "ftp://ssd.jpl.nasa.gov/pub/ssd/debias/debias_hires2018.tgz"
url = "https://ssd.jpl.nasa.gov/ftp/ssd/debias/debias_hires2018.tgz"

[naif0012]
git-tree-sha1 = "8fa307fe9da2a63ed0cf9d681540d94a619a0995"
lazy = true

[[naif0012.download]]
sha256 = "d9b1c3d944f671eca8177e29384accbdb5f4b3fbe4603a4bb2e0bdbf7a900fb4"
url = "https://raw.githubusercontent.com/PerezHz/jpleph/main/naif0012.tar.gz"
sha256 = "678e32bdb5a744117a467cd9601cd6b373f0e9bc9bbde1371d5eee39600a039b"
url = "https://naif.jpl.nasa.gov/pub/naif/generic_kernels/lsk/naif0012.tls"

[sseph_p100]
git-tree-sha1 = "63a7429f64436a92016962f1fab2d70262120f6c"
git-tree-sha1 = "6fb49d939d8cc8675acbb8d64d9014e918c1569c"
lazy = true

[[sseph_p100.download]]
sha256 = "7a5886729bbd85d68417f8d69fb2d7e8f4390376a49c9bcda1b580116f8ed11b"
sha256 = "5051b43a30e33b3bde2388d7bf48dcdfefffd1dc3c139b37042b94b2f877baee"
url = "https://github.com/LuEdRaMo/sseph/raw/main/sseph343ast016_p100y_et.tar.gz"

[ttmtdb_DE430_1995_2030]
git-tree-sha1 = "9e0c56a8987df7426aad09829332f04b014e6264"
lazy = true

[[ttmtdb_DE430_1995_2030.download]]
sha256 = "19f2a3136a81755746795466b4d4d01bfd962b5b1f6f877af0377a21126d99e1"
url = "https://raw.githubusercontent.com/PerezHz/jpleph/main/ttmtdb_DE430_1995_2030_20221103.tar.gz"
23 changes: 2 additions & 21 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NEOs"
uuid = "b41c07a2-2abb-11e9-070a-c3c1b239e7df"
authors = ["Jorge A. Pérez Hernández", "Luis Benet", "Luis Eduardo Ramírez Montoya"]
version = "0.3.1"
version = "0.4.0"

[deps]
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
Expand All @@ -17,19 +17,15 @@ Healpix = "9f4e344d-96bc-545a-84a3-ae6b9e1b672b"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
IntervalRootFinding = "d2bf35a9-74e0-55ec-b149-d360ff49b807"
JLD = "4138dd39-2aa7-5051-a626-17a0bb65d9c8"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
PlanetaryEphemeris = "d83715d0-7e5f-11e9-1a59-4137b20d8363"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Quadmath = "be4d8f0f-7fa4-5f49-b795-2f01399ab2dd"
Query = "1a8c2f83-1ff3-5112-b086-8aa67b057ba1"
ReferenceFrameRotations = "74f56ac7-18b3-5285-802d-d4bd4f104033"
SPICE = "5bab7191-041a-5c2e-a744-024b9c3a5062"
SatelliteToolbox = "6ac157d9-b43d-51bb-8fab-48bf53814f4a"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
TaylorIntegration = "92b13dbe-c966-51a2-8445-caca9f8a7d42"
TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"
Expand All @@ -44,28 +40,13 @@ HTTP = "1.9.5"
Healpix = "4"
IntervalArithmetic = "0.20"
IntervalRootFinding = "0.5.11"
JLD = "0.13"
JLD2 = "0.4"
PlanetaryEphemeris = "0.6"
Quadmath = "0.5"
Query = "1.0"
ReferenceFrameRotations = "3"
SPICE = "0.2"
SatelliteToolbox = "0.10"
StaticArrays = "1.2"
StatsBase = "0.34"
StatsBase = "0.33, 0.34"
TaylorIntegration = "0.13"
TaylorSeries = "0.15"
julia = "1.6"

[extras]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["LinearAlgebra", "Test"]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# NEOs.jl

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5152449.svg)](https://doi.org/10.5281/zenodo.5152449)
[![Coverage Status](https://coveralls.io/repos/github/PerezHz/NEOs.jl/badge.svg?branch=main)](https://coveralls.io/github/PerezHz/NEOs.jl?branch=main)
[![codecov](https://codecov.io/gh/PerezHz/NEOs.jl/branch/main/graph/badge.svg?token=F1IY79YP3J)](https://codecov.io/gh/PerezHz/NEOs.jl)

`NEOs.jl` is a Near-Earth Object orbital propagator and
fitter in Julia. `NEOs.jl` exploits jet transport techniques via
Expand Down
84 changes: 51 additions & 33 deletions dev/generate_artifacts.jl
Original file line number Diff line number Diff line change
@@ -1,72 +1,90 @@
# This script generates Julia artifacts for NEOs.jl, including
# - debiasing tables from Chesley et al. (2010), Farnocchia et al. (2015) and Eggl et al. (2020)
# - JPL lsk and spk
# - PlanetaryEphemeris.jl Solar System ephemeris
# - JPL lsk and spk
# - PlanetaryEphemeris.jl Solar System ephemeris

# TO DO: adapt script for julia1.6+
# TO DO: adapt script for 2010 debiasing tables (requires extra unpacking)

using Pkg.Artifacts
using Pkg.PlatformEngines
using Pkg.PlatformEngines: sha256
using Pkg
# using Downloads: download
Pkg.PlatformEngines.probe_platform_engines!()
using Pkg.PlatformEngines: sha256, unpack
using Downloads

# This is the path to the Artifacts.toml we will manipulate
const artifact_toml = joinpath(dirname(@__DIR__), "Artifacts.toml")

# JPL FTP URL
const ftp_jpl = "ftp://ssd.jpl.nasa.gov/pub/ssd/debias/"
# JPL FTP URL
const ftp_jpl = "https://ssd.jpl.nasa.gov/ftp/"

# Debiasing tables names and URLs
# Debiasing tables names and URLs
const names_debias = ["debias", "debias_2014", "debias_2018", "debias_hires2018"]
const urls_debias = ftp_jpl .* names_debias .* ".tgz"
const urls_debias = ftp_jpl .* "ssd/debias/" .* names_debias .* ".tgz"

# JPL lsk and spk names and URLs
const names_lsk_spk = ["naif0012", "de430", "TTmTDBde430", "a99942", "ttmtdb_DE430_1995_2030"]
# JPL lsk and spk names and URLs
const names_lsk_spk = ["naif0012", "de430", "TTmTDBde430", "a99942"]
const urls_lsk_spk = [
"https://raw.githubusercontent.com/PerezHz/jpleph/main/naif0012.tar.gz",
"https://raw.githubusercontent.com/PerezHz/jpleph/main/de430.tar.gz",
"https://raw.githubusercontent.com/PerezHz/jpleph/main/TTmTDBde430.tar.gz",
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/lsk/naif0012.tls",
ftp_jpl*"eph/planets/bsp/de430_1850-2150.bsp",
ftp_jpl*"eph/planets/bsp/TTmTDB.de430.19feb2015.bsp",
"https://raw.githubusercontent.com/PerezHz/jpleph/main/a99942.tar.gz",
"https://raw.githubusercontent.com/PerezHz/jpleph/main/ttmtdb_DE430_1995_2030_20221103.tar.gz"
]

# PlanetaryEphemeris.jl Solar System ephemeris name and URL
# PlanetaryEphemeris.jl Solar System ephemeris name and URL
const name_sseph = "sseph_p100"
const url_sseph = "https://github.com/LuEdRaMo/sseph/raw/main/sseph343ast016_p100y_et.tar.gz"

# Collect names and URLs
const urls_ = vcat(urls_lsk_spk, urls_debias, url_sseph)
const names_ = vcat(names_lsk_spk, names_debias, name_sseph)
# Collect names and URLs
const urls = vcat(urls_lsk_spk, urls_debias, url_sseph)
const names = vcat(names_lsk_spk, names_debias, name_sseph)

for (url, name) in map((x,y)->(x,y), urls_, names_)
for (url, name) in zip(urls, names)
# Query the `Artifacts.toml` file for the hash bound to the name
# (returns `nothing` if no such binding exists)
artfct_hash = artifact_hash(name, artifact_toml)

# If the name was not bound, or the hash it was bound to does not exist, create it!
if isnothing(artfct_hash) || !artifact_exists(artfct_hash)
tb = Tuple[]
# create_artifact() returns the content-hash of the artifact directory once we're finished creating it
artfct_hash = create_artifact() do artifact_dir
# We create the artifact by simply downloading a few files into the new artifact directory
@show url
@show url name
tmp_dir = mktempdir()
tarball = download(url, joinpath(tmp_dir, basename(url)))
# @show tarball tmp_dir
try
tarball_hash = open(tarball) do file
basename_url = basename(url)
@show basename_url
dot_idx = findlast(isequal('.'), basename_url)
ext = basename_url[dot_idx+1:end]
if ext in ["gz", "tgz"] # If artifact is a tarball with many files
# the following code block was adapted from PlatformEngines.jl, MIT licensed
# https://github.com/JuliaLang/Pkg.jl/blob/048b0e86deba0c5f491eb1a3af2f3c97cac675b3/src/PlatformEngines.jl#L348
dest = joinpath(tmp_dir, basename(url))
tarball = ""
f = retry(delays = fill(1.0, 3)) do
try
tarball = Downloads.download(url, dest)
catch err
@debug "download and verify failed" url dest err
rethrow()
end
end
f()
try
tarball_hash = open(tarball) do file
bytes2hex(sha256(file))
end
unpack(tarball, artifact_dir)
tb = [(url, tarball_hash)]
finally
rm(tarball)
end
else # url containing a single non-tarball file
fpath = Downloads.download(url, joinpath(artifact_dir, basename(url)))
file_hash = open(fpath) do file
bytes2hex(sha256(file))
end
@show tarball_hash
tb = [(url, tarball_hash)]
unpack(tarball, artifact_dir)
finally
rm(tarball)
tb = [(url, file_hash)]
end
end
@show artfct_hash typeof(artfct_hash)
# Now bind that hash within our `Artifacts.toml`. `force = true` means that if it already exists,
# just overwrite the corresponding entry in `Artifacts.toml` with the new content-hash.
# Unless the source files change, we do not expect the content hash to
Expand Down
Loading