diff --git a/socs/agents/acu/agent.py b/socs/agents/acu/agent.py index 02140ccf3..facc1d16b 100644 --- a/socs/agents/acu/agent.py +++ b/socs/agents/acu/agent.py @@ -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): @@ -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 @@ -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 diff --git a/socs/agents/acu/drivers.py b/socs/agents/acu/drivers.py index 419a47d7f..bd68dd9d9 100644 --- a/socs/agents/acu/drivers.py +++ b/socs/agents/acu/drivers.py @@ -21,6 +21,7 @@ 'standard': 0, 'standard_gen': 1, 'three_leg': 2, + 'two_leg': 3, } @@ -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 @@ -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. @@ -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 @@ -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) @@ -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) @@ -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. @@ -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 diff --git a/socs/agents/acu/turnarounds.py b/socs/agents/acu/turnarounds.py index b40286169..5b63baf77 100644 --- a/socs/agents/acu/turnarounds.py +++ b/socs/agents/acu/turnarounds.py @@ -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. @@ -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)