This project contains all the components for performing an LCOGT pilot test of the Atik Titan camera.
The goals is to wrap the C/C++ Artik/Artemis code in Python.
To build:
c:\<project-dir>\build.bat
To run test program:
c:\<project-dir>\artemis.bat
In general the Artemis SDK functions work as explained in the Artemis SDK documentation.
Functions that take pointers for use as return values have been modified.
Function Name | Example |
---|---|
ArtemisGetImageData |
return_code, x, y, w, h, bin_x, bin_y = ArtemisGetImageData(device_handle)
|
ArtemisGetSubframe |
return_code, x, y, w, h = ArtemisGetSubframe(device_handle)
|
ArtemisGetBin |
return_code, x, y = ArtemisBin(device_handle)
|
ArtemisColourProperties |
return_code, colour_type, normal_offset_x, normal_offset_y,
preview_offset_x, preview_offset_y =
ArtemisColourProperties(device_handle)
|
Functions whose return types are not inherently compatible with Python now have similarly-named wrapper functions.
Name/Source | Return Type | Example |
---|---|---|
|
PyString |
device_name = ArtemisDeviceName_pythonString(device_number)
|
|
PyString |
device_serial = ArtemisDeviceSerial_pythonString(device_number)
|
|
PyDict |
device_properties = ArtemisProperties_pythonDictionary(device_handle)
|
|
PyList |
device_serial = ArtemisImageBuffer_pythonList(device_handle)
|
The following functions are unimplemented, or not recommended.
Name | Reason |
---|---|
ArtemisFTName | Deprecated |
ArtemisFTSerial | Deprecated |
ArtemisGetImageArray | Unknown behavior. Replaced by ArtemisImageBuffer_pythonList |
ArtemisSendPeripheralMessage | Diagnostic method: currently unnecessary |
ArtemisIsLicensed | Diagnostic method: currently unnecessary |
artemishsc.i
. For example, given int example(float *response)
:
%apply int *OUTPUT { float *response};
int example(float *response);
<tr><td><code>artemis.bat</code></td><td>Wrapper to execute <code>artemis.py<code></td></tr>
<tr><td><code>artemis.py</code></td><td>Example Python script exercising the Artemis API (outputs <code>titan.fits</code>)</td></tr>
<tr><td><code>artemishsc.i</code></td><td>The <a href="http://www.swig.org/">SWIG</a> interface file</td></tr>
<tr><td><code>artemishsc.py</code></td><td>yyy</td></tr>
<tr><td><code>artemishsc.pyc</code></td><td><i>Auto-generated by SWIG</i></td></tr>
<tr><td><code>artemishsc_wrap.c</code></td><td><i>Auto-generated by SWIG</i></td></tr>
<tr><td><code>ArtemisHscAPI.cpp</code></td><td>The Artemis SDK code (vendor provided)</td></tr>
<tr><td><code>ArtemisHscAPI.h</code></td><td>The Artemis SDK header (vendor provided)</td></tr>
<tr><td><code>build.bat</code></td><td>Builds the <code>lib/artemishsc.pyc</code> SWIG-generated Python library</td></tr>
<tr><td><code>lib/</code></td><td>Output directory for the Python library build process</td></tr>
<tr><td><code>README.md</code></td><td>Source for this document</td></tr>
<tr><td><code>setup.py</code></td><td>Python setup script for the Python library build</td></tr>
<tr><td><code>shared/</code></td><td>A collection of libraries required by the Artemis SDK</td></tr>
<tr><td><code>stdafx.h</code></td><td>Placeholder for unneeded (but included) C header file</td></tr>
Filename | Description |
---|
Steps:
- Install the Atik USB Drivers
- Install the Artemis Universal Package (e.g. SDK, DLLs)
- Install the Anaconda Python Environment
- Install SWIG for Windows
- Install Minimal GNU for Windows 32-bit (MinGW)
- Install the Git Version Control System
- Update the
PATH
environment variable to point to the following directories:c:\MinGW\mingw32\bin
c:\Program Files\swigwin-xxx
c:\Anaconda
c:\Anaconda\Scripts
c:\Program Files (x86)\Git\bin
c:\Program Files (x86)\Git\cmd
- Set the
PYTHONHOME
environment variable toc:\Anaconda
- Update the
PYTHONPATH
environment variable to the following directories:%PYTHONHOME%\Lib
%PYTHONHOME%\DLLs
%PYTHONHOME%\libs
%HOMEPATH%\workspace\titan
- Checkout the project:
- From your home directory:
mkdir workspace
cd workspace
- Ensure you have a SSH key and that Github has it installed: see Generating SSH Keys
- Checkout the project:
git clone [email protected]:LCOGT/atik-titan-pilot.git titan
- Modify the Python environment. Sadly, there is a small incompatibility within the Python library
distutils
module. To fix this, do the following:- Open
%PYTHONHOME%\Lib\distutils\cygwinccompiler.py
- Search for the
Mingw32CCompiler
class - Find the
self.set_executables
method call - Within the call's parameters, change all
gcc
values tog++
- Within the same class, make sure all
no_cygwin
variables are the empty string. - Within the overall file, search for
extra_preargs.extend
, replace all--output-lib
strings to-o
- Open
- From your home directory:
- Try a test build;
- From PowerShell change into the
%HOMEPATH%\workspace\titan
directory - Execute:
build.bat
- If the build is successful run the test program:
- Ensure the camera's USB cable is connected
- Execute
artemis.bat
- If the execution is successful, view the resultant
artemis.fits
file
- From PowerShell change into the