Example #1
0
            x_stop = self.parent.sweep_coupling.sweep_time
        else:
            x_start = self.parent.frequency.start
            x_stop = self.parent.frequency.stop
        size = self.parent.traces[self.trace_name].size
        x_trace = linspace(x_start, x_stop, size, True)
        return x_trace, y_trace


add_sc_fields(ShortCutSpecAn, ShortCutSpecAn._sweep_coupling_fields, "sweep_coupling")
add_sc_fields(ShortCutSpecAn, ShortCutSpecAn._acquisition_fields, "acquisition")
add_sc_fields(ShortCutSpecAn, ShortCutSpecAn._frequency_fields, "frequency")
add_sc_fields(ShortCutSpecAn, ShortCutSpecAn._trace_related_fields, "sc_active_trace")


add_sc_fields_enum(ShortCutSpecAn, "detector_type", *choices.spec_an_detector_types._choices)
add_sc_fields_enum(ShortCutSpecAn, "tr_type", *choices.spec_an_trace_types._choices)


@register_wrapper("IVI-COM", "IviSpecAn")
class IviComSpecAn(IviComWrapper):
    trace_cls = Trace

    def __init__(self, *args, **kwds):
        super(IviComSpecAn, self).__init__(*args, **kwds)
        self.acquisition = Acquisition(self.session.Acquisition, self)
        self.display = Display(self.session.Display, self)
        self.driver_operation = DriverOperation(self.session.DriverOperation, self)
        self.external_mixer = ExternalMixer(self.session.ExternalMixer, self)
        self.frequency = Frequency(self.session.Frequency, self)
        self.identity = Identity(self.session.Identity, self)
Example #2
0
    
    def __init__(self, parent):
        super(ShortCutFreqGen, self).__init__(parent)
        self.channel_idx = 1
        
    @property
    def channel_name(self):
        return self.parent.channels.keys()[self.channel_idx-1]


add_sc_fields(ShortCutFreqGen, 
              ShortCutFreqGen._fields)
add_sc_fields(ShortCutFreqGen, 
              ShortCutFreqGen._channel_related_fields,
              'sc_active_channel')
add_sc_fields_enum(ShortCutFreqGen, 'output_mode', 'func', 'arb', 'seq')
add_sc_fields_enum(ShortCutFreqGen, 'operation_mode', 'continuous', 'burst')

@register_wrapper('IVI-C', 'IviFgen')
class IviCFGen(IviCWrapper):
    _repeated_capabilities = {}
    
    def __init__(self, *args, **kwds):
        super(IviCFGen, self).__init__(*args, **kwds)
        self.sc = ShortCutFreqGen(self)
    
    @property
    def sc_active_channel(self):
        return self.channels[self.sc.channel_name]    
        
    def create_arb_waveform(self, waveform):
Example #3
0
                               ("arb_waveform_handle", "arb_waveform_handle"),
                               ("arb_sequence_handle", "arb_sequence_handle")]

    def __init__(self, parent):
        super(ShortCutFreqGen, self).__init__(parent)
        self.channel_idx = 1

    @property
    def channel_name(self):
        return list(self.parent.channels.keys())[self.channel_idx - 1]


add_sc_fields(ShortCutFreqGen, ShortCutFreqGen._fields)
add_sc_fields(ShortCutFreqGen, ShortCutFreqGen._channel_related_fields,
              'sc_active_channel')
add_sc_fields_enum(ShortCutFreqGen, 'output_mode', 'func', 'arb', 'seq')
add_sc_fields_enum(ShortCutFreqGen, 'operation_mode', 'continuous', 'burst')


@register_wrapper('IVI-C', 'IviFgen')
class IviCFGen(IviCWrapper):
    _repeated_capabilities = {}

    def __init__(self, *args, **kwds):
        super(IviCFGen, self).__init__(*args, **kwds)
        self.sc = ShortCutFreqGen(self)

    @property
    def sc_active_channel(self):
        return self.channels[self.sc.channel_name]
Example #4
0
        super(ShortCutScope, self).__init__(parent)
        self.channel_idx = 1
        self.channel_idxs = Enum(['select channel'] + parent.channels.keys())

    @property
    def channel_name(self):
        return self.parent.channels.keys()[self.channel_idx - 1]

    def fetch(self):
        return self.parent.measurements[self.channel_name].fetch_waveform()


add_sc_fields(ShortCutScope, ShortCutScope._acquisition_fields, 'acquisition')
add_sc_fields(ShortCutScope, ShortCutScope._channel_related_fields,
              'sc_active_channel')
add_sc_fields_enum(ShortCutScope, 'ch_coupling',
                   *choices.scope_couplings._choices)
add_sc_fields_enum(ShortCutScope, 'sample_mode',
                   *choices.scope_sample_modes._choices)
add_sc_fields_enum(ShortCutScope, 'acquisition_type',
                   *choices.scope_acquisition_types._choices)


@register_wrapper('IVI-COM', 'IviScope')
class IviComScope(IviComWrapper):
    _repeated_capabilities = {}
    measurement_cls = Measurement
    channel_cls = Channel

    def __init__(self, *args, **kwds):
        super(IviComScope, self).__init__(*args, **kwds)
        self.trigger = Trigger(self.session.Trigger, self)
