Skip to content
Snippets Groups Projects
Commit 121f73c5 authored by Bas van der Tol's avatar Bas van der Tol
Browse files

Conditionally add ARRAY_CENTER column to OBSERVATION subtable

Add the column only when is does not exist yet.
parent 6d0c79b8
No related branches found
No related tags found
1 merge request!59Resolve "Add stationresponse comparison for oskar"
...@@ -39,13 +39,13 @@ def fix_antenna(oskar_ms_name: str, telescope_center_itrf: np.array): ...@@ -39,13 +39,13 @@ def fix_antenna(oskar_ms_name: str, telescope_center_itrf: np.array):
def add_array_center(oskar_ms_name: str, telescope_center_itrf: np.array): def add_array_center(oskar_ms_name: str, telescope_center_itrf: np.array):
"""Add ARRAY_CENTER column to ::OBSERVATION subtable""" """Add ARRAY_CENTER column to ::OBSERVATION subtable"""
anttable = pt.table(f"{oskar_ms_name}::ANTENNA", ack=False)
coldesc = anttable.getcoldesc("POSITION")
coldesc["name"] = "ARRAY_CENTER"
coldesc["comment"] = "Reference position for array"
obstable = pt.table(f"{oskar_ms_name}::OBSERVATION", readonly=False, ack=False) obstable = pt.table(f"{oskar_ms_name}::OBSERVATION", readonly=False, ack=False)
#obstable.addcols(coldesc) if 'ARRAY_CENTER' not in obstable.colnames():
anttable = pt.table(f"{oskar_ms_name}::ANTENNA", ack=False)
coldesc = anttable.getcoldesc("POSITION")
coldesc["name"] = "ARRAY_CENTER"
coldesc["comment"] = "Reference position for array"
obstable.addcols(coldesc)
obstable.putcol("ARRAY_CENTER", np.array([telescope_center_itrf])) obstable.putcol("ARRAY_CENTER", np.array([telescope_center_itrf]))
obstable.close() obstable.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment