Closed Almuten closed 3 years ago
It should probably be possible, and there are probably several ways to approach the problem. So that we can choose between them: what’s the larger problem that knowing the longitude will help solve?
There is no "larger" problem ). I am doing calculations of the positions of the planets and Nodes. And I found there is a "position" that I don't know how to calculate. A short example of calculating the longitude of the Moon's ascending node for an arbitrary date will be super!
Hmm. Without any physical goal for the calculation, your choice will have to necessarily be arbitrary. The node is more or less a fiction between the moments when the Moon is actually crossing the ecliptic, and here are two possible approaches:
ecliptic = inertial_frames['ECLIPJ2000']
— try using the ecliptic of the date you're looking at:
ecliptic = skyfield.framelib.ecliptic_frame.rotation_at(t)
I would probably do the linear extrapolation myself.
Thank you so much! Started experiment )
Maybe it would help you: there is a function swe_nod_aps in Swiss Ephemeris which calculates mean and osculating Nodes [link removed]
@voronY — Thanks for idea that another tool’s code could help @Almuten! I have removed the direct link, though, because the copyright message at the top of the file indicates that it is not compatible with Skyfield’s license, and I need to make sure none of us Skyfield contributors read the code, which could put us in danger of accidentally copying the code into Skyfield from memory later.
@Almuten — I wanted to check back and see how your experiment went, so that we can hopefully get this issue closed. Thanks for any update you can provide!
@Almuten — I wanted to check back and see how your experiment went, so that we can hopefully get this issue closed. Thanks for any update you can provide!
I took your advice. ecliptic = skyfield.framelib.ecliptic_frame.rotation_at(t)
The solution is super! Thank you!
I'm glad it worked! I'll see about getting it added to the documentation somewhere.
I found the following example:
t0 = ts.utc(2020, 4, 22) t1 = ts.utc(2020, 5, 22) t, y = almanac.find_discrete(t0, t1, almanac.moon_nodes(eph))
print(t.utc_iso()) print(y) print([almanac.MOON_NODES[yi] for yi in y])
Is it possible to solve the inverse problem, by a known time to find the longitude of the Ascending Node of the Moon? I saw an example of use,
position = (moon - earth).at(t) ecliptic = inertial_frames['ECLIPJ2000'] elements = osculating_elements_of(position, ecliptic) i = elements.longitude_of_ascending_node.degrees
but I need specific dates, far from 2000