def normalise_day(day_frac):
    """Adjust the day fraction to correspond to the current day.
      day_frac is a fractional day, so should be adjusted to fall in the range
      0-1 if necessary (Astro. Alg. p.98)
      TODO: This may not be what you want, if you are concerned about the next
      rise or set, as opposed to one that happened today.
    """
    if day_frac < 0:
        day_frac += 1
    if day_frac > 1:
        day_frac -= 1
    return day_frac
