Skip to content

Commit

Permalink
Add vampires_prep [nrm]
Browse files Browse the repository at this point in the history
  • Loading branch information
DasVinch committed Jun 6, 2024
1 parent bdc3309 commit ad3a128
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/vampires_control/configurations/configurations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from __future__ import annotations

import asyncio

from pathlib import Path
from typing import Optional, Union

import click
import tomli
Expand All @@ -14,17 +16,17 @@

class Configuration(BaseModel):
name: str
filter: Optional[Union[str, int]] = None
diff: Optional[Union[str, int]] = None
bs: Optional[Union[str, int]] = None
camfcs: Optional[Union[str, int]] = None
filter: str | int | None = None
diff: str | int | None = None
bs: str | int | None = None
camfcs: str | int | None = None
cam_defocus: float = 0
fcs: Optional[Union[str, int]] = None
puplens: Optional[Union[str, int]] = None
mbi: Optional[Union[str, int]] = None
mask: Optional[Union[str, int]] = None
flc: Optional[Union[str, int]] = None
fieldstop: Optional[Union[str, int]] = None
fcs: str | int | None = None
puplens: str | int | None = None
mbi: str | int | None = None
mask: str | int | None = None
flc: str | int | None = None
fieldstop: str | int | None = None

@property
def mbi_nudge(self) -> float:
Expand Down Expand Up @@ -161,4 +163,4 @@ async def move_mask_async(conf):
async def move_fieldstop_async(conf):
fieldstop = connect(VAMPIRES.FIELDSTOP)
click.echo(f" - Moving fieldstop to {conf}")
fieldstop.move_configuration(conf)
fieldstop.move_configuration(conf)
44 changes: 44 additions & 0 deletions src/vampires_control/configurations/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@
fcs="standard",
mask=8,
),
"NRM": Configuration(
name="NRM",
diff=1,
bs="Open",
mbi="Mirror",
camfcs="single",
fcs="standard",
mask="SAM-7"
)
}


Expand Down Expand Up @@ -140,6 +149,40 @@ def prep_vpl(beamsplitter, mbi):
conf.mbi = mbi
asyncio.run(conf.move_async())

@click.command("nrm", help="NRM + MBI")
@click.option(
"-bs",
"--beamsplitter",
default="Open",
type=click.Choice(["PBS", "Open"], case_sensitive=False),
prompt=True,
)
@click.option(
"-m",
"--mbi",
default="Mirror",
type=click.Choice(["Mirror", "Dichroics"], case_sensitive=False),
prompt=True,
)
@click.option(
"-h",
"--holes",
metavar = '<holes>',
default='7',
type=click.Choice(['7', '9', '18']),
prompt=True,
)
def prep_nrm_mbi(beamsplitter: str, mbi: str, holes: int):
conf = CONFIGS["NRM"]
conf.bs = beamsplitter
conf.mbi = mbi
conf.mask = f'SAM-{holes}'
if "PBS" in beamsplitter:
conf.camfcs = 'dual'
print(conf)
asyncio.run(conf.move_async())



SUBCOMMANDS = {
"parked": prep_parked,
Expand All @@ -148,6 +191,7 @@ def prep_vpl(beamsplitter, mbi):
"SDI": prep_sdi,
"VPL": prep_vpl,
"LAPD": prep_lapd,
"NRM": prep_nrm_mbi,
}


Expand Down

0 comments on commit ad3a128

Please sign in to comment.