Skip to content

Commit

Permalink
0.2.26
Browse files Browse the repository at this point in the history
  • Loading branch information
wasndas committed Feb 9, 2023
1 parent f0e18a9 commit 4161d62
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <hojaeahn@khu.ac.kr>"]
license = "BSD-3-Clause"
Expand Down
23 changes: 11 additions & 12 deletions python/lvmagp/focus/focus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__(
Expand Down Expand Up @@ -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,
Expand All @@ -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]
Expand All @@ -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}")
Expand Down
3 changes: 0 additions & 3 deletions python/lvmagp/images/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down

0 comments on commit 4161d62

Please sign in to comment.