Skip to content

Commit

Permalink
Merge pull request #18 from sdss/develop
Browse files Browse the repository at this point in the history
v.0.2.3a
  • Loading branch information
HojaeAhn authored Dec 10, 2021
2 parents 12791e7 + a08c5fd commit 55e784f
Show file tree
Hide file tree
Showing 16 changed files with 992 additions and 415 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --show-source --statistics
flake8 ./python/lvmagp --count --show-source --statistics
- name: Lint with isort
run: |
Expand Down
2 changes: 2 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 63 additions & 63 deletions poetry.lock

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tool.poetry]
name = "sdss-lvmagp"
version = "0.1.0-alpha.0"
description = "Simple Template package for creating SDSS Python projects"
authors = ["sumin lee <lxmark888@khu.ac.kr>"]
version = "0.2.0-alpha"
description = "Aquisition and guiding package for SDSS-V LVM"
authors = ["Hojae Ahn <hojaeahn@khu.ac.kr>"]
license = "BSD-3-Clause"
readme = "README.md"
homepage = "https://github.com/sdss/lvmagp"
Expand All @@ -16,6 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Documentation :: Sphinx",
"Topic :: Software Development :: Libraries :: Python Modules"
]
Expand Down
Empty file removed python/cluplus/__init__.py
Empty file.
141 changes: 0 additions & 141 deletions python/cluplus/proxy.py

This file was deleted.

71 changes: 49 additions & 22 deletions python/lvmagp/actor/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,23 @@

from clu.actor import AMQPActor

from .commands import parser as lvm_command_python
from lvmagp.actor.commfunc import (LVMEastCamera, LVMFibsel, # noqa: F401
LVMFocuser, LVMKMirror, LVMTANInstrument,
LVMTelescope, LVMWestCamera)

from lvmagp.actor.commfunc import LVMTANInstrument,LVMTelescope,LVMEastCamera,LVMWestCamera,LVMFibsel,LVMFocuser,LVMKMirror
from .commands import parser as lvm_command_python


# from scpactor import __version__

__all__ = ["lvmagp"]
tel_list = ['sci', 'skye', 'skyw', 'spec']
tel_list = ["sci", "skye", "skyw", "spec"]


