diff --git a/Project.toml b/Project.toml index 42a7acf1..bb328e90 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ -name = "ThermoPhysicalModeling" +name = "AsteroidThermoPhysicalModels" uuid = "ab46f4a3-3c83-4d86-98d6-41a8b1a2e76e" authors = ["Masanori Kanamaru"] -version = "0.0.3" +version = "0.0.4" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" diff --git a/README.md b/README.md index a2c9d10d..bb17f3c3 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ ![](logo/Astroshaper_logo.png) -# ThermoPhysicalModeling.jl +# AsteroidThermoPhysicalModels.jl -[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://Astroshaper.github.io/ThermoPhysicalModeling.jl/stable) -[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://Astroshaper.github.io/ThermoPhysicalModeling.jl/dev) -[![Build Status](https://github.com/Astroshaper/ThermoPhysicalModeling.jl/workflows/CI/badge.svg)](https://github.com/Astroshaper/ThermoPhysicalModeling.jl/actions?query=workflow%3ACI+branch%3Amain) -[![codecov](https://codecov.io/gh/Astroshaper/ThermoPhysicalModeling.jl/branch/main/graph/badge.svg?token=dJBiR91dCD)](https://codecov.io/gh/Astroshaper/ThermoPhysicalModeling.jl) +[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://Astroshaper.github.io/AsteroidThermoPhysicalModels.jl/stable) +[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://Astroshaper.github.io/AsteroidThermoPhysicalModels.jl/dev) +[![Build Status](https://github.com/Astroshaper/AsteroidThermoPhysicalModels.jl/workflows/CI/badge.svg)](https://github.com/Astroshaper/AsteroidThermoPhysicalModels.jl/actions?query=workflow%3ACI+branch%3Amain) +[![codecov](https://codecov.io/gh/Astroshaper/AsteroidThermoPhysicalModels.jl/branch/main/graph/badge.svg?token=dJBiR91dCD)](https://codecov.io/gh/Astroshaper/AsteroidThermoPhysicalModels.jl) [![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) Julia-based toolkit for dynamical simulations of planets and small solar system bodies. @@ -13,13 +13,13 @@ Julia-based toolkit for dynamical simulations of planets and small solar system ## Installation using Pkg - Pkg.add(url="https://github.com/Astroshaper/ThermoPhysicalModeling.jl") - using ThermoPhysicalModeling + Pkg.add(url="https://github.com/Astroshaper/AsteroidThermoPhysicalModels.jl") + using AsteroidThermoPhysicalModels You can update the module and run tests as follows. - Pkg.update("ThermoPhysicalModeling") - Pkg.test("ThermoPhysicalModeling") + Pkg.update("AsteroidThermoPhysicalModels") + Pkg.test("AsteroidThermoPhysicalModels") ## Orbital dynamics You can simulate orbital evolution of planets and small bodies under gravity interaction and various perturbations. @@ -60,12 +60,12 @@ Distribution of dynamical elevation on asteroid Itokawa. The color map ranges fr ## Start to play Let's visualize a shape model of asteroid Ryugu. -Please downlad a Ryugu model from ThermoPhysicalModeling/test/ryugu_test.obj. +Please downlad a Ryugu model from AsteroidThermoPhysicalModels/test/ryugu_test.obj. - using ThermoPhysicalModeling + using AsteroidThermoPhysicalModels shapepath = "ryugu_test.obj" # Path to the shape model - shape = Shape(shapepath; scale=1000, find_visible_facets=true) + shape = ShapeModel(shapepath; scale=1000, find_visible_facets=true) draw(shape) # draw(shape, data=:radius) # Radius of each surface facet diff --git a/docs/Project.toml b/docs/Project.toml index 635ba3f0..849c717a 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,3 +1,3 @@ [deps] -ThermoPhysicalModeling = "ab46f4a3-3c83-4d86-98d6-41a8b1a2e76e" +AsteroidThermoPhysicalModels = "ab46f4a3-3c83-4d86-98d6-41a8b1a2e76e" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" diff --git a/docs/make.jl b/docs/make.jl index b7658750..74e17277 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,15 +1,15 @@ -using ThermoPhysicalModeling +using AsteroidThermoPhysicalModels using Documenter -DocMeta.setdocmeta!(ThermoPhysicalModeling, :DocTestSetup, :(using ThermoPhysicalModeling); recursive=true) +DocMeta.setdocmeta!(AsteroidThermoPhysicalModels, :DocTestSetup, :(using AsteroidThermoPhysicalModels); recursive=true) makedocs(; - modules=[ThermoPhysicalModeling], - repo="https://github.com/Astroshaper/ThermoPhysicalModeling.jl/blob/{commit}{path}#{line}", - sitename="ThermoPhysicalModeling.jl", + modules=[AsteroidThermoPhysicalModels], + repo="https://github.com/Astroshaper/AsteroidThermoPhysicalModels.jl/blob/{commit}{path}#{line}", + sitename="AsteroidThermoPhysicalModels.jl", format=Documenter.HTML(; prettyurls=get(ENV, "CI", "false") == "true", - canonical="https://Astroshaper.github.io/ThermoPhysicalModeling.jl", + canonical="https://Astroshaper.github.io/AsteroidThermoPhysicalModels.jl", assets=["assets/favicon.ico"], ), pages=[ @@ -18,5 +18,5 @@ makedocs(; ) deploydocs(; - repo="github.com/Astroshaper/ThermoPhysicalModeling.jl", + repo="github.com/Astroshaper/AsteroidThermoPhysicalModels.jl", ) diff --git a/docs/src/index.md b/docs/src/index.md index 578d9b8e..efb29f30 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,7 +1,7 @@ -# ThermoPhysicalModeling.jl +# AsteroidThermoPhysicalModels.jl A package for dynamical simulation of an asteroid. ```@autodocs -Modules = [ThermoPhysicalModeling] +Modules = [AsteroidThermoPhysicalModels] ``` diff --git a/src/ThermoPhysicalModeling.jl b/src/AsteroidThermoPhysicalModels.jl similarity index 95% rename from src/ThermoPhysicalModeling.jl rename to src/AsteroidThermoPhysicalModels.jl index adde23c1..314b7e7b 100644 --- a/src/ThermoPhysicalModeling.jl +++ b/src/AsteroidThermoPhysicalModels.jl @@ -1,4 +1,4 @@ -module ThermoPhysicalModeling +module AsteroidThermoPhysicalModels using LinearAlgebra using StaticArrays @@ -83,4 +83,4 @@ export run_Euler include("leapfrog.jl") export run_leapfrog -end # module ThermoPhysicalModeling +end # module AsteroidThermoPhysicalModels diff --git a/test/Keplerian_motion.jl b/test/Keplerian_motion.jl index 43634f0b..ada2bebb 100644 --- a/test/Keplerian_motion.jl +++ b/test/Keplerian_motion.jl @@ -2,8 +2,8 @@ # These functions are used in https://github.com/Astroshaper/Astroshaper-examples/blob/main/TPM_Kanamaru2021/TPM_Kanamaru2021.ipynb @testset "Keplerian_motion" begin - orbit = ThermoPhysicalModeling.OrbitalElements(ThermoPhysicalModeling.RYUGU) - spin = ThermoPhysicalModeling.SpinParams(ThermoPhysicalModeling.RYUGU, orbit) + orbit = AsteroidThermoPhysicalModels.OrbitalElements(AsteroidThermoPhysicalModels.RYUGU) + spin = AsteroidThermoPhysicalModels.SpinParams(AsteroidThermoPhysicalModels.RYUGU, orbit) Δt = spin.P / 72 times = collect(0:Δt:orbit.P) @@ -11,11 +11,11 @@ for time in times spin_phase = spin.ω * time - u = ThermoPhysicalModeling.solveKeplerEquation2(orbit, time) - r = ThermoPhysicalModeling.get_r(orbit, u) - F☉ = ThermoPhysicalModeling.SOLAR_CONST / (norm(r) / ThermoPhysicalModeling.AU)^2 + u = AsteroidThermoPhysicalModels.solveKeplerEquation2(orbit, time) + r = AsteroidThermoPhysicalModels.get_r(orbit, u) + F☉ = AsteroidThermoPhysicalModels.SOLAR_CONST / (norm(r) / AsteroidThermoPhysicalModels.AU)^2 r̂☉ = normalize(r) * -1 # Shift the origin from the sun to the body - r̂☉ = ThermoPhysicalModeling.orbit_to_body(r̂☉, spin.γ, spin.ε, spin_phase) # Sun's position in the asteroid-fixed frame + r̂☉ = AsteroidThermoPhysicalModels.orbit_to_body(r̂☉, spin.γ, spin.ε, spin_phase) # Sun's position in the asteroid-fixed frame end end \ No newline at end of file diff --git a/test/TPM_Didymos.jl b/test/TPM_Didymos.jl index d17bbb03..947b1ea6 100644 --- a/test/TPM_Didymos.jl +++ b/test/TPM_Didymos.jl @@ -58,18 +58,18 @@ path_shape2_jld = joinpath("Didymos", "kernels", "dsk", "g_06650mm_rad_obj_didb_0000n00000_v001.jld2") if isfile(path_shape1_jld) - shape1 = ThermoPhysicalModeling.ShapeModel(path_shape1_jld; scale=1000, find_visible_facets=true, save_shape=true) + shape1 = AsteroidThermoPhysicalModels.ShapeModel(path_shape1_jld; scale=1000, find_visible_facets=true, save_shape=true) else - shape1 = ThermoPhysicalModeling.ShapeModel(path_shape1_obj; scale=1000, find_visible_facets=true, save_shape=true) + shape1 = AsteroidThermoPhysicalModels.ShapeModel(path_shape1_obj; scale=1000, find_visible_facets=true, save_shape=true) end if isfile(path_shape2_jld) - shape2 = ThermoPhysicalModeling.ShapeModel(path_shape2_jld; scale=1000, find_visible_facets=true, save_shape=true) + shape2 = AsteroidThermoPhysicalModels.ShapeModel(path_shape2_jld; scale=1000, find_visible_facets=true, save_shape=true) else - shape2 = ThermoPhysicalModeling.ShapeModel(path_shape2_obj; scale=1000, find_visible_facets=true, save_shape=true) + shape2 = AsteroidThermoPhysicalModels.ShapeModel(path_shape2_obj; scale=1000, find_visible_facets=true, save_shape=true) end ##= TPM =## - thermo_params = ThermoPhysicalModeling.ThermoParams( # [Michel+2016; Naidu+2020] + thermo_params = AsteroidThermoPhysicalModels.ThermoParams( # [Michel+2016; Naidu+2020] A_B = 0.059, # Bolometric Bond albedo A_TH = 0.0, k = 0.125, @@ -81,15 +81,15 @@ Nt = length(et_range), z_max = 0.6, Nz = 41, - P = SPICE.convrt(ThermoPhysicalModeling.DIDYMOS[:P], "hours", "seconds"), + P = SPICE.convrt(AsteroidThermoPhysicalModels.DIDYMOS[:P], "hours", "seconds"), ); - ThermoPhysicalModeling.init_temps_zero!(shape1, thermo_params) - ThermoPhysicalModeling.init_temps_zero!(shape2, thermo_params) + AsteroidThermoPhysicalModels.init_temps_zero!(shape1, thermo_params) + AsteroidThermoPhysicalModels.init_temps_zero!(shape2, thermo_params) # Run TPM and save the result savepath = joinpath("Didymos", "TPM_Didymos.jld2") shapes = (shape1, shape2) suns = (sun_d1, sun_d2) - ThermoPhysicalModeling.run_TPM!(shapes, et_range, suns, D2_TO_D1, d2_d1, thermo_params, savepath, [:surf_temps, :forces, :torques]) + AsteroidThermoPhysicalModels.run_TPM!(shapes, et_range, suns, D2_TO_D1, d2_d1, thermo_params, savepath, [:surf_temps, :forces, :torques]) end diff --git a/test/TPM_Ryugu.jl b/test/TPM_Ryugu.jl index b24bab5d..ab253d06 100644 --- a/test/TPM_Ryugu.jl +++ b/test/TPM_Ryugu.jl @@ -49,13 +49,13 @@ ##= Load obj file =## path_jld = splitext(path_obj)[1]*".jld2" if isfile(path_jld) - shape = ThermoPhysicalModeling.ShapeModel(path_jld; scale=1000, find_visible_facets=true, save_shape=true) + shape = AsteroidThermoPhysicalModels.ShapeModel(path_jld; scale=1000, find_visible_facets=true, save_shape=true) else - shape = ThermoPhysicalModeling.ShapeModel(path_obj; scale=1000, find_visible_facets=true, save_shape=true) + shape = AsteroidThermoPhysicalModels.ShapeModel(path_obj; scale=1000, find_visible_facets=true, save_shape=true) end ##= TPM =## - thermo_params = ThermoPhysicalModeling.ThermoParams( + thermo_params = AsteroidThermoPhysicalModels.ThermoParams( A_B = 0.04, # Bolometric Bond albedo A_TH = 0.0, k = 0.1, @@ -69,9 +69,11 @@ Nz = 41, P = 7.63262 * 3600, ) + # Run TPM and save the result savepath = joinpath("Ryugu", "TPM_Ryugu.jld2") - ThermoPhysicalModeling.run_TPM!(shape, et_range, sun_ryugu, thermo_params, savepath, save_range) + AsteroidThermoPhysicalModels.run_TPM!(shape, et_range, sun_ryugu, thermo_params, savepath, save_range) + JLD2.jldopen(savepath, "r+") do file file["RYUGU_TO_J2000"] = RYUGU_TO_J2000[save_range] end diff --git a/test/runtests.jl b/test/runtests.jl index 27a815d5..a3a53d7e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,4 @@ -using ThermoPhysicalModeling +using AsteroidThermoPhysicalModels using Test using Aqua using JLD2 @@ -8,7 +8,7 @@ using Downloads using Statistics using LinearAlgebra -Aqua.test_all(ThermoPhysicalModeling, ambiguities=false) +Aqua.test_all(AsteroidThermoPhysicalModels, ambiguities=false) include("TPM_Ryugu.jl") include("TPM_Didymos.jl")