Example code for Astroshaper packages.
This repository contains example notebooks demonstrating the use of AsteroidThermoPhysicalModels.jl for thermophysical modeling of asteroids. Shape models are handled by AsteroidShapeModels.jl.
New to Julia? The steps below take you from a fresh machine to a running notebook.
Julia 1.10 or later is required. juliaup, the official installer and version manager, is the recommended way to install it:
# macOS / Linux
curl -fsSL https://install.julialang.org | sh
# Windows
winget install --name Julia --id 9NJNWW8PVKMN -e -s msstoreOpen a new terminal and check the installation with julia --version. Useful juliaup commands:
| Command | Description |
|---|---|
juliaup status |
List the installed Julia versions |
juliaup update |
Update Julia to the latest release |
juliaup add 1.10 |
Install another version (run it with julia +1.10) |
juliaup default release |
Choose the version that julia starts |
The examples are Jupyter notebooks, which need a Jupyter kernel for Julia. IJulia.jl provides it; install it in either of the following ways.
- One-liner in a terminal:
julia -e 'using Pkg; Pkg.add("IJulia")' - Julia REPL (start
juliaand press]to enter the package mode):pkg> add IJulia
git clone https://github.com/Astroshaper/Astroshaper-examples.git
cd Astroshaper-examplesThen follow Running the Examples.
Thermophysical modeling (TPM) calculation for asteroid Ryugu.
- Single asteroid TPM with self-shadowing and self-heating
- Energy balance check and 3D temperature map
- Compatible with: AsteroidThermoPhysicalModels.jl v0.3.1 (see CHANGELOG.md for older versions)
TPM calculation for the binary asteroid system Didymos.
- Binary asteroid TPM
- Mutual shadowing (eclipses)
- Mutual heating between primary and secondary (optional; turned off in the notebook to save computation time)
- Compatible with: AsteroidThermoPhysicalModels.jl v0.3.1 (see CHANGELOG.md for older versions)
Example notebook for YORP simulation in Kanamaru et al. (2021).
- YORP effect calculation
- Long-term rotational evolution
- Compatible with: AsteroidThermoPhysicalModels.jl v0.0.4 only (frozen; not migrated to later versions)
Each example directory contains:
- A Jupyter notebook (
.ipynbfile) - A
Project.tomlfile specifying dependencies - A short README
The steps below apply to TPM_Ryugu and TPM_Didymos. TPM_Kanamaru2021 targets an old
version of the library; see its own README.
To run an example:
- Open the notebook in the example directory in one of the following ways.
- JupyterLab / Jupyter Notebook: start
juliain the example directory and run the lines below. If you do not have Jupyter, IJulia offers to install it for you.using IJulia jupyterlab(dir=pwd()) # or notebook(dir=pwd())
- VS Code: install the Jupyter extension,
open the
.ipynbfile and select the Julia kernel.
- JupyterLab / Jupyter Notebook: start
- Only for the first time, uncomment and run the setup cell at the top of the notebook.
It installs the packages listed in
Project.toml, in the versions the notebook was written for:The first run takes several minutes, mostly for precompiling the plotting packages.using Pkg Pkg.activate(".") Pkg.instantiate()
- Run the cells from the top. The SPICE kernels and the shape models are downloaded by the notebook.
- Julia 1.10 or later
- Jupyter (via IJulia.jl)
- Internet connection for downloading shape models and ephemeris data, and for the 3D plots (plotly.js is loaded from the CDN)
- Julia documentation — the language manual and the standard library
- Pkg.jl documentation — environments,
Project.tomland package management - juliaup — installer and version manager
- IJulia.jl — Julia kernel for Jupyter
- Julia extension for VS Code
- AsteroidThermoPhysicalModels.jl documentation
- AsteroidShapeModels.jl documentation
These examples are provided under the same license as AsteroidThermoPhysicalModels.jl (MIT License).
Contributions are welcome! Please feel free to submit issues or pull requests.