Beispiel #1
0
class LayoutPoint(Atom):
    """ A class which represents a point in layout space.

    """
    #: The x-coordinate of the point.
    x = Float(0.0)

    #: The y-coordinate of the point.
    y = Float(0.0)
Beispiel #2
0
class FlatCalibration(Calibration):

    sensitivity = Float().tag(metadata=True)
    fixed_gain = Float().tag(metadata=True)
    mv_pa = Property()

    def _get_mv_pa(self):
        return util.dbi(self.sensitivity) * 1e3

    def _set_mv_pa(self, value):
        self.sensitivity = util.db(value * 1e-3)

    @classmethod
    def as_attenuation(cls, vrms=1, **kwargs):
        '''
        Allows levels to be specified in dB attenuation
        '''
        return cls.from_spl(0, vrms, **kwargs)

    @classmethod
    def from_spl(cls, spl, vrms=1, **kwargs):
        '''
        Generates a calibration object based on the recorded SPL

        Parameters
        ----------
        spl : array-like
            List of magnitudes (e.g., speaker output in SPL) for the specified
            RMS voltage.
        vrms : float
            RMS voltage (in Volts)

        Additional kwargs are passed to the class initialization.
        '''
        sensitivity = util.db(vrms)-spl-util.db(20e-6)
        return cls(sensitivity, **kwargs)

    @classmethod
    def from_mv_pa(cls, mv_pa, **kwargs):
        sens = util.db(mv_pa*1e-3)
        return cls(sens, **kwargs)

    def __init__(self, sensitivity, fixed_gain=0, source=None):
        '''
        Parameters
        ----------
        sensitivity : float
            Sensitivity of system in dB(V/Pa).
        '''
        self.sensitivity = sensitivity
        self.fixed_gain = fixed_gain
        if source is not None:
            self.source = Path(source)

    def get_sens(self, frequency):
        return self.sensitivity-self.fixed_gain
Beispiel #3
0
class _Aux(HasPrefAtom):

    string = Str().tag(pref=True)
    float_n = Float().tag(pref=False)
    enum = Enum('a', 'b').tag(pref=True)
    enum_float = Enum(1.0, 2.0).tag(pref=True)
    list_ = List(Float()).tag(pref=True)
    dict_ = Dict(Str(), Float()).tag(pref=True)

    atom = Typed(_Aaux, ()).tag(pref=True)
class DoubleAttributeDeclarationType(AttributeDeclarationTypeBase):
    value = Float()
    min_value = Float(-np.inf)
    max_value = Float(np.inf)
    default = Float()

    @classmethod
    def xml_get_attributes(cls, node, attrs, namespaces, type_registry):
        attrs['default'] = float(node.get('default', 0))
        attrs['value'] = float(node.get('value', 0))
class ApplyMagFieldTask(InstrumentTask):
    """Use a supraconducting magnet to apply a magnetic field. Parallel task.

    """
    # Target magnetic field (dynamically evaluated)
    target_field = Str().tag(pref=True)

    # Rate at which to sweep the field.
    rate = Float(0.01).tag(pref=True)

    # Whether to stop the switch heater after setting the field.
    auto_stop_heater = Bool(True).tag(pref=True)

    # Time to wait before bringing the field to zero after closing the switch
    # heater.
    post_switch_wait = Float(30.0).tag(pref=True)

    parallel = set_default({'activated': True, 'pool': 'instr'})
    task_database_entries = set_default({'Bfield': 0.01})

    driver_list = ['IPS12010', 'CryomagCS4']
    loopable = True

    def perform(self, target_value=None):
        """
        """
        if not self.driver:
            self.start_driver()

        if (self.driver.owner != self.task_name
                or not self.driver.check_connection()):
            self.driver.owner = self.task_name
            self.driver.make_ready()

        if target_value is None:
            target_value = self.format_and_eval_string(self.target_field)
        self.driver.go_to_field(target_value, self.rate, self.auto_stop_heater,
                                self.post_switch_wait)
        self.write_in_database('Bfield', target_value)

    def check(self, *args, **kwargs):
        """
        """
        test, traceback = super(ApplyMagFieldTask, self).check(*args, **kwargs)
        if self.target_field:
            try:
                val = self.format_and_eval_string(self.target_field)
                self.write_in_database('Bfield', val)
            except Exception as e:
                test = False
                traceback[self.task_path + '/' + self.task_name + '-field'] = \
                    cleandoc('''Failed to eval the target field formula
                        {}: {}'''.format(self.target_field, e))

        return test, traceback
