Skip to content

Commit

Permalink
Add LST to header
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Aug 18, 2023
1 parent 69595bc commit 69d4fc2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
23 changes: 17 additions & 6 deletions python/lvmcam/actor/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

from typing import Any

from astropy.coordinates import EarthLocation
from astropy.utils.iers import conf

from araviscam import BlackflyCamera, BlackflyCameraSystem
from basecam import ImageNamer
from basecam.actor import BaseCameraActor
Expand All @@ -25,6 +28,10 @@
from lvmcam.models import CameraCards, GenicamCards, ScraperParamCards, WCSCards


conf.auto_download = False
conf.iers_degraded_accuracy = "ignore"


CWD = pathlib.Path(__file__).parents[1]
BASE_CAMERA_PARAMS = read_yaml_file(CWD / "etc/lvm.camera_param.agcam.yml")

Expand Down Expand Up @@ -61,14 +68,18 @@ class LVMCamera(BlackflyCamera):
fits_model = FITSModel([raw])
image_namer = ImageNamer(basename=basename, dirname=dirname)

async def expose(self, *args, **kwargs) -> Exposure:
ip = self.camera_params["ip"]
delay = int(ip[-1]) / 10 * 3
await asyncio.sleep(delay)
# LCO
location = EarthLocation.from_geodetic(
lon=-70.70166667,
lat=-29.00333333,
height=2282.0,
)

if self.name == "west":
await asyncio.sleep(0.5)
async def _expose_internal(self, exposure, **kwargs):
exposure.obstime.location = self.location
return await super()._expose_internal(exposure, **kwargs)

async def expose(self, *args, **kwargs) -> Exposure:
return await super().expose(*args, **kwargs)

return LVMCamera
Expand Down
6 changes: 6 additions & 0 deletions python/lvmcam/models/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
value="{__exposure__.camera.telescope}",
comment="Telescope that took the image",
),
Card(
"LST",
value="round(__exposure__.obstime.sidereal_time('mean').value, 6)",
comment="[hr] Mean local sidereal time",
evaluate=True,
),
Card(
"INSTRUME",
value="LVM",
Expand Down

0 comments on commit 69d4fc2

Please sign in to comment.