From 4161d6269a5df8c9b70c24cad9b5930d9369fa22 Mon Sep 17 00:00:00 2001 From: Florian Briegel Date: Thu, 9 Feb 2023 15:23:31 +0100 Subject: [PATCH] 0.2.26 --- pyproject.toml | 2 +- python/lvmagp/focus/focus.py | 23 +++++++++++------------ python/lvmagp/images/image.py | 3 --- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 027e4a0..f646bd6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "sdss-lvmagp" -version = "0.2.25" +version = "0.2.26" description = "Aquisition and guiding package for SDSS-V LVM" authors = ["Hojae Ahn "] license = "BSD-3-Clause" diff --git a/python/lvmagp/focus/focus.py b/python/lvmagp/focus/focus.py index cce82c8..cb21be8 100644 --- a/python/lvmagp/focus/focus.py +++ b/python/lvmagp/focus/focus.py @@ -21,7 +21,7 @@ from lvmagp.images import Image from lvmagp.images.processors.detection import DaophotSourceDetection, SepSourceDetection from lvmagp.focus.focusseries import PhotometryFocusSeries, ProjectionFocusSeries - +from lvmtipo.focus import temp2focus class Focus(): def __init__( @@ -52,16 +52,17 @@ def __init__( async def offset(self, offset): try: - self.logger.debug(f"foc move to {offset} um") - await self.telsubsys.foc.moveRelative(offset, 'UM') + self.logger.debug(f"foc move to {offset} dt") + await self.telsubsys.foc.moveRelative(offset, 'DT') except Exception as ex: self.logger.error(ex) raise ex + async def fine( self, - guess: float = 44, + guess: float = 42, count: int = 3, step: float = 5.0, exposure_time: float = 5.0, @@ -72,20 +73,19 @@ async def fine( focus_series = [PhotometryFocusSeries(self._source_detection, radius_column=self.radius_column) for c in range(camnum)] - # define array of focus values to iterate if self.fine_offset: current = self.telsubsys.foc.getPosition() - await self.telsubsys.foc.moveRelative(count * step) + await self.telsubsys.foc.moveRelative(count * step, 'DT') focus_values = np.linspace(0, 2 * count * step, 2 * count + 1) else: focus_values = np.linspace(guess - count * step, guess + count * step, 2 * count + 1) for foc in focus_values: if self.fine_offset: - await self.telsubsys.foc.moveRelative(foc) + await self.telsubsys.foc.moveRelative(foc, 'DT') else: - await self.telsubsys.foc.moveAbsolute(foc) + await self.telsubsys.foc.moveAbsolute(foc, 'DT') file_names = (await self.telsubsys.agc.expose(exposure_time)).flatten().unpack("*.filename") imgs = [Image.from_file(f) for f in file_names] @@ -103,11 +103,10 @@ async def fine( self.logger.error(ex) raise ex - async def nominal(self): - try: - temp2focus_pos = 42 #TODO: put here a function gathering focus based on temperature. - await self.telsubsys.foc.moveAbsolute(temp2focus_pos) + async def nominal(self, temperature:float): + try: + await self.telsubsys.foc.moveAbsolute(temp2focus(), 'DT') except Exception as ex: self.logger.error(f"{ex}") diff --git a/python/lvmagp/images/image.py b/python/lvmagp/images/image.py index 56db66c..b88c936 100644 --- a/python/lvmagp/images/image.py +++ b/python/lvmagp/images/image.py @@ -10,11 +10,8 @@ from astropy.nddata import CCDData, StdDevUncertainty from numpy.typing import NDArray -#from lvmagp.utils.fits import FilenameFormatter - MetaClass = TypeVar("MetaClass") - class Image: """Image class."""