# Can I retrieve longitude of Lunar Reconnaissance Orbiter around the Moon by POST method (URL)?

I see that I can use an URL like this to retrieve position data for LRO around the Moon:

https://ssd.jpl.nasa.gov/horizons_batch.cgi?batch=1&MAKE_EPHEM=%27YES%27&TABLE_TYPE=%27VECTORS%27&OUT_UNITS=%27KM-S%27&REF_SYSTEM=%27J2000%27&VEC_LABELS=%27YES%27&CSV_FORMAT=%27YES%27&OBJ_DATA=%27YES%27&VEC_TABLE=%273%27&STEP_SIZE=%2710m%27&START_TIME=%272019-10-9%2000:00%27&STOP_TIME=%272019-10-10%2001:15%27&COMMAND=%27-85%27&CENTER=%27@301%27

But what I need is LRO longitude, to calculate when it will pass over a specific position, so I tried using Horizon to retrieve also position of a static point on Moon surface to calculate angular distance, but it dos not work, if it's static it has no ephemeris.

Maybe it could be possible using this page, but I was not able to figure out if an how:

https://wgc.jpl.nasa.gov:8443/webgeocalc/

For example this?

https://wgc.jpl.nasa.gov:8443/webgeocalc/#SurfaceInterceptFinder

But in case it works, which would be the corresponding query URL?

• By url might be hard... But I guess you could take the xyz data and convert to lat/long? See gis.stackexchange.com/a/325618 – mothman Oct 9 at 7:53
• I wasn't able to get it to work, but there is item #14 here: i.stack.imgur.com/KX13X.png I actually am not sure what it even means, there's going to be documentation somewhere though... – uhoh Oct 9 at 12:46

The steps are summarised as follows

curl $url 2&>1 | awk -F ',' '{if(NF==12) print \$1, \$3, \$4, \\$5}' | tail -n +2

1. Redirect it to a file. This will get you the Time, Px_J2000, Py_J2000, Pz_J2000.

2. Now, you need to get the J2000_To_IAU Matrix somehow and then get Time, Px_IAU, Py_IAU, Pz_IAU.

3. Get the sidereal angle at some epoch. Convert it to MCMF (Moon Centred Moon Fixed).

4. Now, you most likely need the Latitude and Longitude in ME frame. So you need PA_TO_ME constant matrix and get Px_ME, Py_ME, Pz_ME. Now getting longitude is as simple as $$atan2(y,x)$$

For reference frame definition: Standardized Lunar Coordinate Systems