Beispiel #6
0
class StlExporter(ModelExporter):
    extension = 'stl'
    linear_deflection = Float(0.05, strict=False)
    angular_deflection = Float(0.5, strict=False)
    relative = Bool()
    binary = Bool()

    @classmethod
    def get_options_view(cls):
        with enaml.imports():
            from .options import OptionsForm
            return OptionsForm

    def export(self):
        """ Export a DeclaraCAD model from an enaml file to an STL based on the
        given options.

        Parameters
        ----------
        options: declaracad.occ.plugin.ExportOptions

        """

        # Make a compound of compounds (if needed)
        compound = TopoDS_Compound()
        builder = BRep_Builder()
        builder.MakeCompound(compound)

        # Load the enaml model file
        parts = load_model(self.filename)

        for part in parts:
            # Render the part from the declaration
            shape = part.render()

            # Must mesh the shape firsts
            if hasattr(shape, 'Shape'):
                builder.Add(compound, shape.Shape())
            else:
                builder.Add(compound, shape)

        #: Build the mesh
        exporter = StlAPI_Writer()
        # TODO: pyOCCT needs to support updating the reference
        # exporter.SetASCIIMode(not self.binary)
        mesh = BRepMesh_IncrementalMesh(compound, self.linear_deflection,
                                        self.relative, self.angular_deflection)
        mesh.Perform()
        if not mesh.IsDone():
            raise RuntimeError("Failed to create the mesh")

        exporter.Write(compound, self.path)

        if not os.path.exists(self.path):
            raise RuntimeError("Failed to write shape")
class Transform2D(Atom):
    m11 = Float(0)
    m12 = Float(0)
    m13 = Float(0)
    m21 = Float(0)
    m22 = Float(0)
    m23 = Float(0)
    m31 = Float(0)
    m32 = Float(0)
    m33 = Float(0)

    def to_list(self):
        return [
            self.m11, self.m12, self.m13, self.m21, self.m22, self.m23,
            self.m31, self.m32, self.m33
        ]

    @classmethod
    def from_list(cls, data):
        return cls(m11=data[0],
                   m12=data[1],
                   m13=data[2],
                   m21=data[3],
                   m22=data[4],
                   m23=data[5],
                   m31=data[6],
                   m32=data[7],
                   m33=data[8])
class Field(Atom):
    name = Str()
    datatype = Coerced(DataType.Flags)
    is_array = Bool()

    latency = Float(0.0)
    selector = Coerced(SelectorType.Flags)
    interval = Float(1.0)

    is_computed = Bool(False)
    is_reference = Bool(False)
Beispiel #9
0
class Cursor(PlotElement):
    """Cursor on a plot."""

    #:
    x_value = Float()

    #:
    y_value = Float()

    #:
    c_value = Float(float("nan"))
Beispiel #10
0
class derived_constants(Check):
    Gamma_el = Float(Gamma_el).tag(latex='\Gamma_{el}')
    Gamma_tot = Float(Gamma_tot).tag(latex='\Gamma')
    gamma_10 = Float(gamma_10).tag(latex='\gamma_{10}')
    hf0 = Float(h * f0).tag(latex='hf_0')
    P_ac_to_N_in = Coerced(complex)

    def _default_P_ac_to_N_in(self):
        return P_ac_to_N_in

    resonance_flux = Float(resonance_flux).tag(check_value=-0.276160914385)
Beispiel #11
0
class ChirpCalibrate(PSIContribution):

    outputs = d_(List())
    input_name = d_(Unicode())
    gain = d_(Float(-30))
    duration = d_(Float(20e-3))
    iti = d_(Float(1e-3))
    repetitions = d_(Int(64))
    show_widget = d_(Bool(True))

    result = Value()
