31
31
'ccat' : {
32
32
'az_speed' : 2 ,
33
33
'az_accel' : 1 ,
34
+ 'el_freq' : .15 ,
34
35
},
35
36
'satp' : {
36
37
'az_speed' : 1 ,
37
38
'az_accel' : 1 ,
39
+ 'el_freq' : 0 ,
38
40
},
39
41
}
40
42
@@ -234,7 +236,7 @@ def __init__(self, agent, acu_config='guess',
234
236
sun_config = self .sun_config )
235
237
self ._reset_sun_params ()
236
238
237
- # Scan params (default vel / accel).
239
+ # Scan params (default vel / accel / el freq ).
238
240
self .default_scan_params = \
239
241
dict (INIT_DEFAULT_SCAN_PARAMS [self .platform_type ])
240
242
for _k in self .default_scan_params .keys ():
@@ -1781,6 +1783,7 @@ def set_speed_mode(self, session, params):
1781
1783
1782
1784
@ocs_agent .param ('az_speed' , type = float , default = None )
1783
1785
@ocs_agent .param ('az_accel' , type = float , default = None )
1786
+ @ocs_agent .param ('el_freq' , type = float , default = None )
1784
1787
@ocs_agent .param ('reset' , default = False , type = bool )
1785
1788
@inlineCallbacks
1786
1789
def set_scan_params (self , session , params ):
@@ -1793,13 +1796,15 @@ def set_scan_params(self, session, params):
1793
1796
az_speed (float, optional): The azimuth scan speed.
1794
1797
az_accel (float, optional): The (average) azimuth
1795
1798
acceleration at turn-around.
1799
+ el_freq (float, optional): The frequency of elevation nods in
1800
+ type 3 scans.
1796
1801
reset (bool, optional): If True, reset all params to default
1797
1802
values before applying any updates passed explicitly here.
1798
1803
1799
1804
"""
1800
1805
if params ['reset' ]:
1801
1806
self .scan_params .update (self .default_scan_params )
1802
- for k in ['az_speed' , 'az_accel' ]:
1807
+ for k in ['az_speed' , 'az_accel' , 'el_freq' ]:
1803
1808
if params [k ] is not None :
1804
1809
self .scan_params [k ] = params [k ]
1805
1810
self .log .info ('Updated default scan params to {sp}' , sp = self .scan_params )
@@ -2009,6 +2014,7 @@ def line_batcher(ff_scan, t_shift=0., n=10):
2009
2014
@ocs_agent .param ('el_endpoint1' , type = float , default = None )
2010
2015
@ocs_agent .param ('el_endpoint2' , type = float , default = None )
2011
2016
@ocs_agent .param ('el_speed' , type = float , default = 0. )
2017
+ @ocs_agent .param ('el_freq' , type = float , default = None )
2012
2018
@ocs_agent .param ('num_scans' , type = float , default = None )
2013
2019
@ocs_agent .param ('start_time' , type = float , default = None )
2014
2020
@ocs_agent .param ('wait_to_start' , type = float , default = None )
@@ -2018,6 +2024,7 @@ def line_batcher(ff_scan, t_shift=0., n=10):
2018
2024
'mid_inc' , 'mid_dec' ])
2019
2025
@ocs_agent .param ('az_drift' , type = float , default = None )
2020
2026
@ocs_agent .param ('az_only' , type = bool , default = True )
2027
+ @ocs_agent .param ('type' , default = 1 , choices = [1 , 2 , 3 ])
2021
2028
@ocs_agent .param ('scan_upload_length' , type = float , default = None )
2022
2029
@inlineCallbacks
2023
2030
def generate_scan (self , session , params ):
@@ -2100,10 +2107,13 @@ def generate_scan(self, session, params):
2100
2107
# Params with defaults configured ...
2101
2108
az_speed = params ['az_speed' ]
2102
2109
az_accel = params ['az_accel' ]
2110
+ el_freq = params ['el_freq' ]
2103
2111
if az_speed is None :
2104
2112
az_speed = self .scan_params ['az_speed' ]
2105
2113
if az_accel is None :
2106
2114
az_accel = self .scan_params ['az_accel' ]
2115
+ if el_freq is None :
2116
+ el_freq = self .scan_params ['el_freq' ]
2107
2117
2108
2118
# Do we need to limit the az_accel? This limit comes from a
2109
2119
# maximum jerk parameter; the equation below (without the
@@ -2206,18 +2216,41 @@ def generate_scan(self, session, params):
2206
2216
return False , f'Start position seek failed with message: { msg } '
2207
2217
2208
2218
# Prepare the point generator.
2209
- g = sh .generate_constant_velocity_scan (az_endpoint1 = az_endpoint1 ,
2219
+ free_form = False
2220
+ if params ["type" ] == 1 :
2221
+ g = sh .generate_constant_velocity_scan (az_endpoint1 = az_endpoint1 ,
2210
2222
az_endpoint2 = az_endpoint2 ,
2211
2223
az_speed = az_speed , acc = az_accel ,
2212
2224
el_endpoint1 = el_endpoint1 ,
2213
2225
el_endpoint2 = el_endpoint2 ,
2214
2226
el_speed = el_speed ,
2215
2227
az_first_pos = plan ['init_az' ],
2216
2228
** scan_params )
2229
+ elif params ["type" ] == 2 :
2230
+ free_form = True
2231
+ g = sh .generate_type2_scan (az_endpoint1 = az_endpoint1 ,
2232
+ az_endpoint2 = az_endpoint2 ,
2233
+ az_speed = az_speed , acc = az_accel ,
2234
+ el_endpoint1 = el_endpoint1 ,
2235
+ az_first_pos = plan ['init_az' ],
2236
+ ** scan_params )
2237
+ elif params ["type" ] == 3 :
2238
+ free_form = True
2239
+ azonly = False
2240
+ g = sh .generate_type3_scan (az_endpoint1 = az_endpoint1 ,
2241
+ az_endpoint2 = az_endpoint2 ,
2242
+ az_speed = az_speed , acc = az_accel ,
2243
+ el_endpoint1 = el_endpoint1 ,
2244
+ el_endpoint2 = el_endpoint2 ,
2245
+ el_freq = el_freq ,
2246
+ az_first_pos = plan ['init_az' ],
2247
+ ** scan_params )
2248
+ else :
2249
+ raise ValueError ("Scan type must be 1, 2, or 3" )
2217
2250
2218
2251
return (yield self ._run_track (
2219
2252
session = session , point_gen = g , step_time = step_time ,
2220
- azonly = azonly , point_batch_count = point_batch_count ))
2253
+ azonly = azonly , point_batch_count = point_batch_count , free_form = free_form ))
2221
2254
2222
2255
@inlineCallbacks
2223
2256
def _run_track (self , session , point_gen , step_time , azonly = False ,
0 commit comments