Coverage for python/lsst/sims/utils/ObservationMetaData.py : 94%

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
"""Observation Metadata
This class contains any metadata for a query which is associated with a particular telescope pointing, including bounds in RA and DEC, and the time of the observation.
**Parameters**
All parameters are optional. It is possible to instantiate an ObservationMetaData that is empty of data.
* pointing[RA,Dec] float The coordinates of the pointing (in degrees; in the International Celestial Reference System)
* boundType characterizes the shape of the field of view. Current options are 'box, and 'circle'
* boundLength is the characteristic length scale of the field of view in degrees.
If boundType is 'box', boundLength can be a float(in which case boundLength is half the length of the side of each box) or boundLength can be a numpy array in which case the first argument is half the width of the RA side of the box and the second argument is half the Dec side of the box.
If boundType is 'circle,' this will be the radius of the circle.
The bound will be centered on the point (pointingRA, pointingDec), however, because objects are stored at their mean RA, Dec in the LSST databases (i.e. they are stored at values of RA, Dec which neglect proper motion), the bounds applied to database queries will be made slightly larger so that queries can be reasonably expected to return all of the objects within the desired field of view once those corrections have been applied.
* mjd : Either a float (in which case, it will be assumed to be in International Atomic Time), or an instantiation of the ModifiedJulianDate class representing the date of the observation
* bandpassName : a char (e.g. 'u') or list (e.g. ['u', 'g', 'z']) denoting the bandpasses used for this particular observation
* site: an instantiation of the lsst.sims.utils.Site class characterizing the site of the observatory.
* m5: float or list this should be the 5-sigma limiting magnitude in the bandpass or bandpasses specified in bandpassName. Ultimately, m5 will be stored in a dict keyed to the bandpassName (or Names) you passed in, i.e. you will be able to access m5 from outside of this class using, for example:
myObservationMetaData.m5['u']
* skyBrightness: float the magnitude of the sky in the filter specified by bandpassName
* seeing float or list Analogous to m5, corresponds to the seeing in arcseconds in the bandpasses in bandpassName
* rotSkyPos float The orientation of the telescope in degrees. This is used by the Astrometry mixins in sims_coordUtils.
The convention for rotSkyPos is as follows:
rotSkyPos = 0 means north is in the +y direction on the focal plane and east is +x
rotSkyPos = 90 means north is +x and east is -y
rotSkyPos = -90 means north is -x and east is +y
rotSkyPos = 180 means north is -y and east is -x
This should be consistent with PhoSim conventions.
**Examples**:: >>> data = ObservationMetaData(boundType='box', pointingRA=5.0, pointingDec=15.0, boundLength=5.0)
""" mjd=None, pointingRA=None, pointingDec=None, rotSkyPos=None, bandpassName=None, site=Site(name='LSST'), m5=None, skyBrightness=None, seeing=None):
else: raise RuntimeError("You must pass either a float or a ModifiedJulianDate " "as the kwarg mjd to ObservationMetaData") else:
else:
else:
else:
else:
def summary(self):
else: mydict['mjd'] = self.mjd.TAI
# mydict['m5'] = self.m5
return False
return False
""" This method sets up a dict of either m5 or seeing values (or any other quantity keyed to bandpassName). It reads in a list of values and associates them with the list of bandpass names in self._bandpass.
Note: this method assumes that self._bandpass has already been set. It will raise an exception of self._bandpass is None.
@param [in] inputValue is a single value or list of m5/seeing/etc. corresponding to the bandpasses stored in self._bandpass
@param [in] inputName is the name of the paramter stored in inputValue (for constructing helpful error message)
@param [out] returns a dict of inputValue values keed to self._bandpass """
else:
raise RuntimeError('You cannot set %s if you have not set ' % inputName + 'bandpass in ObservationMetaData')
'but did not pass a list of %s to ObservationMetaData' % inputName)
'but did not pass a list of bandpass names to ObservationMetaData')
'has a different length than the list of bandpass names you passed')
# now build the dict raise RuntimeError('In ObservationMetaData you tried to assign bandpass ' + 'and %s with lists of different length' % inputName)
else:
""" Set up the member variable self._bounds.
If self._boundType, self._boundLength, self._pointingRA, or self._pointingDec are None, nothing will happen. """
return
self._boundLength)
def pointingRA(self): """ The RA of the telescope pointing in degrees (in the International Celestial Reference System). """ else:
def pointingRA(self, value):
def pointingDec(self): """ The Dec of the telescope pointing in degrees (in the International Celestial Reference System). """ else:
def pointingDec(self, value):
def boundLength(self): """ Either a list or a float indicating the size of the field of view associated with this ObservationMetaData.
See the documentation in the SpatialBounds class for more details (specifically, the 'length' paramter).
In degrees (Yes: the documentation in SpatialBounds says that the length should be in radians. The present class converts from degrees to radians before passing to SpatialBounds). """
def boundLength(self, value):
def boundType(self): """ Tag indicating what sub-class of SpatialBounds should be instantiated for this ObservationMetaData. """
def boundType(self, value):
def bounds(self): """ Instantiation of a sub-class of SpatialBounds. This is what actually construct the WHERE clause of the SQL query associated with this ObservationMetaData. """
def rotSkyPos(self): """ The rotation of the telescope with respect to the sky in degrees. It is a parameter you should get from OpSim. """ else:
def rotSkyPos(self, value):
def m5(self): """ A dict of m5 (the 5-sigma limiting magnitude) values associated with the bandpasses represented by this ObservationMetaData. """
def m5(self, value):
def seeing(self): """ A dict of seeing values in arcseconds associated with the bandpasses represented by this ObservationMetaData """
def seeing(self, value):
def site(self): """ An instantiation of the Site class containing information about the telescope site. """
def site(self, value):
def mjd(self): """ The MJD of the observation associated with this ObservationMetaData. """
def mjd(self, value): """ Either a float or a ModifiedJulianDate. If a float, this setter assumes that you are passing in International Atomic Time """ else: raise RuntimeError("You can only set mjd to either a float or a ModifiedJulianDate")
def bandpass(self): """ The bandpass associated with this ObservationMetaData. Can be a list. """
""" Set the bandpasses and associated 5-sigma limiting magnitudes and seeing values for this ObservationMetaData.
@param [in] bandpassName is either a char or a list of chars denoting the name of the bandpass associated with this ObservationMetaData.
@param [in] m5 is the 5-sigma-limiting magnitude(s) associated with bandpassName
@param [in] seeing is the seeing(s) in arcseconds associated with bandpassName
Nothing is returned. This method just sets member variables of this ObservationMetaData. """
def skyBrightness(self): """ The sky brightness in mags per square arcsecond associated with this ObservationMetaData. """
def skyBrightness(self, value):
def OpsimMetaData(self): """ A dict of all of the columns taken from OpSim when constructing this ObservationMetaData """
def OpsimMetaData(self, value): |