Beispiel #12
0
class Dimension(ToolkitObject):
    """ Basic dimension

    """
    #: Reference to the implementation control
    proxy = Typed(ProxyDimension)

    #: Whether the dimension should be displayed
    display = d_(Bool(True))

    #: A string representing the color of the shape.
    color = d_(ColorMember()).tag(view=True, group='Display')

    def _default_color(self):
        return Color(0, 0, 0)

    #: A tuple or list of the (x, y, z) direction of this shape. This is
    #: coerced into a Point. The direction is relative to the dimensions axis.
    direction = d_(Coerced(Point, coercer=coerce_point))

    def _default_direction(self):
        return Point(10, 10, 10)

    #: Set the flyout distance.
    flyout = d_(Float(0.0, strict=False))

    #: Set the extension length (distance from arrow to text).
    extension_size = d_(Float(0.0, strict=False))

    #: Set the arrow tail length.
    arrow_tail_size = d_(Float(0.0, strict=False))

    #: List of shapes to create the dimension
    shapes = d_(List())

    @observe('display', 'shapes', 'color', 'direction', 'flyout',
             'extension_size', 'arrow_tail_size')
    def _update_proxy(self, change):
        super(Dimension, self)._update_proxy(change)

    def show(self):
        """ Generates the dimension

        Returns
        -------
        dimension: AIS_Dimension
            The dimension generated by this declaration.

        """
        if not self.is_initialized:
            self.initialize()
        if not self.proxy_is_active:
            self.activate_proxy()
        return self.proxy.dimension
Beispiel #13
0
class Mirror(TransformOperation):
    #: Position
    x = Float(0.0, strict=False)
    y = Float(0.0, strict=False)
    z = Float(0.0, strict=False)

    #: Mirror as plane
    plane = Bool()

    def __init__(self, x=0, y=0, z=0, **kwargs):
        super(Mirror, self).__init__(x=x, y=y, z=z, **kwargs)
Beispiel #14
0
class PlotContainer(BasePlotContainer):

    x_min = d_(Float(0))
    x_max = d_(Float(0))

    @observe('x_min', 'x_max')
    def format_container(self, event=None):
        # If we want to specify values relative to a psi context variable, we
        # cannot do it when initializing the plots.
        if (self.x_min != 0) or (self.x_max != 0):
            self.base_viewbox.setXRange(self.x_min, self.x_max, padding=0)
Beispiel #15
0
class BaseTimeseriesPlot(SinglePlot):

    rect_center = d_(Float(0.5))
    rect_height = d_(Float(1))
    fill_color = d_(Typed(object))
    brush = Typed(object)
    _rising = Typed(list, ())
    _falling = Typed(list, ())

    def _default_brush(self):
        return pg.mkBrush(self.fill_color)

    def _default_plot(self):
        plot = pg.QtGui.QGraphicsPathItem()
        plot.setPen(self.pen)
        plot.setBrush(self.brush)
        return plot

    def update(self, event=None):
        lb, ub = self.parent.data_range.current_range
        current_time = self.parent.data_range.current_time

        starts = self._rising
        ends = self._falling
        if len(starts) == 0 and len(ends) == 1:
            starts = [0]
        elif len(starts) == 1 and len(ends) == 0:
            ends = [current_time]
        elif len(starts) > 0 and len(ends) > 0:
            if starts[0] > ends[0]:
                starts = np.r_[0, starts]
            if starts[-1] > ends[-1]:
                ends = np.r_[ends, current_time]

        try:
            epochs = np.c_[starts, ends]
        except ValueError as e:
            log.exception(e)
            log.warning('Unable to update %r, starts shape %r, ends shape %r',
                        self, starts, ends)
            return

        m = ((epochs >= lb) & (epochs < ub)) | np.isnan(epochs)
        epochs = epochs[m.any(axis=-1)]

        path = pg.QtGui.QPainterPath()
        y_start = self.rect_center - self.rect_height * 0.5
        for x_start, x_end in epochs:
            x_width = x_end - x_start
            r = pg.QtCore.QRectF(x_start, y_start, x_width, self.rect_height)
            path.addRect(r)

        deferred_call(self.plot.setPath, path)
Beispiel #16
0
class RevolutionForm(AbstractRibSlot):
    #: Reference to the implementation control
    proxy = Typed(ProxyRevolutionForm)

    #: Height 1
    height1 = d_(Float(1.0, strict=False)).tag(view=True)

    #: Height 2
    height2 = d_(Float(1.0, strict=False)).tag(view=True)

    #: Sliding
    sliding = d_(Bool(False)).tag(view=True)
Beispiel #17
0
class BladeOffsetConfig(Model):
    #: BladeOffset in user units
    offset = Float(strict=False).tag(config=True)

    #: Units for display
    offset_units = Enum(*unit_conversions.keys()).tag(config=True)

    #: If the angle is less than this, consider it continuous
    cutoff = Float(5.0, strict=False).tag(config=True)

    def _default_offset_units(self):
        return 'mm'
