Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions socs/agents/acu/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1802,7 +1802,7 @@ def set_speed_mode(self, session, params):
default=None)
@ocs_agent.param('turnaround_method', type=str, default=None,
choices=[None, 'standard', 'standard_gen',
'three_leg'])
'three_leg', 'two_leg'])
@ocs_agent.param('reset', default=False, type=bool)
@inlineCallbacks
def set_scan_params(self, session, params):
Expand Down Expand Up @@ -2060,7 +2060,7 @@ def line_batcher(ff_scan, t_shift=0., n=10):
@ocs_agent.param('az_vel_ref', type=float, default=None)
@ocs_agent.param('turnaround_method', default=None,
choices=[None, 'standard', 'standard_gen',
'three_leg'])
'three_leg', 'two_leg'])
@ocs_agent.param('scan_upload_length', type=float, default=None)
@ocs_agent.param('type', default=None, choices=[1, 2, 3])
@inlineCallbacks
Expand Down Expand Up @@ -2134,8 +2134,12 @@ def generate_scan(self, session, params):
If None then the average of the endpoints is used.
turnaround_method (str): The method used for generating turnaround.
Default (None) generates the baseline minimal jerk trajectory.
'standard' uses the acu standard turnaround generation (same as None).
'standard_gen' generates a track_point list of points that mimics
the acu standard turnaround generation for use in type2/type3 scans.
'three_leg' generates a three-leg turnaround which attempts to
minimize the acceleration at the midpoint of the turnaround.
'two_leg' generates a three-leg turnaround with second_leg_time = 0.
scan_upload_length (float): number of seconds for each set
of uploaded points. If this is not specified, the
track manager will try to use as short a time as is
Expand Down
26 changes: 21 additions & 5 deletions socs/agents/acu/drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'standard': 0,
'standard_gen': 1,
'three_leg': 2,
'two_leg': 3,
}


Expand Down Expand Up @@ -350,9 +351,12 @@ def generate_constant_velocity_scan(az_endpoint1, az_endpoint2, az_speed,
scan endpoints in time. This can be used to better track
celestial sources in targeted scans.
turnaround_method (str): The method used for generating turnaround.
Default ('standard') generates the baseline minimal jerk trajectory.
(Default) 'standard' generates the baseline minimal jerk trajectory.
'standard_gen' generates a list of track_points throughout the turnaround
to mimic the standard acu turnaround.
'three_leg' generates a three-leg turnaround which attempts to
minimize the acceleration at the midpoint of the turnaround.
'two_leg' generates a "three_leg" turnaround with second_leg_time = 0.

Yields:
points (list): a list of TrackPoint objects. Raises
Expand Down Expand Up @@ -538,7 +542,7 @@ def generate_type3_scan(az_endpoint1, az_endpoint2, az_speed,
az_start='mid_inc',
az_first_pos=None,
az_drift=None,
turnaround_method='three_leg'):
turnaround_method='two_leg'):
"""Python generator to produce times, azimuth and elevation positions,
azimuth and elevation velocities, azimuth and elevation flags for
arbitrarily long type 3 scan.
Expand Down Expand Up @@ -583,6 +587,13 @@ def generate_type3_scan(az_endpoint1, az_endpoint2, az_speed,
az_drift (float): The rate (deg / s) at which to shift the
scan endpoints in time. This can be used to better track
celestial sources in targeted scans.
turnaround_method (str): The method used for generating turnaround.
'standard' is unusable with type3 scans!
'standard_gen' generates a list of track_points throughout the turnaround
to mimic the standard acu turnaround and is usable for type3 scans.
'three_leg' generates a three-leg turnaround which attempts to
minimize the acceleration at the midpoint of the turnaround.
(Default) 'two_leg' generates a "three_leg" turnaround with second_leg_time = 0.

Yields:
points (list): a list of TrackPoint objects. Raises
Expand Down Expand Up @@ -714,7 +725,6 @@ def get_el(_t):
turntime=tt[1],
az_flag=az_flag, el_flag=el_flag,
step_time=step_time,
second_leg_time=0.,
point_group_batch=point_group_batch)
point_queue.extend(turnaround_track)

Expand Down Expand Up @@ -749,7 +759,6 @@ def get_el(_t):
turntime=tt[1],
az_flag=az_flag, el_flag=el_flag,
step_time=step_time,
second_leg_time=0.,
point_group_batch=point_group_batch)
point_queue.extend(turnaround_track)

Expand Down Expand Up @@ -799,7 +808,7 @@ def generate_type2_scan(az_endpoint1, az_endpoint2, az_speed,
az_start='mid_inc',
az_first_pos=None,
az_drift=None,
turnaround_method='three_leg'):
turnaround_method='two_leg'):
"""Python generator to produce times, azimuth and elevation positions,
azimuth and elevation velocities, azimuth and elevation flags for
arbitrarily long type 2 scan.
Expand Down Expand Up @@ -841,6 +850,13 @@ def generate_type2_scan(az_endpoint1, az_endpoint2, az_speed,
az_drift (float): The rate (deg / s) at which to shift the
scan endpoints in time. This can be used to better track
celestial sources in targeted scans.
turnaround_method (str): The method used for generating turnaround.
'standard' is unusable with type2 scans!
'standard_gen' generates a list of track_points throughout the turnaround
to mimic the standard acu turnaround and is usable for type2 scans.
'three_leg' generates a three-leg turnaround which attempts to
minimize the acceleration at the midpoint of the turnaround.
'two_leg' (Default) generates a "three_leg" turnaround with second_leg_time = 0.

Yields:
points (list): a list of TrackPoint objects. Raises
Expand Down
5 changes: 5 additions & 0 deletions socs/agents/acu/turnarounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def gen_turnaround(turnaround_method, t0, az0, el0, v0, turntime, az_flag, el_fl
2. "three_leg": Generates a special turnaround that splits the turnaround into three "legs" that attempt to
minimize the acceleration at the midpoint of the turnaround. See the _gen_three_leg_turnaround() docstring
for further documentation.
3. "two_leg": Generates a "three_leg" turnaround with second_leg_time = 0.
t0 (float): The initial time of the turnaround.
az0 (float): The iniital azimuth position of the turnaround. Should be equal to the final azimuth position of the turnaround.
el0 (float): The initial elevation of the turnaround. El velocity is forced to 0 here so this is only used for creating TrackPoints.
Expand Down Expand Up @@ -45,6 +46,10 @@ def gen_turnaround(turnaround_method, t0, az0, el0, v0, turntime, az_flag, el_fl
if turnaround_method == "standard_gen":
ts, azs, vs = _gen_standard_turnaround(v0, turntime, step_time)

elif turnaround_method == "two_leg":
# Two leg turnarounds set second_leg_time = 0
ts, azs, vs = _gen_three_leg_turnaround(v0, turntime, 0., second_leg_velocity, step_time)

elif turnaround_method == "three_leg":
ts, azs, vs = _gen_three_leg_turnaround(v0, turntime, second_leg_time, second_leg_velocity, step_time)

Expand Down