using SpiceyPy to get state vectors of ground telescopes using their observatory codes
dtamayo opened this issue · comments
I would like to use the various SpiceyPy functions (e.g. spkezr) referencing a particular ground-based observatory, using its observatory code from the Minor Planet Center
https://minorplanetcenter.net/iau/lists/ObsCodesF.html
Alternatively, it would also work to specify a latitude and longitude on the Earth. I'm having trouble finding how to do that from the SPICE and SpiceyPy documentation, but wondered if anyone else had done that and could point me in the right direction.
hey @dtamayo, so I think the easiest approach would be to use spkcpo
or spkcpt
https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spkcpo_c.html, https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spkcpt_c.html, all you would need to do I think is convert your observatories from latitude/longitude into rectangular coordinates in the Earth frame (see https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/georec_c.html).
There is also this relevant posting from the naif discussion board: https://naif.jpl.nasa.gov/pipermail/spice_discussion/2016-April/000439.html for how to make spk files if you want to, and perhaps the source code for the pinpoint application in spice will help you verify your implementation.
Thank you for the rapid and detailed response @AndrewAnnex, this is extremely helpful and exactly what I needed. And thanks for this fantastic package!