Skip to content

Commit

Permalink
Add warning if temperature is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisherlevine committed Oct 27, 2023
1 parent 34b8a8b commit b35964d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/lsst/atmospec/spectraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,13 @@ def setAdrParameters(self, spectrum, exp):
hourAngle = asCoords.Angle(hourAngle.asDegrees(), unit=u.deg)

weather = vi.getWeather()

_temperature = weather.getAirTemperature()
temperature = _temperature if not np.isnan(_temperature) else 10 # maybe average?
if _temperature is None or np.isnan(_temperature):
self.log.warning("Temperature not set, using nominal value of 10 C")
_temperature = 10 # nominal value
temperature = _temperature

_pressure = weather.getAirPressure()
if _pressure is not None and not np.isnan(_pressure):
if _pressure > 10_000:
Expand Down

0 comments on commit b35964d

Please sign in to comment.