anoved / WheresThatSat

A Twitter bot that reports current location information about satellites. (Currently on hiatus.)
https://twitter.com/wheresthatsat
MIT License
1 stars 1 forks source link

Cache TLEs in catalog file instead of separate files. #25

Closed anoved closed 12 years ago

anoved commented 12 years ago

Consider storing TLEs instead of paths to TLE files as the values in catalog.yml. Tidier (currently TLE files remain even if removed from catalog)... Downside is the current alias mechanism would need to be changed (currently aliases can be defined in a fixed fashion, where the value is the same path as the actual name).

Basically, the catalog hash key=>value would be like this: [canonical satellite name]=>[current tle content]. It should be possible to pass the content directly to gtg using the --tle option.

Handling aliases becomes slightly (but not very) more complex. Store a second hash in the catalog called aliases. Format: [alias name] => [canonical name]. When WTS loads the catalog, set each catalog[alias name] = catalog[aliases[alias name]]

Or that could be done at the end of UpdateCatalog, storing the dupe values for alias name, but I prefer the clarity of storing separate alias hash.

anoved commented 12 years ago

Implemented in commit 2fd7b478ac6a4e1df9dae6b01fde311f4ecfdfab - catalog stores actual TLE data instead of path to TLE files. Catalog includes a separate alias table (alias name => canonical name) which programs can use to add aliased records to the catalog at runtime.