Repository: microsoft/Qcodes

Issue:
AWG 5014 ref clock bad parameter name /confusion 
The AWG 5014 driver has two distinct "parameters" in the hardware, 
- Clock source -> int or ext 
- Reference oscillator -> int or ext
![image](https://cloud.githubusercontent.com/assets/6142932/24244655/209c178c-0fc0-11e7-8f63-8ca102bf1acf.png)


The recently updated 5014 driver introduces a 'parameter' ref_clock_source. 
https://github.com/QCoDeS/Qcodes/blob/master/qcodes/instrument_drivers/tektronix/AWG5014.py#L160
This refers to using an internal or external clock and and has nothing to do with the reference oscillator, making this a confusing name. 
Additionally there is no parameter that sets the reference oscillator. 

The driver does contain some reference to these parameter under their proper name. 
https://github.com/QCoDeS/Qcodes/blob/master/qcodes/instrument_drivers/tektronix/AWG5014.py#L847-L852

I would suggest the following fix. 
- Rename the `ref_clock_source` parameter to `clock_source`. 
- Add a parameter for the `reference_source`
 Both of these names are the names that the AWG uses internally, both in it's GUI as in it's sequencer config. 

@WilliamHPNielsen as author of the recent fix, do you agree with these changes? If so I will be sending a PR shortly. 
AWG 5014 ref clock bad parameter name /confusion 
The AWG 5014 driver has two distinct "parameters" in the hardware, 
- Clock source -> int or ext 
- Reference oscillator -> int or ext
![image](https://cloud.githubusercontent.com/assets/6142932/24244655/209c178c-0fc0-11e7-8f63-8ca102bf1acf.png)


The recently updated 5014 driver introduces a 'parameter' ref_clock_source. 
https://github.com/QCoDeS/Qcodes/blob/master/qcodes/instrument_drivers/tektronix/AWG5014.py#L160
This refers to using an internal or external clock and and has nothing to do with the reference oscillator, making this a confusing name. 
Additionally there is no parameter that sets the reference oscillator. 

The driver does contain some reference to these parameter under their proper name. 
https://github.com/QCoDeS/Qcodes/blob/master/qcodes/instrument_drivers/tektronix/AWG5014.py#L847-L852

I would suggest the following fix. 
- Rename the `ref_clock_source` parameter to `clock_source`. 
- Add a parameter for the `reference_source`
 Both of these names are the names that the AWG uses internally, both in it's GUI as in it's sequencer config. 

@WilliamHPNielsen as author of the recent fix, do you agree with these changes? If so I will be sending a PR shortly. 


Discussion:

Resolving patch:
diff --git a/qcodes/instrument_drivers/tektronix/AWG5014.py b/qcodes/instrument_drivers/tektronix/AWG5014.py
--- a/qcodes/instrument_drivers/tektronix/AWG5014.py
+++ b/qcodes/instrument_drivers/tektronix/AWG5014.py
@@ -157,12 +157,20 @@ def __init__(self, name, address, timeout=180, **kwargs):
                            vals=vals.Enum('CONT', 'TRIG', 'SEQ', 'GAT'),
                            get_parser=self.newlinestripper
                            )
-        self.add_parameter('ref_clock_source',
-                           label='Reference clock source',
+        self.add_parameter('clock_source',
+                           label='Clock source',
                            get_cmd='AWGControl:CLOCk:SOURce?',
                            set_cmd='AWGControl:CLOCk:SOURce ' + '{}',
                            vals=vals.Enum('INT', 'EXT'),
                            get_parser=self.newlinestripper)
+
+        self.add_parameter('ref_source',
+                           label='Reference source',
+                           get_cmd='SOURce1:ROSCillator:SOURce?',
+                           set_cmd='SOURce1:ROSCillator:SOURce ' + '{}',
+                           vals=vals.Enum('INT', 'EXT'),
+                           get_parser=self.newlinestripper)
+
         self.add_parameter('DC_output',
                            label='DC Output (ON/OFF)',
                            get_cmd='AWGControl:DC:STATe?',
@@ -331,8 +339,9 @@ def __init__(self, name, address, timeout=180, **kwargs):
                                get_cmd=filter_cmd + '?',
                                set_cmd=filter_cmd + ' {}',
                                vals=vals.Enum(20e6, 100e6, 9.9e37,
+                                              np.float('inf'),
                                               'INF', 'INFinity'),
-                               get_parser=float)
+                               get_parser=self._tek_outofrange_get_parser)
             self.add_parameter('ch{}_DC_out'.format(i),
                                label='DC output level channel {}'.format(i),
                                unit='V',
@@ -387,6 +396,14 @@ def newlinestripper(self, string):
             else:
                 return string
 
+    def _tek_outofrange_get_parser(self, string):
+        val = float(string)
+        # note that 9.9e37 is used as a generic out of range value
+        # in tektronix instruments
+        if val >= 9.9e37:
+            val = np.float('INF')
+        return val
+
     # Functions
     def get_all(self, update=True):
         """


Test patch: