Skip to content

Commit

Permalink
make sure correct behavior if we ask for an MJD that is on sunrise/set
Browse files Browse the repository at this point in the history
  • Loading branch information
yoachim committed Dec 15, 2023
1 parent 300d280 commit 380dee7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rubin_scheduler/site_models/almanac.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ def get_sunset_info(self, mjd):
Returns a numpy array with mjds for various events (sunset, moonrise, sun at -12 degrees alt, etc.).
Also the integer night number.
"""
indx = np.searchsorted(self.sunsets["sunset"], mjd) - 1
indx = np.searchsorted(self.sunsets["sunset"], mjd, side="right") - 1

Check warning on line 88 in rubin_scheduler/site_models/almanac.py

View check run for this annotation

Codecov / codecov/patch

rubin_scheduler/site_models/almanac.py#L88

Added line #L88 was not covered by tests
return self.sunsets[indx]

def mjd_indx(self, mjd):
indx = np.searchsorted(self.sunsets["sunset"], mjd) - 1
indx = np.searchsorted(self.sunsets["sunset"], mjd, side="right") - 1

Check warning on line 92 in rubin_scheduler/site_models/almanac.py

View check run for this annotation

Codecov / codecov/patch

rubin_scheduler/site_models/almanac.py#L92

Added line #L92 was not covered by tests
return indx

def get_sun_moon_positions(self, mjd):
Expand Down

0 comments on commit 380dee7

Please sign in to comment.