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):
17        cpid = 151
18        super(Normalscan, self).__init__(cpid)
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        self.add_slice({  # slice_id = 0, there is only one slice.
31            "pulse_sequence": scf.SEQUENCE_7P,
32            "tau_spacing": scf.TAU_SPACING_7P,
33            "pulse_len": scf.PULSE_LEN_45KM,
34            "num_ranges": num_ranges,
35            "first_range": scf.STD_FIRST_RANGE,
36            "intt": 3500,  # duration of an integration, in ms
37            "beam_angle": scf.STD_16_BEAM_ANGLE,
38            "beam_order": beams_to_use,
39            "scanbound": [i * 3.5 for i in range(len(beams_to_use))], #1 min scan
40            "txfreq" : scf.COMMON_MODE_FREQ_1, #kHz
41            "acf": True,
42            "xcf": True,  # cross-correlation processing
43            "acfint": True,  # interferometer acfs
44        })
45

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):
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        slice_1 = {  # slice_id = 0, the first slice
31            "pulse_sequence": scf.SEQUENCE_7P,
32            "tau_spacing": scf.TAU_SPACING_7P,
33            "pulse_len": scf.PULSE_LEN_45KM,
34            "num_ranges": num_ranges,
35            "first_range": scf.STD_FIRST_RANGE,
36            "intt": 3500,  # duration of an integration, in ms
37            "beam_angle": scf.STD_16_BEAM_ANGLE,
38            "beam_order": beams_to_use,
39            "scanbound" : [i * 3.5 for i in range(len(beams_to_use))],
40            "txfreq" : scf.COMMON_MODE_FREQ_1, #kHz
41            "acf": True,
42            "xcf": True,  # cross-correlation processing
43            "acfint": True,  # interferometer acfs
44        }
45
46        slice_2 = copy.deepcopy(slice_1)
47        slice_2['txfreq'] = scf.COMMON_MODE_FREQ_2
48
49        list_of_slices = [slice_1, slice_2]
50        sum_of_freq = 0
51        for slice in list_of_slices:
52            sum_of_freq += slice['txfreq']# kHz, oscillator mixer frequency on the USRP for TX
53        rxctrfreq = txctrfreq = int(sum_of_freq/len(list_of_slices))
54
55
56        super(Twofsound, self).__init__(cpid, txctrfreq=txctrfreq, rxctrfreq=rxctrfreq,
57                comment_string='Twofsound classic scan-by-scan')
58
59        self.add_slice(slice_1)
60
61        self.add_slice(slice_2, interfacing_dict={0: 'SCAN'})
62