Commit 06b3c1a3 authored by Davide Ricci's avatar Davide Ricci
Browse files

Tested Atik and debugged mercury

parent 14b7670b
Loading
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ class Camera(BaseDevice):
        self._props = ArtemisProperties()

        try:
            self._lib = ctypes.CDLL("libatikcameras.so")
            self._lib = ctypes.CDLL("/usr/lib/libatikcameras.so")
            self._lib.ArtemisConnect.restype = ctypes.c_void_p
            self._lib.ArtemisImageBuffer.restype = ctypes.c_void_p
            self._lib.ArtemisExposureTimeRemaining.restype = ctypes.c_float
@@ -106,6 +106,11 @@ class Camera(BaseDevice):

    # --- Exposure Methods ---

    def abort(self):
        h = self._check_connection()
        if h: self._lib.ArtemisAbortExposure(h)

        
    def start(self, duration, frametype, dt=None):
        h = self._check_connection()
        if not h: return
@@ -114,9 +119,6 @@ class Camera(BaseDevice):
        self._lib.ArtemisSetDarkMode(h, is_dark)
        self._lib.ArtemisStartExposure(h, ctypes.c_float(duration))

    def abort(self):
        h = self._check_connection()
        if h: self._lib.ArtemisAbortExposure(h)
        
    def download(self, filepath=temp_fits):
        h = self._check_connection()
+22 −17
Original line number Diff line number Diff line
@@ -172,11 +172,16 @@ class Mercury(BaseDevice):

        moving = True
        while moving:
            try:
                # log.debug(pidevice.qPOS())
                status_dict = pidevice.IsMoving(self.axis)
                moving = status_dict[self.axis]
            except GCSError as e:
                log.warning(e)

            err = pidevice.qERR()
            if err != 0:
                log.warning(err)
                pass

            time.sleep(0.2)
+7 −5
Original line number Diff line number Diff line
@@ -4,9 +4,11 @@ import zipfile
import shutil
from pathlib import Path
from noctua.utils.logger import log
import urllib.request
from urllib.parse import urljoin

SDK_URL = "https://downloads.atik-cameras.com/AtikCamerasSDK_2025_11_11_Master"
ZIP_NAME = "AtikSDK.zip"
SDK_URL = "https://downloads.atik-cameras.com/"
ZIP_NAME = "AtikCamerasSDK_2025_11_11_Master_2111.zip"

def is_installed():
    """Check if Atik SDK is already installed in the system."""
@@ -25,10 +27,10 @@ def install(force=False):

    # 1. Download if zip is not present locally
    if not Path(ZIP_NAME).exists():
        log.info(f"Downloading Atik SDK from {SDK_URL}...")
        full_path = urljoin(SDK_URL , ZIP_NAME)
        log.info(f"Downloading Atik SDK from {full_path} ...")
        try:
            import requests
            r = requests.get(SDK_URL, stream=True)
            r = urllib.request.urlopen(full_path).read()
            with open(ZIP_NAME, 'wb') as f:
                for chunk in r.iter_content(chunk_size=8192): f.write(chunk)
        except Exception as e: