experiments package

This is where you would create your experiment that you would like to run on the radar. The following are a couple of examples of current SuperDARN experiments, and a brief discussion of the update() method which will be implemented at a later date.

experiments.normalscan module

Normalscan is a very common experiment for SuperDARN. It does not update itself, so no update() method is necessary. It only has a single slice, as there is only one frequency, pulse_len, beam_order, etc. Since there is only one slice there is no need for an interface dictionary.

 1#!/usr/bin/python
 2
 3# write an experiment that creates a new control program.
 4
 5import sys
 6import os
 7
 8BOREALISPATH = os.environ['BOREALISPATH']
 9sys.path.append(BOREALISPATH)
10
11import experiments.superdarn_common_fields as scf
12from experiment_prototype.experiment_prototype import ExperimentPrototype
13
14class Normalscan(ExperimentPrototype):
15
16    def __init__(self, **kwargs):
17        """
18        kwargs:
19
20        freq: int
21
22        """
23        cpid = 151
24        super(Normalscan, self).__init__(cpid)
25
26        if scf.IS_FORWARD_RADAR:
27            beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER
28        else:
29            beams_to_use = scf.STD_16_REVERSE_BEAM_ORDER
30
31        if scf.opts.site_id in ["cly", "rkn", "inv"]:
32            num_ranges = scf.POLARDARN_NUM_RANGES
33        if scf.opts.site_id in ["sas", "pgr"]:
34            num_ranges = scf.STD_NUM_RANGES
35
36        # default frequency set here
37        freq = scf.COMMON_MODE_FREQ_1
38        
39        if kwargs:
40            if 'freq' in kwargs.keys():
41                freq = kwargs['freq']
42        
43        self.printing('Frequency set to {}'.format(freq))
44
45        self.add_slice({  # slice_id = 0, there is only one slice.
46            "pulse_sequence": scf.SEQUENCE_7P,
47            "tau_spacing": scf.TAU_SPACING_7P,
48            "pulse_len": scf.PULSE_LEN_45KM,
49            "num_ranges": num_ranges,
50            "first_range": scf.STD_FIRST_RANGE,
51            "intt": 3500,  # duration of an integration, in ms
52            "beam_angle": scf.STD_16_BEAM_ANGLE,
53            "beam_order": beams_to_use,
54            "scanbound": [i * 3.5 for i in range(len(beams_to_use))], #1 min scan
55            "txfreq" : freq, #kHz
56            "acf": True,
57            "xcf": True,  # cross-correlation processing
58            "acfint": True,  # interferometer acfs
59        })
60

experiments.twofsound module

Twofsound is a common variant of the normalscan experiment for SuperDARN. It does not update itself, so no update() method is necessary. It has two frequencies so will require two slices. The frequencies switch after a full scan (full cycle through the beams), therefore the interfacing between slices 0 and 1 should be ‘SCAN’.

 1#!/usr/bin/python
 2
 3# write an experiment that creates a new control program.
 4import os
 5import sys
 6import copy
 7
 8BOREALISPATH = os.environ['BOREALISPATH']
 9sys.path.append(BOREALISPATH)
10
11from experiment_prototype.experiment_prototype import ExperimentPrototype
12import experiments.superdarn_common_fields as scf
13
14
15class Twofsound(ExperimentPrototype):
16
17    def __init__(self, **kwargs):
18        cpid = 3503
19
20        if scf.IS_FORWARD_RADAR:
21            beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER
22        else:
23            beams_to_use = scf.STD_16_REVERSE_BEAM_ORDER
24
25        if scf.opts.site_id in ["cly", "rkn", "inv"]:
26            num_ranges = scf.POLARDARN_NUM_RANGES
27        if scf.opts.site_id in ["sas", "pgr"]:
28            num_ranges = scf.STD_NUM_RANGES
29
30        tx_freq_1 = scf.COMMON_MODE_FREQ_1
31        tx_freq_2 = scf.COMMON_MODE_FREQ_2
32
33        if kwargs:
34            if 'freq1' in kwargs.keys():
35                tx_freq_1 = int(kwargs['freq1'])
36
37            if 'freq2' in kwargs.keys():
38                tx_freq_2 = int(kwargs['freq2'])
39
40        slice_1 = {  # slice_id = 0, the first slice
41            "pulse_sequence": scf.SEQUENCE_7P,
42            "tau_spacing": scf.TAU_SPACING_7P,
43            "pulse_len": scf.PULSE_LEN_45KM,
44            "num_ranges": num_ranges,
45            "first_range": scf.STD_FIRST_RANGE,
46            "intt": 3500,  # duration of an integration, in ms
47            "beam_angle": scf.STD_16_BEAM_ANGLE,
48            "beam_order": beams_to_use,
49            "scanbound" : [i * 3.5 for i in range(len(beams_to_use))],
50            "txfreq" : tx_freq_1, #kHz
51            "acf": True,
52            "xcf": True,  # cross-correlation processing
53            "acfint": True,  # interferometer acfs
54        }
55
56        slice_2 = copy.deepcopy(slice_1)
57        slice_2['txfreq'] = tx_freq_2
58
59        list_of_slices = [slice_1, slice_2]
60        sum_of_freq = 0
61        for slice in list_of_slices:
62            sum_of_freq += slice['txfreq']# kHz, oscillator mixer frequency on the USRP for TX
63        rxctrfreq = txctrfreq = int(sum_of_freq/len(list_of_slices))
64
65
66        super(Twofsound, self).__init__(cpid, txctrfreq=txctrfreq, rxctrfreq=rxctrfreq,
67                comment_string='Twofsound classic scan-by-scan')
68
69        self.add_slice(slice_1)
70
71        self.add_slice(slice_2, interfacing_dict={0: 'SCAN'})
72