def visible_crescent(self, date): """Return S. K. Shaukat's criterion for likely visibility of crescent moon on eve of date 'date', at location 'location'.""" tee = self.universal_from_standard(self.dusk(date - 1, mpf(4.5))) phase = Lunar.lunar_phase(tee) altitude = self.lunar_altitude(tee) arc_of_light = arccos_degrees(cos_degrees(Lunar.lunar_latitude(tee)) * cos_degrees(phase)) return ((Lunar.NEW < phase < Lunar.FIRST_QUARTER) and (mpf(10.6) <= arc_of_light <= 90) and (altitude > mpf(4.1)))
def refraction(self, tee): """Return refraction angle at location 'location' and time 'tee'.""" h = max(0, self.elevation) cap_R = 6.372E6 dip = arccos_degrees(cap_R / (cap_R + h)) return angle(0, 50, 0) + dip + secs(19) * math.sqrt(h)