Skip to content

Commit

Permalink
Support archon 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Dec 1, 2023
1 parent 370872a commit 28b94f6
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 66 deletions.
125 changes: 72 additions & 53 deletions poetry.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ln2fill = "lvmscp.ln2:ln2fill"
[tool.poetry.dependencies]
python = "^3.9,<3.13"
click-default-group = "^1.2.2"
sdss-archon = "^0.11.6"
sdss-archon = "^0.12.0"
sdss-clu = "^2.1.3"

[tool.poetry.dev-dependencies]
Expand Down
18 changes: 10 additions & 8 deletions python/lvmscp/delegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,23 +195,25 @@ async def post_process(
now.location = self.location

for hdu in hdus:
ccd = str(hdu.header["CCD"])
ccd = str(hdu["header"]["CCD"])

hdu.header["V_LVMSCP"] = __version__
hdu.header["LMST"] = round(now.sidereal_time("mean").value, 6)
hdu["header"]["V_LVMSCP"][0] = __version__
hdu["header"]["LMST"][0] = round(now.sidereal_time("mean").value, 6)

# Update header with values collected during integration.
for key in self.header_data:
hdu.header[key] = self.header_data[key]
hdu["header"][key][0] = self.header_data[key]

# Add SDSS MJD.
hdu.header["SMJD"] = get_sjd("LCO")
hdu.header["PRESSURE"] = self.pressure_data.get(f"{ccd}_pressure", -999.0)
hdu["header"]["SMJD"][0] = get_sjd("LCO")
hdu["header"]["PRESSURE"][0] = self.pressure_data.get(
f"{ccd}_pressure", -999.0
)

depth_camera = self.depth_data.get("camera", "")
for ch in ["A", "B", "C"]:
depth = (self.depth_data[ch] if ccd == depth_camera else -999.0,)
hdu.header[f"DEPTH{ch}"] = depth
depth = self.depth_data[ch] if ccd == depth_camera else -999.0
hdu["header"][f"DEPTH{ch}"][0] = depth

return (controller, hdus)

Expand Down
1 change: 1 addition & 0 deletions python/lvmscp/etc/lvmscp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ files:
data_dir: '/data/spectro/lvm'
split: true
template: 'sdR-{hemisphere}-{ccd}-{exposure_no:08d}.fits.gz'
write_engine: astropy

checksum:
write: true
Expand Down
34 changes: 30 additions & 4 deletions tests/test_lvmscp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,36 @@ header:
r2: ['mod2/tempb', 'Temperature of the sensor (HEATERX 2)', 2]
b2: ['mod2/tempc', 'Temperature of the sensor (HEATERX 12)', 2]
z2: ['mod12/tempb', 'Temperature of the sensor (HEATERX 12)', 2]
DATASEC: ['[1:4120,1:4080]', 'Section of the detector containing data']
CCDSEC: ['[1:4120,1:4080]', 'Section of the detector read out']
BIASSEC: ['[2041:2080,1:4080]', 'Section of calibration/bias data']
TRIMSEC: ['[1:2040,1:4080],[2081:4120,1:4080]', 'Section with useful data']
V_LVMSCP: [null, 'Version of lvmscp that took this image']
LMST: [-999, 'Local mean sidereal time (approximate) [hr]']
TELESCOP: 'SDSS 0.16m'
SURVEY: 'LVM'
OBJECT: ['', 'Name of the target observed']
TRIMSEC1: ['[1:2043, 2041:4080]', 'Data section for quadrant 1']
TRIMSEC2: ['[2078:4120, 2041:4080]', 'Data section for quadrant 2']
TRIMSEC3: ['[1:2043, 1:2040]', 'Data section for quadrant 3']
TRIMSEC4: ['[2078:4120, 1:2040]', 'Data section for quadrant 4']
BIASSEC1: ['[2044:2060, 2041:4080]', 'Overscan section for quadrant 1']
BIASSEC2: ['[2061:2077, 2041:4080]', 'Overscan section for quadrant 2']
BIASSEC3: ['[2044:2060, 1:2040]', 'Overscan section for quadrant 3']
BIASSEC4: ['[2061:2077, 1:2040]', 'Overscan section for quadrant 4']
TILE_ID: [null, 'The tile_id of this observation']
DPOS: [0, 'Dither position']
BUFFER: [null, 'The buffer number read']
SMJD: [null, 'SDSS Modified Julian Date (MJD+0.4)']
HARTMANN: ['0 0', 'Left/right: 0=open 1=closed']
ARGON: ['?', 'Status of lamp Argon']
NEON: ['?', 'Status of lamp Neon']
LDLS: ['?', 'Status of lamp LDLS']
QUARTZ: ['?', 'Status of lamp Quartz']
HGNE: ['?', 'Status of lamp HgNe']
XENON: ['?', 'Status of lamp Xenon']
PRESSURE: [null, 'Cryostat pressure [torr]']
LABTEMP: [null, 'Lab temperature [C]']
LABHUMID: [null, 'Lab relative humidity [%]']
DEPTHA: [null, 'Depth probe A [mm]']
DEPTHB: [null, 'Depth probe B [mm]']
DEPTHC: [null, 'Depth probe C [mm]']

# This is the ACF configuration file to be loaded to the Archon including the
# timing script. {archon_etc} gets completed with the path of the etc directory once
Expand Down
3 changes: 3 additions & 0 deletions typings/astropy/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from typing import Any

def __getattr__(name: str) -> Any: ...
3 changes: 3 additions & 0 deletions typings/astropy/coordinates/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from typing import Any

def __getattr__(name: str) -> Any: ...
3 changes: 3 additions & 0 deletions typings/astropy/io/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from typing import Any

def __getattr__(name: str) -> Any: ...
3 changes: 3 additions & 0 deletions typings/astropy/io/fits/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from typing import Any

def __getattr__(name: str) -> Any: ...
3 changes: 3 additions & 0 deletions typings/astropy/time/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from typing import Any

def __getattr__(name: str) -> Any: ...

0 comments on commit 28b94f6

Please sign in to comment.