Metadata-Version: 2.5
Name: pyobs-asi
Version: 2.4.0
Summary: pyobs model for ASI cameras
Project-URL: Homepage, https://www.pyobs.org
Project-URL: Documentation, https://docs.pyobs.org
Project-URL: Repository, https://github.com/pyobs/pyobs-asi
Project-URL: Issues, https://github.com/pyobs/pyobs-asi/issues
Author-email: Tim-Oliver Husser <thusser@uni-goettingen.de>
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: numpy<3,>=2.2.5
Requires-Dist: pyobs-core<3,>=2.28.0
Requires-Dist: zwoasi>=0.2.0
Provides-Extra: gui
Requires-Dist: pyobs-core[gui]<3,>=2.28.0; extra == 'gui'
Requires-Dist: qasync>=0.28.0; extra == 'gui'
Description-Content-Type: text/markdown

*pyobs* for ZWO ASI cameras
===========================

This is a [pyobs](https://www.pyobs.org) module for [ZWO ASI](https://astronomy-imaging-camera.com/) cameras.


ASI SDK
-------
The Linux libraries of the ASI SDK 1.41 (`armv6`, `armv7`, `armv8`, `x64`, `x86`) and `asi.rules` are included in the
`sdk/` folder, as published by ZWO under the license in `sdk/license.txt`. See
https://www.zwoastro.com/software/product-sdk/ for the official download and newer versions. Do not use the 1.37
libraries from third-party repositories, they return corrupt frames on the ASI2600MM Pro.

Install the library for your platform to `/usr/local/lib` and update the linker cache, e.g. on x86-64:

    sudo install sdk/x64/libASICamera2.so.1.41 /usr/local/lib
    sudo ln -sf libASICamera2.so.1.41 /usr/local/lib/libASICamera2.so
    sudo ldconfig

Then install the udev rules and reconnect the camera:

    sudo install sdk/asi.rules /etc/udev/rules.d/99-asi.rules
    sudo udevadm control --reload && sudo udevadm trigger

The rules also set `usbfs_memory_mb` to 200, which large sensors need. Check it with
`cat /sys/module/usbcore/parameters/usbfs_memory_mb`. Instead of installing the library, you can also pass its path
to the `sdk` parameter of the camera (see below).


Install *pyobs-asi*
--------------------
Clone the repository:

    git clone https://github.com/pyobs/pyobs-asi.git
    cd pyobs-asi

Install it with [uv](https://docs.astral.sh/uv/):

    uv sync

Alternatively, with plain `venv`/`pip`:

    python3 -m venv .venv
    source .venv/bin/activate
    pip install .


Configuration
-------------
The *AsiCamera* class is derived from *BaseCamera* (see *pyobs* documentation) and adds some new parameters:

    camera:
        Name of camera to acquire driver for.
    sdk:
        Path to .so file from ASI SDK.

Therefore, a basic module configuration would look like this:

    class: pyobs_asi.AsiCamera
    name: ASI camera
    camera: ZWO ASI071MC Pro

For cameras with cooling, use *AsiCoolCamera* instead, which adds a `setpoint` parameter for the initial cooling
setpoint in degrees Celsius:

    class: pyobs_asi.AsiCoolCamera
    name: ASI camera
    camera: ZWO ASI071MC Pro
    setpoint: -20

The setpoint is changed in steps (default 2 degC/min when cooling down and 2 degC/min when warming up, and the
cooler is switched off only after warming up to `cooling_off_temperature`, default 15 degC). Use `cooling_rate_cool`,
`cooling_rate_warm`, `cooling_off_temperature` and `cooling_ramp_step` to change this, see *CoolingRampMixin* in *pyobs-core*.

Closing the camera switches the cooler off at once, so the module warms the sensor up first when it is closed
(`cooling_warmup_on_close`, default true). Warming up from -20 degC takes about 17 minutes at the default rate. By
default the module waits for the time that the warm-up needs from the current setpoint, plus 20% and a minute. Set
`cooling_close_timeout` (in seconds) to limit the wait, after which the camera is closed anyway.


GUI
---
For testing a camera without a full *pyobs* setup, install the optional `gui` extra:

    uv sync --extra gui

and run:

    uv run asi-gui [path/to/libASICamera2.so]


Dependencies
------------
* [pyobs-core](https://github.com/pyobs/pyobs-core) for the core functionality.
* [zwoasi](https://github.com/stevemarple/python-zwoasi/) as a Python wrapper for the ASI SDK.
* [Astropy](http://www.astropy.org/) for FITS file handling.
* [NumPy](http://www.numpy.org/) for array handling.