Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reorganize viewer scripts into python module #6

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions camstack/cams/dcamcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,15 @@ class OrcaQuest(DCAMCamera):
# yapf: disable
MODES = {
FIRST: CameraMode(x0=1028, x1=2991, y0=492, y1=727, tint=0.001),
FULL: CameraMode(x0=0, x1=4095, y0=0, y1=2303, tint=0.001),
0: CameraMode(x0=0, x1=4095, y0=0, y1=2303, tint=0.001), # Also full
1: CameraMode(x0=1196, x1=2127, y0=784, y1=1039, tint=0.001), # Kyohoon is Using for WFS mode
FULL: CameraMode(x0=0, x1=2303, y0=0, y1=4095, tint=0.01),
1: CameraMode(x0=1636, x1=2735, y0=1104, y1=1279, tint=0.001), # Kyohoon is Using for WFS mode
11: CameraMode(x0=1536, x1=2335, y0=976, y1=1231, tint=0.1), # Same as 1 no tint.
2: CameraMode(x0=800, x1=3295, y0=876, y1=1531, tint=0.001), # Kyohoon is Using for WFS align
3: CameraMode(x0=1148, x1=2947, y0=696, y1=1807, tint=0.001),
4: CameraMode(x0=1700, x1=1963, y0=760, y1=1015, tint=0.001), # Jen is using for focal plane mode
3: CameraMode(x0=2280, x1=3303, y0=1044, y1=2067, tint=0.01),
4: CameraMode(x0=2072, x1=2327, y0=1024, y1=1279, tint=0.000001), # Jen is using for focal plane mode .000001 tint
DICHROIC: CameraMode(x0=2336, x1=3135, y0=0, y1=2303, tint=0.01), # Dichroic stack mode
}
# yapf: enable

KEYWORDS = {}
KEYWORDS.update(DCAMCamera.KEYWORDS)
MODES[0] = MODES[FULL]

def __init__(self, name: str, stream_name: str, mode_id: Union[CameraMode,
Tuple[int,
Expand Down
Empty file added camstack/viewers/__init__.py
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
34 changes: 26 additions & 8 deletions viewers/firstcam.py → camstack/viewers/viewers/firstcam.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
import docopt

from camstack.viewers.generic_viewer_frontend import GenericViewerFrontend
from camstack.viewers.generic_viewer_backend import GenericViewerBackend

class FirstViewerBackend(GenericViewerBackend):
pass

class FirstViewerFrontend(GenericViewerFrontend):
WINDOW_NAME = 'FIRST camera'
CARTOON_FILE = 'io.png'

def __init__(self, system_zoom, fps, display_base_size):

# Hack the arguments BEFORE
GenericViewerFrontend.__init__(self, system_zoom, fps,
display_base_size)

# Finalize some specifics AFTER
#!/usr/bin/env python

DEFAULT_SHM_NAME = "orcam"
Expand All @@ -18,21 +37,20 @@
-b <binn> SHM binning factor [default: 1]
'''

import docopt

from camstack.viewers.generic_viewer_frontend import FirstViewerFrontend
from camstack.viewers.generic_viewer_backend import FirstViewerBackend

if __name__ == '__main__':

def main():
# parse arguments
args = docopt.docopt(__doc__)
zoom = int(args['-z'])
shm_name = args['<shm_name>']
if shm_name is None:
shm_name = DEFAULT_SHM_NAME

# setup viewer
backend = FirstViewerBackend(shm_name)

frontend = FirstViewerFrontend(zoom, 20, backend.shm_shape)
frontend.register_backend(backend)
# go
frontend.run()

if __name__ == '__main__':
main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ def run(self):
long_description = f.read()

scripts = [
'./viewers/anycam.py',
'./viewers/pueo.py',
'./viewers/apapane.py',
'./viewers/palila.py',
'./viewers/firstcam.py',
'./viewers/vpupcam.py',
'./camstack/viewers/viewers/anycam.py',
'./camstack/viewers/viewers/pueo.py',
'./camstack/viewers/viewers/apapane.py',
'./camstack/viewers/viewers/palila.py',
'./camstack/viewers/viewers/firstcam.py',
'./camstack/viewers/viewers/vpupcam.py',
'./scripts/cam-restartdeps',
'./scripts/cam-apapanestart',
'./scripts/cam-palilastart',
Expand Down