pyobs-asi 1.0.3__tar.gz → 2.0.0.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ name: Publish package to PyPI
2
+ on:
3
+ push:
4
+ tags:
5
+ - 'v*'
6
+ jobs:
7
+ build-n-publish:
8
+ name: Build and publish package to PyPI
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Check out repository code
12
+ uses: actions/checkout@v4
13
+
14
+ - name: Set up Python
15
+ uses: astral-sh/setup-uv@v5
16
+ with:
17
+ enable-cache: true
18
+ python-version: "3.11"
19
+
20
+ - name: Build
21
+ run: uv build
22
+
23
+ - name: Publish
24
+ env:
25
+ PYPI_TOKEN: ${{ secrets.pypi_password }}
26
+ run: uv publish --token $PYPI_TOKEN
@@ -0,0 +1,23 @@
1
+ name: ruff
2
+ on: push
3
+
4
+ jobs:
5
+ ruff:
6
+ runs-on: ubuntu-latest
7
+ timeout-minutes: 10
8
+
9
+ steps:
10
+ - name: Check out repository code
11
+ uses: actions/checkout@v4
12
+
13
+ - name: Set up Python
14
+ uses: astral-sh/setup-uv@v5
15
+ with:
16
+ enable-cache: true
17
+ python-version: "3.13"
18
+
19
+ - name: Install packages
20
+ run: uv sync --all-extras --dev
21
+
22
+ - name: Run ruff
23
+ run: uv run --no-sync ruff check pyobs_asi/
@@ -0,0 +1,15 @@
1
+ repos:
2
+ # Using this mirror lets us use mypyc-compiled black, which is about 2x faster
3
+ - repo: https://github.com/psf/black-pre-commit-mirror
4
+ rev: 25.1.0
5
+ hooks:
6
+ - id: black
7
+ # It is recommended to specify the latest version of Python
8
+ # supported by your project here, or alternatively use
9
+ # pre-commit's default_language_version, see
10
+ # https://pre-commit.com/#top_level-default_language_version
11
+ language_version: python3.11
12
+ - repo: https://github.com/astral-sh/ruff-pre-commit
13
+ rev: v0.9.0
14
+ hooks:
15
+ - id: ruff
@@ -0,0 +1,15 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-24.04
5
+ tools:
6
+ python: "3.11"
7
+
8
+ sphinx:
9
+ configuration: docs/source/conf.py
10
+
11
+ python:
12
+ install:
13
+ - method: pip
14
+ path: .
15
+ - requirements: docs/requirements.txt
@@ -0,0 +1,2 @@
1
+ v1.0.0 (2022-09-13)
2
+ *******************
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyobs-asi
3
+ Version: 2.0.0.dev2
4
+ Summary: pyobs model for ASI cameras
5
+ Author-email: Tim-Oliver Husser <thusser@uni-goettingen.de>
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.11
9
+ Requires-Dist: numpy<3,>=2.2.5
10
+ Requires-Dist: pyobs-core<3,>=2.0.0.dev1
11
+ Requires-Dist: zwoasi>=0.2.0
12
+ Provides-Extra: gui
13
+ Requires-Dist: pyobs-core[gui]<3,>=2.0.0.dev1; extra == 'gui'
14
+ Requires-Dist: qasync>=0.28.0; extra == 'gui'
@@ -0,0 +1,71 @@
1
+ *pyobs* for ZWO ASI cameras
2
+ ===========================
3
+
4
+ This is a [pyobs](https://www.pyobs.org) module for [ZWO ASI](https://astronomy-imaging-camera.com/) cameras.
5
+
6
+
7
+ ASI SDK
8
+ -------
9
+ Download the ASI SDK from https://astronomy-imaging-camera.com/software-drivers and install the libraries from the
10
+ appropriate folder in `lib/` to `/usr/local/lib`. Then copy `asi.rules` to `/etc/udev/rules.d/99-asi.rules`.
11
+
12
+
13
+ Install *pyobs-asi*
14
+ --------------------
15
+ Clone the repository:
16
+
17
+ git clone https://github.com/pyobs/pyobs-asi.git
18
+ cd pyobs-asi
19
+
20
+ Install it with [uv](https://docs.astral.sh/uv/):
21
+
22
+ uv sync
23
+
24
+ Alternatively, with plain `venv`/`pip`:
25
+
26
+ python3 -m venv .venv
27
+ source .venv/bin/activate
28
+ pip install .
29
+
30
+
31
+ Configuration
32
+ -------------
33
+ The *AsiCamera* class is derived from *BaseCamera* (see *pyobs* documentation) and adds some new parameters:
34
+
35
+ camera:
36
+ Name of camera to acquire driver for.
37
+ sdk:
38
+ Path to .so file from ASI SDK.
39
+
40
+ Therefore, a basic module configuration would look like this:
41
+
42
+ class: pyobs_asi.AsiCamera
43
+ name: ASI camera
44
+ camera: ZWO ASI071MC Pro
45
+
46
+ For cameras with cooling, use *AsiCoolCamera* instead, which adds a `setpoint` parameter for the initial cooling
47
+ setpoint in degrees Celsius:
48
+
49
+ class: pyobs_asi.AsiCoolCamera
50
+ name: ASI camera
51
+ camera: ZWO ASI071MC Pro
52
+ setpoint: -20
53
+
54
+
55
+ GUI
56
+ ---
57
+ For testing a camera without a full *pyobs* setup, install the optional `gui` extra:
58
+
59
+ uv sync --extra gui
60
+
61
+ and run:
62
+
63
+ uv run asi-gui [path/to/libASICamera2.so]
64
+
65
+
66
+ Dependencies
67
+ ------------
68
+ * [pyobs-core](https://github.com/pyobs/pyobs-core) for the core functionality.
69
+ * [zwoasi](https://github.com/stevemarple/python-zwoasi/) as a Python wrapper for the ASI SDK.
70
+ * [Astropy](http://www.astropy.org/) for FITS file handling.
71
+ * [NumPy](http://www.numpy.org/) for array handling.
@@ -0,0 +1,31 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line.
5
+ SPHINXOPTS =
6
+ SPHINXBUILD = sphinx-build
7
+ SPHINXPROJ = pyobs
8
+ SOURCEDIR = source
9
+ BUILDDIR = ../.doc-build
10
+
11
+ #.EXPORT_ALL_VARIABLES:
12
+
13
+ #PYTHONPATH:=../pyobs-core/:../pyobs-sbig/:../pyobs-fli:../pyobs-weather:../pyobs-archive:${PYTHONPATH}
14
+
15
+ # Put it first so that "make" without argument is like "make help".
16
+ help:
17
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
18
+
19
+ .PHONY: help Makefile
20
+
21
+ html:
22
+ @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
23
+
24
+ livehtml:
25
+ sphinx-autobuild -b html --watch ../pyobs_sbig $(ALLSPHINXOPTS) "$(SOURCEDIR)/" "$(BUILDDIR)/html/"
26
+
27
+ # Catch-all target: route all unknown targets to Sphinx using the new
28
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
29
+ %: Makefile
30
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
31
+
@@ -0,0 +1,36 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+ set SPHINXPROJ=pyobs
13
+
14
+ if "%1" == "" goto help
15
+
16
+ %SPHINXBUILD% >NUL 2>NUL
17
+ if errorlevel 9009 (
18
+ echo.
19
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
20
+ echo.installed, then set the SPHINXBUILD environment variable to point
21
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
22
+ echo.may add the Sphinx directory to PATH.
23
+ echo.
24
+ echo.If you don't have Sphinx installed, grab it from
25
+ echo.http://sphinx-doc.org/
26
+ exit /b 1
27
+ )
28
+
29
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30
+ goto end
31
+
32
+ :help
33
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34
+
35
+ :end
36
+ popd
@@ -0,0 +1 @@
1
+ sphinx-rtd-theme
@@ -0,0 +1,119 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Configuration file for the Sphinx documentation builder.
4
+ #
5
+ # This file does only contain a selection of the most common options. For a
6
+ # full list see the documentation:
7
+ # http://www.sphinx-doc.org/en/stable/config
8
+
9
+ # -- Path setup --------------------------------------------------------------
10
+
11
+ # If extensions (or modules to document with autodoc) are in another directory,
12
+ # add these directories to sys.path here. If the directory is relative to the
13
+ # documentation root, use os.path.abspath to make it absolute, like shown here.
14
+ #
15
+ import os
16
+ import sys
17
+
18
+ sys.path.insert(0, os.path.abspath("../../"))
19
+
20
+
21
+ # -- Project information -----------------------------------------------------
22
+
23
+ project = "pyobs-asi"
24
+ copyright = "2022, Tim-Oliver Husser"
25
+ author = "Tim-Oliver Husser"
26
+
27
+ # The short X.Y version
28
+ # version = "0.16"
29
+ # The full version, including alpha/beta/rc tags
30
+ # release = "0.16.0"
31
+
32
+
33
+ # -- General configuration ---------------------------------------------------
34
+
35
+ add_module_names = False
36
+
37
+ # If your documentation needs a minimal Sphinx version, state it here.
38
+ #
39
+ # needs_sphinx = '1.0'
40
+
41
+ # Add any Sphinx extension module names here, as strings. They can be
42
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
43
+ # ones.
44
+ extensions = [
45
+ "sphinx.ext.autodoc",
46
+ "sphinx.ext.githubpages",
47
+ "sphinx.ext.napoleon",
48
+ "sphinx.ext.viewcode",
49
+ "sphinx.ext.autosectionlabel",
50
+ "sphinx.ext.intersphinx",
51
+ #'sphinx_autodoc_typehints'
52
+ ]
53
+
54
+ intersphinx_mapping = {"http://docs.python.org/3": None}
55
+
56
+ # napoleon settings
57
+ napoleon_google_docstring = True
58
+ napoleon_numpy_docstring = False
59
+ napoleon_use_param = False
60
+ napoleon_use_ivar = True
61
+
62
+ # typehints
63
+ # set_type_checking_flag = True
64
+ # autodoc_typehints = "description"
65
+
66
+ # show c'tor parameters in class only
67
+ autoclass_content = "both"
68
+
69
+ # Add any paths that contain templates here, relative to this directory.
70
+ templates_path = ["_templates"]
71
+
72
+ # The suffix(es) of source filenames.
73
+ # You can specify multiple suffix as a list of string:
74
+ #
75
+ source_suffix = ".rst"
76
+
77
+ # The master toctree document.
78
+ master_doc = "index"
79
+
80
+ # The language for content autogenerated by Sphinx. Refer to documentation
81
+ # for a list of supported languages.
82
+ #
83
+ # This is also used if you do content translation via gettext catalogs.
84
+ # Usually you set "language" from the command line for these cases.
85
+ language = "en"
86
+
87
+ # List of patterns, relative to source directory, that match files and
88
+ # directories to ignore when looking for source files.
89
+ # This pattern also affects html_static_path and html_extra_path .
90
+ exclude_patterns = []
91
+
92
+ # The name of the Pygments (syntax highlighting) style to use.
93
+ pygments_style = "sphinx"
94
+
95
+ # Be a little nitpicky
96
+ nitpicky = True
97
+ nitpick_ignore = []
98
+
99
+ # intersphinx
100
+ intersphinx_mapping = {
101
+ "pyobs": ("https://pyobs-core.readthedocs.io/en/latest/", None),
102
+ }
103
+
104
+ # -- Options for HTML output -------------------------------------------------
105
+
106
+ # The theme to use for HTML and HTML Help pages. See the documentation for
107
+ # a list of builtin themes.
108
+ html_theme = "sphinx_rtd_theme"
109
+ html_theme_options = {
110
+ "collapse_navigation": False,
111
+ "sticky_navigation": True,
112
+ "navigation_depth": 4,
113
+ "display_version": False,
114
+ "logo_only": False,
115
+ "prev_next_buttons_location": "bottom",
116
+ "titles_only": False,
117
+ "style_nav_header_background": "#cccccc",
118
+ }
119
+ html_logo = "_static/pyobs.gif"
@@ -0,0 +1,69 @@
1
+ pyobs-asi
2
+ #########
3
+
4
+ This is a `pyobs <https://www.pyobs.org>`_ (`documentation <https://docs.pyobs.org>`_) module for ASI ZWO cameras.
5
+
6
+
7
+ Example configuration
8
+ *********************
9
+
10
+ This is an example configuration, tested on a ASI 071 MC::
11
+
12
+ class: pyobs_asi.AsiCoolCamera
13
+ camera: ZWO ASI071MC Pro
14
+
15
+ # file naming
16
+ filenames: /cache/pyobs-{DAY-OBS|date:}-{FRAMENUM|string:04d}-{IMAGETYP|type}00.fits
17
+
18
+ # additional fits headers
19
+ fits_headers:
20
+ 'DET-PIXL': [0.00478, 'Size of detector pixels (square) [mm]']
21
+ 'DET-NAME': ['SONY IMX071', 'Name of detector']
22
+ 'DET-RON': [2.3, 'Detector readout noise [e-]']
23
+ 'DET-SATU': [46000, 'Detector saturation limit [e-]']
24
+
25
+ # opto-mechanical centre
26
+ centre: [2472.0, 1642.0]
27
+
28
+ # rotation (east of north)
29
+ rotation: 3.06
30
+ flip: True
31
+
32
+ # location
33
+ timezone: utc
34
+ location:
35
+ longitude: 9.944333
36
+ latitude: 51.560583
37
+ elevation: 201.
38
+
39
+ # communication
40
+ comm:
41
+ jid: test@example.com
42
+ password: ***
43
+
44
+ # virtual file system
45
+ vfs:
46
+ class: pyobs.vfs.VirtualFileSystem
47
+ roots:
48
+ cache:
49
+ class: pyobs.vfs.HttpFile
50
+ upload: http://localhost:37075/
51
+
52
+
53
+ Available classes
54
+ *****************
55
+
56
+ There are two classes for ASI ZWO cameras: :class:`~pyobs_asi.AsiCamera` for cameras without cooling, and
57
+ :class:`~pyobs_asi.AsiCoolCamera` for cameras with cooling support.
58
+
59
+ AsiCamera
60
+ =========
61
+ .. autoclass:: pyobs_asi.AsiCamera
62
+ :members:
63
+ :show-inheritance:
64
+
65
+ AsiCoolCamera
66
+ =============
67
+ .. autoclass:: pyobs_asi.AsiCoolCamera
68
+ :members:
69
+ :show-inheritance:
@@ -0,0 +1,6 @@
1
+ __title__ = "ASI camera modules"
2
+
3
+ from .asicamera import AsiCamera as AsiCamera
4
+ from .asicamera import AsiCoolCamera as AsiCoolCamera
5
+
6
+ __all__ = ["AsiCamera", "AsiCoolCamera"]