Skip to content

Commit

Permalink
Pass flavour to Exposure()
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jul 19, 2023
1 parent dc33ebf commit 301e16d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/gort/devices/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@ class Exposure(asyncio.Future["Exposure"]):
The exposure sequence number.
spec_set
The `.SpectrographSet` commanding this exposure.
flavour
The image type.
"""

def __init__(self, exp_no: int, spec_set: SpectrographSet):
def __init__(self, exp_no: int, spec_set: SpectrographSet, flavour: str = "object"):
self.spec_set = spec_set
self.exp_no = exp_no
self.flavour=flavour

self.error: bool = False
self.reading: bool = False
Expand All @@ -64,8 +67,8 @@ def __init__(self, exp_no: int, spec_set: SpectrographSet):

def __repr__(self):
return (
f"<Exposure (exp_no={self.exp_no}, error={self.error}, "
f"reading={self.reading}, done={self.done()})>"
f"<Exposure (exp_no={self.exp_no}, flavour={self.flavour}, "
f"error={self.error}, reading={self.reading}, done={self.done()})>"
)

async def expose(
Expand Down Expand Up @@ -645,7 +648,7 @@ async def expose(

await self.reset()

exposure = Exposure(seqno, self)
exposure = Exposure(seqno, self, flavour=flavour)
await exposure.expose(
exposure_time=exposure_time,
header=header,
Expand Down

0 comments on commit 301e16d

Please sign in to comment.