Skip to content
Snippets Groups Projects
Commit bf6dfa1d authored by Pieter Donker's avatar Pieter Donker
Browse files

#2272, add some sweep arguments and removed some magic numbers

parent 45822477
No related branches found
No related tags found
No related merge requests found
...@@ -64,9 +64,10 @@ SC4_40_CBEAMS_XY = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17, ...@@ -64,9 +64,10 @@ SC4_40_CBEAMS_XY = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,
SC4_40_ELEMENT_BEAMS_X = [30,61, 6,31,00,37,27,60,42,00, 3,36,26, 7,00,57, 2,33,18,00,45,56,21,40,00,32,44,63, 5,00,20,39,41,16,00,62,17,38,35,00] SC4_40_ELEMENT_BEAMS_X = [30,61, 6,31,00,37,27,60,42,00, 3,36,26, 7,00,57, 2,33,18,00,45,56,21,40,00,32,44,63, 5,00,20,39,41,16,00,62,17,38,35,00]
SC4_40_ELEMENT_BEAMS_Y = [ 9,30,61,31,00, 6,27,60,42,00, 3,36,15, 7,00,26,57, 2,18,00,45,56,21,29,00,32,11,44,40,00,63,20,41, 5,00,62,17,38,16,00] SC4_40_ELEMENT_BEAMS_Y = [ 9,30,61,31,00, 6,27,60,42,00, 3,36,15, 7,00,26,57, 2,18,00,45,56,21,29,00,32,11,44,40,00,63,20,41, 5,00,62,17,38,16,00]
SC4_CHANNEL_FRACTION = 8.0 # frequency sweep step in unit of channel #SC4_CHANNEL_FRACTION = 8.0 # frequency sweep step in unit of channel
SC4_NOF_CHANNELS_PER_SUBBAND_FULLRATE = 32 SC4_NOF_CHANNELS_PER_SUBBAND_FULLRATE = 32
SC4_NOF_CHANNELS_PER_SUBBAND_HALFRATE = 64 SC4_NOF_CHANNELS_PER_SUBBAND_HALFRATE = 64
SC4_NOF_OUTPUT_STREAMS = 4
# Used for SC1 # Used for SC1
SC1_32_CENTRAL_ELEMENT_BEAMS = [56] SC1_32_CENTRAL_ELEMENT_BEAMS = [56]
...@@ -218,6 +219,8 @@ if __name__ == "__main__": ...@@ -218,6 +219,8 @@ if __name__ == "__main__":
_parser.add_argument('--sc', default=4, type=int, help='ARTS Science Case: 1 or 4. This determines the element beams.') _parser.add_argument('--sc', default=4, type=int, help='ARTS Science Case: 1 or 4. This determines the element beams.')
_parser.add_argument('--wg_steptime', default=0.006, type=float, help='Seconds per frequency step') _parser.add_argument('--wg_steptime', default=0.006, type=float, help='Seconds per frequency step')
_parser.add_argument('--wg_amplitude', default=31, type=int, help='WG amplitude from range(128), choose <= 16 to avoid beamlet clipping') _parser.add_argument('--wg_amplitude', default=31, type=int, help='WG amplitude from range(128), choose <= 16 to avoid beamlet clipping')
_parser.add_argument('--wg_chan_fraction', type=float, help='WG channel fraction for sweep, default = nof_channels_per_sb / nof_output_streams(4)')
_parser.add_argument('--wg_start_chan', type=float, help='WG start channel for sweep, default = nof_channels_per_sb / nof_channels_per_stream(8)')
_parser.add_argument('--fullrate', default=False, action='store_true', help='For use with older SC4 full rate firmware; affects WG channels per subband. The default assumes the latest half rate SC4 firmware.') _parser.add_argument('--fullrate', default=False, action='store_true', help='For use with older SC4 full rate firmware; affects WG channels per subband. The default assumes the latest half rate SC4 firmware.')
_parser.add_argument('--bits', default=6, type=int, help='For use with older SC4 full rate firmware; affects WG channels per subband. The default assumes the latest half rate SC4 firmware.') _parser.add_argument('--bits', default=6, type=int, help='For use with older SC4 full rate firmware; affects WG channels per subband. The default assumes the latest half rate SC4 firmware.')
_parser.add_argument('--rep', default=1, type=int, help='Number of times to repeat the sweep') _parser.add_argument('--rep', default=1, type=int, help='Number of times to repeat the sweep')
...@@ -229,17 +232,29 @@ if __name__ == "__main__": ...@@ -229,17 +232,29 @@ if __name__ == "__main__":
globalsp = SC1_32_CENTRAL_ELEMENT_BEAMS globalsp = SC1_32_CENTRAL_ELEMENT_BEAMS
wg_chan_fraction = SC1_CHANNEL_FRACTION wg_chan_fraction = SC1_CHANNEL_FRACTION
n_chan_per_sub = SC1_NOF_CHANNELS_PER_SUBBAND n_chan_per_sub = SC1_NOF_CHANNELS_PER_SUBBAND
wg_chan = 4
else: #SC4 else: #SC4
wg_chan_fraction = SC4_CHANNEL_FRACTION if args.fullrate:
if args.bits == 6: # is halfrate (6bit) n_chan_per_sub = SC4_NOF_CHANNELS_PER_SUBBAND_FULLRATE
else:
n_chan_per_sub = SC4_NOF_CHANNELS_PER_SUBBAND_HALFRATE n_chan_per_sub = SC4_NOF_CHANNELS_PER_SUBBAND_HALFRATE
wg_chan_fraction = n_chan_per_sub / SC4_NOF_OUTPUT_STREAMS
if args.wg.chan_fraction:
wg_chan_fraction = args.wg.chan_fraction
n_channels_per_output_stream = n_chan_per_sub / SC4_NOF_OUTPUT_STREAMS
wg_chan = n_chan_per_sub / n_channels_per_output_stream
if args.wg_start_chan:
wg_chan = args.wg_start_chan
if args.bits == 6: # is halfrate (6bit)
cbs = SC4_40_CBEAMS_XY cbs = SC4_40_CBEAMS_XY
if 0 in args.pol: if 0 in args.pol:
globalsp = SC4_40_ELEMENT_BEAMS_X globalsp = SC4_40_ELEMENT_BEAMS_X
else: else:
globalsp = SC4_40_ELEMENT_BEAMS_Y globalsp = SC4_40_ELEMENT_BEAMS_Y
else: # must be fullrate (8bit) else: # must be fullrate (8bit)
n_chan_per_sub = SC4_NOF_CHANNELS_PER_SUBBAND_FULLRATE
cbs = SC4_32_CBEAMS_XY cbs = SC4_32_CBEAMS_XY
if 0 in args.pol: if 0 in args.pol:
globalsp = SC4_32_ELEMENT_BEAMS_X globalsp = SC4_32_ELEMENT_BEAMS_X
...@@ -248,11 +263,8 @@ if __name__ == "__main__": ...@@ -248,11 +263,8 @@ if __name__ == "__main__":
set_cb_weights(args.weight) # write weights to all cbs set_cb_weights(args.weight) # write weights to all cbs
wg_chan = n_chan_per_sub / 2 # initial WG channel in WG subband, from range(n_chan_per_sub) where n_chan_per_sub 2 is at center
wg_chan = 4
n_steps = int(NOF_SUBBANDS * n_chan_per_sub / wg_chan_fraction)
n_steps = int(NOF_SUBBANDS * n_chan_per_sub / wg_chan_fraction)
# Derive iblet and thus via Rsub the start WG subband from Central UniBoard # Derive iblet and thus via Rsub the start WG subband from Central UniBoard
n_bb = 24 n_bb = 24
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment