AirmassConstraint#
- class m4opt.constraints.AirmassConstraint(max, min=1.0)[source] [edit on github]#
Bases:
AltitudeConstraintConstrains the airmass of a target by converting airmass limits to altitude limits.
The airmass is approximated as the secant of the zenith angle, which allows for an equivalent formulation in terms of altitude constraints. This class extends
AltitudeConstraintand internally converts the given airmass limits into corresponding altitude limits.- Parameters:
Notes
- The conversion from airmass to altitude follows:
altitude = arcsin(1 / airmass), assuming a standard atmosphere.
Examples
>>> from astropy.coordinates import EarthLocation, SkyCoord >>> from astropy.time import Time >>> from astropy import units as u >>> from m4opt.constraints import AirmassConstraint >>> time = Time("2017-08-17T00:41:04Z") >>> target = SkyCoord.from_name("NGC 4993") >>> location = EarthLocation.of_site("Rubin Observatory") >>> constraint = AirmassConstraint(3) >>> constraint(location, target, time) np.True_