def __call__(self, **params): p = ParamOverrides(self, params, allow_extra_keywords=True) self._set_presenter_overrides(p) if not p.num_orientation % 2: raise Exception("Use odd number of surround orientation to ensure" "the orthogonal to the preferred orientation is" "covered.") results = {} for coord in p.coords: self.or_surrounds = [] orientation = p.preference_lookup_fn('orientation', p.outputs[0], coord, default=p.orientation_center) p.orientationcenter = orientation orientation_step = np.pi / (p.num_orientation - 1) for i in xrange(0, p.num_orientation - 1): self.or_surrounds.append( orientation - np.pi / 2 + i * orientation_step) p.x = p.preference_lookup_fn('x', p.outputs[0], coord, default=coord[0]) p.y = p.preference_lookup_fn('y', p.outputs[0], coord, default=coord[1]) results[coord] = self._compute_curves(p) results = self._populate_grid(results) self._restore_presenter_defaults() return results
def __call__(self, **params): p = ParamOverrides(self, params, allow_extra_keywords=True) self._set_presenter_overrides(p) results = {} for coord in p.coords: p.x = p.preference_lookup_fn('x', p.outputs[0], coord, default=coord[0]) p.y = p.preference_lookup_fn('y', p.outputs[0], coord, default=coord[1]) results[coord] = self._compute_curves(p) self._restore_presenter_defaults() return results
def __call__(self, **params): p = ParamOverrides(self, params, allow_extra_keywords=True) self._set_presenter_overrides(p) results = {} for coord in p.coords: # Orientations are stored as a normalized value beween 0 # and 1, so we scale them by pi to get the true orientations. p.orientation = p.preference_lookup_fn('orientation', p.outputs[0], coord) p.x = p.preference_lookup_fn('x', p.outputs[0], coord, default=coord[0]) p.y = p.preference_lookup_fn('y', p.outputs[0], coord, default=coord[1]) results[coord] = self._compute_curves(p) self._restore_presenter_defaults() return results
def __call__(self, **params): p = ParamOverrides(self, params, allow_extra_keywords=True) self._set_presenter_overrides(p) results = {} for coord in p.coords: orientation = p.preference_lookup_fn('orientation', p.outputs[0], coord) self.curve_parameters = [{"orientation": orientation + ro} for ro in p.relative_orientations] p.x = p.preference_lookup_fn('x', p.outputs[0], coord, default=coord[0]) p.y = p.preference_lookup_fn('y', p.outputs[0], coord, default=coord[1]) results[coord] = self._compute_curves(p, val_format="%.4f") self._restore_presenter_defaults() return results
def __call__(self, **params): p = ParamOverrides(self, params, allow_extra_keywords=True) self._set_presenter_overrides(p) results = {} for coord in p.coords: orientation = p.preference_lookup_fn('orientation', p.outputs[0], coord, default=p.orientation_center) p.orientationcenter = orientation p.phase = p.preference_lookup_fn('phase', p.outputs[0], coord, default=p.orientation_center) p.x = p.preference_lookup_fn('x', p.outputs[0], coord, default=coord[0]) p.y = p.preference_lookup_fn('y', p.outputs[0], coord, default=coord[1]) self.or_surrounds = list(np.linspace(-np.pi/2, np.pi/2, p.num_orientation)) results[coord] = self._compute_curves(p) results = self._populate_grid(results) self._restore_presenter_defaults() return results
def __call__(self, **params): p = ParamOverrides(self, params, allow_extra_keywords=True) self._set_presenter_overrides(p) results = {} for coord in p.coords: self.or_surrounds = [] orientation = p.preference_lookup_fn('orientation', p.outputs[0], coord, default=p.orientation_center) p.orientationcenter = orientation orientation_step = np.pi / (p.num_orientation - 1) for i in xrange(0, p.num_orientation - 1): self.or_surrounds.append( orientation - np.pi / 2 + i * orientation_step) p.x = p.preference_lookup_fn('x', p.outputs[0], coord, default=coord[0]) p.y = p.preference_lookup_fn('y', p.outputs[0], coord, default=coord[1]) results[coord] = self._compute_curves(p) self._restore_presenter_defaults() return results