class lvmagp(AMQPActor):
"""AGP actor.
"""AGP actor.
In addition to the normal arguments and keyword parameters for
`~clu.actor.AMQPActor`, the class accepts the following parameters.
Parameters
----------
controllers
The list of `.SCP_Controller` instances to manage.
"""

parser = lvm_command_python
Expand All @@ -36,6 +34,25 @@ def __init__(
**kwargs,
):
super().__init__(*args, **kwargs)

self.schema = {
"type": "object",
"properties": {
"fail": {"type": "string"},
"Img_ra2000": {"type": "string"},
"Img_dec2000": {"type": "string"},
"Img_pa": {"type": "string"},
"offset_ra": {"type": "string"},
"offset_dec": {"type": "string"},
"xscale_ra": {"type": "string"},
"yscale_ra": {"type": "string"},
"xscale_dec": {"type": "string"},
"yscale_dec": {"type": "string"},
},
"additionalProperties": False,
}
self.load_schema(self.schema, is_file=False)

self.telescopes = {s.name: s for s in telescopes}
self.eastcameras = {s.name: s for s in eastcameras}
self.westcameras = {s.name: s for s in westcameras}
Expand All @@ -50,28 +67,38 @@ def from_config(cls, config, *args, **kwargs):

for (ctrname, ctr) in instance.config.items():
if ctrname in tel_list:
#print(ctrname, ctr)
instance.telescopes.update({ctrname: LVMTelescope(ctrname)})
instance.telescopes[ctrname].latitude = ctr['tel']['latitude']
instance.telescopes[ctrname].longitude = ctr['tel']['longitude']
# print(ctrname, ctr)
instance.telescopes.update({ctrname: LVMTelescope(ctrname, "KHU")})

instance.eastcameras.update({ctrname: LVMEastCamera(ctrname)})
instance.eastcameras[ctrname].pixelscale = ctr['age']['pixelscale']
instance.eastcameras[ctrname].offset_x = ctr['age']['offset_x']
instance.eastcameras[ctrname].offset_y = ctr['age']['offset_y']
instance.eastcameras[ctrname].pixelscale = ctr["age"]["pixelscale"]
instance.eastcameras[ctrname].offset_x = ctr["age"]["offset_x"]
instance.eastcameras[ctrname].offset_y = ctr["age"]["offset_y"]
instance.eastcameras[ctrname].rotationangle = ctr["age"][
"rotationangle"
]

instance.westcameras.update({ctrname: LVMWestCamera(ctrname)})
instance.westcameras[ctrname].pixelscale = ctr['agw']['pixelscale']
instance.westcameras[ctrname].offset_x = ctr['agw']['offset_x']
instance.westcameras[ctrname].offset_y = ctr['agw']['offset_y']
instance.westcameras[ctrname].pixelscale = ctr["agw"]["pixelscale"]
instance.westcameras[ctrname].offset_x = ctr["agw"]["offset_x"]
instance.westcameras[ctrname].offset_y = ctr["agw"]["offset_y"]
instance.westcameras[ctrname].rotationangle = ctr["agw"][
"rotationangle"
]

instance.focusers.update({ctrname: LVMFocuser(ctrname)})

instance.kmirrors.update({ctrname: LVMKMirror(ctrname)})

#print(ctrname,ctr)
# print(ctrname,ctr)

#print(instance.telescopes)
# print(instance.telescopes)

instance.parser_args = [instance.telescopes, instance.eastcameras, instance.westcameras, instance.focusers, instance.kmirrors]
return instance
instance.parser_args = [
instance.telescopes,
instance.eastcameras,
instance.westcameras,
instance.focusers,
instance.kmirrors,
]
return instance
26 changes: 26 additions & 0 deletions python/lvmagp/actor/astrometry_result.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Reading input file 1 of 1: "/home/sumin/lvmcam/python/lvmcam/assets/testshot.fits"...
Extracting sources...
This looks like a multi-color image: processing the first image plane only. (NAXIS=3)
Downsampling by 2...
simplexy: found 663 sources.
Solving...
Reading file "/home/sumin/lvmcam/python/lvmcam/assets/testshot.axy"...
Only searching for solutions within 1 degrees of RA,Dec (92.25,24.33)
Field 1 did not solve (index index-4211.fits, field objects 1-10).
Field 1 did not solve (index index-4210.fits, field objects 1-10).
Field 1 did not solve (index index-4209.fits, field objects 1-10).
Field 1 did not solve (index index-4208.fits, field objects 1-10).
Field 1 did not solve (index index-4207-05.fits, field objects 1-10).
log-odds ratio 574.743 (4.05134e+249), 117 match, 0 conflict, 311 distractors, 137 index.
RA,Dec = (92.2496,24.3312), pixel scale 2.59625 arcsec/pix.
Hit/miss: Hit/miss: +++++++++-+++++++++++++++-+++-+--+++-++++++-+-++-+-++-+-+-++-+-++-++---++--++-+++-++-++++-+++-++-+--
Field 1: solved with index index-4206-05.fits.
Field 1 solved: writing to file /home/sumin/lvmcam/python/lvmcam/assets/testshot.solved to indicate this.
Field: /home/sumin/lvmcam/python/lvmcam/assets/testshot.fits
Field center: (RA,Dec) = (92.250015, 24.331394) deg.
Field center: (RA H:M:S, Dec D:M:S) = (06:09:00.004, +24:19:53.018).
Field size: 69.2532 x 47.6139 arcminutes
Field rotation angle: up is 99.4551 degrees E of N
Field parity: pos
Creating new FITS file "/home/sumin/lvmcam/python/lvmcam/assets/testshot.new"...

31 changes: 26 additions & 5 deletions python/lvmagp/actor/commands/autofocus.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,28 @@ def autofocus(*args):
@autofocus.command()
@click.argument("TEL", type=str)
async def coarse(command: Command, tel: str):
"""
Find the focus coarsely by scanning whole reachable position.
Parameters
----------
tel
The telescope to be focused
"""
pass


@autofocus.command()
@click.argument("TEL", type=str)
async def fine(command: Command, tel: str):
"""
Find the optimal focus position which is near the current position.
Parameters
----------
tel
The telescope to be focused
"""
position, fwhm = [], []
incremental = 100
repeat = 5
Expand All @@ -33,11 +49,16 @@ async def fine(command: Command, tel: str):
agpwd = pwd + "/../../../../"

guideimglist = [
agpwd + "testimg/focus_series/synthetic_image_median_field_5s_seeing_02.5.fits", # noqa: E501
agpwd + "testimg/focus_series/synthetic_image_median_field_5s_seeing_03.0.fits", # noqa: E501
agpwd + "testimg/focus_series/synthetic_image_median_field_5s_seeing_04.0.fits", # noqa: E501
agpwd + "testimg/focus_series/synthetic_image_median_field_5s_seeing_05.0.fits", # noqa: E501
agpwd + "testimg/focus_series/synthetic_image_median_field_5s_seeing_06.0.fits", # noqa: E501
agpwd +
"testimg/focus_series/synthetic_image_median_field_5s_seeing_02.5.fits", # noqa: E501
agpwd +
"testimg/focus_series/synthetic_image_median_field_5s_seeing_03.0.fits", # noqa: E501
agpwd +
"testimg/focus_series/synthetic_image_median_field_5s_seeing_04.0.fits", # noqa: E501
agpwd +
"testimg/focus_series/synthetic_image_median_field_5s_seeing_05.0.fits", # noqa: E501
agpwd +
"testimg/focus_series/synthetic_image_median_field_5s_seeing_06.0.fits", # noqa: E501
]
guideimgidx = [0, 1, 2, 4]

Expand Down
Loading

0 comments on commit 55e784f

Please sign in to comment.