Skip to content

Commit 9f3b2c2

Browse files
authored
Merge pull request #1 from pyobs/develop
v0.8
2 parents 655faf8 + 3292f6a commit 9f3b2c2

File tree

5 files changed

+40
-12
lines changed

5 files changed

+40
-12
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ RUN python setup.py install
1313
RUN rm -rf /src
1414

1515
# set entrypoint
16-
ENTRYPOINT ["/usr/local/bin/pyobs", "/pyobs.yaml"]
16+
ENTRYPOINT ["/usr/local/bin/pyobs"]

pyobs_fli/flicamera.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def _expose(self, exposure_time: int, open_shutter: bool, abort_event: threading
205205
hdu.header['DATAMEAN'] = (float(np.mean(img)), 'Mean data value')
206206

207207
# biassec/trimsec
208-
full = self.get_full_frame()
208+
full = self._driver.get_visible_frame()
209209
self.set_biassec_trimsec(hdu.header, *full)
210210

211211
# return FITS image

pyobs_fli/flidriver.pyx

+23-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ cdef class FliDriver:
117117
# return window and binning
118118
return (hoffset, voffset, width, height), (hbin, vbin)
119119

120-
def get_full_frame(self):
121-
"""Returns the full frame of the connected camera.
120+
def get_visible_frame(self):
121+
"""Returns the visible frame of the connected camera.
122122
123123
Returns:
124124
Tuple with left, top, width, and height of full frame.
@@ -138,6 +138,27 @@ cdef class FliDriver:
138138
# return it
139139
return ul_x, ul_y, lr_x - ul_x, lr_y - ul_y
140140

141+
def get_full_frame(self):
142+
"""Returns the full frame of the connected camera.
143+
144+
Returns:
145+
Tuple with left, top, width, and height of full frame.
146+
147+
Raises:
148+
ValueError: If fetching visible area fails.
149+
"""
150+
151+
# variables
152+
cdef long ul_x, ul_y, lr_x, lr_y
153+
154+
# get area
155+
res = FLIGetArrayArea(self._device, &ul_x, &ul_y, &lr_x, &lr_y)
156+
if res != 0:
157+
raise ValueError('Could not query total area.')
158+
159+
# return it
160+
return ul_x, ul_y, lr_x - ul_x, lr_y - ul_y
161+
141162
def set_binning(self, x: int, y: int):
142163
"""Set the binning.
143164

requirements.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
astropy
2-
numpy
1+
.

setup.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from distutils.core import setup, Extension
1+
from setuptools import setup, Extension
22
import os
33
import numpy
44
from Cython.Build import cythonize
@@ -19,8 +19,16 @@
1919
]
2020

2121
# setup
22-
setup(name='pyobs_fli',
23-
version='0.2',
24-
description='pyobs component for FLI cameras',
25-
packages=['pyobs_fli'],
26-
ext_modules=cythonize(extensions))
22+
setup(
23+
name='pyobs-fli',
24+
version='0.8',
25+
description='pyobs component for FLI cameras',
26+
packages=['pyobs_fli'],
27+
ext_modules=cythonize(extensions),
28+
install_requires=[
29+
'cython',
30+
'numpy',
31+
'astropy',
32+
'pyobs-core'
33+
]
34+
)

0 commit comments

Comments
 (0)