Coverage for python/lsst/ts/dateloc/location.py : 40%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""Class for the observatory location.
This class handles keeping the necessary information for the observatory's location.
Attributes ---------- height : float The elevation of the observatory in meters. latitude_rad : float The latitude of the observatory in radians. longitude_rad : float The longitude of the observatory in radians. """
"""Initialize the class.
Parameters ---------- latitude_rad : float The latitude (radians) position of the observatory. longitude_rad : float The longitude (radians) position of the observatory. height : float The elevation (meters) of the observatory. """ self.height = height self.latitude_rad = latitude_rad self.longitude_rad = longitude_rad
def get_configure_dict(cls): """Get the configuration dictionary for the observatory location.
Returns ------- dict The configuration dictionary for the observatory location. """ lsst = simsUtils.Site(name='LSST') conf_dict = { 'obs_site': { 'latitude': lsst.latitude, 'longitude': lsst.longitude, 'height': lsst.height } } return conf_dict
def latitude(self): """float: Return the observatory's latitude in degrees. """ return math.degrees(self.latitude_rad)
def longitude(self): """float: Return the observatory's longitude in degrees. """ return math.degrees(self.longitude_rad)
"""Configure the observatory information via a dictionary.
This function requires a simple dictionary for the observatory information. The dictionary needs to look like this:
{'obs_site': {'latitude': 0.0, 'longitude': 0.0, 'height': 0.0}}
The numerical values should be replaced with proper values in the class's expected units. The latitude and longitude can be specified in degrees in the dictionary and they will be converted internally.
Parameters ---------- location_confdict : dict The observatory information. """ self.latitude_rad = math.radians(location_confdict["obs_site"]["latitude"]) self.longitude_rad = math.radians(location_confdict["obs_site"]["longitude"]) self.height = location_confdict["obs_site"]["height"]
"""A convenience function to set the observatory location for LSST. """ lsst = simsUtils.Site(name='LSST') self.latitude_rad = math.radians(lsst.latitude) self.longitude_rad = math.radians(lsst.longitude) self.height = lsst.height
"""Override the current observatory information.
Parameters ---------- latitude_rad : float The latitude (radians) position of the observatory. longitude_rad : float The longitude (radians) position of the observatory. height : float The elevation (meters) of the observatory. """ self.latitude_rad = latitude_rad self.longitude_rad = longitude_rad self.height = height |