Example #5
0
            x_start = self.parent.frequency.start
            x_stop = self.parent.frequency.stop
        size = self.parent.traces[self.trace_name].size
        x_trace = linspace(x_start, x_stop, size, True)
        return x_trace, y_trace


add_sc_fields(ShortCutSpecAn, ShortCutSpecAn._sweep_coupling_fields,
              'sweep_coupling')
add_sc_fields(ShortCutSpecAn, ShortCutSpecAn._acquisition_fields,
              'acquisition')
add_sc_fields(ShortCutSpecAn, ShortCutSpecAn._frequency_fields, 'frequency')
add_sc_fields(ShortCutSpecAn, ShortCutSpecAn._trace_related_fields,
              'sc_active_trace')

add_sc_fields_enum(ShortCutSpecAn, 'detector_type',
                   *choices.spec_an_detector_types._choices)
add_sc_fields_enum(ShortCutSpecAn, 'tr_type',
                   *choices.spec_an_trace_types._choices)


@register_wrapper('IVI-COM', 'IviSpecAn')
class IviComSpecAn(IviComWrapper):
    trace_cls = Trace

    def __init__(self, *args, **kwds):
        super(IviComSpecAn, self).__init__(*args, **kwds)
        self.acquisition = Acquisition(self.session.Acquisition, self)
        self.display = Display(self.session.Display, self)
        self.driver_operation = DriverOperation(self.session.DriverOperation,
                                                self)
        self.external_mixer = ExternalMixer(self.session.ExternalMixer, self)
Example #6
0
            raise ValueError("Expected format either formatted or complex!")
        if format == "complex":
            y_curve = self.active_measurement.fetch_complex()
        else:
            y_curve = self.active_measurement.fetch_formatted()
        x_curve = self.active_measurement.fetch_x()
        return x_curve, y_curve


add_sc_fields(ShortCutNA, ShortCutNA._channel_related_fields,
              'sc_active_channel')
add_sc_fields(ShortCutNA, ShortCutNA._measurement_related_fields,
              'sc_active_measurement')
add_sc_fields(ShortCutNA, ShortCutNA._stimulus_range_fields,
              'sc_active_stimulus_range')
add_sc_fields_enum(ShortCutNA, 'sweep_type', *choices.na_sweep_types._choices)

add_sc_fields_enum(ShortCutNA, 'format', *choices.na_formats._choices)


class Channel(object):
    measurement_cls = Measurement

    def __init__(self, name, parent):
        self.name = name
        self.parent = parent
        self.session = parent.session.Channels[name]

        self.stimulus_range = StimulusRange(self.session.StimulusRange, self)

        pick_from_session(self, [
Example #7
0
        super(ShortCutScope, self).__init__(parent)
        self.channel_idx = 1
        self.channel_idxs = Enum(['select channel'] + parent.channels.keys())
        
    @property
    def channel_name(self):
        return self.parent.channels.keys()[self.channel_idx-1]

    def fetch(self):
        return self.parent.channels[self.channel_name].fetch_waveform()

add_sc_fields(ShortCutScope, ShortCutScope._fields_direct)
add_sc_fields(ShortCutScope,
              ShortCutScope._channel_related_fields,
              'sc_active_channel')
add_sc_fields_enum(ShortCutScope, 'ch_coupling', *choices.scope_couplings._choices)
add_sc_fields_enum(ShortCutScope, 'sample_mode', *choices.scope_sample_modes._choices)
add_sc_fields_enum(ShortCutScope, 'acquisition_type', *choices.scope_acquisition_types._choices)


@register_wrapper('IVI-C', 'IviScope')
class IviCScope(IviCWrapper):
    _repeated_capabilities = {}

    def __init__(self, *args, **kwds):
        super(IviCScope, self).__init__(*args, **kwds)
        self.sc = ShortCutScope(self)
    
    @property
    def sc_active_channel(self):
        return self.channels[self.sc.channel_name]
Example #8
0
            y_curve = self.active_measurement.fetch_formatted()
        x_curve = self.active_measurement.fetch_x()
        return x_curve, y_curve
    
    
    
add_sc_fields(ShortCutNA, 
              ShortCutNA._channel_related_fields, 
              'sc_active_channel')
add_sc_fields(ShortCutNA, 
              ShortCutNA._measurement_related_fields, 
              'sc_active_measurement')
add_sc_fields(ShortCutNA,
              ShortCutNA._stimulus_range_fields,
              'sc_active_stimulus_range')
add_sc_fields_enum(ShortCutNA, 'sweep_type', *choices.na_sweep_types._choices)

add_sc_fields_enum(ShortCutNA, 'format',  *choices.na_formats._choices)

class Channel(object):
    measurement_cls = Measurement
    def __init__(self, name, parent):
        self.name = name
        self.parent = parent
        self.session = parent.session.Channels[name]
        
        self.stimulus_range = StimulusRange(self.session.StimulusRange, self)
        
        pick_from_session(self, ['AsynchronousTriggerSweep',
                                 'Averaging',
                                 'AveragingFactor',