Skip to content

Commit

Permalink
add elevation_check, temperature_check in the calibration() to enable…
Browse files Browse the repository at this point in the history
… remval of these checks
  • Loading branch information
sadachi5 committed Sep 5, 2024
1 parent ec336e9 commit a7929da
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/sorunlib/wiregrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _check_zenith():


# Calibration Functions
def _check_telescope_position(boresight_check=True):
def _check_telescope_position(elevation_check=True, boresight_check=True):
# Get current telescope position
acu = run.CLIENTS['acu']
resp = acu.monitor.status()
Expand All @@ -81,13 +81,14 @@ def _check_telescope_position(boresight_check=True):
boresight = resp.session['data']['StatusDetailed']['Boresight current position']

# Check appropriate elevation
try:
assert (el > 50 - EL_DIFF_THRESHOLD)
except AssertionError:
error = "Telescope not at > 50 deg elevation. Cannot proceed with " + \
f"wiregrid calibration in current position ({az}, {el}). " + \
"Aborting."
raise RuntimeError(error)
if elevation_check:
try:
assert (el > 50 - EL_DIFF_THRESHOLD)
except AssertionError:
error = "Telescope not at > 50 deg elevation. Cannot proceed with " + \
f"wiregrid calibration in current position ({az}, {el}). " + \
"Aborting."
raise RuntimeError(error)

# Check boresight angle
if boresight_check:
Expand Down Expand Up @@ -255,7 +256,8 @@ def rotate(continuous, duration=30, num_laps=1, stopped_time=10.):
check_response(kikusui, resp)


def calibrate(continuous=False, boresight_check=True):
def calibrate(continuous=False, elevation_check=True, boresight_check=True,
temperature_check=True):
"""Run a wiregrid calibration.
Args:
Expand All @@ -266,9 +268,11 @@ def calibrate(continuous=False, boresight_check=True):
"""
try:
_check_telescope_position(boresight_check=boresight_check)
_check_telescope_position(elevation_check=elevation_check,
boresight_check=boresight_check)
_check_agents_online()
_check_temperature_sensors()
if temperature_check:
_check_temperature_sensors()
_check_motor_on()

# Rotate for reference before insertion
Expand Down

0 comments on commit a7929da

Please sign in to comment.