about summary refs log tree commit diff
path: root/README.md
blob: 7f82c95368774fc39fe20dca395c59518bf96801 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[![GoDoc](https://godoc.org/git.darknebu.la/Satellite/tle2json?status.svg)](https://godoc.org/git.darknebu.la/Satellite/tle2json) [![Go Report Card](https://goreportcard.com/badge/git.darknebu.la/Satellite/tle2json)](https://goreportcard.com/report/git.darknebu.la/Satellite/tle2json)
[![Build Status](https://drone.nbg1.emile.space/api/badges/Satellite/tle2json/status.svg)](https://drone.nbg1.emile.space/Satellite/tle2json)
# TLE2JSON

http api returning TLEs as json

## Setup

### Run the server

standalone:
`go run . -p <port>`

docker (selfbuilt):
```
$ docker build . -t tle2json
$ docker run -p <port extern>:8080 tle2json
```

docker (prebuilt image):
```
$ docker pull registry.darknebu.la/emile/tle2json:latest
$ docker run -p 8080:8080 registry.darknebu.la/emile/tle2json
```

### Populate the cache

By accessing the `/dumpall` endpoint, you can download all the TLEs populating
the cache. The next time the file containing the TLE needs to be accessed, it
doesn't need to be downloaded resulting in somwhat faster results.

![](imgs/out.png)

## Api endpoints

`/`
index, some examples

`/dumpall`
manually dump all the TLEs from [celestack](https://celestrak.com/NORAD/elements/) into the `data/` folder.

`/{category}/{name}`
dump a specific TLE
The TLE is searched by printing the first tle matching the given name. So by
searching for `SIRIUSSAT` from the `stations` category, the TLE of the first
match (`SIRIUSSAT-1`) will be returned, not `SIRIUSSAT-2`. 

## Links

Convert Keppler Orbital Elements to Cartesian State Vectors: https://downloads.rene-schwarz.com/download/M001-Keplerian_Orbit_Elements_to_Cartesian_State_Vectors.pdf