def iq(self, out, q): """ Function to call to evaluate the scattering intensity :param args: c-parameters, and q :return: I(q) """ return Cinvertor.iq(self, out, q) + self.background
def __setattr__(self, name, value): """ Set the value of an attribute. Access the parent class methods for x, y, err, d_max, q_min, q_max and alpha """ if name == 'x': if 0.0 in value: msg = "Invertor: one of your q-values is zero. " msg += "Delete that entry before proceeding" raise ValueError, msg return self.set_x(value) elif name == 'y': return self.set_y(value) elif name == 'err': value2 = abs(value) return self.set_err(value2) elif name == 'd_max': if value <= 0.0: msg = "Invertor: d_max must be greater than zero." msg += "Correct that entry before proceeding" raise ValueError, msg return self.set_dmax(value) elif name == 'q_min': if value is None: return self.set_qmin(-1.0) return self.set_qmin(value) elif name == 'q_max': if value is None: return self.set_qmax(-1.0) return self.set_qmax(value) elif name == 'alpha': return self.set_alpha(value) elif name == 'slit_height': return self.set_slit_height(value) elif name == 'slit_width': return self.set_slit_width(value) elif name == 'est_bck': if value == True: return self.set_est_bck(1) elif value == False: return self.set_est_bck(0) else: raise ValueError, "Invertor: est_bck can only be True or False" return Cinvertor.__setattr__(self, name, value)
def __setattr__(self, name, value): """ Set the value of an attribute. Access the parent class methods for x, y, err, d_max, q_min, q_max and alpha """ if name == 'x': if 0.0 in value: msg = "Invertor: one of your q-values is zero. " msg += "Delete that entry before proceeding" raise ValueError, msg return self.set_x(value) elif name == 'y': return self.set_y(value) elif name == 'err': value2 = abs(value) return self.set_err(value2) elif name == 'd_max': if value <= 0.0: msg = "Invertor: d_max must be greater than zero." msg += "Correct that entry before proceeding" raise ValueError, msg return self.set_dmax(value) elif name == 'q_min': if value is None: return self.set_qmin(-1.0) return self.set_qmin(value) elif name == 'q_max': if value is None: return self.set_qmax(-1.0) return self.set_qmax(value) elif name == 'alpha': return self.set_alpha(value) elif name == 'slit_height': return self.set_slit_height(value) elif name == 'slit_width': return self.set_slit_width(value) elif name == 'has_bck': if value == True: return self.set_has_bck(1) elif value == False: return self.set_has_bck(0) else: raise ValueError, "Invertor: has_bck can only be True or False" return Cinvertor.__setattr__(self, name, value)
def __init__(self): Cinvertor.__init__(self)