Beispiel #18
0
class MapPolygon(ToolkitObject):
    """ A polygon on the map. """

    #: Sets the alpha (opacity) of the marker.
    points = d_(ContainerList(tuple))

    #: Specifies whether this polygon is clickable.
    clickable = d_(Bool())

    #: Adds a holes to the polygon being built.
    #: May be a list of coordinates or multiple coordinate lists
    holes = d_(ContainerList(tuple))

    #: Sets the fill color of the polygon
    fill_color = d_(Unicode())

    #: Specifies whether to draw each segment of this polyline as a geodesic
    geodesic = d_(Bool())

    #: Sets the color of the polygon
    stroke_color = d_(Unicode())

    #: Sets the joint type for all vertices of the polyline except the start and end vertices.
    stroke_joint_type = d_(Enum('', 'bevel', 'round'))

    #: Sets the width of the polyline in screen pixels.
    stroke_width = d_(Float(10, strict=False))

    #: Sets the visibility for the polygon.
    visible = d_(Bool(True))

    #: Sets the zIndex for the polygon.
    zindex = d_(Float(strict=False))

    #: Line clicked
    #: event value will have a 'result' that can be set to True
    #: to indicate the event was handled
    clicked = d_(Event(dict), writable=False)

    #: A reference to the proxy object.
    proxy = Typed(ProxyMapPolygon)

    @observe('points', 'clickable', 'holes', 'fill_color', 'geodesic',
             'stroke_joint_type', 'stroke_width', 'visible', 'zindex')
    def _update_proxy(self, change):
        """ An observer which sends the state change to the proxy.

        """
        if change['type'] == 'container':
            #: Only update what's needed
            self.proxy.update_points(change)
        else:
            super(MapPolygon, self)._update_proxy(change)
Beispiel #19
0
class BladeOffsetConfig(Model):
    #: BladeOffset in user units
    offset = Float(strict=False).tag(config=True)
    
    #: Units for display 
    offset_units = Enum(*unit_conversions.keys()).tag(config=True)
    
    #: Cutoff angle
    cutoff = Float(20.0, strict=False).tag(config=True)
    
    def _default_offset_units(self):
        return 'mm'
class TestObject(Atom):

    number = Float(2.0)
    list_of_numbers = ContainerList(Float())
    flag = Bool()

    @observe('number')
    def _add_number_to_list(self, change):
        self.list_of_numbers.append(change['value'])

    def add_to_number(self, value):
        self.number += value
Beispiel #21
0
class MapPolyline(ToolkitObject):
    """ A polyline on the map. """

    #: Sets the alpha (opacity) of the marker.
    points = d_(ContainerList(tuple))

    #: Specifies whether this polyline is clickable.
    clickable = d_(Bool())

    #: Sets the color of the polyline
    color = d_(Unicode())

    #: Sets the cap at the end vertex of the polyline
    end_cap = d_(Enum('butt', 'round', 'square'))

    #: Specifies whether to draw each segment of this polyline as a geodesic
    geodesic = d_(Bool())

    #: Sets the joint type for all vertices of the polyline except the start and end vertices.
    joint_type = d_(Enum('', 'bevel', 'round'))

    #: Sets the cap at the start vertex of the polyline
    start_cap = d_(Enum('butt', 'round', 'square'))

    #: Sets the visibility for the marker.
    visible = d_(Bool(True))

    #: Sets the width of the polyline in screen pixels.
    width = d_(Float(10, strict=False))

    #: Sets the zIndex for the marker.
    zindex = d_(Float(strict=False))

    #: Line clicked
    #: event value will have a 'result' that can be set to True
    #: to indicate the event was handled
    clicked = d_(Event(dict), writable=False)

    #: A reference to the proxy object.
    proxy = Typed(ProxyMapPolyline)

    @observe('points', 'clickable', 'color', 'end_cap', 'geodesic',
             'joint_type', 'start_cap', 'visible', 'width', 'zindex')
    def _update_proxy(self, change):
        """ An observer which sends the state change to the proxy.

        """
        if change['type'] == 'container':
            #: Only update what's needed
            self.proxy.update_points(change)
        else:
            super(MapPolyline, self)._update_proxy(change)
Beispiel #22
0
class GraphicsRectItem(AbstractGraphicsShapeItem):
    #: Proxy reference
    proxy = Typed(ProxyGraphicsRectItem)

    #: Width
    width = d_(Float(10.0, strict=False))

    #: Height
    height = d_(Float(10.0, strict=False))

    @observe("width", "height")
    def _update_proxy(self, change):
        super(GraphicsRectItem, self)._update_proxy(change)
