Osa controller¶
This is the controller for the optical spectrum analyzer (OSA), from Ando, model AQ6317B.
| copyright: | 2020 by Hyperion Authors, see AUTHORS for more details. |
|---|---|
| license: | BSD, see LICENSE for more details. |
-
class
hyperion.controller.osa.osa_controller.OsaController(settings)¶ Class for OSA controller.
Parameters: settings (dict) – this includes all the settings needed to connect to the device in question. -
end_wav¶ ” The end_wav is the end wavelength of the osa. :param end_wav: a value between 600 and 1750, must be greater than start_wav :type int
-
finalize()¶ This method closes the connection to the osa machine. This method should be called when all the things are done which you wanted to do with osa machine.
-
get_data()¶ Calculates the data created with the single sweep. Wait for OSA to finish before grabbing data
Return wav: an list of the wavelengths, spec an list with spectrum data. Rtype wav: a list of floats and a list of floats
-
initialize()¶ Starts the connection to the device with given port
-
optical_resolution¶ ” The optical resolution is the resolution of the spectrum you can take :param optical_resolution: a value that must be : 0.01, 0.02 ,0.05 ,0.1 ,0.2 ,0.5 ,1.0 ,2.0 , 5.0 :type float
-
perform_single_sweep()¶ Gives a command to the osa machine to perform a single sweep.
-
query(msg)¶ writes into the device message
Parameters: msg (string) – command to write into the device port Return ans: answer from the osa Rtype ans: string
-
sample_points¶ ” The amount of sample_points the osa machine must use in order to take a spectrum :param sample_points: the amount of points that will be on the x axis :type int
-
sensitivity¶ ” The sensitivity of the osa machine :param sensitivity_string: a string that says how much the sensitivity must be :type string
-
set_settings_for_osa()¶ in this method the parameters for the osa machine are set with hand in order to quickly get results.
-
start_wav¶ ” The start_wav is the start wavelength of the osa. :param start_wav: a value between 600 and 1750 :type int
-
wait_for_osa(timeout=None)¶ Method to let the program do nothing for a while in order to create enough time to let the osa machine take a spectrum.
Parameters: timeout – time in seconds how long the program must wait before it resumes if no timeout is specified a timeout will be calculated using self._time_constants :type timeout: float
-
-
class
hyperion.controller.osa.osa_controller.OsaControllerDummy(settings)¶ In essence we have the same methods and we re-write the query to answer something meaningful but without connecting to the real device.
-
idn()¶ Identify command
Returns: identification for the device Return type: string
-
initialize()¶ Dummy initialize
-
query(msg)¶ writes into the dummy device msg
Parameters: msg (string) – command to write into the device port
-
read()¶ Fake read that returns always the value in the dictionary FAKE RESULTS.
Returns: fake result Return type: string
-
write(msg)¶ Writes into the dummy device
Parameters: msg (string) – message to be written in the device port
-