Skip to content

Commit

Permalink
Fix quote consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
jak574 committed Jan 14, 2024
1 parent 240424a commit c90ef9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions astroplan/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def _get_solar_altitudes(self, times, observer, targets):
if not hasattr(observer, '_altaz_cache'):
observer._altaz_cache = {}

aakey = _make_cache_key(times, 'sun')
aakey = _make_cache_key(times, "sun")

if aakey not in observer._altaz_cache:
try:
Expand All @@ -432,7 +432,7 @@ def _get_solar_altitudes(self, times, observer, targets):
observer.pressure = 0

# find solar altitude at these times
altaz = observer.altaz(times, observer.get_body('sun', times))
altaz = observer.altaz(times, observer.get_body("sun", times))
altitude = altaz.alt
# cache the altitude
observer._altaz_cache[aakey] = dict(times=times,
Expand Down Expand Up @@ -510,7 +510,7 @@ def compute_constraint(self, times, observer, targets):
# centred frame, so the separation is as-seen
# by the observer.
# 'get_sun' returns ICRS coords.
sun = observer.get_body('sun', times)
sun = observer.get_body("sun", times)
targets = get_skycoord(targets)
solar_separation = sun.separation(targets)

Expand Down
16 changes: 8 additions & 8 deletions astroplan/observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ def get_body(self, body, time, ephemeris=None):
>>> from astropy.coordinates import SkyCoord
>>> apo = Observer.at_site("APO")
>>> time = Time('2001-02-03 04:05:06')
>>> target = apo.get_body('sun', time)
>>> target = apo.get_body("sun", time)
"""
if not isinstance(time, Time):
time = Time(time)
Expand Down Expand Up @@ -687,7 +687,7 @@ def altaz(self, time, target=None, obswl=None, grid_times_targets=False):
if target is MoonFlag:
target = self.get_body("moon", time)
elif target is SunFlag:
target = self.get_body('sun', time)
target = self.get_body("sun", time)

time, target = self._preprocess_inputs(time, target, grid_times_targets)

Expand Down Expand Up @@ -1440,7 +1440,7 @@ def sun_rise_time(self, time, which='nearest', horizon=0*u.degree, n_grid_points
>>> print("ISO: {0.iso}, JD: {0.jd}".format(sun_rise)) # doctest: +SKIP
ISO: 2001-02-02 14:02:50.554, JD: 2451943.08531
"""
return self.target_rise_time(time, self.get_body('sun', time), which, horizon,
return self.target_rise_time(time, self.get_body("sun", time), which, horizon,
n_grid_points=n_grid_points)

@u.quantity_input(horizon=u.deg)
Expand Down Expand Up @@ -1491,7 +1491,7 @@ def sun_set_time(self, time, which='nearest', horizon=0*u.degree, n_grid_points=
>>> print("ISO: {0.iso}, JD: {0.jd}".format(sun_set)) # doctest: +SKIP
ISO: 2001-02-04 00:35:42.102, JD: 2451944.52479
"""
return self.target_set_time(time, self.get_body('sun', time), which, horizon,
return self.target_set_time(time, self.get_body("sun", time), which, horizon,
n_grid_points=n_grid_points)

def noon(self, time, which='nearest', n_grid_points=150):
Expand Down Expand Up @@ -1520,7 +1520,7 @@ def noon(self, time, which='nearest', n_grid_points=150):
`~astropy.time.Time`
Time at solar noon
"""
return self.target_meridian_transit_time(time, self.get_body('sun', time), which,
return self.target_meridian_transit_time(time, self.get_body("sun", time), which,
n_grid_points=n_grid_points)

def midnight(self, time, which='nearest', n_grid_points=150):
Expand Down Expand Up @@ -1549,7 +1549,7 @@ def midnight(self, time, which='nearest', n_grid_points=150):
`~astropy.time.Time`
Time at solar midnight
"""
return self.target_meridian_antitransit_time(time, self.get_body('sun', time), which,
return self.target_meridian_antitransit_time(time, self.get_body("sun", time), which,
n_grid_points=n_grid_points)

# Twilight convenience functions
Expand Down Expand Up @@ -1935,7 +1935,7 @@ def sun_altaz(self, time):
if not isinstance(time, Time):
time = Time(time)

sun = self.get_body('sun', time)
sun = self.get_body("sun", time)
return self.altaz(time, sun)

@u.quantity_input(horizon=u.deg)
Expand Down Expand Up @@ -2045,7 +2045,7 @@ def is_night(self, time, horizon=0*u.deg, obswl=None):
if not isinstance(time, Time):
time = Time(time)

solar_altitude = self.altaz(time, target=self.get_body('sun', time), obswl=obswl).alt
solar_altitude = self.altaz(time, target=self.get_body("sun", time), obswl=obswl).alt

if solar_altitude.isscalar:
return bool(solar_altitude < horizon)
Expand Down

0 comments on commit c90ef9a

Please sign in to comment.