Beispiel #23
0
class Arc(Line):
    """ Creates an Arc that can be used to build a Wire. 
    
    Attributes
    ----------
    
    radius: Float, optional
        The radius of the arc.
    alpha1: Float, optional
        The starting angle of the arc. 
    alpha2: Float, optional
        The ending angle of the arc. 
    
    Notes
    ------
    An arc can be constructed using:
    
    1. three child Points
    2. axis, radius, alpha 1, alpha 2
    3. axis, radius, and two child Points
    4. axis, radius, one child Point and alpha 1
     
    Examples
    ---------
    import math
    Wire:
        Arc: 
            attr deg = 5
            radius = 1
            alpha1 = math.radians(deg)
            alpha2 = math.radians(deg+2)
    Wire:
        Arc:
            Point:
                position = (1, 0, 0)
            Point:
                position = (2, 5, 0)
            Point:
                position = (3, 0, 0)
    
    """
    proxy = Typed(ProxyArc)

    #: Radius of the circle (optional)
    radius = d_(Float(0, strict=False)).tag(view=True)

    #: Angle circle (optional)
    alpha1 = d_(Float(0, strict=False)).tag(view=True)

    #: 2nd Angle circle (optional)
    alpha2 = d_(Float(0, strict=False)).tag(view=True)
Beispiel #24
0
class Hyperbola(Edge):
    """ Creates a Hyperbola. 
    
    Attributes
    ----------

    major_radius: Float
        The major radius of the hyperbola
    minor_radius: Float
        The minor radius of the hyperbola
    
    Notes
    ------
    
    The hyperbola is positioned in the space by the coordinate system A2 such 
    that:

    - the origin of A2 is the center of the hyperbola,
    - the "X Direction" of A2 defines the major axis of the hyperbola, that is, 
        the major radius MajorRadius is measured along this axis, and
    - the "Y Direction" of A2 defines the minor axis of the hyperbola, that is, 
        the minor radius MinorRadius is measured along this axis.
    
    This class does not prevent the creation of a hyperbola where:
    - MajorAxis is equal to MinorAxis, or
    - MajorAxis is less than MinorAxis. Exceptions Standard_ConstructionError 
        if MajorAxis or MinorAxis is negative. 
    
    Raises ConstructionError if MajorRadius < 0.0 or MinorRadius < 0.0 Raised 
        if MajorRadius < 0.0 or MinorRadius < 0.0
    
    Examples
    --------
    
    Wire:
        Hyperbola:
            major_radius = 5
            minor_radius = 3
    
    """
    proxy = Typed(ProxyHyperbola)

    #: Major radius of the hyperbola
    major_radius = d_(Float(1, strict=False)).tag(view=True)

    #: Minor radius of the hyperbola
    minor_radius = d_(Float(1, strict=False)).tag(view=True)

    @observe('major_radius', 'minor_radius')
    def _update_proxy(self, change):
        super(Hyperbola, self)._update_proxy(change)
Beispiel #25
0
class FFTContainer(BasePlotContainer):
    '''
    Contains one or more viewboxes that share the same frequency-based X-axis
    '''
    freq_lb = d_(Float(500))
    freq_ub = d_(Float(50000))
    octave_spacing = d_(Bool(True))

    def _default_x_transform(self):
        return np.log10

    @observe('container', 'freq_lb', 'freq_ub')
    def _update_x_limits(self, event):
        if not self.is_initialized:
            # This addresses a segfault that occurs when attempting to load
            # experiment manifests that use FFTContainer. If the Experiment
            # manifest attempts to set freq_lb or freq_ub, then it will attempt
            # to initialize everything else before the GUI is created, leading
            # to a segfault (creating an AxisItem leads to attempting to call
            # QGraphicsLabel.setHtml, which will segfault if there is no
            # instance of QtApplcation). By ensuring we don't continue if the
            # object is not initialized yet, we can properly load experiment
            # manifests (e.g., so that `psi` can properly list the available
            # paradigms).
            return
        self.base_viewbox.setXRange(np.log10(self.freq_lb),
                                    np.log10(self.freq_ub),
                                    padding=0)
        if self.octave_spacing:
            major_ticks = util.octave_space(self.freq_lb / 1e3,
                                            self.freq_ub / 1e3, 1.0)
            major_ticklabs = [str(t) for t in major_ticks]
            major_ticklocs = np.log10(major_ticks * 1e3)
            minor_ticks = util.octave_space(self.freq_lb / 1e3,
                                            self.freq_ub / 1e3, 0.125)
            minor_ticklabs = [str(t) for t in minor_ticks]
            minor_ticklocs = np.log10(minor_ticks * 1e3)
            ticks = [
                list(zip(major_ticklocs, major_ticklabs)),
                list(zip(minor_ticklocs, minor_ticklabs)),
            ]
            self.x_axis.setTicks(ticks)
        else:
            self.x_axis.setTicks()

    def _default_x_axis(self):
        x_axis = super()._default_x_axis()
        x_axis.setLabel('Frequency', units='Hz')
        x_axis.logTickStrings = format_log_ticks
        x_axis.setLogMode(True)
        return x_axis
