<p>The rising-setting search routine is currently optimized for objects near the celestial equator, like the Sun, Moon, and planets, that spent about half the day in the sky. This assumption lets it search in ¼-day increments, making it more efficient for such objects.</p>
<p>But the Andromeda galaxy and your observer position are both far to the north of the ecliptic, such that the galaxy spends only (if I'm doing the math in my head correctly, given the output you posted) about 4 hours below the horizon each day. It's easy for Skyfield to miss that 4 hour window when it’s stepping forward in ¼-day = 6 hour steps looking for the galaxy to be below the horizon.</p>
<p>Maybe Skyfield should someday have more intelligence around risings and settings! For now, you can tell it to search a tighter collection of points:</p>
<pre><code>rise_set.step_days = 0.1
</code></pre>
<p>If you put that before your call to <code>almanac.find_discrete()</code>, I believe you will find that it computes all of the galaxy’s risings and settings!</p>

CC BY-SA 4.0
2021-11-14T20:52:12.833Z
2021-11-14T20:52:12.833Z
Brandon Rhodes
<p>To compute the Andromeda Galaxy Risings and Settings I essentially use this code (in a more colplex code, but this serves the purpose):</p>
<pre><code>from skyfield import api, almanac
from skyfield.api import N,S,E,W, wgs84, load, Star

ts = api.load.timescale()
eph = api.load('de421.bsp')
t0 = ts.utc(2021, 11, 1)
t1 = ts.utc(2021, 11, 13)

#The object
andromeda = Star(ra_hours=(00, 42, 44.330), dec_degrees=(41, 16, 7.50), parallax_mas=6.0, radial_km_per_s=-300, names=(&quot;Andromeda&quot;))

#The Location
location = api.wgs84.latlon(46.1927800 * N, 9.0170300 * E, elevation_m=200 )

rise_set = almanac.risings_and_settings(eph, andromeda, location)
riseset_time, isrise = almanac.find_discrete(t0, t1, rise_set)
for riseset_time_u, isrise_u in zip(riseset_time, isrise):
    print(riseset_time_u.utc_iso(), 'Rise' if isrise_u else 'Set')
</code></pre>
<p>I do optain this results</p>
<pre><code>2021-11-04T07:51:31Z Set
2021-11-04T10:33:33Z Rise
2021-11-05T07:47:35Z Set
2021-11-05T10:29:37Z Rise
2021-11-06T07:43:39Z Set
2021-11-06T10:25:41Z Rise
2021-11-07T07:39:43Z Set
2021-11-07T10:21:45Z Rise
2021-11-08T07:35:47Z Set
2021-11-08T10:17:49Z Rise
2021-11-09T07:31:51Z Set
2021-11-09T10:13:53Z Rise
</code></pre>
<p>Now the problem is that <code>t0</code> is set on November the 1st, but the rises_and_settings function does not return any result before the Novembre 4th.
Why is that?</p>

CC BY-SA 4.0
2021-11-14T00:49:59.067Z
For this question I recommend you also post it in the ["issues" section of Skyfield's github page](https://github.com/skyfielders/python-skyfield/issues). It's very active and I think you'll get a response faster than you will here.
uhoh
<python><skyfield>
Skyfield missing some rise and set dates
Luca Berti
# Skyfield missing some rise and set dates

(Asked by: username_0 on 2021-11-13)

To compute the Andromeda Galaxy Risings and Settings I essentially use this code (in a more colplex code, but this serves the purpose):

```
from skyfield import api, almanac
from skyfield.api import N,S,E,W, wgs84, load, Star

ts = api.load.timescale()
eph = api.load('de421.bsp')
t0 = ts.utc(2021, 11, 1)
t1 = ts.utc(2021, 11, 13)

#The object
andromeda = Star(ra_hours=(00, 42, 44.330), dec_degrees=(41, 16, 7.50), parallax_mas=6.0, radial_km_per_s=-300, names=("Andromeda"))

#The Location
location = api.wgs84.latlon(46.1927800 * N, 9.0170300 * E, elevation_m=200 )

rise_set = almanac.risings_and_settings(eph, andromeda, location)
riseset_time, isrise = almanac.find_discrete(t0, t1, rise_set)
for riseset_time_u, isrise_u in zip(riseset_time, isrise):
    print(riseset_time_u.utc_iso(), 'Rise' if isrise_u else 'Set')

```

I do optain this results

```
2021-11-04T07:51:31Z Set
2021-11-04T10:33:33Z Rise
2021-11-05T07:47:35Z Set
2021-11-05T10:29:37Z Rise
2021-11-06T07:43:39Z Set
2021-11-06T10:25:41Z Rise
2021-11-07T07:39:43Z Set
2021-11-07T10:21:45Z Rise
2021-11-08T07:35:47Z Set
2021-11-08T10:17:49Z Rise
2021-11-09T07:31:51Z Set
2021-11-09T10:13:53Z Rise

```

Now the problem is that `t0` is set on November the 1st, but the rises\_and\_settings function does not return any result before the Novembre 4th.
Why is that?

**Tags:** python, skyfield

> **Comments:**
> **username_1**: For this question I recommend you also post it in the ["issues" section of Skyfield's github page](https://github.com/skyfielders/python-skyfield/issues). It's very active and I think you'll get a response faster than you will here.  

---

## 1 answers

### Answer by username_2 on 2021-11-14. Score: 3 | Accepted answer

The rising-setting search routine is currently optimized for objects near the celestial equator, like the Sun, Moon, and planets, that spent about half the day in the sky. This assumption lets it search in ¼-day increments, making it more efficient for such objects.

But the Andromeda galaxy and your observer position are both far to the north of the ecliptic, such that the galaxy spends only (if I'm doing the math in my head correctly, given the output you posted) about 4 hours below the horizon each day. It's easy for Skyfield to miss that 4 hour window when it’s stepping forward in ¼-day = 6 hour steps looking for the galaxy to be below the horizon.

Maybe Skyfield should someday have more intelligence around risings and settings! For now, you can tell it to search a tighter collection of points:

```
rise_set.step_days = 0.1

```

If you put that before your call to `almanac.find_discrete()`, I believe you will find that it computes all of the galaxy’s risings and settings!


---

