<p>Yes, I asked this in the past but I got sidetracked and did other things. Now my question is, can one find the exact time when &quot;north node&quot; reaches a certain longitude?</p>
<p>I am looking for 15.125 or 15° 07' 30&quot; and happen to know exactly when this will happen but only after playing with the dates and time in this little &quot;app&quot; (it is used in astrology, but I do not know anything about astrology nor care to know). Anyway I got to this after many changes in the date and time so obviously it's not something I want to keep doing.</p>
<pre><code>swetest -pt -b10.5.2024 -ut21:33:24 
date (dmy) 10.5.2024 greg.   21:33:24
 UT     version 2.10.03-deb1
UT:  2460441.398194444     delta t: 69.065689 sec
TT:  2460441.398993816
Epsilon (t/m)     23°26'18.6220   23°26' 9.9980
Nutation          -0° 0' 5.1606    0° 0' 8.6241
true Node         15° 7'29.9990    0° 0' 0.0000    0.002408994
</code></pre>
<p>Then I tried to figure it the old fashion way, but the time is not accurate because I could only find the start DMS and end DMS for the day without seconds so it's a little off. This is how that works:</p>
<pre><code>    start at 0:00 15°13 == 54,780 arc seconds
    end at 24:00 15° 7 == 54,420 arc seconds
    total arc seconds for 24 hours 360 arc seconds

15.125 == 54,450 arc seconds

54,780 - 
54,450
   330 

330/360 = 0.9167 x 24 = 22(10 PM) which is a little off.
</code></pre>
<p>I also tried to work on this code but failed thus far:</p>
<pre><code>import numpy as np
from typing import Callable
 
import pytz
import skyfield.searchlib
from skyfield import api, timelib
from skyfield.jpllib import SpiceKernel, ChebyshevPosition
from skyfield.vectorlib import VectorSum
from skyfield.framelib import ecliptic_frame
 
 
def ecliptic_longitude_exceeds(
        longitude: float,
        target: str|VectorSum|ChebyshevPosition,
        ephemeris: SpiceKernel) -&gt; Callable[[timelib.Time], np.array]:
    &quot;&quot;&quot;
    Creates functions that check whether target ecliptic longitude exceeds
    value at a specified time
    :param longitude: Ecliptic Longitude in decimal degrees
    :param target: Object to be checked
    :param ephemeris: Ephemeris to be used.
    :return: find_discrete-compatible function
    &quot;&quot;&quot;

    earth = ephemeris['earth']
    target = ephemeris[target] if isinstance(target, str) else target
 
    def function(time: timelib.Time) -&gt; np.array:
        &quot;&quot;&quot;
        :param time: Time of Observation
        :return: Array of booleans indicating whether ecliptic longitude &gt; longitude
        &quot;&quot;&quot;
        observation = earth.at(time).observe(target).apparent()
        _, observed_longitude, _ = observation.frame_latlon(ecliptic_frame)
        return observed_longitude.degrees &gt; longitude
 
    function.step_days = 60
 
    return function
 
 
def main():
 
    ephemeris = api.load('de421.bsp')
    ts = api.load.timescale()
    utc = pytz.timezone(&quot;UTC&quot;)
    # Set start and stop dates to May 9 and May 11, 2024
    start, stop = ts.utc(2024, 5, 9), ts.utc(2024, 5, 11)
 
    moon_exceeds = ecliptic_longitude_exceeds(
        longitude=15.125, target=&quot;moon&quot;, ephemeris=ephemeris  
    )
 
    times, states = skyfield.searchlib.find_discrete(start, stop, moon_exceeds)
 
    longitude_times = list(time for time, in_state
                           in zip(times.astimezone(utc), states)
                           if in_state)
 
    print('\n'.join(str(lt) for lt in longitude_times))
 
 
if __name__ == '__main__':
    main()
</code></pre>