Beispiel #26
0
class AWG(Instrument, AWGDriver):
    isMaster = Bool(False).tag(desc='Whether this AWG is master')
    triggerSource = Enum('Internal', 'External').tag(desc='Source of trigger')
    triggerInterval = Float(1e-4).tag(desc='Internal trigger interval')
    samplingRate = Float(1200000000).tag(desc='Sampling rate in Hz')
    numChannels = Int()
    channels = List(AWGChannel)
    seqFile = Str().tag(desc='Path to sequence file.')
    seqForce = Bool(True).tag(desc='Whether to reload the sequence')
    delay = Float(0.0).tag(desc='time shift to align multiple AWGs')

    def __init__(self, **traits):
        super(AWG, self).__init__(**traits)
        if not self.channels:
            for ct in range(self.numChannels):
                self.channels.append(AWGChannel())

    def json_encode(self, matlabCompatible=False):
        jsonDict = super(AWG, self).json_encode(matlabCompatible)

        #The seq file extension is constant so don't encode
        del jsonDict["seqFileExt"]

        if matlabCompatible:
            channels = jsonDict.pop('channels', None)
            for ct, chan in enumerate(channels):
                jsonDict['chan_{}'.format(ct + 1)] = chan
        return jsonDict

    def update_from_jsondict(self, params):

        for ct in range(self.numChannels):
            channelParams = params['channels'][ct]

            # if this is still a raw dictionary convert to object
            if isinstance(channelParams, dict):
                channelParams.pop('x__class__', None)
                channelParams.pop('x__module__', None)
                channelParams = AWGChannel(**channelParams)

            self.channels[ct].label = channelParams.label
            self.channels[ct].amplitude = channelParams.amplitude
            self.channels[ct].offset = channelParams.offset
            self.channels[ct].enabled = channelParams.enabled

        for p in [
                'label', 'enabled', 'address', 'isMaster', 'triggerSource',
                'triggerInterval', 'samplingRate', 'seqFile', 'seqForce',
                'delay'
        ]:
            setattr(self, p, params[p])
Beispiel #27
0
class Waypoint(Atom):
    X = Float()
    Y = Float()
    Z = Float()
    A = Float()
    B = Float()
    C = Float()
    U = Float()
    V = Float()
    W = Float()
Beispiel #28
0
class _Aux(HasPrefAtom):

    string = Unicode().tag(pref=True)
    float_n = Float().tag(pref=False)
    enum = Enum('a', 'b').tag(pref=True)
    enum_float = Enum(1.0, 2.0).tag(pref=True)
    list_ = List(Float()).tag(pref=True)
    dict_ = Dict(Unicode(), Float()).tag(pref=True)
    value = Value().tag(pref=True)
    const = Constant('r').tag(pref=True)

    atom = Typed(_Aaux, ()).tag(pref=True)

    no_tag = Int()
Beispiel #29
0
class Ellipse(Edge):
    """ A2 locates the circle and gives its orientation in 3D space.
    """
    proxy = Typed(ProxyEllipse)

    #: Radius of the ellipse
    major_radius = d_(Float(1, strict=False)).tag(view=True)

    #: Minor radius of the ellipse
    minor_radius = d_(Float(1, strict=False)).tag(view=True)

    @observe('major_radius', 'minor_radius')
    def _update_proxy(self, change):
        super(Ellipse, self)._update_proxy(change)
Beispiel #30
0
class ToneCalibrate(PSIContribution):

    outputs = d_(Dict())
    input_name = d_(Unicode())
    gain = d_(Float(-40))
    duration = d_(Float(100e3))
    iti = d_(Float(0))
    trim = d_(Float(10e-3))
    max_thd = d_(Value(None))
    min_snr = d_(Value(None))
    selector_name = d_(Unicode('default'))
    show_widget = d_(Bool(True))

    result = Value()