Commit b794e0bf authored by Nick Sauerwein's avatar Nick Sauerwein
Browse files

progressing in linux move

parent 38ec8a10
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}
{
"cells": [
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from instruments.thorlabs import APTMotorController as apt"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "__init__() missing 1 required positional argument: 'idx_chan'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-2-ccad56ac2510>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmz\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mapt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mMotorChannel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m123\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m: __init__() missing 1 required positional argument: 'idx_chan'"
]
}
],
"source": [
"mz = apt.MotorChannel(123)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"ename": "SerialException",
"evalue": "[Errno 13] could not open port /dev/serial/by-id/usb-Thorlabs_APT_DC_Motor_Controller_83829619-if00-port0: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Thorlabs_APT_DC_Motor_Controller_83829619-if00-port0'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mPermissionError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/home/data/anaconda3/lib/python3.6/site-packages/serial/serialposix.py\u001b[0m in \u001b[0;36mopen\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 264\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 265\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfd\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mportstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mO_RDWR\u001b[0m \u001b[0;34m|\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mO_NOCTTY\u001b[0m \u001b[0;34m|\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mO_NONBLOCK\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 266\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mOSError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mmsg\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mPermissionError\u001b[0m: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Thorlabs_APT_DC_Motor_Controller_83829619-if00-port0'",
"\nDuring handling of the above exception, another exception occurred:\n",
"\u001b[0;31mSerialException\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-9-7266db32826e>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mapt1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mapt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mopen_serial\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'/dev/serial/by-id/usb-Thorlabs_APT_DC_Motor_Controller_83829619-if00-port0'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/home/data/anaconda3/lib/python3.6/site-packages/instruments/abstract_instruments/instrument.py\u001b[0m in \u001b[0;36mopen_serial\u001b[0;34m(cls, port, baud, vid, pid, serial_number, timeout, write_timeout)\u001b[0m\n\u001b[1;32m 521\u001b[0m \u001b[0mbaud\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mbaud\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 522\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 523\u001b[0;31m \u001b[0mwrite_timeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mwrite_timeout\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 524\u001b[0m )\n\u001b[1;32m 525\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mser\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/home/data/anaconda3/lib/python3.6/site-packages/instruments/abstract_instruments/comm/serial_manager.py\u001b[0m in \u001b[0;36mnew_serial_connection\u001b[0;34m(port, baud, timeout, write_timeout)\u001b[0m\n\u001b[1;32m 62\u001b[0m \u001b[0mbaudrate\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mbaud\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 63\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 64\u001b[0;31m \u001b[0mwriteTimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mwrite_timeout\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 65\u001b[0m ))\n\u001b[1;32m 66\u001b[0m \u001b[0mserialObjDict\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mport\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mconn\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/home/data/anaconda3/lib/python3.6/site-packages/serial/serialutil.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, port, baudrate, bytesize, parity, stopbits, timeout, xonxoff, rtscts, write_timeout, dsrdtr, inter_byte_timeout, exclusive, **kwargs)\u001b[0m\n\u001b[1;32m 238\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 239\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mport\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 240\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 241\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 242\u001b[0m \u001b[0;31m# - - - - - - - - - - - - - - - - - - - - - - - -\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/home/data/anaconda3/lib/python3.6/site-packages/serial/serialposix.py\u001b[0m in \u001b[0;36mopen\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 266\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mOSError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mmsg\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 267\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfd\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 268\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mSerialException\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmsg\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0merrno\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"could not open port {}: {}\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_port\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmsg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 269\u001b[0m \u001b[0;31m#~ fcntl.fcntl(self.fd, fcntl.F_SETFL, 0) # set blocking\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 270\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mSerialException\u001b[0m: [Errno 13] could not open port /dev/serial/by-id/usb-Thorlabs_APT_DC_Motor_Controller_83829619-if00-port0: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Thorlabs_APT_DC_Motor_Controller_83829619-if00-port0'"
]
}
],
"source": [
"apt1 = apt.open_serial('/dev/serial/by-id/usb-Thorlabs_APT_DC_Motor_Controller_83829619-if00-port0')"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from thorpy.comm.discovery import discover_stages"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import thorpy"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[]\n"
]
}
],
"source": [
"discover_stages()\n",
"\n",
"stages = list(discover_stages())\n",
"print (stages)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"import sys"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
......@@ -134,8 +134,8 @@ class Interferometer:
assert('camera not found')
cam.properties['GevSCPSPacketSize']=8000
cam.properties['TriggerMode']='On'
#cam.properties['GevSCPSPacketSize']=8000
cam.properties['TriggerMode']='Off'
cam.properties['AcquisitionFrameRateEnable']=False
cam.properties['AcquisitionFrameRateAbs']=100
cam.properties['GainRaw']=150
......
This diff is collapsed.
......@@ -19,8 +19,19 @@ For any questions concerning the software please contact Nick Sauerwein (nicksau
## To Install
1. install anaconda python 3.5 from https://www.continuum.io/downloads
2. install divers for devices, i.e.:
pip install pypylon
pip install pyepics
install pypylon:
yum install gcc gcc-c++
git clone https://github.com/mabl/PyPylon.git
python setup.py develop
install pyepics:
http://nazarovsky.ru/2016/07/11/installing-epics-core-system-on-red-hat-linux/
pip install pyepics
pip install instrumentkit
install elog:
git clone https://github.com/paulscherrerinstitute/py_elog
python setup.py install
## Start Programm
- open the terminal in the lwfaserver folder and type:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment