def __init__(self, value, err2, units, selector, **kwargs): """ Class constructor @param value: The values associated with the information @type value: C{list} of C{tuple}s or C{tuple} @param err2: The uncertainties squared associated with the values @type err2: C{list} of C{tuple}s or C{tuple} @param selector: The name of an index selector @type selector: C{string} @param kwargs: A list of key word arguments. This list is reserved for the use of passing key words arguments to the index selector. """ import indexselector self.__value__ = value self.__err2__ = err2 self.__units__ = units self.__selector__ = indexselector.getIndexSelector(selector, **kwargs)
def __init__(self, **kwargs): """ Class constructor @param kwargs: A list of key word arguments that the class accepts: @keyword instrument: The short name of the instrument. @type instrument: C{string} @keyword azimuthal: The values of the azimuthal angle. @type azimuthal: C{list} of C{tuple}s or C{tuple} @keyword azimuthal_err2: The values of the square of the uncertainty in the azimuthal angle. @type azimuthal_err2: C{list} of C{tuple}s or C{tuple} @keyword azimuthal_selector: The name of the index selector for the azimuthal angle. @type azimuthal_selector: C{string} @keyword det_secondary: The values of the detector bank secondary flight path and it's associated uncertainty. @type det_secondary: C{tuple} @keyword polar: The values of the polar angle. @type polar: C{list} of C{tuple}s or C{tuple} @keyword polar_err2: The values of the square of the uncertainty in the polar angle. @type polar_err2: C{list} of C{tuple}s or C{tuple} @keyword polar_selector: The name of the index selector for the polar angle. @type polar_selector: C{string} @keyword secondary: The values of the secondary flight path. @type secondary: C{list} of C{tuple}s or C{tuple} @keyword secondary_err2: The values of the square of the uncertainty in the secondary flight path. @type secondary_err2: C{list} of C{tuple}s or C{tuple} @keyword secondary_selector: The name of the index selector for the secondary flight path. @type secondary_selector: C{string} @keyword extra: The maximum value for the fastest running index. This is necessary if the L{IJSelector} is used. @type extra: C{int} @keyword diff_geom: A dictionary containing the differential geometry for the instrument. @type diff_geom: C{dict} @keyword x_pix_offset: The values of the x pixel offsets. @type x_pix_offset: C{list} of C{tuple}s or C{tuple} @keyword y_pix_offset: The values of the y pixel offsets. @type y_pix_offset: C{list} of C{tuple}s or C{tuple} """ # primary flight path try: self.__L0 = kwargs["primary"] except KeyError: self.__L0 = None # detector secondary flight path try: self.__L1 = kwargs["det_secondary"] except KeyError: self.__L1 = None #secondary flight path try: self.__secondary__ = kwargs["secondary"] except KeyError: self.__secondary__ = None try: self.__secondary_err2__ = kwargs["secondary_err2"] if self.__secondary__ is None: self.__secondary_err2__ = None except KeyError: self.__secondary_err2__ = None # polar angle try: self.__polar__ = kwargs["polar"] except KeyError: self.__polar__ = None try: self.__polar_err2__ = kwargs["polar_err2"] if self.__polar__ is None: self.__polar_err2__ = None except KeyError: self.__polar_err2__ = None # azimuthal angle try: self.__azimuthal__ = kwargs["azimuthal"] except KeyError: self.__azimuthal__ = None try: self.__azimuthal_err2__ = kwargs["azimuthal_err2"] if self.__azimuthal__ is None: self.__azimuthal_err2__ = None except KeyError: self.__azimuthal_err2__ = None # set the instrument short name try: self.__inst__ = kwargs["instrument"] try: # uppercase version of instrument name self.__inst__ = self.__inst__.upper() except AttributeError: self.__inst__ = "" except KeyError: self.__inst__ = "" try: extra = kwargs["extra"] except KeyError: extra = None # Set the instrument differential geometry dictionary (if present) try: self.__diff_geom__ = kwargs["diff_geom"] if self.__diff_geom__ is not None: self.__diff_geom_keys__ = self.__diff_geom__.keys() else: self.__diff_geom_keys__ = None except KeyError: self.__diff_geom__ = None self.__diff_geom_keys__ = None # x pixel offsets try: self.__x_pix_offset__ = kwargs["x_pix_offset"] except KeyError: self.__x_pix_offset__ = None # y pixel offsets try: self.__y_pix_offset__ = kwargs["y_pix_offset"] except KeyError: self.__y_pix_offset__ = None # set the selectors from indexselector import getIndexSelector self.__azimuthal_selector__ = getIndexSelector("IJSelector", Nj=extra) self.__polar_selector__ = getIndexSelector("IJSelector", Nj=extra) self.__secondary_selector__ = getIndexSelector("IJSelector", Nj=extra) self.__xoff_selector__ = getIndexSelector("ISelector") self.__yoff_selector__ = getIndexSelector("JSelector") # override capability mainly for backwards compatibility try: az_sel_name = kwargs["azimuthal_selector"] if az_sel_name is not None: self.__azimuthal_selector__ = getIndexSelector(az_sel_name, Nj=extra) except KeyError: pass try: pol_sel_name = kwargs["polar_selector"] if pol_sel_name is not None: self.__polar_selector__ = getIndexSelector(pol_sel_name, Nj=extra) except KeyError: pass try: sec_sel_name = kwargs["secondary_selector"] if sec_sel_name is not None: self.__secondary_selector__ = getIndexSelector(sec_sel_name, Nj=extra) except KeyError: pass