CC BY-SA 4.0
2024-03-29T01:12:13.157Z
The motion of the Moon's north node is rather irregular. Using my [plotting script](https://astronomy.stackexchange.com/a/55112/16685) I get [this graph](https://i.sstatic.net/9UQBa.png).
PM 2Ring
CC BY-SA 4.0
2024-03-29T01:13:34.557Z
Horizons says OM is 15.125° on [2024-Apr-27 23:40 TDB](https://ssd.jpl.nasa.gov/api/horizons.api?format=text&OBJ_DATA=NO&COMMAND=301&EPHEM_TYPE=E&CENTER=%40399&START_TIME=%272024-Apr-27+23%3A35%27&STOP_TIME=%272024-Apr-27+23%3A45%27&STEP_SIZE=1m), but that's for the J2000 equinox. If you want to use the "of date" equinox you need to adjust for precession of the equinox, as Mike G mentioned on one of your earlier questions.
PM 2Ring
CC BY-SA 4.0
2024-03-29T01:25:16.893Z
Your Python code appears to be checking the Moon's longitude, not its north node's longitude.
PM 2Ring
CC BY-SA 4.0
2024-03-29T02:26:21.660Z
Adjusting for precession  0.3402638°, so OM=14.784736°, gives 2024-May-11 01:00:36 TDB https://ssd.jpl.nasa.gov/api/horizons.api?format=text&OBJ_DATA=NO&COMMAND=301&EPHEM_TYPE=E&CENTER=%40399&START_TIME=%272024-May-11+1%3A00%3A35%27&STOP_TIME=%272024-May-11+1%3A00%3A45%27&STEP_SIZE=10
PM 2Ring
CC BY-SA 4.0
2024-03-29T04:56:43.050Z
PM 2Ring, I appreciate your comments ```select_date = swe.julday(2024, 5, 10, 21.55067, swe.GREG_CAL)
```   this is what the swieesph code prints ```alculation successful!
Ascending node:
Position: (15.125165845230343,)
Descending node:
Position: (195.12516584523127,)
Velocity: (0.0, 0.0, 0.0)
Perihelion:
Position: (4.957640578587505,)
Velocity: (-0.9184831739624794, 0.002406733121510601, 0.0, 0.0, 0.0)
Aphelion:
Position: (184.9576405785884,)
Velocity: (0.9184831739628908, 0.0027318105529593037, 0.0, 0.0, 0.0)
```
dimitri33
<the-moon><solar-system><earth><ephemeris><earths-orbit>
How to find the Moon's node longitude crossing
dimitri33
# How to find the Moon's node longitude crossing

(Asked by: username_0 on 2024-03-29)

Yes, I asked this in the past but I got sidetracked and did other things. Now my question is, can one find the exact time when "north node" reaches a certain longitude?
I am looking for 15.125 or 15° 07' 30" and happen to know exactly when this will happen but only after playing with the dates and time in this little "app" (it is used in astrology, but I do not know anything about astrology nor care to know). Anyway I got to this after many changes in the date and time so obviously it's not something I want to keep doing.
swetest -pt -b10.5.2024 -ut21:33:24 
date (dmy) 10.5.2024 greg.   21:33:24
 UT     version 2.10.03-deb1
UT:  2460441.398194444     delta t: 69.065689 sec
TT:  2460441.398993816
Epsilon (t/m)     23°26'18.6220   23°26' 9.9980
Nutation          -0° 0' 5.1606    0° 0' 8.6241
true Node         15° 7'29.9990    0° 0' 0.0000    0.002408994

Then I tried to figure it the old fashion way, but the time is not accurate because I could only find the start DMS and end DMS for the day without seconds so it's a little off. This is how that works:
    start at 0:00 15°13 == 54,780 arc seconds
    end at 24:00 15° 7 == 54,420 arc seconds
    total arc seconds for 24 hours 360 arc seconds

15.125 == 54,450 arc seconds

54,780 - 
54,450
   330 

330/360 = 0.9167 x 24 = 22(10 PM) which is a little off.

I also tried to work on this code but failed thus far:
import numpy as np
from typing import Callable
 
import pytz
import skyfield.searchlib
from skyfield import api, timelib
from skyfield.jpllib import SpiceKernel, ChebyshevPosition
from skyfield.vectorlib import VectorSum
from skyfield.framelib import ecliptic_frame
 
 
def ecliptic_longitude_exceeds(
        longitude: float,
        target: str|VectorSum|ChebyshevPosition,
        ephemeris: SpiceKernel) -> Callable[[timelib.Time], np.array]:
    """
    Creates functions that check whether target ecliptic longitude exceeds
    value at a specified time
    :param longitude: Ecliptic Longitude in decimal degrees
    :param target: Object to be checked
    :param ephemeris: Ephemeris to be used.
    :return: find_discrete-compatible function
    """

    earth = ephemeris['earth']
    target = ephemeris[target] if isinstance(target, str) else target
 
    def function(time: timelib.Time) -> np.array:
        """
        :param time: Time of Observation
        :return: Array of booleans indicating whether ecliptic longitude > longitude
        """
        observation = earth.at(time).observe(target).apparent()
        _, observed_longitude, _ = observation.frame_latlon(ecliptic_frame)
        return observed_longitude.degrees > longitude
 
    function.step_days = 60
 
    return function
 
 
def main():
 
    ephemeris = api.load('de421.bsp')
    ts = api.load.timescale()
    utc = pytz.timezone("UTC")
    # Set start and stop dates to May 9 and May 11, 2024
    start, stop = ts.utc(2024, 5, 9), ts.utc(2024, 5, 11)
 
    moon_exceeds = ecliptic_longitude_exceeds(
        longitude=15.125, target="moon", ephemeris=ephemeris  
    )
 
    times, states = skyfield.searchlib.find_discrete(start, stop, moon_exceeds)
 
    longitude_times = list(time for time, in_state
                           in zip(times.astimezone(utc), states)
                           if in_state)
 
    print('\n'.join(str(lt) for lt in longitude_times))
 
 
if __name__ == '__main__':
    main()

**Tags:** the-moon, solar-system, earth, ephemeris, earths-orbit

> **Comments:**
> **username_1**: The motion of the Moon's north node is rather irregular. Using my [plotting script](https://astronomy.stackexchange.com/a/55112/16685) I get [this graph](https://i.sstatic.net/9UQBa.png).  
> **username_1**: Horizons says OM is 15.125° on [2024-Apr-27 23:40 TDB](https://ssd.jpl.nasa.gov/api/horizons.api?format=text&OBJ_DATA=NO&COMMAND=301&EPHEM_TYPE=E&CENTER=%40399&START_TIME=%272024-Apr-27+23%3A35%27&STOP_TIME=%272024-Apr-27+23%3A45%27&STEP_SIZE=1m), but that's for the J2000 equinox. If you want to use the "of date" equinox you need to adjust for precession of the equinox, as Mike G mentioned on one of your earlier questions.  
> **username_1**: Your Python code appears to be checking the Moon's longitude, not its north node's longitude.  
> **username_1**: Adjusting for precession  0.3402638°, so OM=14.784736°, gives 2024-May-11 01:00:36 TDB https://ssd.jpl.nasa.gov/api/horizons.api?format=text&OBJ_DATA=NO&COMMAND=301&EPHEM_TYPE=E&CENTER=%40399&START_TIME=%272024-May-11+1%3A00%3A35%27&STOP_TIME=%272024-May-11+1%3A00%3A45%27&STEP_SIZE=10  
> **username_0**: username_1, I appreciate your comments ```select_date = swe.julday(2024, 5, 10, 21.55067, swe.GREG_CAL) ```   this is what the swieesph code prints ```alculation successful! Ascending node: Position: (15.125165845230343,) Descending node: Position: (195.12516584523127,) Velocity: (0.0, 0.0, 0.0) Perihelion: Position: (4.957640578587505,) Velocity: (-0.9184831739624794, 0.002406733121510601, 0.0, 0.0, 0.0) Aphelion: Position: (184.9576405785884,) Velocity: (0.9184831739628908, 0.0027318105529593037, 0.0, 0.0, 0.0) ```  

---

## 0 answers

