Until I have figured out what catalogues I want to include in my device's database, I can work on the representation of the celestial sphere as a number of patches. In a system with very limited memory and low CPU power (even though the mk20dx256 has lots more than the AVRs I worked with earlier), I need to partition the data.
Starting with an icosahedron, I will divide the sphere into a number of patches (triangles), from 20 upwards. Refining it by dividing each patch into 4 (or 9, that works as well) new triangles, I can get a larger number of smaller patches, and so on - resulting in 80, 320, ... - you get the idea.
What level of refinement is "right"? That is subject to the following considerations:
- I can/will have to handle more than one patch at a time.
- A center patch, which includes the coordinate that is pointed at by the telescope, can have a number of neighbours. A neighbour is one that shares at least one point (not a line) with the center patch, so the center patch will have 12 neighbours - I need to manage 13 patches.
- During panning, the telescope's view will eventually leave the center patch, and move into an already "loaded" (whatever that means, I don't know yet) neighbour. That will become the new center patch.
- That means that the center+neighbour patches should cover at least the displyed area of about 10° x 10°, a bit more won't hurt.
- The area covered by one triangle of an icosahedron is about 1/20th of the sphere's surface, and I need to display a spherical cap that is about 14° across (that's the display's diagonal).
And now it's time for some math. The surface ratio between a spherical cap and the whole sphere is
Putting in the display's diagonal yields
for h, so we get
which means that the device display 1/268th of the sky. This now must be divided by the number of patches we display at a time, which is 13. One patch must therefore cover 1/3484th of the sky - that's a lot of patches! A possible icosahedron refinement that gets close to this is 20x4x4x9 = 2880. I'll go for that.
If you find seríous errors in the above, please tell me!
Each patch will be stored in a file on the SD card. The information stored per patch is:
- the neighbour indices,
- the indices of objects that are in that patch,
- the patch center coordinate. I need that to tell if it's the center patch