def forward_mapping(self, attributes): if attributes is None: attributes=self.source.get_attribute_names_defined_in_store() source=self.source.empty_copy() channel1=self.source.new_channel_to(source) target=self.target.empty_copy() channel2=self.target.new_channel_to(target) channel3=target.new_channel_to(self.target) channel1.copy_attributes(attributes) channel2.copy_attributes(self._axes_names) nodes=self._generate_nodes(source,attributes) xpos=value_in( getattr(target,self._axes_names[0]), self._xpos_unit) ypos=value_in( getattr(target,self._axes_names[1]), self._ypos_unit) for attribute in attributes: values=to_quantity( getattr(nodes,attribute) ) unit=values.unit values=values.number samples=self.sample(values,xpos,ypos) setattr(target, attribute, (samples if unit is units.none else (samples | unit))) channel3.copy_attributes(attributes)
def forward_mapping(self, attributes): if attributes is None: attributes = self.source.get_attribute_names_defined_in_store() source = self.source.empty_copy() channel1 = self.source.new_channel_to(source) target = self.target.empty_copy() channel2 = self.target.new_channel_to(target) channel3 = target.new_channel_to(self.target) channel1.copy_attributes(attributes) channel2.copy_attributes(self._axes_names) nodes = self._generate_nodes(source, attributes) xpos = value_in(getattr(target, self._axes_names[0]), self._xpos_unit) ypos = value_in(getattr(target, self._axes_names[1]), self._ypos_unit) for attribute in attributes: values = to_quantity(getattr(nodes, attribute)) unit = values.unit values = values.number samples = self.sample(values, xpos, ypos) setattr(target, attribute, (samples if unit is units.none else (samples | unit))) channel3.copy_attributes(attributes)
def in_rev(angle): return quantities.value_in(angle,rev)
def in_deg(angle): return quantities.value_in(angle,deg)
def in_rad(angle): return quantities.value_in(angle,rad)
def in_rev(angle): return quantities.value_in(angle, rev)
def in_deg(angle): return quantities.value_in(angle, deg)
def in_rad(angle): return quantities.value_in(angle, rad)