Skip to content

Commit

Permalink
Update tutorial.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bgodard authored May 27, 2019
1 parent 6e61582 commit 5f5a9c3
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions docs/src/tutorial.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Tutorial

This tutorial will walk you through the features and functionality of CALCEPH.jl
This tutorial will walk you through the features and functionality of [CALCEPH.jl](https://github.com/JuliaAstro/CALCEPH.jl)

## Ephemerides sources

The supported sources of ephemerides are:
- JPL DExxx binary ephemerides files: https://ssd.jpl.nasa.gov/?planet_eph_export
- IMCCE INPOP ephemerides files: https://www.imcce.fr/inpop/
- some NAIF SPICE kernels: https://naif.jpl.nasa.gov/naif/data.html
- JPL DExxx binary ephemerides files: [https://ssd.jpl.nasa.gov/?planet_eph_export](https://ssd.jpl.nasa.gov/?planet_eph_export)
- IMCCE INPOP ephemerides files: [https://www.imcce.fr/inpop/](https://www.imcce.fr/inpop/)
- some NAIF SPICE kernels: [https://naif.jpl.nasa.gov/naif/data.html](https://naif.jpl.nasa.gov/naif/data.html)

Example:
```julia
Expand Down Expand Up @@ -96,11 +96,11 @@ CALCEPH has the following identification scheme for bodies:

If target is 14, 15, 16 or 17 (nutation, libration, TT-TDB or TCG-TCB), center must be 0.

The more complete NAIF identification number can be used if the value useNaifId is added to the options argument.
The more complete NAIF identification scheme can be used if the value useNaifId is added to the options argument.

## NAIF body identification scheme

See https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/naif_ids.html
See [https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/naif_ids.html](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/naif_ids.html)

CALCEPH uses this identification scheme only when the value useNaifId is added to the options argument.

Expand All @@ -124,7 +124,7 @@ naifId also stores the following identifiers:
- :tcgmtcb (1000000002): the target argument when requesting a value from the difference TCG-TCB time ephemeris.


naifId is actually an instance of mutable struct BodyId. The user can also create its own identification scheme for its NAIF kernels:
naifId is actually an instance of mutable struct BodyId. The user can also create its own identification scheme for its SPICE kernels:
```julia
const MyUniverseIds = CALCEPH.BodyId()
CALCEPH.add!(MyUniverseIds,:tatooine,1000001)
Expand All @@ -139,7 +139,7 @@ You can also load identification data from an external file:
```julia
loadData!(MyUniverseIds, "MyUniverseIds.txt"))
```
See example: https://github.com/JuliaAstro/CALCEPH.jl/blob/master/data/NaifIds.txt
See example: [https://github.com/JuliaAstro/CALCEPH.jl/blob/master/data/NaifIds.txt](https://github.com/JuliaAstro/CALCEPH.jl/blob/master/data/NaifIds.txt)

Names from the file are converted to lower case and have spaces replaced by underscores before being converted to symbols/interned strings.

Expand All @@ -165,6 +165,9 @@ Those methods compute the position and its time derivatives of target with respe
- 1: compute position and velocity
- 2: compute position, velocity and acceleration
- 3: compute position, velocity, acceleration and jerk.


When order is not specified, position and velocity are computed.

#### Example:
Computing position only of Jupiter system barycenter with respect to the Earth Moon center in kilometers at JD=2456293.5 (Ephemeris Time).
Expand Down Expand Up @@ -217,8 +220,8 @@ Note that the returned value is a vector of 3 even though there are only 2 nutat
The following methods are available to compute body angular momentum with CALCEPH:

```julia
rotrotAngMom(eph,jd1,jd2,target,unit)
rotrotAngMom(eph,jd1,jd2,target,unit,order)
rotAngMom(eph,jd1,jd2,target,unit)
rotAngMom(eph,jd1,jd2,target,unit,order)
```

Those methods compute the angular momentum of target and their time derivatives.
Expand All @@ -237,11 +240,11 @@ Those methods compute the angular momentum of target and their time derivatives.

The time ephemeris TT-TDB or TCG-TCB at the geocenter can be evaluated with a suitable source.

INPOP and some JPL DE ephemerides includes a numerically integrated time ephemerides for the geocenter which is usually more accurate than the analytical series: Moreover it is much faster to interpolate those ephemerides than to evaluate the analytical series. This is only for the geocenter but a simple correction can also be added for the location of the observer (and its velocity in case the observer is on a highly elliptical orbit).
INPOP and some JPL DE ephemerides includes a numerically integrated time ephemeris for the geocenter which is usually more accurate than the analytical series: Moreover it is much faster to interpolate those ephemerides than to evaluate the analytical series. This is only for the geocenter but a simple correction can also be added for the location of the observer (and its velocity in case the observer is on a highly elliptical orbit).

The difference bewteen TT and TDB can be obtained from the following files:
- ftp://ftp.imcce.fr/pub/ephem/planets/inpop17a/inpop17a_TDB_m100_p100_tt.dat
- ftp://ssd.jpl.nasa.gov/pub/eph/planets/bsp/de432t.bsp
Files that can be used to obtain the difference between TT and TDB are, e.g.:
- [ftp://ftp.imcce.fr/pub/ephem/planets/inpop17a/inpop17a_TDB_m100_p100_tt.dat](ftp://ftp.imcce.fr/pub/ephem/planets/inpop17a/inpop17a_TDB_m100_p100_tt.dat)
- [ftp://ssd.jpl.nasa.gov/pub/eph/planets/bsp/de432t.bsp](ftp://ssd.jpl.nasa.gov/pub/eph/planets/bsp/de432t.bsp)

#### Example:
Computing TT-TDB at geocenter in seconds at JD=2456293.5 (Ephemeris Time).
Expand Down Expand Up @@ -272,7 +275,7 @@ unsafe_rotAngMom!(result,eph,jd1,jd2,target,options)
unsafe_rotAngMom!(result,eph,jd1,jd2,target,options,order)
```

Those methods do not perform any checks on their inputs. In particular, result must be a contiguous vector of double precion floating point number of dimension at least 6 when order is not specified or at least 3*(order+1) otherwise.
Those methods do not perform any checks on their inputs. In particular, result must be a contiguous vector of double precision floating point number of dimension at least 6 when order is not specified or at least 3*(order+1) otherwise.

## Constants

Expand Down Expand Up @@ -307,9 +310,9 @@ returns the triplet:
- julian date of first entry in ephemerides context.
- julian date of last entry in ephemerides context.
- information about the availability of the quantities over the time span:
- 1 if the quantities of all bodies are available for any time between the first and last time.
- 2 if the quantities of some bodies are available on discontinuous time intervals between the first and last time.
- 3 if the quantities of each body are available on a continuous time interval between the first and last time, but not available for any time between the first and last time.
- 1 if the quantities of all bodies are available for any time between the first and last time.
- 2 if the quantities of some bodies are available on discontinuous time intervals between the first and last time.
- 3 if the quantities of each body are available on a continuous time interval between the first and last time, but not available for any time between the first and last time.

#### Position records

Expand Down

2 comments on commit 5f5a9c3

@bgodard
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/1029

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.2 -m "<description of version>" 5f5a9c3fa2df55957d0c1b8d5af6ce8d8f2ad48f
git push origin v1.0.2

Please sign in to comment.