From c716edd025e96c67b5927f22aa8804f18744540c Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Fri, 7 Apr 2023 00:32:09 -0600 Subject: [PATCH 01/13] Updated so all pass new pydantic tests. * Updated all non-test experiments to pass tests. Changes include: - self.printing() changed to print() - decimation_scheme field added to all slices - rxonly added to listen-only slices --- 2multifsound.py | 2 ++ IB_collab_mode.py | 13 ++++++------- bistatic_test.py | 4 +++- borealis_paper.py | 5 ++++- epopsound.py | 9 +++++---- epopsound_one_beam.py | 11 +++++------ full_fov.py | 6 ++++-- full_fov_15km.py | 5 +++-- full_fov_2freq.py | 4 +++- full_fov_3freq.py | 4 +++- full_fov_comparison.py | 6 ++++-- fullscanstepmode.py | 4 +++- haarpscan.py | 4 +++- impttest.py | 2 ++ interleavedscan.py | 2 ++ interleavesound.py | 11 +++++++---- listening_normalscan_1.py | 4 ++++ listening_normalscan_2.py | 4 ++++ multifreq_widebeam.py | 2 ++ narrow_wide_comparison.py | 6 ++++-- normalscan.py | 4 +++- normalscan_13MHz.py | 2 ++ normalscan_aligned.py | 6 ++++-- normalscan_boresite.py | 2 ++ normalscan_intn.py | 4 +++- normalscan_ppo_test.py | 6 ++++-- normalscan_single_beam.py | 2 ++ normalsound.py | 3 +++ politescan.py | 3 +++ politescan2.py | 5 +++++ power_meter_mode.py | 4 +++- pulse_interfacing_test.py | 4 +++- pulse_phase_offset_decoding_test.py | 4 +++- rbspscan.py | 2 ++ synch_test.py | 2 ++ tauscan.py | 4 +++- themisscan.py | 2 ++ twofsound.py | 5 ++++- widebeam_2tx.py | 4 +++- widebeam_3tx.py | 4 +++- 40 files changed, 132 insertions(+), 48 deletions(-) diff --git a/2multifsound.py b/2multifsound.py index ba2991e..ec628fe 100644 --- a/2multifsound.py +++ b/2multifsound.py @@ -13,6 +13,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class TwoMultifsound(ExperimentPrototype): @@ -47,6 +48,7 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } slice_2 = copy.deepcopy(slice_1) diff --git a/IB_collab_mode.py b/IB_collab_mode.py index bce4a53..d812655 100644 --- a/IB_collab_mode.py +++ b/IB_collab_mode.py @@ -68,14 +68,12 @@ def __init__(self, **kwargs): if kwargs: if 'freq' in kwargs.keys(): freq = int(kwargs['freq']) - self.printing('Using frequency scheduled for {date}: {freq} kHz' - .format(date=datetime.datetime.utcnow().strftime('%Y%m%d %H:%M'), freq=freq)) + print('Using frequency scheduled for {date}: {freq} kHz' # TODO: Log + .format(date=datetime.datetime.utcnow().strftime('%Y%m%d %H:%M'), freq=freq)) else: - self.printing('Frequency not found: using default frequency {freq} kHz' - .format(freq=freq)) + print('Frequency not found: using default frequency {freq} kHz'.format(freq=freq)) # TODO: Log else: - self.printing('Frequency not found: using default frequency {freq} kHz' - .format(freq=freq)) + print('Frequency not found: using default frequency {freq} kHz'.format(freq=freq)) # TODO: Log decimation_scheme = create_15km_scheme() @@ -99,6 +97,7 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": decimation_scheme, } list_of_slices = [slice_1] @@ -111,7 +110,7 @@ def __init__(self, **kwargs): super().__init__( cpid, txctrfreq=txctrfreq, output_rx_rate=decimation_scheme.output_sample_rate, - rxctrfreq=rxctrfreq, decimation_scheme=decimation_scheme, + rxctrfreq=rxctrfreq, comment_string='ICEBEAR, 5 beam, 2s integration, 15 km') self.add_slice(slice_1) diff --git a/bistatic_test.py b/bistatic_test.py index cd37b0d..131b68a 100644 --- a/bistatic_test.py +++ b/bistatic_test.py @@ -14,6 +14,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class BistaticTest(ExperimentPrototype): @@ -61,7 +62,8 @@ def __init__(self, **kwargs): "freq": freq, # kHz "scanbound": [i * 3.7 for i in range(len(scf.STD_16_BEAM_ANGLE))], # align each aveperiod to 3.7s boundary "wait_for_first_scanbound": False, - "align_sequences": True # align start of sequence to tenths of a second + "align_sequences": True, # align start of sequence to tenths of a second + "decimation_scheme": create_default_scheme(), } if 'listen_to' in kwargs.keys() and 'beam_order' in kwargs.keys(): # Mutually exclusive arguments diff --git a/borealis_paper.py b/borealis_paper.py index 38e238a..37a3077 100644 --- a/borealis_paper.py +++ b/borealis_paper.py @@ -14,6 +14,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme def phase_encode(beam_iter, sequence_num, num_pulses): @@ -37,7 +38,9 @@ def __init__(self): "rx_beam_order": [0], "tx_beam_order": [0], "freq" : 13100, - "acf" : True + "acf" : True, + "decimation_scheme": create_default_scheme(), + } slice2 = copy.deepcopy(default_slice) diff --git a/epopsound.py b/epopsound.py index 02ad083..68375be 100644 --- a/epopsound.py +++ b/epopsound.py @@ -19,6 +19,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Epopsound(ExperimentPrototype): @@ -47,9 +48,8 @@ def __init__(self, **kwargs): if 'marker_period' in kwargs.keys(): marker_period = int(kwargs['marker_period']) - self.printing('Freqs (kHz): {}, Start Beam: {}, Stop Beam: {}, ' - 'Marker Period: {}, ' - .format(freqs, startbeam, stopbeam, marker_period)) + print('Freqs (kHz): {}, Start Beam: {}, Stop Beam: {}, Marker Period: {}, ' # TODO: Log + .format(freqs, startbeam, stopbeam, marker_period)) if scf.options.site_id in ["cly", "rkn", "inv"]: num_ranges = scf.POLARDARN_NUM_RANGES @@ -84,7 +84,8 @@ def __init__(self, **kwargs): "tx_beam_order": beams_to_use, "acf": True, "xcf": True, - "acfint": True + "acfint": True, + "decimation_scheme": create_default_scheme(), } for freq in freqs: diff --git a/epopsound_one_beam.py b/epopsound_one_beam.py index fdecb5b..33ec866 100644 --- a/epopsound_one_beam.py +++ b/epopsound_one_beam.py @@ -19,6 +19,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Epopsound(ExperimentPrototype): @@ -45,9 +46,7 @@ def __init__(self, **kwargs): if 'marker_period' in kwargs.keys(): marker_period = int(kwargs['marker_period']) - self.printing('Freqs (kHz): {}, Beam: {}, ' - 'Marker Period: {}' - .format(freqs, beam, marker_period)) + print('Freqs (kHz): {}, Beam: {}, Marker Period: {}'.format(freqs, beam, marker_period)) # TODO: Log center_freq = int(sum(freqs)/len(freqs)) @@ -67,7 +66,8 @@ def __init__(self, **kwargs): "beam_angle": scf.STD_16_BEAM_ANGLE, "acf": True, "xcf": True, - "acfint": True + "acfint": True, + "decimation_scheme": create_default_scheme(), } for num, freq in enumerate(freqs): @@ -95,8 +95,7 @@ def __init__(self, **kwargs): slices.append(new_slice) - super().__init__(cpid=cpid, txctrfreq=center_freq, rxctrfreq=center_freq, - comment_string=Epopsound.__doc__) + super().__init__(cpid=cpid, txctrfreq=center_freq, rxctrfreq=center_freq, comment_string=Epopsound.__doc__) self.add_slice(slices[0]) if len(slices) > 1: diff --git a/full_fov.py b/full_fov.py index c6b2a33..6fae3ce 100644 --- a/full_fov.py +++ b/full_fov.py @@ -13,6 +13,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class FullFOV(ExperimentPrototype): @@ -37,7 +38,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) # TODO: Log num_antennas = scf.options.main_antenna_count @@ -56,6 +57,7 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "align_sequences": True # align start of sequence to tenths of a second + "align_sequences": True, # align start of sequence to tenths of a second + "decimation_scheme": create_default_scheme(), }) diff --git a/full_fov_15km.py b/full_fov_15km.py index fe5b1f5..bf6ea53 100644 --- a/full_fov_15km.py +++ b/full_fov_15km.py @@ -60,7 +60,7 @@ def __init__(self, **kwargs): cpid = 3801 decimation_scheme = create_15km_scheme() - super().__init__(cpid, output_rx_rate=decimation_scheme.output_sample_rate, decimation_scheme=decimation_scheme, + super().__init__(cpid, output_rx_rate=decimation_scheme.output_sample_rate, comment_string='Full FOV 15km Resolution Experiment') num_ranges = scf.STD_NUM_RANGES * 3 # Each range is a third of the usual size, want same spatial extent @@ -72,7 +72,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) # TODO: Log num_antennas = scf.options.main_antenna_count @@ -88,5 +88,6 @@ def __init__(self, **kwargs): "tx_beam_order": [0], # only one pattern "tx_antenna_pattern": scf.easy_widebeam, "freq": freq, # kHz + "decimation_scheme": create_15km_scheme(), }) diff --git a/full_fov_2freq.py b/full_fov_2freq.py index b9a2cb9..1e45c03 100644 --- a/full_fov_2freq.py +++ b/full_fov_2freq.py @@ -16,6 +16,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class FullFOV2Freq(ExperimentPrototype): @@ -63,7 +64,8 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "align_sequences": True # align start of sequence to tenths of a second + "align_sequences": True, # align start of sequence to tenths of a second + "decimation_scheme": create_default_scheme(), } # Transmit on the second frequency on the right half of the array diff --git a/full_fov_3freq.py b/full_fov_3freq.py index a0f56c1..a0986e0 100644 --- a/full_fov_3freq.py +++ b/full_fov_3freq.py @@ -16,6 +16,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class FullFOV3Freq(ExperimentPrototype): @@ -62,7 +63,8 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "align_sequences": True # align start of sequence to tenths of a second + "align_sequences": True, # align start of sequence to tenths of a second + "decimation_scheme": create_default_scheme(), } # Transmit on the second frequency on the right half of the array diff --git a/full_fov_comparison.py b/full_fov_comparison.py index 244149b..6ac26fc 100644 --- a/full_fov_comparison.py +++ b/full_fov_comparison.py @@ -16,6 +16,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme def widebeam_no_phase(frequency_khz, tx_antennas, antenna_spacing_m): @@ -48,7 +49,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) # TODO: Log num_antennas = scf.options.main_antenna_count @@ -66,7 +67,8 @@ def __init__(self, **kwargs): "freq": freq, # kHz "align_sequences": True, # align start of sequence to tenths of a second "scanbound": scf.easy_scanbound(scf.INTT_7P, scf.STD_16_BEAM_ANGLE), - "wait_for_first_scanbound": False + "wait_for_first_scanbound": False, + "decimation_scheme": create_default_scheme(), } slice_1 = copy.deepcopy(slice_0) diff --git a/fullscanstepmode.py b/fullscanstepmode.py index f804a1e..b338e95 100644 --- a/fullscanstepmode.py +++ b/fullscanstepmode.py @@ -13,6 +13,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class FullScanStepMode(ExperimentPrototype): @@ -89,7 +90,8 @@ def move_freqs(direction): "acf": True, "xcf": True, # cross-correlation processing "acfint" : True, # interferometer acfs - "comment" : FullScanStepMode.__doc__ + "comment" : FullScanStepMode.__doc__, + "decimation_scheme": create_default_scheme(), } slices.append(s) diff --git a/haarpscan.py b/haarpscan.py index f4b6557..f9489b9 100644 --- a/haarpscan.py +++ b/haarpscan.py @@ -12,6 +12,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class HAARPScan(ExperimentPrototype): @@ -43,7 +44,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) # TODO: Log self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, @@ -60,4 +61,5 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) diff --git a/impttest.py b/impttest.py index 9edc657..0af78ef 100644 --- a/impttest.py +++ b/impttest.py @@ -16,6 +16,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme def phase_encode(beam_iter, sequence_num, num_pulses): @@ -37,6 +38,7 @@ def __init__(self): "rx_beam_order": [0], "tx_beam_order": [0], "freq" : 13100, + "decimation_scheme": create_default_scheme(), } impt_slice = copy.deepcopy(default_slice) diff --git a/interleavedscan.py b/interleavedscan.py index 3c71817..055a145 100644 --- a/interleavedscan.py +++ b/interleavedscan.py @@ -16,6 +16,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class InterleavedScan(ExperimentPrototype): @@ -47,6 +48,7 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "lag_table": scf.STD_8P_LAG_TABLE, # lag table needed for 8P since not all lags used. + "decimation_scheme": create_default_scheme(), } super().__init__(cpid) diff --git a/interleavesound.py b/interleavesound.py index 73b6379..50f16bc 100644 --- a/interleavesound.py +++ b/interleavesound.py @@ -13,6 +13,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class InterleaveSound(ExperimentPrototype): @@ -50,6 +51,7 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "lag_table": scf.STD_8P_LAG_TABLE, # lag table needed for 8P since not all lags used. + "decimation_scheme": create_default_scheme(), }) sounding_scanbound_spacing = 1.5 # seconds @@ -73,15 +75,16 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "lag_table": scf.STD_8P_LAG_TABLE, # lag table needed for 8P since not all lags used + "decimation_scheme": create_default_scheme(), }) sum_of_freq = 0 + all_freqs = [] for slice in slices: - sum_of_freq += slice['freq'] # kHz, oscillator mixer frequency on the USRP for TX - rxctrfreq = txctrfreq = int(sum_of_freq / len(slices)) + all_freqs.append(slice['freq']) # kHz, oscillator mixer frequency on the USRP for TX + rxctrfreq = txctrfreq = int((max(all_freqs) + min(all_freqs)) / 2) - super().__init__(cpid, txctrfreq=txctrfreq, rxctrfreq=rxctrfreq, - comment_string=InterleaveSound.__doc__) + super().__init__(cpid, txctrfreq=txctrfreq, rxctrfreq=rxctrfreq, comment_string=InterleaveSound.__doc__) self.add_slice(slices[0]) self.add_slice(slices[1], {0: 'SCAN'}) diff --git a/listening_normalscan_1.py b/listening_normalscan_1.py index 448f466..f0f89de 100644 --- a/listening_normalscan_1.py +++ b/listening_normalscan_1.py @@ -14,6 +14,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class ListeningNormalscan1(ExperimentPrototype): @@ -49,6 +50,7 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) self.add_slice({ # slice_id = 1, receive only @@ -65,4 +67,6 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), + "rxonly": True, }, interfacing_dict={0: 'SCAN'}) diff --git a/listening_normalscan_2.py b/listening_normalscan_2.py index 8b181e9..a816b99 100644 --- a/listening_normalscan_2.py +++ b/listening_normalscan_2.py @@ -15,6 +15,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class ListeningNormalscan2(ExperimentPrototype): @@ -52,6 +53,7 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) self.add_slice({ # slice_id = 1, receive only @@ -69,4 +71,6 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), + "rxonly": True, }, interfacing_dict={0: 'CONCURRENT'}) diff --git a/multifreq_widebeam.py b/multifreq_widebeam.py index dcd93bd..268d9d7 100644 --- a/multifreq_widebeam.py +++ b/multifreq_widebeam.py @@ -18,6 +18,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class MultifreqWidebeam(ExperimentPrototype): @@ -61,6 +62,7 @@ def __init__(self, **kwargs): "tx_antennas": [6, 7], # Using two tx antennas from the middle of array "align_sequences": True, "scanbound": [i * scf.INTT_7P * 1e-3 for i in range(len(scf.STD_16_BEAM_ANGLE))], + "decimation_scheme": create_default_scheme(), } slice_2 = copy.deepcopy(slice_1) # slice_id = 1, the second slice diff --git a/narrow_wide_comparison.py b/narrow_wide_comparison.py index 35d483c..676ea2b 100644 --- a/narrow_wide_comparison.py +++ b/narrow_wide_comparison.py @@ -17,6 +17,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme def boresight(frequency_khz, tx_antennas, antenna_spacing_m): @@ -49,7 +50,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) # TODO: Log slice_0 = { # slice_id = 0 "pulse_sequence": scf.SEQUENCE_7P, @@ -65,7 +66,8 @@ def __init__(self, **kwargs): "freq": freq, # kHz "align_sequences": True, # align start of sequence to tenths of a second "scanbound": scf.easy_scanbound(scf.INTT_7P, scf.STD_16_BEAM_ANGLE), - "wait_for_first_scanbound": False + "wait_for_first_scanbound": False, + "decimation_scheme": create_default_scheme(), } slice_1 = copy.deepcopy(slice_0) diff --git a/normalscan.py b/normalscan.py index fcdf9f7..9b1cec1 100644 --- a/normalscan.py +++ b/normalscan.py @@ -10,6 +10,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Normalscan(ExperimentPrototype): @@ -41,7 +42,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) # TODO: Log self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, @@ -59,4 +60,5 @@ def __init__(self, **kwargs): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "wait_for_first_scanbound": False, + "decimation_scheme": create_default_scheme(), }) diff --git a/normalscan_13MHz.py b/normalscan_13MHz.py index 5ba2979..90681e8 100644 --- a/normalscan_13MHz.py +++ b/normalscan_13MHz.py @@ -13,6 +13,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Normalscan(ExperimentPrototype): @@ -46,5 +47,6 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) diff --git a/normalscan_aligned.py b/normalscan_aligned.py index 34f27cb..38a104c 100644 --- a/normalscan_aligned.py +++ b/normalscan_aligned.py @@ -10,6 +10,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Normalscan(ExperimentPrototype): @@ -41,7 +42,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) # TODO: Log self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, @@ -58,6 +59,7 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "align_sequences": True # align start of sequence to tenths of a second + "align_sequences": True, # align start of sequence to tenths of a second + "decimation_scheme": create_default_scheme(), }) diff --git a/normalscan_boresite.py b/normalscan_boresite.py index 1fcace0..7b65247 100644 --- a/normalscan_boresite.py +++ b/normalscan_boresite.py @@ -10,6 +10,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class NormalscanBoresite(ExperimentPrototype): @@ -33,4 +34,5 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) diff --git a/normalscan_intn.py b/normalscan_intn.py index 73f6e27..b0615e5 100644 --- a/normalscan_intn.py +++ b/normalscan_intn.py @@ -10,6 +10,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Normalscan(ExperimentPrototype): @@ -41,7 +42,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) # TODO: Log self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, @@ -59,5 +60,6 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) diff --git a/normalscan_ppo_test.py b/normalscan_ppo_test.py index 71f5b21..7041335 100644 --- a/normalscan_ppo_test.py +++ b/normalscan_ppo_test.py @@ -12,6 +12,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme def phase_encode(beam_iter, sequence_num, num_pulses): @@ -47,7 +48,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) # TODO: Log self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, @@ -64,6 +65,7 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "pulse_phase_offset": phase_encode + "pulse_phase_offset": phase_encode, + "decimation_scheme": create_default_scheme(), }) diff --git a/normalscan_single_beam.py b/normalscan_single_beam.py index eba794a..03f8827 100644 --- a/normalscan_single_beam.py +++ b/normalscan_single_beam.py @@ -12,6 +12,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class NormalscanSingleBeam(ExperimentPrototype): @@ -35,4 +36,5 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) diff --git a/normalsound.py b/normalsound.py index e1ec839..9fecb15 100644 --- a/normalsound.py +++ b/normalsound.py @@ -10,6 +10,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class NormalSound(ExperimentPrototype): @@ -46,6 +47,7 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "lag_table": scf.STD_8P_LAG_TABLE, # lag table needed for 8P since not all lags used. + "decimation_scheme": create_default_scheme(), }) sounding_scanbound_spacing = 1.5 # seconds @@ -72,6 +74,7 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "lag_table": scf.STD_8P_LAG_TABLE, # lag table needed for 8P since not all lags used. + "decimation_scheme": create_default_scheme(), }) super().__init__(cpid, txctrfreq=centerfreq, rxctrfreq=centerfreq, comment_string=NormalSound.__doc__) diff --git a/politescan.py b/politescan.py index be22da4..a90b46c 100644 --- a/politescan.py +++ b/politescan.py @@ -11,6 +11,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Politescan(ExperimentPrototype): @@ -38,4 +39,6 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), + "rxonly": True, }) diff --git a/politescan2.py b/politescan2.py index f081131..421bc0b 100644 --- a/politescan2.py +++ b/politescan2.py @@ -16,6 +16,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Politescan2(ExperimentPrototype): @@ -49,6 +50,8 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), + "rxonly": True, }) self.add_slice({ # slice_id = 1, receive only @@ -66,4 +69,6 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), + "rxonly": True, }, interfacing_dict={0: 'CONCURRENT'}) diff --git a/power_meter_mode.py b/power_meter_mode.py index d685f3b..0295b43 100644 --- a/power_meter_mode.py +++ b/power_meter_mode.py @@ -11,6 +11,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class PowerMeterMode(ExperimentPrototype): @@ -32,7 +33,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) # TODO: Log self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": [0], @@ -49,5 +50,6 @@ def __init__(self, **kwargs): "acf": False, "xcf": False, # cross-correlation processing "acfint": False, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) diff --git a/pulse_interfacing_test.py b/pulse_interfacing_test.py index d760473..c11b270 100644 --- a/pulse_interfacing_test.py +++ b/pulse_interfacing_test.py @@ -14,6 +14,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class PulseInterfacingTest(ExperimentPrototype): @@ -35,7 +36,8 @@ def __init__(self): "beam_angle": [0.0], "rx_beam_order": beams_to_use, "tx_beam_order": beams_to_use, - "freq" : 10500 # kHz + "freq" : 10500, # kHz + "decimation_scheme": create_default_scheme(), } slice_1 = copy.deepcopy(slice_0) diff --git a/pulse_phase_offset_decoding_test.py b/pulse_phase_offset_decoding_test.py index c12c43f..9a9edc6 100644 --- a/pulse_phase_offset_decoding_test.py +++ b/pulse_phase_offset_decoding_test.py @@ -12,6 +12,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme def phase_encode(beam_iter, sequence_num, num_pulses): @@ -39,5 +40,6 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "pulse_phase_offset": phase_encode + "pulse_phase_offset": phase_encode, + "decimation_scheme": create_default_scheme(), }) diff --git a/rbspscan.py b/rbspscan.py index 13c9483..a8c0b79 100644 --- a/rbspscan.py +++ b/rbspscan.py @@ -42,6 +42,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class RBSPScan(ExperimentPrototype): @@ -101,6 +102,7 @@ def __init__(self,): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } super().__init__(cpid) diff --git a/synch_test.py b/synch_test.py index 146c623..b95dde0 100644 --- a/synch_test.py +++ b/synch_test.py @@ -9,6 +9,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class SynchTest(ExperimentPrototype): @@ -33,4 +34,5 @@ def __init__(self): "acf": False, "xcf": False, # cross-correlation processing "acfint": False, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) diff --git a/tauscan.py b/tauscan.py index e99fafd..ffc9a86 100644 --- a/tauscan.py +++ b/tauscan.py @@ -15,6 +15,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Tauscan(ExperimentPrototype): @@ -50,7 +51,8 @@ def __init__(self): "acf" : True, "xcf" : True, "acfint" : True, - "comment" : Tauscan.__doc__ + "comment" : Tauscan.__doc__, + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) diff --git a/themisscan.py b/themisscan.py index 34fcc68..c271f9c 100644 --- a/themisscan.py +++ b/themisscan.py @@ -12,6 +12,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class ThemisScan(ExperimentPrototype): @@ -68,6 +69,7 @@ def __init__(self,): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } super().__init__(cpid) diff --git a/twofsound.py b/twofsound.py index 29a84a2..c05bb93 100644 --- a/twofsound.py +++ b/twofsound.py @@ -12,6 +12,8 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme + class Twofsound(ExperimentPrototype): @@ -50,10 +52,11 @@ def __init__(self, **kwargs): "rx_beam_order": beams_to_use, "tx_beam_order": beams_to_use, "scanbound" : scf.easy_scanbound(scf.INTT_7P, beams_to_use), - "freq" : tx_freq_1, #kHz + "freq" : tx_freq_1, # kHz "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } slice_2 = copy.deepcopy(slice_1) diff --git a/widebeam_2tx.py b/widebeam_2tx.py index 1455fdb..c56f1fd 100644 --- a/widebeam_2tx.py +++ b/widebeam_2tx.py @@ -15,6 +15,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Widebeam_2tx(ExperimentPrototype): @@ -41,7 +42,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) # TODO: Log self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, @@ -57,5 +58,6 @@ def __init__(self, **kwargs): "tx_antennas": [7, 8], # Using two tx antennas from the middle of array "align_sequences": True, "scanbound": [i * scf.INTT_7P * 1e-3 for i in range(len(scf.STD_16_BEAM_ANGLE))], + "decimation_scheme": create_default_scheme(), }) diff --git a/widebeam_3tx.py b/widebeam_3tx.py index 37537ed..18bfba6 100644 --- a/widebeam_3tx.py +++ b/widebeam_3tx.py @@ -15,6 +15,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Widebeam_3tx(ExperimentPrototype): @@ -41,7 +42,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) # TODO: Log self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, @@ -55,5 +56,6 @@ def __init__(self, **kwargs): "tx_beam_order": [0], "freq": freq, # kHz "tx_antennas": [6, 7, 8], # Using three tx antennas from near the middle of array + "decimation_scheme": create_default_scheme(), }) From be653019eca7516d1e509f2393a15931bc14e758 Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Fri, 7 Apr 2023 21:34:37 -0600 Subject: [PATCH 02/13] Fixed bugs and experiment files such that all unittests pass. * Some experiment tests are now not applicable and have been moved to deprecated_tests * experiment_tests.csv no longer needed, each test class defines its own class method that returns the expected Exception that will be thrown and the error message. --- .../test_beam_order_too_long.py | 7 +++ .../test_clrfrqrng_not_list.py | 7 +++ .../test_first_range_not_float.py | 7 +++ .../test_scanbound_bad_len.py | 7 +++ .../test_too_many_slices.py | 11 ++-- .../test_wavetype_not_defined.py | 0 testing_archive/test_avg_method_dne.py | 10 ++++ testing_archive/test_bad_interface.py | 8 +++ testing_archive/test_bad_interfacing.py | 8 +++ testing_archive/test_bad_slice.py | 20 +++----- testing_archive/test_bad_slice_id.py | 8 +++ testing_archive/test_beam_angle_dne.py | 6 +++ testing_archive/test_beam_angle_dups.py | 8 +++ .../test_beam_angle_not_increasing.py | 9 ++++ testing_archive/test_beam_angle_not_list.py | 8 +++ testing_archive/test_beam_angle_not_num.py | 10 ++++ testing_archive/test_beam_order_bad_index.py | 9 ++++ testing_archive/test_beam_order_dne.py | 6 +++ .../test_beam_order_lists_bad_index.py | 9 ++++ .../test_beam_order_lists_not_ints.py | 22 ++++++++ .../test_beam_order_not_ints_or_lists.py | 22 ++++++++ testing_archive/test_beam_order_not_list.py | 8 +++ testing_archive/test_clrfrqrng_not_2.py | 9 ++++ testing_archive/test_clrfrqrng_not_inc.py | 11 ++++ testing_archive/test_clrfrqrng_not_ints.py | 10 ++++ testing_archive/test_clrfrqrng_too_high.py | 12 +++++ testing_archive/test_clrfrqrng_too_low.py | 12 +++++ testing_archive/test_cpid_int.py | 7 +++ testing_archive/test_cpid_pos.py | 10 ++++ testing_archive/test_cpid_unique.py | 7 +++ testing_archive/test_del_slice_dne.py | 6 +++ testing_archive/test_dm_rate_not_int.py | 7 +++ testing_archive/test_edit_slice_bad_param.py | 6 +++ testing_archive/test_edit_slice_dne.py | 6 +++ .../test_finalstage_bad_outputrate.py | 9 ++++ testing_archive/test_first_range_dne.py | 6 +++ testing_archive/test_int_antenna_dne.py | 10 +++- testing_archive/test_int_antenna_dups.py | 12 ++++- testing_archive/test_intn_not_int.py | 8 +++ .../test_intt_longer_than_scanbound.py | 8 +++ .../test_intt_longer_than_scanbounds.py | 8 +++ testing_archive/test_intt_not_num.py | 8 +++ testing_archive/test_intt_too_low.py | 11 ++++ testing_archive/test_lag_table_bad.py | 8 +++ testing_archive/test_no_class.py | 2 + testing_archive/test_no_freq_set.py | 7 +++ testing_archive/test_no_inheritance.py | 7 +++ testing_archive/test_no_intt_intn.py | 7 +++ testing_archive/test_no_slices.py | 6 +++ testing_archive/test_num_ranges_dne.py | 6 +++ testing_archive/test_num_ranges_not_int.py | 8 +++ testing_archive/test_output_rxrate_high.py | 7 +++ testing_archive/test_pulse_len_bad.py | 9 ++++ testing_archive/test_pulse_len_dne.py | 6 +++ testing_archive/test_pulse_len_not_int.py | 8 +++ testing_archive/test_pulse_len_too_high.py | 10 ++++ testing_archive/test_pulse_len_too_low.py | 13 +++-- testing_archive/test_rx_antenna_dne.py | 11 +++- testing_archive/test_rx_antenna_dups.py | 11 +++- testing_archive/test_rxbw_not_divisible.py | 9 ++++ testing_archive/test_rxfreq_not_num.py | 12 ++++- testing_archive/test_rxfreq_too_high.py | 11 ++++ testing_archive/test_rxfreq_too_low.py | 11 ++++ testing_archive/test_rxrate_high.py | 8 +++ testing_archive/test_scanbound_but_no_intt.py | 8 +++ testing_archive/test_scanbound_dne.py | 7 +++ testing_archive/test_scanbound_negative.py | 51 +++++++++++++++++++ .../test_scanbound_not_increasing.py | 7 +++ testing_archive/test_seq_not_increasing.py | 8 +++ testing_archive/test_sequence_dne.py | 6 +++ testing_archive/test_sequence_not_int.py | 14 +++++ testing_archive/test_sequence_not_list.py | 8 +++ testing_archive/test_slices_beam_order_bad.py | 9 ++++ testing_archive/test_slices_intn_bad.py | 8 +++ testing_archive/test_slices_intt_bad.py | 9 ++++ testing_archive/test_slices_scanbound_bad.py | 8 +++ testing_archive/test_stage0_bad_inputrate.py | 9 ++++ testing_archive/test_stagex_bad_outputrate.py | 9 ++++ testing_archive/test_taps_not_list.py | 9 ++++ testing_archive/test_taps_not_nums.py | 8 +++ testing_archive/test_tau_dne.py | 6 +++ testing_archive/test_tau_not_int.py | 8 +++ testing_archive/test_tau_not_multiple.py | 10 ++++ testing_archive/test_tau_too_small.py | 10 ++++ testing_archive/test_too_many_dm_stages.py | 7 +++ testing_archive/test_too_many_int_antennas.py | 11 +++- testing_archive/test_too_many_rx_antennas.py | 10 +++- testing_archive/test_too_many_tx_antennas.py | 10 +++- testing_archive/test_two_classes.py | 13 +++++ testing_archive/test_tx_antenna_dne.py | 9 +++- testing_archive/test_tx_antenna_dups.py | 11 +++- .../test_tx_antenna_pattern_dim_mismatch.py | 11 +++- .../test_tx_antenna_pattern_magnitude.py | 10 +++- .../test_tx_antenna_pattern_not_2d.py | 10 +++- .../test_tx_antenna_pattern_not_callable.py | 11 ++-- .../test_tx_antenna_pattern_not_numpy.py | 10 +++- testing_archive/test_tx_beam_order_dne.py | 8 +++ .../test_tx_beam_order_list_not_ints.py | 19 +++++++ .../test_tx_beam_order_listnum_too_high.py | 8 +++ .../test_tx_beam_order_not_list.py | 8 +++ .../test_tx_beam_order_not_same_len_as_rx.py | 9 +++- testing_archive/test_txbw_not_divisible.py | 9 ++++ testing_archive/test_txfreq_restricted.py | 7 +++ testing_archive/test_txrate_high.py | 8 +++ testing_archive/test_unused_param.py | 7 +++ .../test_wait_for_first_scanbound_type.py | 11 ++++ 106 files changed, 958 insertions(+), 41 deletions(-) rename testing_archive/{ => deprecated_tests}/test_beam_order_too_long.py (85%) rename testing_archive/{ => deprecated_tests}/test_clrfrqrng_not_list.py (83%) rename testing_archive/{ => deprecated_tests}/test_first_range_not_float.py (85%) rename testing_archive/{ => deprecated_tests}/test_scanbound_bad_len.py (83%) rename testing_archive/{ => deprecated_tests}/test_too_many_slices.py (93%) rename testing_archive/{ => deprecated_tests}/test_wavetype_not_defined.py (100%) diff --git a/testing_archive/test_beam_order_too_long.py b/testing_archive/deprecated_tests/test_beam_order_too_long.py similarity index 85% rename from testing_archive/test_beam_order_too_long.py rename to testing_archive/deprecated_tests/test_beam_order_too_long.py index 7c44018..7f26379 100644 --- a/testing_archive/test_beam_order_too_long.py +++ b/testing_archive/deprecated_tests/test_beam_order_too_long.py @@ -11,6 +11,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -44,5 +46,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "pass" diff --git a/testing_archive/test_clrfrqrng_not_list.py b/testing_archive/deprecated_tests/test_clrfrqrng_not_list.py similarity index 83% rename from testing_archive/test_clrfrqrng_not_list.py rename to testing_archive/deprecated_tests/test_clrfrqrng_not_list.py index 2144131..6c66b3f 100644 --- a/testing_archive/test_clrfrqrng_not_list.py +++ b/testing_archive/deprecated_tests/test_clrfrqrng_not_list.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -42,5 +44,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, "pass" diff --git a/testing_archive/test_first_range_not_float.py b/testing_archive/deprecated_tests/test_first_range_not_float.py similarity index 85% rename from testing_archive/test_first_range_not_float.py rename to testing_archive/deprecated_tests/test_first_range_not_float.py index a4536d3..a71bd05 100644 --- a/testing_archive/test_first_range_not_float.py +++ b/testing_archive/deprecated_tests/test_first_range_not_float.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "pass" diff --git a/testing_archive/test_scanbound_bad_len.py b/testing_archive/deprecated_tests/test_scanbound_bad_len.py similarity index 83% rename from testing_archive/test_scanbound_bad_len.py rename to testing_archive/deprecated_tests/test_scanbound_bad_len.py index 4acc702..b956a2d 100644 --- a/testing_archive/test_scanbound_bad_len.py +++ b/testing_archive/deprecated_tests/test_scanbound_bad_len.py @@ -11,6 +11,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -45,5 +47,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "Slice 0 must have scanbound of same length as the beam order" diff --git a/testing_archive/test_too_many_slices.py b/testing_archive/deprecated_tests/test_too_many_slices.py similarity index 93% rename from testing_archive/test_too_many_slices.py rename to testing_archive/deprecated_tests/test_too_many_slices.py index 17f7ef6..ec6f61f 100644 --- a/testing_archive/test_too_many_slices.py +++ b/testing_archive/deprecated_tests/test_too_many_slices.py @@ -14,6 +14,8 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype from experiment_prototype.decimation_scheme.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation +from experiment_prototype.experiment_exception import ExperimentException + class TestExperiment(ExperimentPrototype): @@ -40,9 +42,7 @@ def __init__(self): # changed from 10e3/3->10e3 decimation_scheme = (DecimationScheme(rates[0], rates[-1]/dm_rates[-1], stages=all_stages)) - super(TestExperiment, self).__init__( - cpid, output_rx_rate=decimation_scheme.output_sample_rate, - decimation_scheme=decimation_scheme) + super(TestExperiment, self).__init__(cpid, output_rx_rate=decimation_scheme.output_sample_rate) if scf.IS_FORWARD_RADAR: beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER @@ -69,6 +69,7 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": decimation_scheme, } # The check for too many slices is like so: # effective_length = 2^x => the next power of two for how many taps there are in a stage @@ -102,3 +103,7 @@ def __init__(self): self.add_slice(copy.deepcopy(slice_1),interfacing_dict={0: 'SCAN'}) self.add_slice(copy.deepcopy(slice_1),interfacing_dict={0: 'SCAN'}) self.add_slice(copy.deepcopy(slice_1),interfacing_dict={0: 'SCAN'}) + + @classmethod + def error_message(cls): + return ExperimentException, "pass" diff --git a/testing_archive/test_wavetype_not_defined.py b/testing_archive/deprecated_tests/test_wavetype_not_defined.py similarity index 100% rename from testing_archive/test_wavetype_not_defined.py rename to testing_archive/deprecated_tests/test_wavetype_not_defined.py diff --git a/testing_archive/test_avg_method_dne.py b/testing_archive/test_avg_method_dne.py index b5c4cee..9c3c769 100644 --- a/testing_archive/test_avg_method_dne.py +++ b/testing_archive/test_avg_method_dne.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,13 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "averaging_method": 'not_a_method', ### This is not a valid method + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, \ + "averaging_method\n" \ + " unexpected value; permitted: 'mean', 'median' " \ + "\(type=value_error.const; given=not_a_method; permitted=\('mean', 'median'\)\)" diff --git a/testing_archive/test_bad_interface.py b/testing_archive/test_bad_interface.py index 16b0b70..e952a8a 100644 --- a/testing_archive/test_bad_interface.py +++ b/testing_archive/test_bad_interface.py @@ -11,6 +11,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -44,6 +47,7 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) slice_2 = copy.deepcopy(slice_1) @@ -52,3 +56,7 @@ def __init__(self): ### Interface type is not in the interface_types list self.add_slice(slice_2, interfacing_dict={0:'THISWILLBREAK'}) + @classmethod + def error_message(cls): + return ExperimentException,\ + "Interface value with slice 0: THISWILLBREAK not valid. Types available are: \('SCAN', 'AVEPERIOD', 'SEQUENCE', 'CONCURRENT'\)" diff --git a/testing_archive/test_bad_interfacing.py b/testing_archive/test_bad_interfacing.py index 935c1e9..58daa68 100644 --- a/testing_archive/test_bad_interfacing.py +++ b/testing_archive/test_bad_interfacing.py @@ -12,6 +12,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -45,6 +47,7 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) ### Interfacing between slices is not internally consistent. Here we add slice_2 and slice_3, @@ -55,3 +58,8 @@ def __init__(self): self.add_slice(slice_2, interfacing_dict={0:'CONCURRENT'}) self.add_slice(slice_3, interfacing_dict={0:'CONCURRENT', 1:'SCAN'}) + @classmethod + def error_message(cls): + return ExperimentException,\ + "The interfacing values of new slice cannot be reconciled. Interfacing with slice 0: CONCURRENT and " \ + "with slice 1: SCAN does not make sense with existing interface between slices of None: CONCURRENT" diff --git a/testing_archive/test_bad_slice.py b/testing_archive/test_bad_slice.py index 9c4e004..5269da2 100644 --- a/testing_archive/test_bad_slice.py +++ b/testing_archive/test_bad_slice.py @@ -6,9 +6,8 @@ Expected exception: Attempt to add a slice failed - .* is not a dictionary of slice parameters """ - -import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -17,15 +16,10 @@ def __init__(self): cpid = 1 super(TestExperiment, self).__init__(cpid) - if scf.IS_FORWARD_RADAR: - beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER - else: - beams_to_use = scf.STD_16_REVERSE_BEAM_ORDER - - if scf.options.site_id in ["cly", "rkn", "inv"]: - num_ranges = scf.POLARDARN_NUM_RANGES - if scf.options.site_id in ["sas", "pgr"]: - num_ranges = scf.STD_NUM_RANGES - - ### exp_slice is not a dictionary of slice parameters + # exp_slice is not a dictionary of slice parameters self.add_slice('garbage') + + @classmethod + def error_message(cls): + return ExperimentException,\ + "Attempt to add a slice failed - garbage is not a dictionary of slice parameters" diff --git a/testing_archive/test_bad_slice_id.py b/testing_archive/test_bad_slice_id.py index e927998..ba88361 100644 --- a/testing_archive/test_bad_slice_id.py +++ b/testing_archive/test_bad_slice_id.py @@ -11,6 +11,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -44,9 +46,15 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) slice_2 = copy.deepcopy(slice_1) slice_2['freq'] = scf.COMMON_MODE_FREQ_2 ### Interfacing dict has interfacing set to an unknown sibling slice ID self.add_slice(slice_2, interfacing_dict={99:'SCAN'}) + + @classmethod + def error_message(cls): + return ExperimentException,\ + "Cannot add slice: the interfacing_dict set interfacing to an unknown slice 99 not in slice ids \[0\]" diff --git a/testing_archive/test_beam_angle_dne.py b/testing_archive/test_beam_angle_dne.py index 6c1b5f1..257fda4 100644 --- a/testing_archive/test_beam_angle_dne.py +++ b/testing_archive/test_beam_angle_dne.py @@ -9,6 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): @@ -42,5 +43,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return TypeError, "__init__\(\) missing 1 required positional argument: 'beam_angle'" diff --git a/testing_archive/test_beam_angle_dups.py b/testing_archive/test_beam_angle_dups.py index 073f98a..525d648 100644 --- a/testing_archive/test_beam_angle_dups.py +++ b/testing_archive/test_beam_angle_dups.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "beam_angle\n" \ + " the list has duplicated items \(type=value_error.list.unique_items\)" diff --git a/testing_archive/test_beam_angle_not_increasing.py b/testing_archive/test_beam_angle_not_increasing.py index 2cdbf73..c9faa80 100644 --- a/testing_archive/test_beam_angle_not_increasing.py +++ b/testing_archive/test_beam_angle_not_increasing.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "beam_angle\n" \ + " not increasing: \[26.25, 22.75, 19.25, 15.75, 12.25, 8.75, 5.25, 1.75, -1.75, " \ + "-5.25, -8.75, -12.25, -15.75, -19.25, -22.75, -26.25\] \(type=value_error\)" \ No newline at end of file diff --git a/testing_archive/test_beam_angle_not_list.py b/testing_archive/test_beam_angle_not_list.py index c5bc0c9..e839bbe 100644 --- a/testing_archive/test_beam_angle_not_list.py +++ b/testing_archive/test_beam_angle_not_list.py @@ -10,6 +10,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "beam_angle\n" \ + " value is not a valid list \(type=type_error.list\)" diff --git a/testing_archive/test_beam_angle_not_num.py b/testing_archive/test_beam_angle_not_num.py index 7d43d72..b085320 100644 --- a/testing_archive/test_beam_angle_not_num.py +++ b/testing_archive/test_beam_angle_not_num.py @@ -10,6 +10,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,13 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "beam_angle -> 2\n" \ + " value is not a valid float \(type=type_error.float\)\n" \ + "beam_angle -> 2\n" \ + " value is not a valid integer \(type=type_error.integer\)" diff --git a/testing_archive/test_beam_order_bad_index.py b/testing_archive/test_beam_order_bad_index.py index 28f01b2..7a7f50d 100644 --- a/testing_archive/test_beam_order_bad_index.py +++ b/testing_archive/test_beam_order_bad_index.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rx_beam_order -> 15\n" \ + " Beam number 90 could not index in beam_angle list of length 16. Slice: 0 " \ + "\(type=value_error\)" diff --git a/testing_archive/test_beam_order_dne.py b/testing_archive/test_beam_order_dne.py index a57f94c..171452f 100644 --- a/testing_archive/test_beam_order_dne.py +++ b/testing_archive/test_beam_order_dne.py @@ -10,6 +10,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): @@ -43,5 +44,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return TypeError, "__init__\(\) missing 1 required positional argument: 'rx_beam_order'" diff --git a/testing_archive/test_beam_order_lists_bad_index.py b/testing_archive/test_beam_order_lists_bad_index.py index 34ef1db..eeb065d 100644 --- a/testing_archive/test_beam_order_lists_bad_index.py +++ b/testing_archive/test_beam_order_lists_bad_index.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rx_beam_order -> 0\n" \ + " Beam number 55 could not index in beam_angle list of length 16. Slice: 0 " \ + "\(type=value_error\)" diff --git a/testing_archive/test_beam_order_lists_not_ints.py b/testing_archive/test_beam_order_lists_not_ints.py index 5abea67..e347e03 100644 --- a/testing_archive/test_beam_order_lists_not_ints.py +++ b/testing_archive/test_beam_order_lists_not_ints.py @@ -10,6 +10,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,25 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rx_beam_order -> 0 -> 0\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "rx_beam_order -> 0 -> 1\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "rx_beam_order -> 0 -> 2\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "rx_beam_order -> 0\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "rx_beam_order -> 1 -> 0\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "rx_beam_order -> 1\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "rx_beam_order -> 2 -> 0\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "rx_beam_order -> 2\n" \ + " value is not a valid integer \(type=type_error.integer\)" diff --git a/testing_archive/test_beam_order_not_ints_or_lists.py b/testing_archive/test_beam_order_not_ints_or_lists.py index 21a5755..bf7a08f 100644 --- a/testing_archive/test_beam_order_not_ints_or_lists.py +++ b/testing_archive/test_beam_order_not_ints_or_lists.py @@ -10,6 +10,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,25 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rx_beam_order -> 0\n" \ + " value is not a valid list \(type=type_error.list\)\n" \ + "rx_beam_order -> 0\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "rx_beam_order -> 1\n" \ + " value is not a valid list \(type=type_error.list\)\n" \ + "rx_beam_order -> 1\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "rx_beam_order -> 2\n" \ + " value is not a valid list \(type=type_error.list\)\n" \ + "rx_beam_order -> 2\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "rx_beam_order -> 3\n" \ + " value is not a valid list \(type=type_error.list\)\n" \ + "rx_beam_order -> 3\n" \ + " value is not a valid integer \(type=type_error.integer\)" diff --git a/testing_archive/test_beam_order_not_list.py b/testing_archive/test_beam_order_not_list.py index c2a86bd..4ae3ad7 100644 --- a/testing_archive/test_beam_order_not_list.py +++ b/testing_archive/test_beam_order_not_list.py @@ -10,6 +10,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rx_beam_order\n" \ + " value is not a valid list \(type=type_error.list\)" diff --git a/testing_archive/test_clrfrqrng_not_2.py b/testing_archive/test_clrfrqrng_not_2.py index 16e8863..13b9522 100644 --- a/testing_archive/test_clrfrqrng_not_2.py +++ b/testing_archive/test_clrfrqrng_not_2.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "clrfrqrange\n" \ + " ensure this value has at least 2 items " \ + "\(type=value_error.list.min_items; limit_value=2\)" diff --git a/testing_archive/test_clrfrqrng_not_inc.py b/testing_archive/test_clrfrqrng_not_inc.py index f017773..e1dee27 100644 --- a/testing_archive/test_clrfrqrng_not_inc.py +++ b/testing_archive/test_clrfrqrng_not_inc.py @@ -11,6 +11,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -44,5 +46,14 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "clrfrqrange\n" \ + " clrfrqrange must be between min and max tx frequencies \(10250000.01117587, " \ + "13750000.01117587\) and rx frequencies \(10250000.01117587, 13750000.01117587\)" \ + " according to license and/or center frequencies / sampling rates / transition " \ + "bands, and must have lower frequency first. \(type=value_error\)" diff --git a/testing_archive/test_clrfrqrng_not_ints.py b/testing_archive/test_clrfrqrng_not_ints.py index 0c092f9..24dbf83 100644 --- a/testing_archive/test_clrfrqrng_not_ints.py +++ b/testing_archive/test_clrfrqrng_not_ints.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,13 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "clrfrqrange -> 0\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "clrfrqrange -> 1\n" \ + " value is not a valid integer \(type=type_error.integer\)" diff --git a/testing_archive/test_clrfrqrng_too_high.py b/testing_archive/test_clrfrqrng_too_high.py index bdc3dc6..fab7586 100644 --- a/testing_archive/test_clrfrqrng_too_high.py +++ b/testing_archive/test_clrfrqrng_too_high.py @@ -11,6 +11,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -44,5 +46,15 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "clrfrqrange -> 0\n" \ + " ensure this value is less than or equal to 20000.0 " \ + "\(type=value_error.number.not_le; limit_value=20000.0\)\n" \ + "clrfrqrange -> 1\n" \ + " ensure this value is less than or equal to 20000.0 " \ + "\(type=value_error.number.not_le; limit_value=20000.0\)" diff --git a/testing_archive/test_clrfrqrng_too_low.py b/testing_archive/test_clrfrqrng_too_low.py index 91f0ca9..66132b4 100644 --- a/testing_archive/test_clrfrqrng_too_low.py +++ b/testing_archive/test_clrfrqrng_too_low.py @@ -11,6 +11,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -44,5 +46,15 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "clrfrqrange -> 0\n" \ + " ensure this value is greater than or equal to 8000.0 " \ + "\(type=value_error.number.not_ge; limit_value=8000.0\)\n" \ + "clrfrqrange -> 1\n" \ + " ensure this value is greater than or equal to 8000.0 " \ + "\(type=value_error.number.not_ge; limit_value=8000.0\)" diff --git a/testing_archive/test_cpid_int.py b/testing_archive/test_cpid_int.py index 359edae..c49fe97 100644 --- a/testing_archive/test_cpid_int.py +++ b/testing_archive/test_cpid_int.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -42,5 +44,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, "CPID must be a unique int" diff --git a/testing_archive/test_cpid_pos.py b/testing_archive/test_cpid_pos.py index 0fdfcec..d10fa7f 100644 --- a/testing_archive/test_cpid_pos.py +++ b/testing_archive/test_cpid_pos.py @@ -11,6 +11,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -44,5 +46,13 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException,\ + "The CPID should be a positive number in the experiment. Borealis will determine if it should be " \ + "negative based on the scheduling mode. Only experiments run during discretionary time will have " \ + "negative CPIDs." diff --git a/testing_archive/test_cpid_unique.py b/testing_archive/test_cpid_unique.py index c642ca3..8cf2806 100644 --- a/testing_archive/test_cpid_unique.py +++ b/testing_archive/test_cpid_unique.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -42,5 +44,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, "CPID must be unique. 151 is in use by another local experiment" diff --git a/testing_archive/test_del_slice_dne.py b/testing_archive/test_del_slice_dne.py index 413af0b..4c0e800 100644 --- a/testing_archive/test_del_slice_dne.py +++ b/testing_archive/test_del_slice_dne.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -42,7 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) self.del_slice(7) ### Non-existent slice ID should fail + @classmethod + def error_message(cls): + return ExperimentException, "Cannot remove slice id 7 : it does not exist in slice dictionary" diff --git a/testing_archive/test_dm_rate_not_int.py b/testing_archive/test_dm_rate_not_int.py index fa9ae50..b44750f 100644 --- a/testing_archive/test_dm_rate_not_int.py +++ b/testing_archive/test_dm_rate_not_int.py @@ -11,6 +11,8 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype from experiment_prototype.decimation_scheme.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation +from experiment_prototype.experiment_exception import ExperimentException + class TestExperiment(ExperimentPrototype): @@ -63,5 +65,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": decimation_scheme, } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, "Decimation rate is not an integer" diff --git a/testing_archive/test_edit_slice_bad_param.py b/testing_archive/test_edit_slice_bad_param.py index 98f1297..b1817bf 100644 --- a/testing_archive/test_edit_slice_bad_param.py +++ b/testing_archive/test_edit_slice_bad_param.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -42,7 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) self.edit_slice(0, tx_freak=scf.COMMON_MODE_FREQ_2) ### Non-existent param should fail + @classmethod + def error_message(cls): + return ExperimentException, "Cannot edit slice ID 0: tx_freak is not a valid slice parameter" diff --git a/testing_archive/test_edit_slice_dne.py b/testing_archive/test_edit_slice_dne.py index 8064724..685f780 100644 --- a/testing_archive/test_edit_slice_dne.py +++ b/testing_archive/test_edit_slice_dne.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -42,7 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) self.edit_slice(7, freq=scf.COMMON_MODE_FREQ_2) ### Non-existent slice ID should fail + @classmethod + def error_message(cls): + return ExperimentException, "Trying to edit 7 but it does not exist in Slice_IDs list." diff --git a/testing_archive/test_finalstage_bad_outputrate.py b/testing_archive/test_finalstage_bad_outputrate.py index 57583fb..ceb6c84 100644 --- a/testing_archive/test_finalstage_bad_outputrate.py +++ b/testing_archive/test_finalstage_bad_outputrate.py @@ -12,6 +12,8 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype from experiment_prototype.decimation_scheme.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation +from experiment_prototype.experiment_exception import ExperimentException + class TestExperiment(ExperimentPrototype): @@ -66,5 +68,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": decimation_scheme, } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, \ + "Last decimation stage 3 does not have output rate 3333.3333333333335 equal to requested output data " \ + "rate 20000.0" diff --git a/testing_archive/test_first_range_dne.py b/testing_archive/test_first_range_dne.py index 5619997..4c33929 100644 --- a/testing_archive/test_first_range_dne.py +++ b/testing_archive/test_first_range_dne.py @@ -9,6 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): @@ -42,5 +43,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return TypeError, "__init__\(\) missing 1 required positional argument: 'first_range'" diff --git a/testing_archive/test_int_antenna_dne.py b/testing_archive/test_int_antenna_dne.py index 1e82b8a..bce766d 100644 --- a/testing_archive/test_int_antenna_dne.py +++ b/testing_archive/test_int_antenna_dne.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,6 +44,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "rx_int_antennas": [0,1,2,18] ### int antenna 18 DNE, should fail + "rx_int_antennas": [0,1,2,18], ### int antenna 18 DNE, should fail + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rx_int_antennas -> 3\n" \ + " ensure this value is less than 4 \(type=value_error.number.not_lt; limit_value=4\)" diff --git a/testing_archive/test_int_antenna_dups.py b/testing_archive/test_int_antenna_dups.py index ab1cfe9..86bb54f 100644 --- a/testing_archive/test_int_antenna_dups.py +++ b/testing_archive/test_int_antenna_dups.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,6 +44,14 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "rx_int_antennas": [0,0,1,2,3] ### 0 duplicated, should fail + "rx_int_antennas": [0,0,1,2,3], ### 0 duplicated, should fail + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rx_int_antennas\n" \ + " ensure this value has at most 4 items " \ + "\(type=value_error.list.max_items; limit_value=4\)" + diff --git a/testing_archive/test_intn_not_int.py b/testing_archive/test_intn_not_int.py index d728d62..1da52b7 100644 --- a/testing_archive/test_intn_not_int.py +++ b/testing_archive/test_intn_not_int.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "intn\n" \ + " value is not a valid integer \(type=type_error.integer\)" diff --git a/testing_archive/test_intt_longer_than_scanbound.py b/testing_archive/test_intt_longer_than_scanbound.py index 5426fc0..1963bee 100644 --- a/testing_archive/test_intt_longer_than_scanbound.py +++ b/testing_archive/test_intt_longer_than_scanbound.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "scanbound\n" \ + " Slice 0 intt 3600.0ms longer than scanbound time 3.5s \(type=value_error\)" diff --git a/testing_archive/test_intt_longer_than_scanbounds.py b/testing_archive/test_intt_longer_than_scanbounds.py index a30e68c..7195a8d 100644 --- a/testing_archive/test_intt_longer_than_scanbounds.py +++ b/testing_archive/test_intt_longer_than_scanbounds.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "scanbound\n" \ + " Slice 0 intt 3600.0ms longer than one of the scanbound times \(type=value_error\)" diff --git a/testing_archive/test_intt_not_num.py b/testing_archive/test_intt_not_num.py index 6c5c5a3..8dc968b 100644 --- a/testing_archive/test_intt_not_num.py +++ b/testing_archive/test_intt_not_num.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "intt\n" \ + " value is not a valid float \(type=type_error.float\)" diff --git a/testing_archive/test_intt_too_low.py b/testing_archive/test_intt_too_low.py index 9442b75..1e2195f 100644 --- a/testing_archive/test_intt_too_low.py +++ b/testing_archive/test_intt_too_low.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,14 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "intt\n" \ + " Slice 0: pulse sequence is too long for integration time given " \ + "\(type=value_error\)\n" \ + "scanbound\n" \ + " Slice 0 must have intt enabled to use scanbound \(type=value_error\)" diff --git a/testing_archive/test_lag_table_bad.py b/testing_archive/test_lag_table_bad.py index f9bff7b..1b9b8db 100644 --- a/testing_archive/test_lag_table_bad.py +++ b/testing_archive/test_lag_table_bad.py @@ -11,6 +11,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + class TestExperiment(ExperimentPrototype): @@ -44,6 +47,7 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } lag_table = list(itertools.combinations(slice_1['pulse_sequence'], 2)) @@ -57,3 +61,7 @@ def __init__(self): slice_1['lag_table'] = lag_table self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "Lag \[99, 0\] not valid; One of the pulses does not exist in the sequence. Slice 0" diff --git a/testing_archive/test_no_class.py b/testing_archive/test_no_class.py index 12bb53a..0c7a82a 100644 --- a/testing_archive/test_no_class.py +++ b/testing_archive/test_no_class.py @@ -8,6 +8,7 @@ """ import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme ### class TestExperiment(ExperimentPrototype): @@ -41,5 +42,6 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) diff --git a/testing_archive/test_no_freq_set.py b/testing_archive/test_no_freq_set.py index 13167cd..b5958dd 100644 --- a/testing_archive/test_no_freq_set.py +++ b/testing_archive/test_no_freq_set.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -41,6 +43,7 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } ### No freq or clrfrqrange @@ -57,3 +60,7 @@ def __init__(self): except: pass self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "A freq or clrfrqrange must be specified in a slice. Slice: 0 \(type=value_error\)" diff --git a/testing_archive/test_no_inheritance.py b/testing_archive/test_no_inheritance.py index 040f8fe..5161573 100644 --- a/testing_archive/test_no_inheritance.py +++ b/testing_archive/test_no_inheritance.py @@ -8,6 +8,8 @@ """ import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(): ### Doesn't inherit from ExperimentPrototype @@ -41,5 +43,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, "pass" diff --git a/testing_archive/test_no_intt_intn.py b/testing_archive/test_no_intt_intn.py index 596364c..26b793d 100644 --- a/testing_archive/test_no_intt_intn.py +++ b/testing_archive/test_no_intt_intn.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -41,5 +43,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "Slice must specify either an intn \(unitless\) or intt in ms. Slice: 0" diff --git a/testing_archive/test_no_slices.py b/testing_archive/test_no_slices.py index a3ea698..dd72cca 100644 --- a/testing_archive/test_no_slices.py +++ b/testing_archive/test_no_slices.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -28,3 +30,7 @@ def __init__(self): num_ranges = scf.STD_NUM_RANGES ### Don't add any slices + + @classmethod + def error_message(cls): + return ExperimentException, "Invalid num_slices less than 1" diff --git a/testing_archive/test_num_ranges_dne.py b/testing_archive/test_num_ranges_dne.py index 4d719f6..d27957f 100644 --- a/testing_archive/test_num_ranges_dne.py +++ b/testing_archive/test_num_ranges_dne.py @@ -9,6 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): @@ -42,5 +43,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return TypeError, "__init__\(\) missing 1 required positional argument: 'num_ranges'" diff --git a/testing_archive/test_num_ranges_not_int.py b/testing_archive/test_num_ranges_not_int.py index 87621c5..591725d 100644 --- a/testing_archive/test_num_ranges_not_int.py +++ b/testing_archive/test_num_ranges_not_int.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "num_ranges\n" \ + " value is not a valid integer \(type=type_error.integer\)" diff --git a/testing_archive/test_output_rxrate_high.py b/testing_archive/test_output_rxrate_high.py index e28ecec..e29705c 100644 --- a/testing_archive/test_output_rxrate_high.py +++ b/testing_archive/test_output_rxrate_high.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -43,5 +45,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, "Experiment's output sample rate is too high: 100001.0 greater than max 100000.0." diff --git a/testing_archive/test_pulse_len_bad.py b/testing_archive/test_pulse_len_bad.py index 3d5ef11..50b9cc7 100644 --- a/testing_archive/test_pulse_len_bad.py +++ b/testing_archive/test_pulse_len_bad.py @@ -10,6 +10,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "pulse_len\n" \ + " ensure this value is greater than or equal to 100.0 " \ + "\(type=value_error.number.not_ge; limit_value=100.0\)" diff --git a/testing_archive/test_pulse_len_dne.py b/testing_archive/test_pulse_len_dne.py index e05f65e..cbbb390 100644 --- a/testing_archive/test_pulse_len_dne.py +++ b/testing_archive/test_pulse_len_dne.py @@ -9,6 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): @@ -42,5 +43,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return TypeError, "__init__\(\) missing 1 required positional argument: 'pulse_len'" diff --git a/testing_archive/test_pulse_len_not_int.py b/testing_archive/test_pulse_len_not_int.py index f9e080d..8e49575 100644 --- a/testing_archive/test_pulse_len_not_int.py +++ b/testing_archive/test_pulse_len_not_int.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "pulse_len\n" \ + " value is not a valid integer \(type=type_error.integer\)" diff --git a/testing_archive/test_pulse_len_too_high.py b/testing_archive/test_pulse_len_too_high.py index 7f2df18..18e3a40 100644 --- a/testing_archive/test_pulse_len_too_high.py +++ b/testing_archive/test_pulse_len_too_high.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,13 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "tau_spacing\n" \ + " Slice 0 correlation lags will be off because tau_spacing 100 us is not a " \ + "multiple of the output rx sampling period \(1/output_rx_rate 3333.3333333333335 " \ + "Hz\). \(type=value_error\)" diff --git a/testing_archive/test_pulse_len_too_low.py b/testing_archive/test_pulse_len_too_low.py index 4f8bbb7..95c5f7d 100644 --- a/testing_archive/test_pulse_len_too_low.py +++ b/testing_archive/test_pulse_len_too_low.py @@ -11,6 +11,8 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype from experiment_prototype.decimation_scheme.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation +from pydantic import ValidationError + class TestExperiment(ExperimentPrototype): @@ -34,9 +36,7 @@ def __init__(self): # changed from 10e3/3->10e3 decimation_scheme = (DecimationScheme(rates[0], rates[-1]/dm_rates[-1], stages=all_stages)) - super(TestExperiment, self).__init__( - cpid, output_rx_rate=decimation_scheme.output_sample_rate, - decimation_scheme=decimation_scheme) + super(TestExperiment, self).__init__(cpid, output_rx_rate=decimation_scheme.output_sample_rate) if scf.IS_FORWARD_RADAR: beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER @@ -65,5 +65,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": decimation_scheme, } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "pulse_len\n" \ + " ensure this value is greater than or equal to 100.0 " \ + "\(type=value_error.number.not_ge; limit_value=100.0\)" diff --git a/testing_archive/test_rx_antenna_dne.py b/testing_archive/test_rx_antenna_dne.py index 0115958..fcf61b9 100644 --- a/testing_archive/test_rx_antenna_dne.py +++ b/testing_archive/test_rx_antenna_dne.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,6 +44,13 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "rx_main_antennas": [0,1,2,3,4,5,6,7,8,23] ### antenna 23 DNE, should fail + "rx_main_antennas": [0,1,2,3,4,5,6,7,8,23], ### antenna 23 DNE, should fail + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rx_main_antennas -> 9\n" \ + " ensure this value is less than 16 " \ + "\(type=value_error.number.not_lt; limit_value=16\)" diff --git a/testing_archive/test_rx_antenna_dups.py b/testing_archive/test_rx_antenna_dups.py index 8114800..c9d5d75 100644 --- a/testing_archive/test_rx_antenna_dups.py +++ b/testing_archive/test_rx_antenna_dups.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,6 +44,13 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "rx_main_antennas": [0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] ### 0 is dup'd, should fail + "rx_main_antennas": [0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15], ### 0 is dup'd, should fail + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rx_main_antennas\n" \ + " ensure this value has at most 16 items " \ + "\(type=value_error.list.max_items; limit_value=16\)" diff --git a/testing_archive/test_rxbw_not_divisible.py b/testing_archive/test_rxbw_not_divisible.py index 2cf498e..eda7e0f 100644 --- a/testing_archive/test_rxbw_not_divisible.py +++ b/testing_archive/test_rxbw_not_divisible.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -44,5 +46,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, \ + "Experiment's receive bandwidth 3141590.0 is not possible as it must be an integer divisor of USRP " \ + "master clock rate 100000000.0" diff --git a/testing_archive/test_rxfreq_not_num.py b/testing_archive/test_rxfreq_not_num.py index 6eaa36a..138a8cc 100644 --- a/testing_archive/test_rxfreq_not_num.py +++ b/testing_archive/test_rxfreq_not_num.py @@ -10,6 +10,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + class TestExperiment(ExperimentPrototype): @@ -37,9 +40,16 @@ def __init__(self): "beam_angle": scf.STD_16_BEAM_ANGLE, "rx_beam_order": beams_to_use, "scanbound": [i * 3.5 for i in range(len(beams_to_use))], #1 min scan - "freq" : '12005', ### not an int or float + "freq" : 'twelve thousand', ### not an int or float "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), + "rxonly": True, } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "freq\n" \ + " value is not a valid float \(type=type_error.float\)" diff --git a/testing_archive/test_rxfreq_too_high.py b/testing_archive/test_rxfreq_too_high.py index a561f5a..0a45f57 100644 --- a/testing_archive/test_rxfreq_too_high.py +++ b/testing_archive/test_rxfreq_too_high.py @@ -10,6 +10,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + class TestExperiment(ExperimentPrototype): @@ -41,5 +44,13 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), + "rxonly": True, } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "freq\n" \ + " ensure this value is less than or equal to 20000.0 " \ + "\(type=value_error.number.not_le; limit_value=20000.0\)" diff --git a/testing_archive/test_rxfreq_too_low.py b/testing_archive/test_rxfreq_too_low.py index c9fa3a5..d0c544a 100644 --- a/testing_archive/test_rxfreq_too_low.py +++ b/testing_archive/test_rxfreq_too_low.py @@ -10,6 +10,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + class TestExperiment(ExperimentPrototype): @@ -41,5 +44,13 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), + "rxonly": True, } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "freq\n" \ + " ensure this value is less than or equal to 20000.0 " \ + "\(type=value_error.number.not_le; limit_value=20000.0\)" diff --git a/testing_archive/test_rxrate_high.py b/testing_archive/test_rxrate_high.py index 1543e64..7acf992 100644 --- a/testing_archive/test_rxrate_high.py +++ b/testing_archive/test_rxrate_high.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -44,5 +46,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, \ + "Experiment's receive bandwidth is too large: 25000000.0 greater than max 5000000.0." diff --git a/testing_archive/test_scanbound_but_no_intt.py b/testing_archive/test_scanbound_but_no_intt.py index 4e8b0b2..a26113d 100644 --- a/testing_archive/test_scanbound_but_no_intt.py +++ b/testing_archive/test_scanbound_but_no_intt.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "scanbound\n" \ + " Slice 0 must have intt enabled to use scanbound \(type=value_error\)" diff --git a/testing_archive/test_scanbound_dne.py b/testing_archive/test_scanbound_dne.py index 5964f7e..8a97125 100644 --- a/testing_archive/test_scanbound_dne.py +++ b/testing_archive/test_scanbound_dne.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -42,6 +44,7 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } slice_2 = { # slice_id = 1 "pulse_sequence": scf.SEQUENCE_8P, @@ -58,7 +61,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) self.add_slice(slice_2, interfacing_dict={0: 'SCAN'}) ### no scanbound on second slice, should fail + @classmethod + def error_message(cls): + return ExperimentException, "If one slice has a scanbound, they all must to avoid up to minute-long downtimes." diff --git a/testing_archive/test_scanbound_negative.py b/testing_archive/test_scanbound_negative.py index 2ffd165..555aa89 100644 --- a/testing_archive/test_scanbound_negative.py +++ b/testing_archive/test_scanbound_negative.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,54 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "scanbound -> 1\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 2\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 3\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 4\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 5\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 6\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 7\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 8\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 9\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 10\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 11\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 12\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 13\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 14\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)\n" \ + "scanbound -> 15\n" \ + " ensure this value is greater than or equal to 0 " \ + "\(type=value_error.number.not_ge; limit_value=0\)" diff --git a/testing_archive/test_scanbound_not_increasing.py b/testing_archive/test_scanbound_not_increasing.py index 4a54726..72e8c9a 100644 --- a/testing_archive/test_scanbound_not_increasing.py +++ b/testing_archive/test_scanbound_not_increasing.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "Slice 0 scanbound times must be increasing" diff --git a/testing_archive/test_seq_not_increasing.py b/testing_archive/test_seq_not_increasing.py index 2e6681e..bb01d67 100644 --- a/testing_archive/test_seq_not_increasing.py +++ b/testing_archive/test_seq_not_increasing.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "pulse_sequence\n" \ + " not increasing: \[14, 0, 19, 21, 40\] \(type=value_error\)" diff --git a/testing_archive/test_sequence_dne.py b/testing_archive/test_sequence_dne.py index b395641..341e94c 100644 --- a/testing_archive/test_sequence_dne.py +++ b/testing_archive/test_sequence_dne.py @@ -9,6 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): @@ -42,5 +43,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return TypeError, "__init__\(\) missing 1 required positional argument: 'pulse_sequence'" diff --git a/testing_archive/test_sequence_not_int.py b/testing_archive/test_sequence_not_int.py index 6b67ff3..9aa78cd 100644 --- a/testing_archive/test_sequence_not_int.py +++ b/testing_archive/test_sequence_not_int.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,17 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "pulse_sequence -> 0\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "pulse_sequence -> 1\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "pulse_sequence -> 2\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "pulse_sequence -> 3\n" \ + " value is not a valid integer \(type=type_error.integer\)" diff --git a/testing_archive/test_sequence_not_list.py b/testing_archive/test_sequence_not_list.py index 138372b..4563ce4 100644 --- a/testing_archive/test_sequence_not_list.py +++ b/testing_archive/test_sequence_not_list.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "pulse_sequence\n" \ + " value is not a valid list \(type=type_error.list\)" diff --git a/testing_archive/test_slices_beam_order_bad.py b/testing_archive/test_slices_beam_order_bad.py index 3d8580e..6b81bf7 100644 --- a/testing_archive/test_slices_beam_order_bad.py +++ b/testing_archive/test_slices_beam_order_bad.py @@ -12,6 +12,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -44,9 +46,16 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } slice_2 = copy.deepcopy(slice_1) slice_2['rx_beam_order'] = [0, 1, 2, 3, 4, 5, 6, 7] ### Only half of the beams, should fail slice_2['tx_beam_order'] = [0, 1, 2, 3, 4, 5, 6, 7] self.add_slice(slice_1) self.add_slice(slice_2, interfacing_dict={0:'CONCURRENT'}) + + @classmethod + def error_message(cls): + return ExperimentException, \ + "Slices 0 and 1 are SEQUENCE or CONCURRENT interfaced but do not have the same number of averaging " \ + "periods in their beam order" diff --git a/testing_archive/test_slices_intn_bad.py b/testing_archive/test_slices_intn_bad.py index 50d992a..a91b227 100644 --- a/testing_archive/test_slices_intn_bad.py +++ b/testing_archive/test_slices_intn_bad.py @@ -11,6 +11,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -43,6 +45,7 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } slice_2 = copy.deepcopy(slice_1) del slice_2['intt'] @@ -51,3 +54,8 @@ def __init__(self): slice_1['intn'] = 9 ### Different intn targets, should fail self.add_slice(slice_1) self.add_slice(slice_2, interfacing_dict={0:'CONCURRENT'}) + + @classmethod + def error_message(cls): + return ExperimentException, \ + "Slices 0 and 1 are SEQUENCE or CONCURRENT interfaced and do not have the same NAVE goal intn" diff --git a/testing_archive/test_slices_intt_bad.py b/testing_archive/test_slices_intt_bad.py index 17bdf74..c8c670e 100644 --- a/testing_archive/test_slices_intt_bad.py +++ b/testing_archive/test_slices_intt_bad.py @@ -12,6 +12,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -45,6 +47,7 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } slice_2 = copy.deepcopy(slice_1) try: @@ -59,3 +62,9 @@ def __init__(self): slice_1['intt'] = 3490 ### Different intt durations, should fail self.add_slice(slice_1) self.add_slice(slice_2, interfacing_dict={0:'CONCURRENT'}) + + @classmethod + def error_message(cls): + return ExperimentException, \ + "Slices 0 and 1 are SEQUENCE or CONCURRENT interfaced and do not have the same Averaging Period " \ + "duration intt" diff --git a/testing_archive/test_slices_scanbound_bad.py b/testing_archive/test_slices_scanbound_bad.py index ccbfb54..5c4b0d9 100644 --- a/testing_archive/test_slices_scanbound_bad.py +++ b/testing_archive/test_slices_scanbound_bad.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -42,6 +44,7 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } slice_2 = { # slice_id = 1 "pulse_sequence": scf.SEQUENCE_8P, @@ -59,7 +62,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) self.add_slice(slice_2, interfacing_dict={0: 'CONCURRENT'}) + @classmethod + def error_message(cls): + return ExperimentException, \ + "Scan boundary not the same between slices 0 and 1 for AVEPERIOD or CONCURRENT interfaced slices" diff --git a/testing_archive/test_stage0_bad_inputrate.py b/testing_archive/test_stage0_bad_inputrate.py index 8dcf30b..0a8236b 100644 --- a/testing_archive/test_stage0_bad_inputrate.py +++ b/testing_archive/test_stage0_bad_inputrate.py @@ -11,6 +11,9 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype from experiment_prototype.decimation_scheme.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException + class TestExperiment(ExperimentPrototype): @@ -62,5 +65,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": decimation_scheme, } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, \ + "Decimation stage 0 does not have input rate 5100000.0 equal to USRP sampling rate 5200000.0" diff --git a/testing_archive/test_stagex_bad_outputrate.py b/testing_archive/test_stagex_bad_outputrate.py index ff10ec3..61cce7e 100644 --- a/testing_archive/test_stagex_bad_outputrate.py +++ b/testing_archive/test_stagex_bad_outputrate.py @@ -11,6 +11,9 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype from experiment_prototype.decimation_scheme.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException + class TestExperiment(ExperimentPrototype): @@ -64,5 +67,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": decimation_scheme, } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, \ + "Decimation stage 0 output rate 500000.0 does not equal next stage 1 input rate 250000.0" diff --git a/testing_archive/test_taps_not_list.py b/testing_archive/test_taps_not_list.py index 6483db7..c8de476 100644 --- a/testing_archive/test_taps_not_list.py +++ b/testing_archive/test_taps_not_list.py @@ -11,6 +11,9 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype from experiment_prototype.decimation_scheme.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException + class TestExperiment(ExperimentPrototype): @@ -64,5 +67,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": decimation_scheme, } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, \ + "Filter taps {0.06289466724896364, -0.0010733131978737358, 0.0034739473230933704, 0.08225352451182923, 3.8736815548755935e-08, -0.0003365289888721362, 3.4897229020296903e-07, 0.0695951435514344, -0.000480057381930764, -0.0024009882540009953, 1.525146324717017e-08, 9.601880324662872e-06, 6.608587739736533e-07, -0.00016656726614700716, -0.0022723317036880673, -0.0016715904235526304, -0.0006259778310093054, -0.0002094213323572842, 0.07634050450522707, 0.0106603162082833, -0.0023209924921151776, -0.0022170321752018897, 0.02202242256928963, 0.07742532989277437, 0.01961658218455495, 8.656110753604306e-06, -0.0015284578439195467, 0.00311186718534993, 0.05246321634635108, 5.916082120294521e-06, 2.206181197828724e-06, 8.31958089807559e-06, -0.0009494006071805216, -0.0023741416143331384, -9.158646873676331e-06, 0.044474664856345325, -0.0006911903688554466, -0.0008710245542883229, -0.0009898869300578451, 0.0012238590423045022, -2.6700248795790924e-05, 0.01448547446571537, -4.6927550412560446e-05, 5.587216209820598e-06, 3.998349768150298e-07, -0.0019527138712386045, 0.039488918105640064, 0.0646579013169585, 0.022850152522714638, 9.727379207166697e-06, -0.0012398028883716249, 0.08248346019377377, -0.000295966757047972, -0.0001301713473561059, 5.265893055101848e-06, 6.936630970229283e-06, -1.7930139381572334e-20, 1.145744914222454e-06, 0.0817809903523374, 2.0236773618653963e-06, 7.283516730366471e-06, 0.0018003197798039563, -0.00022500176418186612, 5.862064728909546e-07, 6.592084651684843e-06, 0.01733226200494296, -0.0023448070313587697, 0.006409896594214745, 0.018841320531247194, -9.949928935860894e-05, -0.0020416727959042917, 1.072105188825564e-05, -0.00134044547650692, -0.00024151879218492644, 0.008413656338717823, 1.1462731497374251e-07, 0.006888224518248666, -0.0024464487464716965, 8.313013071426383e-07, 5.180756075436137e-07, 0.04748202391696512, 0.07322733954560626, 0.005497987864126837, -3.604067103754201e-05, -0.0013869177812535149, 1.630849982118407e-07, 0.007381582840818176, -0.0017308486273283738, 0.05047951717977588, 0.05637020863639402, 0.057330221475522074, -2.256329274414122e-05, -0.0005354982526097347, 0.07516197231547955, 0.07886881128252848, 0.07970377954383184, 0.029888851116174845, 0.0009547146941380543, 1.3730619869641689e-07, 0.05344857851244929, -0.002167116474271743, 1.0151210931692294e-05, 1.0968593941858368e-05, -0.0005949127718093778, 0.02040535791763117, 0.01126006210510896, -0.00045378543991217744, 0.05540278724658995, 0.08235405470373033, 0.04048044299550955, 1.6908671985746142e-06, 0.05442867261903071, 0.00045346041199266593, 2.1692138188908925e-08, 0.012505081755886823, 0.0355690403475698, -0.00020926850658720052, 0.008952470327740493, -0.0019241158571979655, -0.0010936785623917133, 2.3997275272667507e-06, -0.0001416384354536527, 6.893936394546042e-06, -0.0005646791231571291, 0.05147329442618035, -0.0018316094229349966, -0.0007962628392915341, -0.0012944378446069925, -6.649832703027695e-05, 0.07035960997716854, 0.07453881083873386, 0.018079808020846345, -0.0012489546615515699, -0.002491035919873828, -4.110307107626933e-06, -0.00040763984980213367, 0.04347314441125988, 0.028064904788379367, 7.424251342076469e-07, -0.002464664890689465, 0.025406406637780994, 0.007890041340352606, 0.06378282944908116, 0.07110567363567229, 0.0784127263720031, 1.7390766626423138e-06, -0.001433790551060219, 0.00022087753900598367, 0.07254013599442419, -0.00038065769245545437, 0.048483190537792244, -0.00010912347465243661, 6.251441430724166e-06, 0.042473177377907664, 0.03175006199386798, 0.06108187135546527, -0.002488055736150857, 0.07793142728177971, 1.048157713433648e-18, 3.0481814907737657e-06, 0.005946516218467315, 6.254755780767991e-08, 0.021207394911218383, 0.07929928693128875, -0.002497435583084663, -0.0007252552261758124, 0.046479766087839575, 0.05922515725189695, 0.08105521614904057, 0.002429115361732433, 3.799273256474238e-06, 0.013150244251379149, -1.5266453654540216e-05, 1.54000892264513e-06, 4.649336493175233e-06, 0.04547709110451463, -0.0020854545539949515, -0.0021265579956648052, 0.016598882191637684, -0.0024251560420184845, 0.08246907333454662, -0.0024297559197984926, -5.951595955482316e-05, 0.08212442362785628, -4.128125873174736e-05, 0.002108071424421339, -0.0024544610304810055, -0.00018007205277773653, -0.0004040962927861809, -0.001159779264374637, 0.002763650442432735, 1.0974104396405544e-05, -0.0014809950371240943, 0.08132496494423744, -0.002399445992839946, -8.194238715866198e-05, 0.03654091959760706, 4.560786615966971e-07, -0.002279410655343552, -0.0015034720365777578, -0.0013763102602103565, -0.0024795978433219752, 0.06719768019427408, 2.619506572776292e-07, 1.3990993373858622e-06, 0.003850063349973732, 0.027168005364606732, 0.030815026614753223, 3.28542585637886e-06, 8.983995021377113e-06, 4.953012724983122e-06, 3.537596842711744e-06, 1.0325682164026036e-06, 7.977066439096651e-06, 9.885216922940113e-06, 0.08008193713562287, 0.05828210969100015, 0.08043342996708851, 1.2677976203724372e-06, 0.08242592546680576, 2.251002403810694e-07, -0.0012040513839653522, -0.000658096113070276, -0.000771500714345233, 4.96984486342935e-08, 0.07689487035035975, 5.850790244901255e-06, 1.088337650374436e-05, -0.0018139390414664727, 0.011874999820488966, 0.08156696057641506, 2.8206225823486905e-06, -0.0020846945161923478, -0.000833182058539254, 2.6044971758924117e-06, -0.0018607444369520907, -9.044609231282396e-05, 4.35549696550302e-06, 0.0006979930404067116, -0.0019070424543745927, 9.300314863763255e-06, 0.07183271711995307, 0.07389375151868346, -0.0025025561317611146, -5.299913249536603e-05, 4.0720078346828775e-06, 0.00950651160781722, 1.0381801829536081e-05, 0.02454247716865664, -0.0007602828542883173, 1.047964050270924e-05, -0.002498762495863228, 0.041475401287418334, -1.945166613773851e-06, 0.004240378072983618, 0.07576270733041814, -0.0019976340304188444, 0.060158648978224226, -0.0002588393089865985, -0.0016215605297766622, 1.0146552138739823e-05, 1.1000295935293669e-05, 0.015879850736619606, -0.0011161854690177769, 1.8519927447572555e-06, 0.005064203732491989, 1.922496480229604e-07, 0.03751857137598318, -0.002502190709845202, -6.509826143199113e-06, 0.03364479107221002, 0.0807579509706507, -0.0017192561495253307, -0.000909771406807081, -0.0015761008273510904, 0.06199411335353473, 7.792624870566256e-06, 1.0756068275015736e-05, -0.0001193402643357173, -0.0016238409971062475, -3.1186593826643534e-05, 0.08196686594268496, 9.278839615312733e-07, 0.02897199583990937, 1.0885236198501121e-05, -0.00019429881069767612, 3.2871902683031636e-06, 0.023690278657604633, 8.557647635737622e-06, -0.0017667401073523435, 7.630983599570356e-06, 0.06881290397321826, 0.06551918999587059, -0.0021548288421496787, 0.013810407330902556, -7.396684131510267e-05, -0.002363277236350318, 0.034603485095254245, -0.00031580995158641254, -0.000358139896049816, -0.0005072927054517898, -0.0024738119586286025, -0.0002769824642020327, 0.026281708138255495, -0.0004284684074119294, -0.0023131700220996028, -0.0020086403684454724, 7.749770595358078e-08, -0.0009376672646191548, 0.03269348085846506, 0.038501430413861934, -0.002243703505338492, 0.0015056537011587817, 2.9463235340704388e-08, 0.015175332356763542, 0.0046450441666391834, 0.06801353228963597, -0.0010312018065974904, -0.0022062176158428814, 3.031280692631285e-07, 0.010075793939417774, 9.199298196946883e-06, -1.2072207088245197e-05, -0.0005948385597234552, 0.06636600923202082, 0.04948258440617524, 1.05865566153314e-05, -1.875783517136941e-05, -0.00015376321007033492, 9.477681572350969e-08, 4.651889343061061e-06} of type must be a list in decimation stage 0" diff --git a/testing_archive/test_taps_not_nums.py b/testing_archive/test_taps_not_nums.py index 034c9fc..44c3811 100644 --- a/testing_archive/test_taps_not_nums.py +++ b/testing_archive/test_taps_not_nums.py @@ -11,6 +11,9 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype from experiment_prototype.decimation_scheme.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException + class TestExperiment(ExperimentPrototype): @@ -64,5 +67,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": decimation_scheme, } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, "Filter tap 1.525146324717017e-08 is not numeric in decimation stage 0" diff --git a/testing_archive/test_tau_dne.py b/testing_archive/test_tau_dne.py index 0275d2e..13001d5 100644 --- a/testing_archive/test_tau_dne.py +++ b/testing_archive/test_tau_dne.py @@ -9,6 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): @@ -42,5 +43,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return TypeError, "__init__\(\) missing 1 required positional argument: 'tau_spacing'" diff --git a/testing_archive/test_tau_not_int.py b/testing_archive/test_tau_not_int.py index b6d47d6..e51d490 100644 --- a/testing_archive/test_tau_not_int.py +++ b/testing_archive/test_tau_not_int.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "tau_spacing\n" \ + " value is not a valid integer \(type=type_error.integer\)" diff --git a/testing_archive/test_tau_not_multiple.py b/testing_archive/test_tau_not_multiple.py index b3fad06..faa58ac 100644 --- a/testing_archive/test_tau_not_multiple.py +++ b/testing_archive/test_tau_not_multiple.py @@ -10,6 +10,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,13 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "tau_spacing\n" \ + " Slice 0 correlation lags will be off because tau_spacing 2407 us is not a " \ + "multiple of the output rx sampling period \(1/output_rx_rate " \ + "3333.3333333333335 Hz\). \(type=value_error\)" diff --git a/testing_archive/test_tau_too_small.py b/testing_archive/test_tau_too_small.py index 05c4093..7f06feb 100644 --- a/testing_archive/test_tau_too_small.py +++ b/testing_archive/test_tau_too_small.py @@ -9,6 +9,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + class TestExperiment(ExperimentPrototype): @@ -41,5 +44,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "tau_spacing\n" \ + " ensure this value is greater than or equal to 1.0 " \ + "\(type=value_error.number.not_ge; limit_value=1.0\)" diff --git a/testing_archive/test_too_many_dm_stages.py b/testing_archive/test_too_many_dm_stages.py index 899a5ed..2e2e7cd 100644 --- a/testing_archive/test_too_many_dm_stages.py +++ b/testing_archive/test_too_many_dm_stages.py @@ -11,6 +11,8 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype from experiment_prototype.decimation_scheme.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation +from experiment_prototype.experiment_exception import ExperimentException + class TestExperiment(ExperimentPrototype): @@ -64,7 +66,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": decimation_scheme, } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, "Number of decimation stages \(7\) is greater than max available 6" diff --git a/testing_archive/test_too_many_int_antennas.py b/testing_archive/test_too_many_int_antennas.py index 03e384a..ad966ec 100644 --- a/testing_archive/test_too_many_int_antennas.py +++ b/testing_archive/test_too_many_int_antennas.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,6 +44,13 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "rx_int_antennas": [0,1,2,3,4] ### One too many antennas, should fail + "rx_int_antennas": [0,1,2,3,4], ### One too many antennas, should fail + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rx_int_antennas\n" \ + " ensure this value has at most 4 items " \ + "\(type=value_error.list.max_items; limit_value=4\)" diff --git a/testing_archive/test_too_many_rx_antennas.py b/testing_archive/test_too_many_rx_antennas.py index 070df74..a964589 100644 --- a/testing_archive/test_too_many_rx_antennas.py +++ b/testing_archive/test_too_many_rx_antennas.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,6 +44,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "rx_main_antennas": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] ### One too many antennas, should fail + "rx_main_antennas": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], ### One too many antennas, should fail + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "ensure this value has at most 16 items " \ + "\(type=value_error.list.max_items; limit_value=16\)" diff --git a/testing_archive/test_too_many_tx_antennas.py b/testing_archive/test_too_many_tx_antennas.py index cbc77f8..e4281a1 100644 --- a/testing_archive/test_too_many_tx_antennas.py +++ b/testing_archive/test_too_many_tx_antennas.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,6 +44,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "tx_antennas": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] ### One too many antennas, should fail + "tx_antennas": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], ### One too many antennas, should fail + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "ensure this value has at most 16 items " \ + "\(type=value_error.list.max_items; limit_value=16\)" diff --git a/testing_archive/test_two_classes.py b/testing_archive/test_two_classes.py index c39e742..0c5f526 100644 --- a/testing_archive/test_two_classes.py +++ b/testing_archive/test_two_classes.py @@ -9,6 +9,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException + class TestExperiment2(ExperimentPrototype): ### First class @@ -41,9 +44,14 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + @classmethod + def error_message(cls): + return "pass" + class TestExperiment(ExperimentPrototype): ### Second class @@ -76,5 +84,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, "You have more than one experiment class in your experiment file - exiting" diff --git a/testing_archive/test_tx_antenna_dne.py b/testing_archive/test_tx_antenna_dne.py index bc9d921..c84d02f 100644 --- a/testing_archive/test_tx_antenna_dne.py +++ b/testing_archive/test_tx_antenna_dne.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,6 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "tx_antennas": [0,1,2,3,4,5,23] ### antenna 23 doesn't exist, should fail + "tx_antennas": [0,1,2,3,4,5,23], ### antenna 23 doesn't exist, should fail + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "ensure this value is less than 16 \(type=value_error.number.not_lt; limit_value=16\)" diff --git a/testing_archive/test_tx_antenna_dups.py b/testing_archive/test_tx_antenna_dups.py index 779347f..ed491ac 100644 --- a/testing_archive/test_tx_antenna_dups.py +++ b/testing_archive/test_tx_antenna_dups.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,6 +44,13 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "tx_antennas": [0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] ### antenna 0 is duplicated, should fail + "tx_antennas": [0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15], ### antenna 0 is duplicated, should fail + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "tx_antennas\n" \ + " ensure this value has at most 16 items \(type=value_error.list.max_items; " \ + "limit_value=16\)" diff --git a/testing_archive/test_tx_antenna_pattern_dim_mismatch.py b/testing_archive/test_tx_antenna_pattern_dim_mismatch.py index 2853b22..aaf22fe 100644 --- a/testing_archive/test_tx_antenna_pattern_dim_mismatch.py +++ b/testing_archive/test_tx_antenna_pattern_dim_mismatch.py @@ -11,6 +11,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + ### pattern second dimension is not equal to num_main_antennas, this will fail in check_slice() ### of ExperimentPrototype @@ -46,8 +49,6 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) - self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, "tau_spacing": scf.TAU_SPACING_7P, @@ -63,4 +64,10 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) + + @classmethod + def error_message(cls): + return ValidationError, \ + "Slice 0 tx antenna pattern return 2nd dimension \(15\) must be equal to number of main antennas \(16\)" diff --git a/testing_archive/test_tx_antenna_pattern_magnitude.py b/testing_archive/test_tx_antenna_pattern_magnitude.py index 88131a5..1811948 100644 --- a/testing_archive/test_tx_antenna_pattern_magnitude.py +++ b/testing_archive/test_tx_antenna_pattern_magnitude.py @@ -11,6 +11,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + ### One of the pattern's elements' magnitudes is > 1.0, this will fail in check_slice() ### of ExperimentPrototype @@ -47,8 +50,6 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) - self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, "tau_spacing": scf.TAU_SPACING_7P, @@ -64,5 +65,10 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) + @classmethod + def error_message(cls): + return ValidationError, \ + "Slice 0 tx antenna pattern return must not have any values with a magnitude greater than 1" diff --git a/testing_archive/test_tx_antenna_pattern_not_2d.py b/testing_archive/test_tx_antenna_pattern_not_2d.py index da6db95..8665c20 100644 --- a/testing_archive/test_tx_antenna_pattern_not_2d.py +++ b/testing_archive/test_tx_antenna_pattern_not_2d.py @@ -10,6 +10,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + ### pattern returned is only one dimensional, but is required to be 2-dimensional ### this will fail in check_slice() of ExperimentPrototype @@ -45,8 +48,6 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) - self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, "tau_spacing": scf.TAU_SPACING_7P, @@ -62,4 +63,9 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) + + @classmethod + def error_message(cls): + return ValidationError, "Slice 0 tx antenna pattern return shape \(16,\) must be 2-dimensional" diff --git a/testing_archive/test_tx_antenna_pattern_not_callable.py b/testing_archive/test_tx_antenna_pattern_not_callable.py index 789fe3d..8483801 100644 --- a/testing_archive/test_tx_antenna_pattern_not_callable.py +++ b/testing_archive/test_tx_antenna_pattern_not_callable.py @@ -9,11 +9,13 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + ### tx_antenna_pattern is not a callable function. ### this will fail in check_slice() of ExperimentPrototype - class TxAntennaPatternTest(ExperimentPrototype): def __init__(self, **kwargs): @@ -40,8 +42,6 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) - self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, "tau_spacing": scf.TAU_SPACING_7P, @@ -57,4 +57,9 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) + + @classmethod + def error_message(cls): + return ValidationError, "pattern is not callable \(type=type_error.callable; value=pattern\)" diff --git a/testing_archive/test_tx_antenna_pattern_not_numpy.py b/testing_archive/test_tx_antenna_pattern_not_numpy.py index 3cf37cd..501bcd2 100644 --- a/testing_archive/test_tx_antenna_pattern_not_numpy.py +++ b/testing_archive/test_tx_antenna_pattern_not_numpy.py @@ -9,6 +9,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + ### pattern returned by tx_antenna_pattern is not a numpy array, but a list ### this will fail in check_slice() of ExperimentPrototype @@ -44,8 +47,6 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = kwargs['freq'] - self.printing('Frequency set to {}'.format(freq)) - self.add_slice({ # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, "tau_spacing": scf.TAU_SPACING_7P, @@ -61,4 +62,9 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), }) + + @classmethod + def error_message(cls): + return ValidationError, "Slice 0 tx antenna pattern return is not a numpy array" diff --git a/testing_archive/test_tx_beam_order_dne.py b/testing_archive/test_tx_beam_order_dne.py index d42be45..66b0827 100644 --- a/testing_archive/test_tx_beam_order_dne.py +++ b/testing_archive/test_tx_beam_order_dne.py @@ -11,6 +11,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + def tx_antenna_pattern(tx_freq_khz, tx_antennas, antenna_spacing): """tx_antenna_pattern function for boresight transmission.""" @@ -51,5 +54,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rxonly specified as False but tx_beam_order not given. Slice: 0" diff --git a/testing_archive/test_tx_beam_order_list_not_ints.py b/testing_archive/test_tx_beam_order_list_not_ints.py index 411e3cb..ae3cdbf 100644 --- a/testing_archive/test_tx_beam_order_list_not_ints.py +++ b/testing_archive/test_tx_beam_order_list_not_ints.py @@ -10,6 +10,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,22 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "6 validation errors for ExperimentSlice\n" \ + "tx_beam_order -> 0\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "tx_beam_order -> 0\n" \ + " value is not a valid list \(type=type_error.list\)\n" \ + "tx_beam_order -> 1\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "tx_beam_order -> 1\n" \ + " value is not a valid list \(type=type_error.list\)\n" \ + "tx_beam_order -> 2\n" \ + " value is not a valid integer \(type=type_error.integer\)\n" \ + "tx_beam_order -> 2\n" \ + " value is not a valid list \(type=type_error.list\)" diff --git a/testing_archive/test_tx_beam_order_listnum_too_high.py b/testing_archive/test_tx_beam_order_listnum_too_high.py index d2b8624..b438e58 100644 --- a/testing_archive/test_tx_beam_order_listnum_too_high.py +++ b/testing_archive/test_tx_beam_order_listnum_too_high.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, \ + "Beam number 22 in tx_beam_order could not index in beam_angle list of length 16. Slice: 0" diff --git a/testing_archive/test_tx_beam_order_not_list.py b/testing_archive/test_tx_beam_order_not_list.py index 80cf3a7..93c6dd4 100644 --- a/testing_archive/test_tx_beam_order_not_list.py +++ b/testing_archive/test_tx_beam_order_not_list.py @@ -10,6 +10,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "tx_beam_order\n" \ + " value is not a valid list \(type=type_error.list\)" diff --git a/testing_archive/test_tx_beam_order_not_same_len_as_rx.py b/testing_archive/test_tx_beam_order_not_same_len_as_rx.py index 7da14f6..f74e2cf 100644 --- a/testing_archive/test_tx_beam_order_not_same_len_as_rx.py +++ b/testing_archive/test_tx_beam_order_not_same_len_as_rx.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -42,5 +44,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } - self.add_slice(slice_1) \ No newline at end of file + self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "tx_beam_order does not have same length as rx_beam_order. Slice: 0" diff --git a/testing_archive/test_txbw_not_divisible.py b/testing_archive/test_txbw_not_divisible.py index eac786f..9209abe 100644 --- a/testing_archive/test_txbw_not_divisible.py +++ b/testing_archive/test_txbw_not_divisible.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -44,5 +46,12 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, \ + "Experiment's transmit bandwidth 3141590.0 is not possible as it must be an integer divisor of USRP " \ + "master clock rate 100000000.0" diff --git a/testing_archive/test_txfreq_restricted.py b/testing_archive/test_txfreq_restricted.py index 447c974..f136abe 100644 --- a/testing_archive/test_txfreq_restricted.py +++ b/testing_archive/test_txfreq_restricted.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +45,10 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "freq is within a restricted frequency range \(13155, 13617\)" diff --git a/testing_archive/test_txrate_high.py b/testing_archive/test_txrate_high.py index e6dfa76..eadbcc9 100644 --- a/testing_archive/test_txrate_high.py +++ b/testing_archive/test_txrate_high.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -44,5 +46,11 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ExperimentException, \ + "Experiment's transmit bandwidth is too large: 25000000.0 greater than max 5000000.0." diff --git a/testing_archive/test_unused_param.py b/testing_archive/test_unused_param.py index d579999..fab6646 100644 --- a/testing_archive/test_unused_param.py +++ b/testing_archive/test_unused_param.py @@ -9,6 +9,8 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException class TestExperiment(ExperimentPrototype): @@ -43,5 +45,10 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "UNUSED": "it's a me-a, Mario", ### Unused param, should fail + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return TypeError, "__init__\(\) got an unexpected keyword argument 'UNUSED'" diff --git a/testing_archive/test_wait_for_first_scanbound_type.py b/testing_archive/test_wait_for_first_scanbound_type.py index 211c3e8..68f1e2b 100644 --- a/testing_archive/test_wait_for_first_scanbound_type.py +++ b/testing_archive/test_wait_for_first_scanbound_type.py @@ -9,6 +9,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException +from pydantic import ValidationError class TestExperiment(ExperimentPrototype): @@ -43,5 +46,13 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "wait_for_first_scanbound": 0, ### Not boolean, should fail + "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, \ + '1 validation error for ExperimentSlice\n' \ + 'wait_for_first_scanbound\n' \ + ' value is not a valid boolean \(type=value_error.strictbool\)' From c382ed5c60f492254322fe65a00ebb2460b839b7 Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Tue, 11 Apr 2023 17:18:36 +0000 Subject: [PATCH 03/13] Updated tests for better coverage. * All tests pass when using exp_proto_refactor branch of Borealis. --- .../deprecated_tests/test_txfreq_not_num.py | 2 +- .../deprecated_tests/test_txfreq_too_high.py | 2 +- .../deprecated_tests/test_txfreq_too_low.py | 2 +- testing_archive/test_avg_method_dne.py | 2 - testing_archive/test_bad_interface.py | 2 - testing_archive/test_bad_interfacing.py | 3 - testing_archive/test_bad_slice.py | 2 - testing_archive/test_bad_slice_id.py | 2 - testing_archive/test_beam_angle_dne.py | 2 - testing_archive/test_beam_angle_dups.py | 2 - .../test_beam_angle_not_increasing.py | 5 +- testing_archive/test_beam_angle_not_list.py | 3 - testing_archive/test_beam_angle_not_num.py | 3 - testing_archive/test_beam_order_bad_index.py | 4 +- testing_archive/test_beam_order_dne.py | 3 - .../test_beam_order_lists_bad_index.py | 2 - .../test_beam_order_lists_not_ints.py | 3 - .../test_beam_order_not_ints_or_lists.py | 3 - testing_archive/test_beam_order_not_list.py | 3 - testing_archive/test_clrfrqrng_not_2.py | 2 - testing_archive/test_clrfrqrng_not_inc.py | 12 +-- testing_archive/test_clrfrqrng_not_ints.py | 2 - testing_archive/test_clrfrqrng_too_high.py | 4 - testing_archive/test_clrfrqrng_too_low.py | 4 - testing_archive/test_cpid_int.py | 2 - testing_archive/test_cpid_pos.py | 4 - testing_archive/test_cpid_unique.py | 2 - testing_archive/test_del_slice_dne.py | 2 - testing_archive/test_dm_rate_not_int.py | 2 - testing_archive/test_edit_slice_bad_param.py | 2 - testing_archive/test_edit_slice_dne.py | 2 - testing_archive/test_edit_slice_improperly.py | 40 ++++++++++ .../test_finalstage_bad_outputrate.py | 3 - testing_archive/test_first_range_dne.py | 2 - ...rxfreq_not_num.py => test_freq_not_num.py} | 3 - ..._restricted.py => test_freq_restricted.py} | 2 - ...freq_too_high.py => test_freq_too_high.py} | 3 - ...rxfreq_too_low.py => test_freq_too_low.py} | 3 - testing_archive/test_int_antenna_dne.py | 2 - testing_archive/test_int_antenna_dups.py | 2 - testing_archive/test_intn_not_int.py | 2 - .../test_intt_longer_than_scanbound.py | 2 - .../test_intt_longer_than_scanbounds.py | 2 - testing_archive/test_intt_not_num.py | 2 - testing_archive/test_intt_too_low.py | 7 +- testing_archive/test_lag_table_bad.py | 17 ++--- testing_archive/test_mismatched_dm_schemes.py | 75 +++++++++++++++++++ .../test_mismatched_dm_schemes_aveperiod.py | 69 +++++++++++++++++ testing_archive/test_no_class.py | 2 - testing_archive/test_no_freq_set.py | 2 - testing_archive/test_no_inheritance.py | 2 - testing_archive/test_no_intt_intn.py | 2 - testing_archive/test_no_slices.py | 2 - testing_archive/test_num_ranges_dne.py | 2 - testing_archive/test_num_ranges_not_int.py | 2 - testing_archive/test_output_rxrate_high.py | 2 - testing_archive/test_ppo_bad_length.py | 48 ++++++++++++ testing_archive/test_ppo_not_1d.py | 47 ++++++++++++ testing_archive/test_ppo_np.py | 47 ++++++++++++ testing_archive/test_pulse_len_bad.py | 25 ++----- testing_archive/test_pulse_len_dne.py | 2 - testing_archive/test_pulse_len_not_int.py | 2 - testing_archive/test_pulse_len_too_high.py | 2 - testing_archive/test_pulse_len_too_low.py | 2 - testing_archive/test_rx_antenna_dne.py | 2 - testing_archive/test_rx_antenna_dups.py | 2 - .../test_rx_int_antenna_invalid.py | 45 +++++++++++ .../test_rx_main_antenna_invalid.py | 45 +++++++++++ testing_archive/test_rxbw_not_divisible.py | 2 - testing_archive/test_rxonly_dne.py | 40 ++++++++++ testing_archive/test_rxrate_high.py | 2 - testing_archive/test_scanbound_but_no_intt.py | 2 - testing_archive/test_scanbound_dne.py | 2 - testing_archive/test_scanbound_negative.py | 2 - .../test_scanbound_not_increasing.py | 2 - testing_archive/test_seq_not_increasing.py | 2 - testing_archive/test_sequence_dne.py | 2 - testing_archive/test_sequence_not_int.py | 2 - testing_archive/test_sequence_not_list.py | 2 - testing_archive/test_slices_beam_order_bad.py | 3 - testing_archive/test_slices_intn_bad.py | 2 - testing_archive/test_slices_intt_bad.py | 3 - testing_archive/test_slices_scanbound_bad.py | 2 - testing_archive/test_stage0_bad_inputrate.py | 2 - testing_archive/test_stagex_bad_outputrate.py | 2 - testing_archive/test_taps_not_list.py | 2 - testing_archive/test_taps_not_nums.py | 2 - testing_archive/test_tau_dne.py | 2 - testing_archive/test_tau_not_int.py | 2 - testing_archive/test_tau_not_multiple.py | 3 - testing_archive/test_tau_too_small.py | 4 +- testing_archive/test_too_many_dm_stages.py | 2 - testing_archive/test_too_many_int_antennas.py | 2 - testing_archive/test_too_many_rx_antennas.py | 2 - testing_archive/test_too_many_tx_antennas.py | 2 - testing_archive/test_two_classes.py | 2 - testing_archive/test_tx_antenna_dne.py | 2 - testing_archive/test_tx_antenna_dups.py | 2 - testing_archive/test_tx_antenna_invalid.py | 45 +++++++++++ .../test_tx_antenna_pattern_dim_mismatch.py | 2 - .../test_tx_antenna_pattern_magnitude.py | 2 - .../test_tx_antenna_pattern_not_2d.py | 2 - .../test_tx_antenna_pattern_not_callable.py | 2 - .../test_tx_antenna_pattern_not_numpy.py | 2 - testing_archive/test_tx_beam_order_dne.py | 2 - .../test_tx_beam_order_list_not_ints.py | 13 +--- .../test_tx_beam_order_listnum_too_high.py | 2 - ..._beam_order_mismatch_tx_antenna_pattern.py | 60 +++++++++++++++ .../test_tx_beam_order_not_list.py | 3 - .../test_tx_beam_order_not_same_len_as_rx.py | 2 - testing_archive/test_txbw_not_divisible.py | 2 - testing_archive/test_txrate_high.py | 2 - testing_archive/test_unused_param.py | 2 - .../test_wait_for_first_scanbound_type.py | 2 - 114 files changed, 588 insertions(+), 271 deletions(-) create mode 100644 testing_archive/test_edit_slice_improperly.py rename testing_archive/{test_rxfreq_not_num.py => test_freq_not_num.py} (89%) rename testing_archive/{test_txfreq_restricted.py => test_freq_restricted.py} (96%) rename testing_archive/{test_rxfreq_too_high.py => test_freq_too_high.py} (89%) rename testing_archive/{test_rxfreq_too_low.py => test_freq_too_low.py} (89%) create mode 100644 testing_archive/test_mismatched_dm_schemes.py create mode 100644 testing_archive/test_mismatched_dm_schemes_aveperiod.py create mode 100644 testing_archive/test_ppo_bad_length.py create mode 100644 testing_archive/test_ppo_not_1d.py create mode 100644 testing_archive/test_ppo_np.py create mode 100644 testing_archive/test_rx_int_antenna_invalid.py create mode 100644 testing_archive/test_rx_main_antenna_invalid.py create mode 100644 testing_archive/test_rxonly_dne.py create mode 100644 testing_archive/test_tx_antenna_invalid.py create mode 100644 testing_archive/test_tx_beam_order_mismatch_tx_antenna_pattern.py diff --git a/testing_archive/deprecated_tests/test_txfreq_not_num.py b/testing_archive/deprecated_tests/test_txfreq_not_num.py index 906e052..f2f725f 100644 --- a/testing_archive/deprecated_tests/test_txfreq_not_num.py +++ b/testing_archive/deprecated_tests/test_txfreq_not_num.py @@ -8,7 +8,7 @@ frequencies .* for the radar license and be within range given center frequencies \(.* kHz\), sampling rates \(.* kHz\), and transition band \(.* kHz\) -NOTE: This test is covered by test_rxfreq_not_num.py since rxfreq and txfreq were combined to freq +NOTE: This test is covered by test_freq_not_num.py since rxfreq and txfreq were combined to freq """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/deprecated_tests/test_txfreq_too_high.py b/testing_archive/deprecated_tests/test_txfreq_too_high.py index 0f0c8af..ff12cbe 100644 --- a/testing_archive/deprecated_tests/test_txfreq_too_high.py +++ b/testing_archive/deprecated_tests/test_txfreq_too_high.py @@ -8,7 +8,7 @@ frequencies .* for the radar license and be within range given center frequencies \(.* kHz\), sampling rates \(.* kHz\), and transition band \(.* kHz\) -NOTE: This test is covered by test_rxfreq_not_num.py since rxfreq and txfreq were combined to freq +NOTE: This test is covered by test_freq_not_num.py since rxfreq and txfreq were combined to freq """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/deprecated_tests/test_txfreq_too_low.py b/testing_archive/deprecated_tests/test_txfreq_too_low.py index d82c013..f6d59fb 100644 --- a/testing_archive/deprecated_tests/test_txfreq_too_low.py +++ b/testing_archive/deprecated_tests/test_txfreq_too_low.py @@ -8,7 +8,7 @@ frequencies .* for the radar license and be within range given center frequencies \(.* kHz\), sampling rates \(.* kHz\), and transition band \(.* kHz\) -NOTE: This test is covered by test_rxfreq_not_num.py since rxfreq and txfreq were combined to freq +NOTE: This test is covered by test_freq_not_num.py since rxfreq and txfreq were combined to freq """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_avg_method_dne.py b/testing_archive/test_avg_method_dne.py index 9c3c769..4ffc120 100644 --- a/testing_archive/test_avg_method_dne.py +++ b/testing_archive/test_avg_method_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: Setting averaging_method to an invalid method -Expected exception: - Averaging method .* not valid method. Possible methods are .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_bad_interface.py b/testing_archive/test_bad_interface.py index e952a8a..aedc2e3 100644 --- a/testing_archive/test_bad_interface.py +++ b/testing_archive/test_bad_interface.py @@ -3,8 +3,6 @@ """ Experiment fault: Interfacing two slices with an invalid interface type -Expected exception: - Interface value with slice .* not valid. Types available are """ import copy diff --git a/testing_archive/test_bad_interfacing.py b/testing_archive/test_bad_interfacing.py index 58daa68..d2cc1b0 100644 --- a/testing_archive/test_bad_interfacing.py +++ b/testing_archive/test_bad_interfacing.py @@ -3,9 +3,6 @@ """ Experiment fault: Invalid interfacing between three different slices -Expected exception: - The interfacing values of new slice cannot be reconciled. Interfacing with slice .* and with - slice .* does not make sense with existing interface between slices of .* """ import copy diff --git a/testing_archive/test_bad_slice.py b/testing_archive/test_bad_slice.py index 5269da2..f8f9745 100644 --- a/testing_archive/test_bad_slice.py +++ b/testing_archive/test_bad_slice.py @@ -3,8 +3,6 @@ """ Experiment fault: Adding a slice that isn't a dictionary of parameters -Expected exception: - Attempt to add a slice failed - .* is not a dictionary of slice parameters """ from experiment_prototype.experiment_prototype import ExperimentPrototype from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_bad_slice_id.py b/testing_archive/test_bad_slice_id.py index ba88361..4dbf9a8 100644 --- a/testing_archive/test_bad_slice_id.py +++ b/testing_archive/test_bad_slice_id.py @@ -3,8 +3,6 @@ """ Experiment fault: Interfacing between two slices with an unknown slice ID -Expected exception: - Cannot add slice: the interfacing_dict set interfacing to an unknown slice .* not in slice ids """ import copy diff --git a/testing_archive/test_beam_angle_dne.py b/testing_archive/test_beam_angle_dne.py index 257fda4..d4e35f6 100644 --- a/testing_archive/test_beam_angle_dne.py +++ b/testing_archive/test_beam_angle_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: No beam_angle set in slice -Expected exception: - Slice must specify beam_angle that must be a list of numbers \(ints or floats\) which are angles of degrees off boresight \(positive E of N\) """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_beam_angle_dups.py b/testing_archive/test_beam_angle_dups.py index 525d648..5462704 100644 --- a/testing_archive/test_beam_angle_dups.py +++ b/testing_archive/test_beam_angle_dups.py @@ -3,8 +3,6 @@ """ Experiment fault: beam_angle contains duplicates -Expected exception: - Slice .* beam angles has duplicate directions """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_beam_angle_not_increasing.py b/testing_archive/test_beam_angle_not_increasing.py index c9faa80..83074d7 100644 --- a/testing_archive/test_beam_angle_not_increasing.py +++ b/testing_archive/test_beam_angle_not_increasing.py @@ -3,8 +3,6 @@ """ Experiment fault: beam_angle not increasing -Expected exception: - Slice .* beam_angle not increasing clockwise \(E of N is positive\) """ import borealis_experiments.superdarn_common_fields as scf @@ -28,7 +26,8 @@ def __init__(self): num_ranges = scf.POLARDARN_NUM_RANGES if scf.options.site_id in ["sas", "pgr"]: num_ranges = scf.STD_NUM_RANGES - reversedlist = [-26.25, -22.75, -19.25, -15.75, -12.25, -8.75,-5.25, -1.75, 1.75, 5.25, 8.75, 12.25, 15.75, 19.25, 22.75, 26.25] + reversedlist = [-26.25, -22.75, -19.25, -15.75, -12.25, -8.75, -5.25, -1.75, + 1.75, 5.25, 8.75, 12.25, 15.75, 19.25, 22.75, 26.25] reversedlist.reverse() slice_1 = { # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, diff --git a/testing_archive/test_beam_angle_not_list.py b/testing_archive/test_beam_angle_not_list.py index e839bbe..5a82724 100644 --- a/testing_archive/test_beam_angle_not_list.py +++ b/testing_archive/test_beam_angle_not_list.py @@ -3,9 +3,6 @@ """ Experiment fault: beam_angle not a list -Expected exception: - Slice must specify beam_angle that must be a list of numbers \(ints or floats\) which are angles - of degrees off boresight \(positive E of N\) """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_beam_angle_not_num.py b/testing_archive/test_beam_angle_not_num.py index b085320..92dc37e 100644 --- a/testing_archive/test_beam_angle_not_num.py +++ b/testing_archive/test_beam_angle_not_num.py @@ -3,9 +3,6 @@ """ Experiment fault: beam_angle not all numbers -Expected exception: - .*Slice must specify beam_angle that must be a list of numbers \(ints or floats\) which are - angles of degrees off boresight \(positive E of N\) """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_beam_order_bad_index.py b/testing_archive/test_beam_order_bad_index.py index 7a7f50d..3d81c5a 100644 --- a/testing_archive/test_beam_order_bad_index.py +++ b/testing_archive/test_beam_order_bad_index.py @@ -3,8 +3,6 @@ """ Experiment fault: rx_beam_order invalid index -Expected exception: - Beam number .* could not index in beam_angle list of length .*. Slice: .* """ import borealis_experiments.superdarn_common_fields as scf @@ -38,7 +36,7 @@ def __init__(self): "intt": 3500, # duration of an integration, in ms "beam_angle": scf.STD_16_BEAM_ANGLE, "rx_beam_order": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,90], # At least one is larger than the len(beam_angle) - "tx_beam_order": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15], # At least one is larger than the len(beam_angle) + "tx_beam_order": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15], "scanbound": [i * 3.5 for i in range(len(beams_to_use))], #1 min scan "freq" : scf.COMMON_MODE_FREQ_1, #kHz "acf": True, diff --git a/testing_archive/test_beam_order_dne.py b/testing_archive/test_beam_order_dne.py index 171452f..c3b5523 100644 --- a/testing_archive/test_beam_order_dne.py +++ b/testing_archive/test_beam_order_dne.py @@ -3,9 +3,6 @@ """ Experiment fault: rx_beam_order not specified in slice -Expected exception: - Slice must specify rx_beam_order that must be a list of ints or lists \(of ints\) corresponding - to the order of the angles in the beam_angle list """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_beam_order_lists_bad_index.py b/testing_archive/test_beam_order_lists_bad_index.py index eeb065d..6f4fe05 100644 --- a/testing_archive/test_beam_order_lists_bad_index.py +++ b/testing_archive/test_beam_order_lists_bad_index.py @@ -3,8 +3,6 @@ """ Experiment fault: rx_beam_order index invalid -Expected exception: - Beam number .* could not index in beam_angle list of length .*. Slice: .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_beam_order_lists_not_ints.py b/testing_archive/test_beam_order_lists_not_ints.py index e347e03..4baea38 100644 --- a/testing_archive/test_beam_order_lists_not_ints.py +++ b/testing_archive/test_beam_order_lists_not_ints.py @@ -3,9 +3,6 @@ """ Experiment fault: rx_beam_order list values not integers -Expected exception: - Slice must specify rx_beam_order that must be a list of ints or lists \(of ints\) corresponding - to the order of the angles in the beam_angle list """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_beam_order_not_ints_or_lists.py b/testing_archive/test_beam_order_not_ints_or_lists.py index bf7a08f..ce47548 100644 --- a/testing_archive/test_beam_order_not_ints_or_lists.py +++ b/testing_archive/test_beam_order_not_ints_or_lists.py @@ -3,9 +3,6 @@ """ Experiment fault: rx_beam_order list values not lists or integers -Expected exception: - Slice must specify rx_beam_order that must be a list of ints or lists \(of ints\) corresponding - to the order of the angles in the beam_angle list """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_beam_order_not_list.py b/testing_archive/test_beam_order_not_list.py index 4ae3ad7..6e5c8ec 100644 --- a/testing_archive/test_beam_order_not_list.py +++ b/testing_archive/test_beam_order_not_list.py @@ -3,9 +3,6 @@ """ Experiment fault: rx_beam_order not a list -Expected exception: - Slice must specify rx_beam_order that must be a list of ints or lists \(of ints\) corresponding - to the order of the angles in the beam_angle list """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_clrfrqrng_not_2.py b/testing_archive/test_clrfrqrng_not_2.py index 13b9522..bba241f 100644 --- a/testing_archive/test_clrfrqrng_not_2.py +++ b/testing_archive/test_clrfrqrng_not_2.py @@ -3,8 +3,6 @@ """ Experiment fault: clrfrqrange not a range of length 2 -Expected exception: - clrfrqrange must be an integer list of length = 2 """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_clrfrqrng_not_inc.py b/testing_archive/test_clrfrqrng_not_inc.py index e1dee27..dcf9284 100644 --- a/testing_archive/test_clrfrqrng_not_inc.py +++ b/testing_archive/test_clrfrqrng_not_inc.py @@ -3,10 +3,6 @@ """ Experiment fault: clrfrqrange not increasing -Expected exception: - clrfrqrange must be between min and max tx frequencies .* and rx frequencies .* according to - license and/or center frequencies / sampling rates / transition bands, and must have lower - frequency first """ import borealis_experiments.superdarn_common_fields as scf @@ -53,7 +49,7 @@ def __init__(self): @classmethod def error_message(cls): return ValidationError, "clrfrqrange\n" \ - " clrfrqrange must be between min and max tx frequencies \(10250000.01117587, " \ - "13750000.01117587\) and rx frequencies \(10250000.01117587, 13750000.01117587\)" \ - " according to license and/or center frequencies / sampling rates / transition " \ - "bands, and must have lower frequency first. \(type=value_error\)" + " Slice 0 clrfrqrange must be between min and max tx frequencies " \ + "\(10250000.01117587, 13750000.01117587\) and rx frequencies \(10250000.01117587, " \ + "13750000.01117587\) according to license and/or center frequencies / sampling rates " \ + "/ transition bands, and must have lower frequency first. \(type=value_error\)" diff --git a/testing_archive/test_clrfrqrng_not_ints.py b/testing_archive/test_clrfrqrng_not_ints.py index 24dbf83..de638ba 100644 --- a/testing_archive/test_clrfrqrng_not_ints.py +++ b/testing_archive/test_clrfrqrng_not_ints.py @@ -3,8 +3,6 @@ """ Experiment fault: clrfrqrange list of non-integers -Expected exception: - clrfrqrange must be an integer list of length = 2 """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_clrfrqrng_too_high.py b/testing_archive/test_clrfrqrng_too_high.py index fab7586..57539ad 100644 --- a/testing_archive/test_clrfrqrng_too_high.py +++ b/testing_archive/test_clrfrqrng_too_high.py @@ -3,10 +3,6 @@ """ Experiment fault: clrfrqrange too high -Expected exception: - clrfrqrange must be between min and max tx frequencies .* and rx frequencies .* according to - license and/or center frequencies / sampling rates / transition bands, and must have lower - frequency first """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_clrfrqrng_too_low.py b/testing_archive/test_clrfrqrng_too_low.py index 66132b4..4922521 100644 --- a/testing_archive/test_clrfrqrng_too_low.py +++ b/testing_archive/test_clrfrqrng_too_low.py @@ -3,10 +3,6 @@ """ Experiment fault: clrfrqrange too low -Expected exception: - clrfrqrange must be between min and max tx frequencies .* and rx frequencies .* according to - license and/or center frequencies / sampling rates / transition bands, and must have lower - frequency first """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_cpid_int.py b/testing_archive/test_cpid_int.py index c49fe97..0767d15 100644 --- a/testing_archive/test_cpid_int.py +++ b/testing_archive/test_cpid_int.py @@ -3,8 +3,6 @@ """ Experiment fault: cpid not an integer -Expected exception: - CPID must be a unique int """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_cpid_pos.py b/testing_archive/test_cpid_pos.py index d10fa7f..ff2db75 100644 --- a/testing_archive/test_cpid_pos.py +++ b/testing_archive/test_cpid_pos.py @@ -3,10 +3,6 @@ """ Experiment fault: cpid negative integer -Expected exception: - The CPID should be a positive number in the experiment. Borealis will determine if it should be - negative based on the scheduling mode. Only experiments run during discretionary time will have - negative CPIDs. """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_cpid_unique.py b/testing_archive/test_cpid_unique.py index 8cf2806..f0533a6 100644 --- a/testing_archive/test_cpid_unique.py +++ b/testing_archive/test_cpid_unique.py @@ -3,8 +3,6 @@ """ Experiment fault: cpid non unique integer -Expected exception: - CPID must be unique. .* is in use by another local experiment """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_del_slice_dne.py b/testing_archive/test_del_slice_dne.py index 4c0e800..b18a4a7 100644 --- a/testing_archive/test_del_slice_dne.py +++ b/testing_archive/test_del_slice_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: Removing a slice that doesn't exist -Expected exception: - Cannot remove slice id .* : it does not exist in slice dictionary """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_dm_rate_not_int.py b/testing_archive/test_dm_rate_not_int.py index b44750f..d729958 100644 --- a/testing_archive/test_dm_rate_not_int.py +++ b/testing_archive/test_dm_rate_not_int.py @@ -3,8 +3,6 @@ """ Experiment fault: Non-integer decimation rate -Expected exception: - Decimation rate is not an integer """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_edit_slice_bad_param.py b/testing_archive/test_edit_slice_bad_param.py index b1817bf..0a25135 100644 --- a/testing_archive/test_edit_slice_bad_param.py +++ b/testing_archive/test_edit_slice_bad_param.py @@ -3,8 +3,6 @@ """ Experiment fault: Editing slice with invalid parameter -Expected exception: - Cannot edit slice ID .*: .* is not a valid slice parameter """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_edit_slice_dne.py b/testing_archive/test_edit_slice_dne.py index 685f780..20470a1 100644 --- a/testing_archive/test_edit_slice_dne.py +++ b/testing_archive/test_edit_slice_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: Editing a slice that doesn't exist -Expected exception: - Trying to edit .* but it does not exist in Slice_IDs list """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_edit_slice_improperly.py b/testing_archive/test_edit_slice_improperly.py new file mode 100644 index 0000000..b125697 --- /dev/null +++ b/testing_archive/test_edit_slice_improperly.py @@ -0,0 +1,40 @@ +#!/usr/bin/python + +""" +Experiment fault: + Editing a slice without using edit_slice +""" +import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme + + +class TestExperiment(ExperimentPrototype): + + def __init__(self): + cpid = 1 + super().__init__(cpid) + + beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER + num_ranges = scf.STD_NUM_RANGES + + slice_1 = { # slice_id = 0, there is only one slice. + "pulse_sequence": scf.SEQUENCE_7P, + "tau_spacing": scf.TAU_SPACING_7P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": num_ranges, + "first_range": scf.STD_FIRST_RANGE, + "intt": 3500, # duration of an integration, in ms + "beam_angle": scf.STD_16_BEAM_ANGLE, + "rx_beam_order": beams_to_use, + "tx_beam_order": beams_to_use, + "freq": scf.COMMON_MODE_FREQ_1, #kHz + "decimation_scheme": create_default_scheme(), + } + self.add_slice(slice_1) + setattr(self.slice_dict[0], 'gibberish', 'asdlkfj') + # self.slice_dict[0].check_slice() + + @classmethod + def error_message(cls): + return TypeError, "__init__\(\) got an unexpected keyword argument 'gibberish'" diff --git a/testing_archive/test_finalstage_bad_outputrate.py b/testing_archive/test_finalstage_bad_outputrate.py index ceb6c84..a5d3efa 100644 --- a/testing_archive/test_finalstage_bad_outputrate.py +++ b/testing_archive/test_finalstage_bad_outputrate.py @@ -3,9 +3,6 @@ """ Experiment fault: Building decimation stage with bad output rate -Expected exception: - Last decimation stage .* does not have output rate .* equal to - requested output data rate .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_first_range_dne.py b/testing_archive/test_first_range_dne.py index 4c33929..e40d883 100644 --- a/testing_archive/test_first_range_dne.py +++ b/testing_archive/test_first_range_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: first_range not specified in slice -Expected exception: - Slice must specify first_range in km that must be a number """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_rxfreq_not_num.py b/testing_archive/test_freq_not_num.py similarity index 89% rename from testing_archive/test_rxfreq_not_num.py rename to testing_archive/test_freq_not_num.py index 138a8cc..0864267 100644 --- a/testing_archive/test_rxfreq_not_num.py +++ b/testing_archive/test_freq_not_num.py @@ -3,9 +3,6 @@ """ Experiment fault: freq set to a non-number -Expected exception: - freq must be a number \(kHz\) between rx min and max frequencies .* for the radar license and be - within range given center frequency .* kHz, sampling rate .* kHz, and transition band .* kHz """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_txfreq_restricted.py b/testing_archive/test_freq_restricted.py similarity index 96% rename from testing_archive/test_txfreq_restricted.py rename to testing_archive/test_freq_restricted.py index f136abe..2c060e1 100644 --- a/testing_archive/test_txfreq_restricted.py +++ b/testing_archive/test_freq_restricted.py @@ -3,8 +3,6 @@ """ Experiment fault: freq within restricted range -Expected exception: - freq is within a restricted frequency range .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_rxfreq_too_high.py b/testing_archive/test_freq_too_high.py similarity index 89% rename from testing_archive/test_rxfreq_too_high.py rename to testing_archive/test_freq_too_high.py index 0a45f57..2c8eef9 100644 --- a/testing_archive/test_rxfreq_too_high.py +++ b/testing_archive/test_freq_too_high.py @@ -3,9 +3,6 @@ """ Experiment fault: freq above max freq -Expected exception: - freq must be a number \(kHz\) between rx min and max frequencies .* for the radar license and be - within range given center frequency .* kHz, sampling rate .* kHz, and transition band .* kHz """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_rxfreq_too_low.py b/testing_archive/test_freq_too_low.py similarity index 89% rename from testing_archive/test_rxfreq_too_low.py rename to testing_archive/test_freq_too_low.py index d0c544a..e4dc25b 100644 --- a/testing_archive/test_rxfreq_too_low.py +++ b/testing_archive/test_freq_too_low.py @@ -3,9 +3,6 @@ """ Experiment fault: freq below min freq -Expected exception: - freq must be a number \(kHz\) between rx min and max frequencies .* for the radar license and be - within range given center frequency .* kHz, sampling rate .* kHz, and transition band .* kHz """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_int_antenna_dne.py b/testing_archive/test_int_antenna_dne.py index bce766d..9b4c2f8 100644 --- a/testing_archive/test_int_antenna_dne.py +++ b/testing_archive/test_int_antenna_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: rx_int_antennas specify an antenna that doesn't exist -Expected exception: - Slice .* specifies interferometer array antenna numbers over config max .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_int_antenna_dups.py b/testing_archive/test_int_antenna_dups.py index 86bb54f..cf873c2 100644 --- a/testing_archive/test_int_antenna_dups.py +++ b/testing_archive/test_int_antenna_dups.py @@ -3,8 +3,6 @@ """ Experiment fault: rx_int_antennas contain duplicate antenna numbers -Expected exception: - Slice .* RX main antennas has duplicate antennas """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_intn_not_int.py b/testing_archive/test_intn_not_int.py index 1da52b7..c541f68 100644 --- a/testing_archive/test_intn_not_int.py +++ b/testing_archive/test_intn_not_int.py @@ -3,8 +3,6 @@ """ Experiment fault: intn not an integer -Expected exception: - intn must be an integer """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_intt_longer_than_scanbound.py b/testing_archive/test_intt_longer_than_scanbound.py index 1963bee..addfff9 100644 --- a/testing_archive/test_intt_longer_than_scanbound.py +++ b/testing_archive/test_intt_longer_than_scanbound.py @@ -3,8 +3,6 @@ """ Experiment fault: intt longer than single scanbound time -Expected exception: - Slice .* intt .*ms longer than scanbound time .*s """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_intt_longer_than_scanbounds.py b/testing_archive/test_intt_longer_than_scanbounds.py index 7195a8d..a6cad66 100644 --- a/testing_archive/test_intt_longer_than_scanbounds.py +++ b/testing_archive/test_intt_longer_than_scanbounds.py @@ -3,8 +3,6 @@ """ Experiment fault: intt longer than one of multiple scanbound times -Expected exception: - Slice .* intt .*ms longer than one of the scanbound times """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_intt_not_num.py b/testing_archive/test_intt_not_num.py index 8dc968b..b911154 100644 --- a/testing_archive/test_intt_not_num.py +++ b/testing_archive/test_intt_not_num.py @@ -3,8 +3,6 @@ """ Experiment fault: intt not a number -Expected exception: - intt must be a number """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_intt_too_low.py b/testing_archive/test_intt_too_low.py index 1e2195f..a5d0a82 100644 --- a/testing_archive/test_intt_too_low.py +++ b/testing_archive/test_intt_too_low.py @@ -3,8 +3,6 @@ """ Experiment fault: intt too low for pulse sequence length -Expected exception: - Slice .* : pulse sequence is too long for integration time given """ import borealis_experiments.superdarn_common_fields as scf @@ -40,7 +38,6 @@ def __init__(self): "beam_angle": scf.STD_16_BEAM_ANGLE, "rx_beam_order": beams_to_use, "tx_beam_order": beams_to_use, - "scanbound": [i * 3.5 for i in range(len(beams_to_use))], #1 min scan "freq" : scf.COMMON_MODE_FREQ_1, #kHz "acf": True, "xcf": True, # cross-correlation processing @@ -53,6 +50,4 @@ def __init__(self): def error_message(cls): return ValidationError, "intt\n" \ " Slice 0: pulse sequence is too long for integration time given " \ - "\(type=value_error\)\n" \ - "scanbound\n" \ - " Slice 0 must have intt enabled to use scanbound \(type=value_error\)" + "\(type=value_error\)" diff --git a/testing_archive/test_lag_table_bad.py b/testing_archive/test_lag_table_bad.py index 1b9b8db..75f154c 100644 --- a/testing_archive/test_lag_table_bad.py +++ b/testing_archive/test_lag_table_bad.py @@ -3,8 +3,6 @@ """ Experiment fault: Adding a pulse that doesn't exist to lag table -Expected exception: - Lag .* not valid; One of the pulses does not exist in the sequence """ import itertools @@ -15,7 +13,6 @@ from pydantic import ValidationError - class TestExperiment(ExperimentPrototype): def __init__(self): @@ -42,8 +39,8 @@ def __init__(self): "beam_angle": scf.STD_16_BEAM_ANGLE, "rx_beam_order": beams_to_use, "tx_beam_order": beams_to_use, - "scanbound": [i * 3.5 for i in range(len(beams_to_use))], #1 min scan - "freq" : scf.COMMON_MODE_FREQ_1, #kHz + "scanbound": [i * 3.5 for i in range(len(beams_to_use))], # 1 min scan + "freq" : scf.COMMON_MODE_FREQ_1, # kHz "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs @@ -51,17 +48,15 @@ def __init__(self): } lag_table = list(itertools.combinations(slice_1['pulse_sequence'], 2)) - lag_table.append([slice_1['pulse_sequence'][0], slice_1[ - 'pulse_sequence'][0]]) # lag 0 - lag_table.append([99,0]) ### Should fail on this!! + lag_table.append([slice_1['pulse_sequence'][0], slice_1['pulse_sequence'][0]]) # lag 0 + lag_table.append([99, 0]) ### Should fail on this!! # sort by lag number lag_table = sorted(lag_table, key=lambda x: x[1] - x[0]) - lag_table.append([slice_1['pulse_sequence'][-1], slice_1[ - 'pulse_sequence'][-1]]) # alternate lag 0 + lag_table.append([slice_1['pulse_sequence'][-1], slice_1['pulse_sequence'][-1]]) # alternate lag 0 slice_1['lag_table'] = lag_table self.add_slice(slice_1) @classmethod def error_message(cls): - return ValidationError, "Lag \[99, 0\] not valid; One of the pulses does not exist in the sequence. Slice 0" + return ValidationError, "Lag \[99, 0\] not valid; One of the pulses does not exist in the sequence. Slice: 0" diff --git a/testing_archive/test_mismatched_dm_schemes.py b/testing_archive/test_mismatched_dm_schemes.py new file mode 100644 index 0000000..b69a59b --- /dev/null +++ b/testing_archive/test_mismatched_dm_schemes.py @@ -0,0 +1,75 @@ +#!/usr/bin/python + +""" +Experiment fault: + CONCURRENT interfaced slices have different DecimationSchemes +""" +import copy + +import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import \ + DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation, create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException + + +class TestExperiment(ExperimentPrototype): + + def __init__(self): + cpid = 1 + ### dm_rate is not an integer + rates = [5.0e6, 500.0e3, 500.0e3/6, 50.0e3/3] + dm_rates = [10, 6, 5, 5] # default scheme is [10, 5, 6, 5] + transition_widths = [150.0e3, 40.0e3, 15.0e3, 1.0e3] + cutoffs = [20.0e3, 10.0e3, 10.0e3, 5.0e3] + ripple_dbs = [150.0, 80.0, 35.0, 9.0] + scaling_factors = [10.0, 100.0, 100.0, 100.0] + all_stages = [] + for stage in range(0, len(rates)): + filter_taps = list( + scaling_factors[stage] * create_firwin_filter_by_attenuation( + rates[stage], transition_widths[stage], cutoffs[stage], + ripple_dbs[stage])) + all_stages.append(DecimationStage(stage, rates[stage], + dm_rates[stage], filter_taps)) + + # changed from 10e3/3->10e3 + decimation_scheme = (DecimationScheme(rates[0], rates[-1]/dm_rates[-1], stages=all_stages)) + super(TestExperiment, self).__init__(cpid, output_rx_rate=decimation_scheme.output_sample_rate) + + if scf.IS_FORWARD_RADAR: + beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER + else: + beams_to_use = scf.STD_16_REVERSE_BEAM_ORDER + + if scf.options.site_id in ["cly", "rkn", "inv"]: + num_ranges = scf.POLARDARN_NUM_RANGES + if scf.options.site_id in ["sas", "pgr"]: + num_ranges = scf.STD_NUM_RANGES + + slice_1 = { # slice_id = 0 + "pulse_sequence": scf.SEQUENCE_7P, + "tau_spacing": scf.TAU_SPACING_7P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": num_ranges, + "first_range": scf.STD_FIRST_RANGE, + "intt": 3500, # duration of an integration, in ms + "beam_angle": scf.STD_16_BEAM_ANGLE, + "rx_beam_order": beams_to_use, + "tx_beam_order": beams_to_use, + "scanbound": [i * 3.5 for i in range(len(beams_to_use))], #1 min scan + "freq" : scf.COMMON_MODE_FREQ_1, #kHz + "acf": True, + "xcf": True, # cross-correlation processing + "acfint": True, # interferometer acfs + "decimation_scheme": decimation_scheme, + } + self.add_slice(slice_1) + slice_2 = copy.deepcopy(slice_1) + slice_2['decimation_scheme'] = create_default_scheme() + self.add_slice(slice_2, {0: "CONCURRENT"}) + + @classmethod + def error_message(cls): + return ExperimentException, \ + "Slices 0 and 1 are CONCURRENT interfaced and do not have the same decimation scheme" diff --git a/testing_archive/test_mismatched_dm_schemes_aveperiod.py b/testing_archive/test_mismatched_dm_schemes_aveperiod.py new file mode 100644 index 0000000..70d7950 --- /dev/null +++ b/testing_archive/test_mismatched_dm_schemes_aveperiod.py @@ -0,0 +1,69 @@ +#!/usr/bin/python + +""" +No fault expected, SEQUENCE interfaced slices are allowed to have different DecimationSchemes +""" +import copy + +import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import \ + DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation, create_default_scheme +from experiment_prototype.experiment_exception import ExperimentException + + +class TestExperiment(ExperimentPrototype): + + def __init__(self): + cpid = 1 + ### dm_rate is not an integer + rates = [5.0e6, 500.0e3, 500.0e3/6, 50.0e3/3] + dm_rates = [10, 6, 5, 5] + transition_widths = [150.0e3, 40.0e3, 15.0e3, 1.0e3] + cutoffs = [20.0e3, 10.0e3, 10.0e3, 5.0e3] + ripple_dbs = [150.0, 80.0, 35.0, 9.0] + scaling_factors = [10.0, 100.0, 100.0, 100.0] + all_stages = [] + for stage in range(0, len(rates)): + filter_taps = list( + scaling_factors[stage] * create_firwin_filter_by_attenuation( + rates[stage], transition_widths[stage], cutoffs[stage], + ripple_dbs[stage])) + all_stages.append(DecimationStage(stage, rates[stage], + dm_rates[stage], filter_taps)) + + # changed from 10e3/3->10e3 + decimation_scheme = (DecimationScheme(rates[0], rates[-1]/dm_rates[-1], stages=all_stages)) + super(TestExperiment, self).__init__(cpid, output_rx_rate=decimation_scheme.output_sample_rate) + + if scf.IS_FORWARD_RADAR: + beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER + else: + beams_to_use = scf.STD_16_REVERSE_BEAM_ORDER + + if scf.options.site_id in ["cly", "rkn", "inv"]: + num_ranges = scf.POLARDARN_NUM_RANGES + if scf.options.site_id in ["sas", "pgr"]: + num_ranges = scf.STD_NUM_RANGES + + slice_1 = { # slice_id = 0 + "pulse_sequence": scf.SEQUENCE_7P, + "tau_spacing": scf.TAU_SPACING_7P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": num_ranges, + "first_range": scf.STD_FIRST_RANGE, + "intt": 3500, # duration of an integration, in ms + "beam_angle": scf.STD_16_BEAM_ANGLE, + "rx_beam_order": beams_to_use, + "tx_beam_order": beams_to_use, + "scanbound": [i * 3.5 for i in range(len(beams_to_use))], #1 min scan + "freq" : scf.COMMON_MODE_FREQ_1, #kHz + "acf": True, + "xcf": True, # cross-correlation processing + "acfint": True, # interferometer acfs + "decimation_scheme": decimation_scheme, + } + self.add_slice(slice_1) + slice_2 = copy.deepcopy(slice_1) + slice_2['decimation_scheme'] = create_default_scheme() + self.add_slice(slice_2, {0: "SEQUENCE"}) diff --git a/testing_archive/test_no_class.py b/testing_archive/test_no_class.py index 0c7a82a..0821104 100644 --- a/testing_archive/test_no_class.py +++ b/testing_archive/test_no_class.py @@ -3,8 +3,6 @@ """ Experiment fault: Experiment isn't a class -Expected exception: - No experiment classes are present that are built from parent class ExperimentPrototype - exiting """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_no_freq_set.py b/testing_archive/test_no_freq_set.py index b5958dd..02ed61e 100644 --- a/testing_archive/test_no_freq_set.py +++ b/testing_archive/test_no_freq_set.py @@ -3,8 +3,6 @@ """ Experiment fault: Slice has no freq or clrfrqrange -Expected exception: - A freq or clrfrqrange must be specified in a slice """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_no_inheritance.py b/testing_archive/test_no_inheritance.py index 5161573..ff36d40 100644 --- a/testing_archive/test_no_inheritance.py +++ b/testing_archive/test_no_inheritance.py @@ -3,8 +3,6 @@ """ Experiment fault: Experiment doesn't inherit from ExperimentPrototype -Expected exception: - No experiment classes are present that are built from parent class ExperimentPrototype - exiting """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_no_intt_intn.py b/testing_archive/test_no_intt_intn.py index 26b793d..2d4e454 100644 --- a/testing_archive/test_no_intt_intn.py +++ b/testing_archive/test_no_intt_intn.py @@ -3,8 +3,6 @@ """ Experiment fault: No intt or intn -Expected exception: - Slice .* has transmission but no intt or intn """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_no_slices.py b/testing_archive/test_no_slices.py index dd72cca..46b9921 100644 --- a/testing_archive/test_no_slices.py +++ b/testing_archive/test_no_slices.py @@ -3,8 +3,6 @@ """ Experiment fault: Experiment has no slices -Expected exception: - Invalid num_slices less than 1 """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_num_ranges_dne.py b/testing_archive/test_num_ranges_dne.py index d27957f..020e3b0 100644 --- a/testing_archive/test_num_ranges_dne.py +++ b/testing_archive/test_num_ranges_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: num_ranges not set in slice -Expected exception: - Slice must specify num_ranges that must be an integer """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_num_ranges_not_int.py b/testing_archive/test_num_ranges_not_int.py index 591725d..51306d9 100644 --- a/testing_archive/test_num_ranges_not_int.py +++ b/testing_archive/test_num_ranges_not_int.py @@ -3,8 +3,6 @@ """ Experiment fault: num_ranges not an integer -Expected exception: - Slice must specify num_ranges that must be an integer """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_output_rxrate_high.py b/testing_archive/test_output_rxrate_high.py index e29705c..7093f2d 100644 --- a/testing_archive/test_output_rxrate_high.py +++ b/testing_archive/test_output_rxrate_high.py @@ -3,8 +3,6 @@ """ Experiment fault: output_rx_rate higher than max sample rate -Expected exception: - Experiment's output sample rate is too high """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_ppo_bad_length.py b/testing_archive/test_ppo_bad_length.py new file mode 100644 index 0000000..8f48330 --- /dev/null +++ b/testing_archive/test_ppo_bad_length.py @@ -0,0 +1,48 @@ +#!/usr/bin/python + +""" +Experiment fault: + pulse_phase_offset return value does not have shape equal to (num_pulses,) +""" + +import numpy as np + +import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + + +def phase_encode(beam_iter, sequence_num, num_pulses): + return np.random.uniform(-180.0, 180, num_pulses-1) # length is not num_pulses + + +class TestExperiment(ExperimentPrototype): + + def __init__(self): + cpid = 1 + + default_slice = { # slice_id = 0, the first slice + "pulse_sequence": scf.SEQUENCE_8P, + "tau_spacing": scf.TAU_SPACING_8P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": scf.STD_NUM_RANGES, + "first_range": scf.STD_FIRST_RANGE, + "intt": scf.INTT_8P, + "beam_angle": [1.75], + "rx_beam_order": [0], + "tx_beam_order": [0], + "freq": 13100, + "decimation_scheme": create_default_scheme(), + "pulse_phase_offset": phase_encode + } + + super().__init__(cpid) + + self.add_slice(default_slice) + + @classmethod + def error_message(cls): + return ValidationError, "pulse_phase_offset\n" \ + " Slice 0 Phase encoding return dimension must be equal to number of pulses " \ + "\(type=value_error\)" \ No newline at end of file diff --git a/testing_archive/test_ppo_not_1d.py b/testing_archive/test_ppo_not_1d.py new file mode 100644 index 0000000..0807fc7 --- /dev/null +++ b/testing_archive/test_ppo_not_1d.py @@ -0,0 +1,47 @@ +#!/usr/bin/python + +""" +Experiment fault: + pulse_phase_offset return value is not 1-dimensional +""" + +import numpy as np + +import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + + +def phase_encode(beam_iter, sequence_num, num_pulses): + return np.random.uniform(-180.0, 180, num_pulses).reshape(1, num_pulses) + + +class TestExperiment(ExperimentPrototype): + + def __init__(self): + cpid = 1 + + default_slice = { # slice_id = 0, the first slice + "pulse_sequence": scf.SEQUENCE_8P, + "tau_spacing": scf.TAU_SPACING_8P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": scf.STD_NUM_RANGES, + "first_range": scf.STD_FIRST_RANGE, + "intt": scf.INTT_8P, + "beam_angle": [1.75], + "rx_beam_order": [0], + "tx_beam_order": [0], + "freq": 13100, + "decimation_scheme": create_default_scheme(), + "pulse_phase_offset": phase_encode + } + + super().__init__(cpid) + + self.add_slice(default_slice) + + @classmethod + def error_message(cls): + return ValidationError, "pulse_phase_offset\n" \ + " Slice 0 Phase encoding return must be 1 dimensional \(type=value_error\)" \ No newline at end of file diff --git a/testing_archive/test_ppo_np.py b/testing_archive/test_ppo_np.py new file mode 100644 index 0000000..73b23d6 --- /dev/null +++ b/testing_archive/test_ppo_np.py @@ -0,0 +1,47 @@ +#!/usr/bin/python + +""" +Experiment fault: + pulse_phase_offset return value is not a numpy array +""" + +import numpy as np + +import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + + +def phase_encode(beam_iter, sequence_num, num_pulses): + return np.random.uniform(-180.0, 180, num_pulses).tolist() + + +class TestExperiment(ExperimentPrototype): + + def __init__(self): + cpid = 1 + + default_slice = { # slice_id = 0, the first slice + "pulse_sequence": scf.SEQUENCE_8P, + "tau_spacing": scf.TAU_SPACING_8P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": scf.STD_NUM_RANGES, + "first_range": scf.STD_FIRST_RANGE, + "intt": scf.INTT_8P, + "beam_angle": [1.75], + "rx_beam_order": [0], + "tx_beam_order": [0], + "freq": 13100, + "decimation_scheme": create_default_scheme(), + "pulse_phase_offset": phase_encode + } + + super().__init__(cpid) + + self.add_slice(default_slice) + + @classmethod + def error_message(cls): + return ValidationError, "pulse_phase_offset\n" \ + " Slice 0 Phase encoding return is not numpy array \(type=value_error\)" \ No newline at end of file diff --git a/testing_archive/test_pulse_len_bad.py b/testing_archive/test_pulse_len_bad.py index 50b9cc7..ebeb92e 100644 --- a/testing_archive/test_pulse_len_bad.py +++ b/testing_archive/test_pulse_len_bad.py @@ -3,9 +3,6 @@ """ Experiment fault: pulse_len invalid -Expected exception: - For an experiment slice with real-time acfs, pulse length must be equal \(within 1 us\) to - 1\/output_rx_rate to make acfs valid. Current pulse length is .* us, output rate is .* Hz """ import borealis_experiments.superdarn_common_fields as scf @@ -18,23 +15,15 @@ class TestExperiment(ExperimentPrototype): def __init__(self): cpid = 1 - super(TestExperiment, self).__init__(cpid) + super().__init__(cpid) - if scf.IS_FORWARD_RADAR: - beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER - else: - beams_to_use = scf.STD_16_REVERSE_BEAM_ORDER - - if scf.options.site_id in ["cly", "rkn", "inv"]: - num_ranges = scf.POLARDARN_NUM_RANGES - if scf.options.site_id in ["sas", "pgr"]: - num_ranges = scf.STD_NUM_RANGES + beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER slice_1 = { # slice_id = 0, there is only one slice. "pulse_sequence": scf.SEQUENCE_7P, "tau_spacing": scf.TAU_SPACING_7P, - "pulse_len": int(1/self.output_rx_rate) + 1, ### pulse_len must be the same as 1/output_rx_rate (within floating point error) - "num_ranges": num_ranges, + "pulse_len": int(1/self.output_rx_rate*1e6) + 1, ### pulse_len must be the same as 1/output_rx_rate (within floating point error) + "num_ranges": scf.STD_NUM_RANGES, "first_range": scf.STD_FIRST_RANGE, "intt": 3500, # duration of an integration, in ms "beam_angle": scf.STD_16_BEAM_ANGLE, @@ -51,6 +40,6 @@ def __init__(self): @classmethod def error_message(cls): - return ValidationError, "pulse_len\n" \ - " ensure this value is greater than or equal to 100.0 " \ - "\(type=value_error.number.not_ge; limit_value=100.0\)" + return ValidationError, "For an experiment slice with real-time acfs, pulse length must be equal \(within 1 " \ + "us\) to 1/output_rx_rate to make acfs valid. Current pulse length is 301 us, output" \ + " rate is 3333.3333333333335 Hz. Slice: 0 \(type=value_error\)" diff --git a/testing_archive/test_pulse_len_dne.py b/testing_archive/test_pulse_len_dne.py index cbbb390..69a9d42 100644 --- a/testing_archive/test_pulse_len_dne.py +++ b/testing_archive/test_pulse_len_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: pulse_len not specified in slice -Expected exception: - Slice must specify pulse_len in us that must be an integer """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_pulse_len_not_int.py b/testing_archive/test_pulse_len_not_int.py index 8e49575..c162811 100644 --- a/testing_archive/test_pulse_len_not_int.py +++ b/testing_archive/test_pulse_len_not_int.py @@ -3,8 +3,6 @@ """ Experiment fault: pulse_len not an integer -Expected exception: - Slice must specify pulse_len in us that must be an integer """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_pulse_len_too_high.py b/testing_archive/test_pulse_len_too_high.py index 18e3a40..3789ac3 100644 --- a/testing_archive/test_pulse_len_too_high.py +++ b/testing_archive/test_pulse_len_too_high.py @@ -3,8 +3,6 @@ """ Experiment fault: pulse_len too high -Expected exception: - Slice .* pulse length greater than tau_spacing """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_pulse_len_too_low.py b/testing_archive/test_pulse_len_too_low.py index 95c5f7d..3c3eda8 100644 --- a/testing_archive/test_pulse_len_too_low.py +++ b/testing_archive/test_pulse_len_too_low.py @@ -3,8 +3,6 @@ """ Experiment fault: pulse_len too small -Expected exception: - Slice .* pulse length too small """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_rx_antenna_dne.py b/testing_archive/test_rx_antenna_dne.py index fcf61b9..068c6cd 100644 --- a/testing_archive/test_rx_antenna_dne.py +++ b/testing_archive/test_rx_antenna_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: Specify rx_main_antennas number of antenna that doesn't exist -Expected exception: - Slice .* specifies RX main array antenna numbers over config max .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_rx_antenna_dups.py b/testing_archive/test_rx_antenna_dups.py index c9d5d75..2d31f27 100644 --- a/testing_archive/test_rx_antenna_dups.py +++ b/testing_archive/test_rx_antenna_dups.py @@ -3,8 +3,6 @@ """ Experiment fault: rx_main_antennas containing duplicate antennas -Expected exception: - Slice .* RX main antennas has duplicate antennas """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_rx_int_antenna_invalid.py b/testing_archive/test_rx_int_antenna_invalid.py new file mode 100644 index 0000000..119a7c9 --- /dev/null +++ b/testing_archive/test_rx_int_antenna_invalid.py @@ -0,0 +1,45 @@ +#!/usr/bin/python + +""" +Experiment fault: + tx_antennas has invalid values (above and below the allowed range) +""" + +import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + + +class TestExperiment(ExperimentPrototype): + + def __init__(self): + cpid = 1 + super().__init__(cpid) + + beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER + num_ranges = scf.STD_NUM_RANGES + + slice_1 = { # slice_id = 0, there is only one slice. + "pulse_sequence": scf.SEQUENCE_7P, + "tau_spacing": scf.TAU_SPACING_7P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": num_ranges, + "first_range": scf.STD_FIRST_RANGE, + "intt": 3500, # duration of an integration, in ms + "beam_angle": scf.STD_16_BEAM_ANGLE, + "rx_beam_order": beams_to_use, + "tx_beam_order": beams_to_use, + "freq": scf.COMMON_MODE_FREQ_1, #kHz + "rx_int_antennas": [-1, 1, 2, 4], ### antenna -1 and 4 are out of range + "decimation_scheme": create_default_scheme(), + } + self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rx_int_antennas -> 0\n" \ + " ensure this value is greater than or equal to 0 \(type=value_error.number.not_ge; " \ + "limit_value=0\)\n" \ + "rx_int_antennas -> 3\n" \ + " ensure this value is less than 4 \(type=value_error.number.not_lt; limit_value=4\)" diff --git a/testing_archive/test_rx_main_antenna_invalid.py b/testing_archive/test_rx_main_antenna_invalid.py new file mode 100644 index 0000000..d247354 --- /dev/null +++ b/testing_archive/test_rx_main_antenna_invalid.py @@ -0,0 +1,45 @@ +#!/usr/bin/python + +""" +Experiment fault: + tx_antennas has invalid values (above and below the allowed range) +""" + +import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + + +class TestExperiment(ExperimentPrototype): + + def __init__(self): + cpid = 1 + super().__init__(cpid) + + beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER + num_ranges = scf.STD_NUM_RANGES + + slice_1 = { # slice_id = 0, there is only one slice. + "pulse_sequence": scf.SEQUENCE_7P, + "tau_spacing": scf.TAU_SPACING_7P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": num_ranges, + "first_range": scf.STD_FIRST_RANGE, + "intt": 3500, # duration of an integration, in ms + "beam_angle": scf.STD_16_BEAM_ANGLE, + "rx_beam_order": beams_to_use, + "tx_beam_order": beams_to_use, + "freq": scf.COMMON_MODE_FREQ_1, #kHz + "rx_main_antennas": [-1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16], ### antenna -1 and 16 are out of range + "decimation_scheme": create_default_scheme(), + } + self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "rx_main_antennas -> 0\n" \ + " ensure this value is greater than or equal to 0 \(type=value_error.number.not_ge; " \ + "limit_value=0\)\n" \ + "rx_main_antennas -> 15\n" \ + " ensure this value is less than 16 \(type=value_error.number.not_lt; limit_value=16\)" diff --git a/testing_archive/test_rxbw_not_divisible.py b/testing_archive/test_rxbw_not_divisible.py index eda7e0f..c94ef50 100644 --- a/testing_archive/test_rxbw_not_divisible.py +++ b/testing_archive/test_rxbw_not_divisible.py @@ -3,8 +3,6 @@ """ Experiment fault: rx_bandwidth not divisible by usrp clock rate -Expected exception: - Experiment's receive bandwidth .* is not possible as it must be an integer divisor of USRP master clock rate """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_rxonly_dne.py b/testing_archive/test_rxonly_dne.py new file mode 100644 index 0000000..771c4f2 --- /dev/null +++ b/testing_archive/test_rxonly_dne.py @@ -0,0 +1,40 @@ +#!/usr/bin/python + +""" +Experiment fault: + rxonly not specified alongside and no tx_beam_order specified either. rxonly must be manually set to True + for receive-only modes. +""" + +import numpy as np + +import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + + +class TestExperiment(ExperimentPrototype): + + def __init__(self): + cpid = 1 + super().__init__(cpid) + + slice_1 = { # slice_id = 0, there is only one slice. + "pulse_sequence": scf.SEQUENCE_7P, + "tau_spacing": scf.TAU_SPACING_7P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": scf.STD_NUM_RANGES, + "first_range": scf.STD_FIRST_RANGE, + "intt": 3500, # duration of an integration, in ms + "beam_angle": scf.STD_16_BEAM_ANGLE, + "rx_beam_order": scf.STD_16_FORWARD_BEAM_ORDER, + "freq": scf.COMMON_MODE_FREQ_1, # kHz + "decimation_scheme": create_default_scheme(), + } + self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "__root__\n" \ + " rxonly specified as False but tx_beam_order not given. Slice: 0 \(type=value_error\)" diff --git a/testing_archive/test_rxrate_high.py b/testing_archive/test_rxrate_high.py index 7acf992..4b1bb2e 100644 --- a/testing_archive/test_rxrate_high.py +++ b/testing_archive/test_rxrate_high.py @@ -3,8 +3,6 @@ """ Experiment fault: rx_bandwidth too large -Expected exception: - Experiment's receive bandwidth is too large """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_scanbound_but_no_intt.py b/testing_archive/test_scanbound_but_no_intt.py index a26113d..ebca80f 100644 --- a/testing_archive/test_scanbound_but_no_intt.py +++ b/testing_archive/test_scanbound_but_no_intt.py @@ -3,8 +3,6 @@ """ Experiment fault: scanbound specified by not intt -Expected exception: - Slice .* must have intt enabled to use scanbound """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_scanbound_dne.py b/testing_archive/test_scanbound_dne.py index 8a97125..1740178 100644 --- a/testing_archive/test_scanbound_dne.py +++ b/testing_archive/test_scanbound_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: scanbound not specified for all slices -Expected exception: - If one slice has a scanbound, they all must to avoid up to minute-long downtimes. """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_scanbound_negative.py b/testing_archive/test_scanbound_negative.py index 555aa89..0f089f2 100644 --- a/testing_archive/test_scanbound_negative.py +++ b/testing_archive/test_scanbound_negative.py @@ -3,8 +3,6 @@ """ Experiment fault: scanbound containing negative values -Expected exception: - Slice .* scanbound times must be non-negative """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_scanbound_not_increasing.py b/testing_archive/test_scanbound_not_increasing.py index 72e8c9a..703108f 100644 --- a/testing_archive/test_scanbound_not_increasing.py +++ b/testing_archive/test_scanbound_not_increasing.py @@ -3,8 +3,6 @@ """ Experiment fault: scanbound non-increasing values -Expected exception: - Slice .* scanbound times must be increasing """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_seq_not_increasing.py b/testing_archive/test_seq_not_increasing.py index bb01d67..ba72d4a 100644 --- a/testing_archive/test_seq_not_increasing.py +++ b/testing_archive/test_seq_not_increasing.py @@ -3,8 +3,6 @@ """ Experiment fault: pulse_sequence not increasing -Expected exception: - Slice .* pulse_sequence not increasing """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_sequence_dne.py b/testing_archive/test_sequence_dne.py index 341e94c..602d6e0 100644 --- a/testing_archive/test_sequence_dne.py +++ b/testing_archive/test_sequence_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: No pulse_sequence specified -Expected exception: - Slice must specify pulse_sequence that must be a list of integers """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_sequence_not_int.py b/testing_archive/test_sequence_not_int.py index 9aa78cd..d06cb78 100644 --- a/testing_archive/test_sequence_not_int.py +++ b/testing_archive/test_sequence_not_int.py @@ -3,8 +3,6 @@ """ Experiment fault: pulse_sequence containing non-integer values -Expected exception: - Slice must specify pulse_sequence that must be a list of integers """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_sequence_not_list.py b/testing_archive/test_sequence_not_list.py index 4563ce4..e23def7 100644 --- a/testing_archive/test_sequence_not_list.py +++ b/testing_archive/test_sequence_not_list.py @@ -3,8 +3,6 @@ """ Experiment fault: pulse_sequence not a list -Expected exception: - Slice must specify pulse_sequence that must be a list of integers """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_slices_beam_order_bad.py b/testing_archive/test_slices_beam_order_bad.py index 6b81bf7..fbf1d8b 100644 --- a/testing_archive/test_slices_beam_order_bad.py +++ b/testing_archive/test_slices_beam_order_bad.py @@ -3,9 +3,6 @@ """ Experiment fault: invalid beam_order for slice interfacing -Expected exception: - Slices .* and .* are SEQUENCE or CONCURRENT interfaced but do not have the same number of - averaging periods in their beam order """ import copy diff --git a/testing_archive/test_slices_intn_bad.py b/testing_archive/test_slices_intn_bad.py index a91b227..a085b1d 100644 --- a/testing_archive/test_slices_intn_bad.py +++ b/testing_archive/test_slices_intn_bad.py @@ -3,8 +3,6 @@ """ Experiment fault: interfacing slices have different intn -Expected exception: - Slices .* and .* are SEQUENCE or CONCURRENT interfaced and do not have the same NAVE goal intn """ import copy diff --git a/testing_archive/test_slices_intt_bad.py b/testing_archive/test_slices_intt_bad.py index c8c670e..3d9574b 100644 --- a/testing_archive/test_slices_intt_bad.py +++ b/testing_archive/test_slices_intt_bad.py @@ -3,9 +3,6 @@ """ Experiment fault: Interfacing slices have different intt -Expected exception: - Slices .* and .* are SEQUENCE or CONCURRENT interfaced and do not have the same Averaging Period - duration intt """ import copy diff --git a/testing_archive/test_slices_scanbound_bad.py b/testing_archive/test_slices_scanbound_bad.py index 5c4b0d9..63620a7 100644 --- a/testing_archive/test_slices_scanbound_bad.py +++ b/testing_archive/test_slices_scanbound_bad.py @@ -3,8 +3,6 @@ """ Experiment fault: Interfacing slices have different scanbound values -Expected exception: - Scan boundary not the same between slices .* and .* for AVEPERIOD or CONCURRENT interfaced slices """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_stage0_bad_inputrate.py b/testing_archive/test_stage0_bad_inputrate.py index 0a8236b..83bad7f 100644 --- a/testing_archive/test_stage0_bad_inputrate.py +++ b/testing_archive/test_stage0_bad_inputrate.py @@ -3,8 +3,6 @@ """ Experiment fault: Decimation stage 0 invalid input rate -Expected exception: - Decimation stage 0 does not have input rate .* equal to USRP sampling rate .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_stagex_bad_outputrate.py b/testing_archive/test_stagex_bad_outputrate.py index 61cce7e..65715a3 100644 --- a/testing_archive/test_stagex_bad_outputrate.py +++ b/testing_archive/test_stagex_bad_outputrate.py @@ -3,8 +3,6 @@ """ Experiment fault: Decimation stage x invalid output rate -Expected exception: - Decimation stage .* output rate .* does not equal next stage .* input rate .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_taps_not_list.py b/testing_archive/test_taps_not_list.py index c8de476..2e1e5a2 100644 --- a/testing_archive/test_taps_not_list.py +++ b/testing_archive/test_taps_not_list.py @@ -3,8 +3,6 @@ """ Experiment fault: Decimation stage filter taps not a list -Expected exception: - Filter taps .* of type .* must be a list in decimation stage .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_taps_not_nums.py b/testing_archive/test_taps_not_nums.py index 44c3811..083c072 100644 --- a/testing_archive/test_taps_not_nums.py +++ b/testing_archive/test_taps_not_nums.py @@ -3,8 +3,6 @@ """ Experiment fault: Decimation stage filter taps not numbers -Expected exception: - Filter tap .* is not numeric in decimation stage .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_tau_dne.py b/testing_archive/test_tau_dne.py index 13001d5..78a7d7d 100644 --- a/testing_archive/test_tau_dne.py +++ b/testing_archive/test_tau_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: tau_spacing not specified -Expected exception: - Slice must specify tau_spacing in us that must be an integer """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_tau_not_int.py b/testing_archive/test_tau_not_int.py index e51d490..780c736 100644 --- a/testing_archive/test_tau_not_int.py +++ b/testing_archive/test_tau_not_int.py @@ -3,8 +3,6 @@ """ Experiment fault: tau_spacing not an integer -Expected exception: - Slice must specify tau_spacing in us that must be an integer """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_tau_not_multiple.py b/testing_archive/test_tau_not_multiple.py index faa58ac..f389c93 100644 --- a/testing_archive/test_tau_not_multiple.py +++ b/testing_archive/test_tau_not_multiple.py @@ -3,9 +3,6 @@ """ Experiment fault: tau_spacing not multiple of output rx sampling period -Expected exception: - Slice .* correlation lags will be off because tau_spacing .* us is not a multiple of the output - rx sampling period \(1\/output_rx_rate .* Hz\). """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_tau_too_small.py b/testing_archive/test_tau_too_small.py index 7f06feb..2c5e9ad 100644 --- a/testing_archive/test_tau_too_small.py +++ b/testing_archive/test_tau_too_small.py @@ -2,9 +2,7 @@ """ Experiment fault: - tau_spacing too smal -Expected exception: - Slice .* multi-pulse increment too small + tau_spacing too small """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_too_many_dm_stages.py b/testing_archive/test_too_many_dm_stages.py index 2e2e7cd..e06be79 100644 --- a/testing_archive/test_too_many_dm_stages.py +++ b/testing_archive/test_too_many_dm_stages.py @@ -3,8 +3,6 @@ """ Experiment fault: Too many decimation stages -Expected exception: - Number of decimation stages .* is greater than max available .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_too_many_int_antennas.py b/testing_archive/test_too_many_int_antennas.py index ad966ec..811ba24 100644 --- a/testing_archive/test_too_many_int_antennas.py +++ b/testing_archive/test_too_many_int_antennas.py @@ -3,8 +3,6 @@ """ Experiment fault: rx_int_antennas specifies too many channels -Expected exception: - Slice .* has too many RX interferometer antenna channels .* greater than config .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_too_many_rx_antennas.py b/testing_archive/test_too_many_rx_antennas.py index a964589..82d3c3f 100644 --- a/testing_archive/test_too_many_rx_antennas.py +++ b/testing_archive/test_too_many_rx_antennas.py @@ -3,8 +3,6 @@ """ Experiment fault: rx_main_antennas specifies too many channels -Expected exception: - Slice .* has too many main RX antenna channels .* greater than config .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_too_many_tx_antennas.py b/testing_archive/test_too_many_tx_antennas.py index e4281a1..35a4733 100644 --- a/testing_archive/test_too_many_tx_antennas.py +++ b/testing_archive/test_too_many_tx_antennas.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_antennas specifies too many channels -Expected exception: - Slice .* has too many main TX antenna channels .* greater than config .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_two_classes.py b/testing_archive/test_two_classes.py index 0c5f526..7c62c30 100644 --- a/testing_archive/test_two_classes.py +++ b/testing_archive/test_two_classes.py @@ -3,8 +3,6 @@ """ Experiment fault: File contains two classes -Expected exception: - You have more than one experiment class in your experiment file - exiting """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_tx_antenna_dne.py b/testing_archive/test_tx_antenna_dne.py index c84d02f..3e48cbc 100644 --- a/testing_archive/test_tx_antenna_dne.py +++ b/testing_archive/test_tx_antenna_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_antenna specifies antenna that doesn't exist -Expected exception: - Slice .* specifies TX main array antenna numbers over config max .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_tx_antenna_dups.py b/testing_archive/test_tx_antenna_dups.py index ed491ac..fb0f935 100644 --- a/testing_archive/test_tx_antenna_dups.py +++ b/testing_archive/test_tx_antenna_dups.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_antennas has duplicate values -Expected exception: - Slice .* TX main antennas has duplicate antennas """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_tx_antenna_invalid.py b/testing_archive/test_tx_antenna_invalid.py new file mode 100644 index 0000000..0343928 --- /dev/null +++ b/testing_archive/test_tx_antenna_invalid.py @@ -0,0 +1,45 @@ +#!/usr/bin/python + +""" +Experiment fault: + tx_antennas has invalid values (above and below the allowed range) +""" + +import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + + +class TestExperiment(ExperimentPrototype): + + def __init__(self): + cpid = 1 + super().__init__(cpid) + + beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER + num_ranges = scf.STD_NUM_RANGES + + slice_1 = { # slice_id = 0, there is only one slice. + "pulse_sequence": scf.SEQUENCE_7P, + "tau_spacing": scf.TAU_SPACING_7P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": num_ranges, + "first_range": scf.STD_FIRST_RANGE, + "intt": 3500, # duration of an integration, in ms + "beam_angle": scf.STD_16_BEAM_ANGLE, + "rx_beam_order": beams_to_use, + "tx_beam_order": beams_to_use, + "freq": scf.COMMON_MODE_FREQ_1, #kHz + "tx_antennas": [-1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16], ### antenna -1 and 16 are out of range + "decimation_scheme": create_default_scheme(), + } + self.add_slice(slice_1) + + @classmethod + def error_message(cls): + return ValidationError, "tx_antennas -> 0\n" \ + " ensure this value is greater than or equal to 0 \(type=value_error.number.not_ge; " \ + "limit_value=0\)\n" \ + "tx_antennas -> 15\n" \ + " ensure this value is less than 16 \(type=value_error.number.not_lt; limit_value=16\)" diff --git a/testing_archive/test_tx_antenna_pattern_dim_mismatch.py b/testing_archive/test_tx_antenna_pattern_dim_mismatch.py index aaf22fe..f084c55 100644 --- a/testing_archive/test_tx_antenna_pattern_dim_mismatch.py +++ b/testing_archive/test_tx_antenna_pattern_dim_mismatch.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_antenna_pattern dimension mismatch with number of main antennas -Expected exception: - Slice .* tx antenna pattern return 2nd dimension \(.*\) must be equal to number of main antennas \(.*\) """ import numpy as np diff --git a/testing_archive/test_tx_antenna_pattern_magnitude.py b/testing_archive/test_tx_antenna_pattern_magnitude.py index 1811948..0e5209d 100644 --- a/testing_archive/test_tx_antenna_pattern_magnitude.py +++ b/testing_archive/test_tx_antenna_pattern_magnitude.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_antenna_pattern magnitude too large -Expected exception: - Slice .* tx antenna pattern return must not have any values with a magnitude greater than 1 """ import numpy as np diff --git a/testing_archive/test_tx_antenna_pattern_not_2d.py b/testing_archive/test_tx_antenna_pattern_not_2d.py index 8665c20..876ad8f 100644 --- a/testing_archive/test_tx_antenna_pattern_not_2d.py +++ b/testing_archive/test_tx_antenna_pattern_not_2d.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_antenna_pattern not 2d -Expected exception: - Slice .* tx antenna pattern return shape .* must be 2-dimensional """ import numpy as np diff --git a/testing_archive/test_tx_antenna_pattern_not_callable.py b/testing_archive/test_tx_antenna_pattern_not_callable.py index 8483801..26657ce 100644 --- a/testing_archive/test_tx_antenna_pattern_not_callable.py +++ b/testing_archive/test_tx_antenna_pattern_not_callable.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_antenna_pattern not a function -Expected exception: - Slice .* tx antenna pattern must be a function """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_tx_antenna_pattern_not_numpy.py b/testing_archive/test_tx_antenna_pattern_not_numpy.py index 501bcd2..0c6ba23 100644 --- a/testing_archive/test_tx_antenna_pattern_not_numpy.py +++ b/testing_archive/test_tx_antenna_pattern_not_numpy.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_antenna_pattern returns non-numpy array -Expected exception: - Slice .* tx antenna pattern return is not a numpy array """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_tx_beam_order_dne.py b/testing_archive/test_tx_beam_order_dne.py index 66b0827..f75d0ee 100644 --- a/testing_archive/test_tx_beam_order_dne.py +++ b/testing_archive/test_tx_beam_order_dne.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_beam_order not specified alongside tx_antenna_pattern -Expected exception: - tx_beam_order must be specified if tx_antenna_pattern specified. Slice .* """ import numpy as np diff --git a/testing_archive/test_tx_beam_order_list_not_ints.py b/testing_archive/test_tx_beam_order_list_not_ints.py index ae3cdbf..de11055 100644 --- a/testing_archive/test_tx_beam_order_list_not_ints.py +++ b/testing_archive/test_tx_beam_order_list_not_ints.py @@ -3,9 +3,6 @@ """ Experiment fault: tx_beam_order not integer values in list -Expected exception: - tx_beam_order must be a list of ints corresponding to the order of the angles in the beam_angle - list or an array of phases in the tx_antenna_pattern return. Slice: .* """ import borealis_experiments.superdarn_common_fields as scf @@ -51,16 +48,10 @@ def __init__(self): @classmethod def error_message(cls): - return ValidationError, "6 validation errors for ExperimentSlice\n" \ + return ValidationError, "3 validation errors for ExperimentSlice\n" \ "tx_beam_order -> 0\n" \ " value is not a valid integer \(type=type_error.integer\)\n" \ - "tx_beam_order -> 0\n" \ - " value is not a valid list \(type=type_error.list\)\n" \ - "tx_beam_order -> 1\n" \ - " value is not a valid integer \(type=type_error.integer\)\n" \ "tx_beam_order -> 1\n" \ - " value is not a valid list \(type=type_error.list\)\n" \ - "tx_beam_order -> 2\n" \ " value is not a valid integer \(type=type_error.integer\)\n" \ "tx_beam_order -> 2\n" \ - " value is not a valid list \(type=type_error.list\)" + " value is not a valid integer \(type=type_error.integer\)" diff --git a/testing_archive/test_tx_beam_order_listnum_too_high.py b/testing_archive/test_tx_beam_order_listnum_too_high.py index b438e58..6f90830 100644 --- a/testing_archive/test_tx_beam_order_listnum_too_high.py +++ b/testing_archive/test_tx_beam_order_listnum_too_high.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_beam_order specifies beam that doesn't exist -Expected exception: - Beam number .* in tx_beam_order could not index in beam_angle list of length .*. Slice: .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_tx_beam_order_mismatch_tx_antenna_pattern.py b/testing_archive/test_tx_beam_order_mismatch_tx_antenna_pattern.py new file mode 100644 index 0000000..0892595 --- /dev/null +++ b/testing_archive/test_tx_beam_order_mismatch_tx_antenna_pattern.py @@ -0,0 +1,60 @@ +#!/usr/bin/python + +""" +Experiment fault: + tx_beam_order has a value greater than the first dimension of tx_antenna_pattern return +""" + +import numpy as np + +import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype +from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from pydantic import ValidationError + + +### pattern second dimension is not equal to num_main_antennas, this will fail in check_slice() +### of ExperimentPrototype +def tx_antenna_pattern(tx_freq_khz, tx_antennas, antenna_spacing): + """Sets the amplitude and phase weighting for each tx antenna""" + pattern = np.array([1.0 for _ in range(len(tx_antennas))]).reshape((1, len(tx_antennas))) + return pattern + + +class TxAntennaPatternTest(ExperimentPrototype): + + def __init__(self): + """ + kwargs: + + freq: int + + """ + cpid = 12345 + super().__init__(cpid) + + beams_to_use = scf.STD_16_FORWARD_BEAM_ORDER + num_ranges = scf.STD_NUM_RANGES + + # default frequency set here + freq = scf.COMMON_MODE_FREQ_1 + + self.add_slice({ # slice_id = 0, there is only one slice. + "pulse_sequence": scf.SEQUENCE_7P, + "tau_spacing": scf.TAU_SPACING_7P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": num_ranges, + "first_range": scf.STD_FIRST_RANGE, + "intt": scf.INTT_7P, # duration of an integration, in ms + "tx_antenna_pattern": tx_antenna_pattern, + "beam_angle": scf.STD_16_BEAM_ANGLE, + "rx_beam_order": [beams_to_use, beams_to_use], + "tx_beam_order": [0, 1], # tx_antenna_pattern returns array with only one row + "freq": freq, # kHz + "decimation_scheme": create_default_scheme(), + }) + + @classmethod + def error_message(cls): + return ValidationError, "tx_beam_order\n" \ + " Slice 0 scan tx beam number 1 DNE \(type=value_error\)" diff --git a/testing_archive/test_tx_beam_order_not_list.py b/testing_archive/test_tx_beam_order_not_list.py index 93c6dd4..c63af44 100644 --- a/testing_archive/test_tx_beam_order_not_list.py +++ b/testing_archive/test_tx_beam_order_not_list.py @@ -3,9 +3,6 @@ """ Experiment fault: tx_beam_order not a list -Expected exception: - tx_beam_order must be a list of ints corresponding to the order of the angles in the beam_angle - list or an array of phases in the tx_antenna_pattern return. Slice: .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_tx_beam_order_not_same_len_as_rx.py b/testing_archive/test_tx_beam_order_not_same_len_as_rx.py index f74e2cf..c348acb 100644 --- a/testing_archive/test_tx_beam_order_not_same_len_as_rx.py +++ b/testing_archive/test_tx_beam_order_not_same_len_as_rx.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_beam_order different length from rx_beam_order -Expected exception: - tx_beam_order does not have same length as rx_beam_order. Slice: .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_txbw_not_divisible.py b/testing_archive/test_txbw_not_divisible.py index 9209abe..246644a 100644 --- a/testing_archive/test_txbw_not_divisible.py +++ b/testing_archive/test_txbw_not_divisible.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_bandwidth not divisor of usrp clock rate -Expected exception: - Experiment's transmit bandwidth .* is not possible as it must be an integer divisor of USRP master clock rate """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_txrate_high.py b/testing_archive/test_txrate_high.py index eadbcc9..c19c978 100644 --- a/testing_archive/test_txrate_high.py +++ b/testing_archive/test_txrate_high.py @@ -3,8 +3,6 @@ """ Experiment fault: tx_bandwidth too high -Expected exception: - Experiment's transmit bandwidth is too large """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_unused_param.py b/testing_archive/test_unused_param.py index fab6646..926bbbd 100644 --- a/testing_archive/test_unused_param.py +++ b/testing_archive/test_unused_param.py @@ -3,8 +3,6 @@ """ Experiment fault: Slice has specified unused parameter -Expected exception: - Slice .* has a parameter that is not used: .* = .* """ import borealis_experiments.superdarn_common_fields as scf diff --git a/testing_archive/test_wait_for_first_scanbound_type.py b/testing_archive/test_wait_for_first_scanbound_type.py index 68f1e2b..bc6219c 100644 --- a/testing_archive/test_wait_for_first_scanbound_type.py +++ b/testing_archive/test_wait_for_first_scanbound_type.py @@ -3,8 +3,6 @@ """ Experiment fault: wait_for_first_scanbound not a boolean value -Expected exception: - Slice .* wait_for_first_scanbound must be True or False, got .* instead """ import borealis_experiments.superdarn_common_fields as scf From 58b5b561ad0dc41b8447bdcd022d1462b8514768 Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Fri, 14 Apr 2023 18:17:45 +0000 Subject: [PATCH 04/13] Removed decimation_scheme where default scheme was used. --- 2multifsound.py | 2 -- bistatic_test.py | 2 -- borealis_paper.py | 2 -- epopsound.py | 2 -- epopsound_one_beam.py | 2 -- full_fov.py | 2 -- full_fov_2freq.py | 2 -- full_fov_3freq.py | 2 -- full_fov_comparison.py | 2 -- fullscanstepmode.py | 2 -- haarpscan.py | 2 -- impttest.py | 3 +-- interleavedscan.py | 2 -- interleavesound.py | 3 --- listening_normalscan_1.py | 3 --- listening_normalscan_2.py | 3 --- multifreq_widebeam.py | 2 -- narrow_wide_comparison.py | 2 -- normalscan.py | 2 -- normalscan_13MHz.py | 2 -- normalscan_aligned.py | 2 -- normalscan_boresite.py | 2 -- normalscan_intn.py | 2 -- normalscan_ppo_test.py | 2 -- normalscan_single_beam.py | 2 -- normalsound.py | 3 --- politescan.py | 2 -- politescan2.py | 3 --- power_meter_mode.py | 2 -- pulse_interfacing_test.py | 2 -- pulse_phase_offset_decoding_test.py | 2 -- rbspscan.py | 2 -- synch_test.py | 2 -- tauscan.py | 2 -- themisscan.py | 2 -- twofsound.py | 3 --- widebeam_2tx.py | 2 -- widebeam_3tx.py | 2 -- 38 files changed, 1 insertion(+), 82 deletions(-) diff --git a/2multifsound.py b/2multifsound.py index ec628fe..ba2991e 100644 --- a/2multifsound.py +++ b/2multifsound.py @@ -13,7 +13,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class TwoMultifsound(ExperimentPrototype): @@ -48,7 +47,6 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), } slice_2 = copy.deepcopy(slice_1) diff --git a/bistatic_test.py b/bistatic_test.py index 131b68a..d86e46d 100644 --- a/bistatic_test.py +++ b/bistatic_test.py @@ -14,7 +14,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class BistaticTest(ExperimentPrototype): @@ -63,7 +62,6 @@ def __init__(self, **kwargs): "scanbound": [i * 3.7 for i in range(len(scf.STD_16_BEAM_ANGLE))], # align each aveperiod to 3.7s boundary "wait_for_first_scanbound": False, "align_sequences": True, # align start of sequence to tenths of a second - "decimation_scheme": create_default_scheme(), } if 'listen_to' in kwargs.keys() and 'beam_order' in kwargs.keys(): # Mutually exclusive arguments diff --git a/borealis_paper.py b/borealis_paper.py index 37a3077..a7cb297 100644 --- a/borealis_paper.py +++ b/borealis_paper.py @@ -14,7 +14,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme def phase_encode(beam_iter, sequence_num, num_pulses): @@ -39,7 +38,6 @@ def __init__(self): "tx_beam_order": [0], "freq" : 13100, "acf" : True, - "decimation_scheme": create_default_scheme(), } diff --git a/epopsound.py b/epopsound.py index 68375be..1b4062f 100644 --- a/epopsound.py +++ b/epopsound.py @@ -19,7 +19,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Epopsound(ExperimentPrototype): @@ -85,7 +84,6 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, "acfint": True, - "decimation_scheme": create_default_scheme(), } for freq in freqs: diff --git a/epopsound_one_beam.py b/epopsound_one_beam.py index 33ec866..6dcd87e 100644 --- a/epopsound_one_beam.py +++ b/epopsound_one_beam.py @@ -19,7 +19,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Epopsound(ExperimentPrototype): @@ -67,7 +66,6 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, "acfint": True, - "decimation_scheme": create_default_scheme(), } for num, freq in enumerate(freqs): diff --git a/full_fov.py b/full_fov.py index 6fae3ce..84a2662 100644 --- a/full_fov.py +++ b/full_fov.py @@ -13,7 +13,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class FullFOV(ExperimentPrototype): @@ -58,6 +57,5 @@ def __init__(self, **kwargs): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "align_sequences": True, # align start of sequence to tenths of a second - "decimation_scheme": create_default_scheme(), }) diff --git a/full_fov_2freq.py b/full_fov_2freq.py index 1e45c03..b34ab78 100644 --- a/full_fov_2freq.py +++ b/full_fov_2freq.py @@ -16,7 +16,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class FullFOV2Freq(ExperimentPrototype): @@ -65,7 +64,6 @@ def __init__(self, **kwargs): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "align_sequences": True, # align start of sequence to tenths of a second - "decimation_scheme": create_default_scheme(), } # Transmit on the second frequency on the right half of the array diff --git a/full_fov_3freq.py b/full_fov_3freq.py index a0986e0..dd666ed 100644 --- a/full_fov_3freq.py +++ b/full_fov_3freq.py @@ -16,7 +16,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class FullFOV3Freq(ExperimentPrototype): @@ -64,7 +63,6 @@ def __init__(self, **kwargs): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "align_sequences": True, # align start of sequence to tenths of a second - "decimation_scheme": create_default_scheme(), } # Transmit on the second frequency on the right half of the array diff --git a/full_fov_comparison.py b/full_fov_comparison.py index 6ac26fc..b88bff3 100644 --- a/full_fov_comparison.py +++ b/full_fov_comparison.py @@ -16,7 +16,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme def widebeam_no_phase(frequency_khz, tx_antennas, antenna_spacing_m): @@ -68,7 +67,6 @@ def __init__(self, **kwargs): "align_sequences": True, # align start of sequence to tenths of a second "scanbound": scf.easy_scanbound(scf.INTT_7P, scf.STD_16_BEAM_ANGLE), "wait_for_first_scanbound": False, - "decimation_scheme": create_default_scheme(), } slice_1 = copy.deepcopy(slice_0) diff --git a/fullscanstepmode.py b/fullscanstepmode.py index b338e95..b2d5b1c 100644 --- a/fullscanstepmode.py +++ b/fullscanstepmode.py @@ -13,7 +13,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class FullScanStepMode(ExperimentPrototype): @@ -91,7 +90,6 @@ def move_freqs(direction): "xcf": True, # cross-correlation processing "acfint" : True, # interferometer acfs "comment" : FullScanStepMode.__doc__, - "decimation_scheme": create_default_scheme(), } slices.append(s) diff --git a/haarpscan.py b/haarpscan.py index f9489b9..a7ddc43 100644 --- a/haarpscan.py +++ b/haarpscan.py @@ -12,7 +12,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class HAARPScan(ExperimentPrototype): @@ -61,5 +60,4 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), }) diff --git a/impttest.py b/impttest.py index 0af78ef..f267c3f 100644 --- a/impttest.py +++ b/impttest.py @@ -16,12 +16,12 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme def phase_encode(beam_iter, sequence_num, num_pulses): return np.random.uniform(-180.0, 180, num_pulses) + class ImptTest(ExperimentPrototype): def __init__(self): @@ -38,7 +38,6 @@ def __init__(self): "rx_beam_order": [0], "tx_beam_order": [0], "freq" : 13100, - "decimation_scheme": create_default_scheme(), } impt_slice = copy.deepcopy(default_slice) diff --git a/interleavedscan.py b/interleavedscan.py index 055a145..3c71817 100644 --- a/interleavedscan.py +++ b/interleavedscan.py @@ -16,7 +16,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class InterleavedScan(ExperimentPrototype): @@ -48,7 +47,6 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "lag_table": scf.STD_8P_LAG_TABLE, # lag table needed for 8P since not all lags used. - "decimation_scheme": create_default_scheme(), } super().__init__(cpid) diff --git a/interleavesound.py b/interleavesound.py index 50f16bc..bbe6be1 100644 --- a/interleavesound.py +++ b/interleavesound.py @@ -13,7 +13,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class InterleaveSound(ExperimentPrototype): @@ -51,7 +50,6 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "lag_table": scf.STD_8P_LAG_TABLE, # lag table needed for 8P since not all lags used. - "decimation_scheme": create_default_scheme(), }) sounding_scanbound_spacing = 1.5 # seconds @@ -75,7 +73,6 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "lag_table": scf.STD_8P_LAG_TABLE, # lag table needed for 8P since not all lags used - "decimation_scheme": create_default_scheme(), }) sum_of_freq = 0 diff --git a/listening_normalscan_1.py b/listening_normalscan_1.py index f0f89de..0ea8c11 100644 --- a/listening_normalscan_1.py +++ b/listening_normalscan_1.py @@ -14,7 +14,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class ListeningNormalscan1(ExperimentPrototype): @@ -50,7 +49,6 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), }) self.add_slice({ # slice_id = 1, receive only @@ -67,6 +65,5 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), "rxonly": True, }, interfacing_dict={0: 'SCAN'}) diff --git a/listening_normalscan_2.py b/listening_normalscan_2.py index a816b99..0f5911a 100644 --- a/listening_normalscan_2.py +++ b/listening_normalscan_2.py @@ -15,7 +15,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class ListeningNormalscan2(ExperimentPrototype): @@ -53,7 +52,6 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), }) self.add_slice({ # slice_id = 1, receive only @@ -71,6 +69,5 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), "rxonly": True, }, interfacing_dict={0: 'CONCURRENT'}) diff --git a/multifreq_widebeam.py b/multifreq_widebeam.py index 268d9d7..dcd93bd 100644 --- a/multifreq_widebeam.py +++ b/multifreq_widebeam.py @@ -18,7 +18,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class MultifreqWidebeam(ExperimentPrototype): @@ -62,7 +61,6 @@ def __init__(self, **kwargs): "tx_antennas": [6, 7], # Using two tx antennas from the middle of array "align_sequences": True, "scanbound": [i * scf.INTT_7P * 1e-3 for i in range(len(scf.STD_16_BEAM_ANGLE))], - "decimation_scheme": create_default_scheme(), } slice_2 = copy.deepcopy(slice_1) # slice_id = 1, the second slice diff --git a/narrow_wide_comparison.py b/narrow_wide_comparison.py index 676ea2b..31e44a0 100644 --- a/narrow_wide_comparison.py +++ b/narrow_wide_comparison.py @@ -17,7 +17,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme def boresight(frequency_khz, tx_antennas, antenna_spacing_m): @@ -67,7 +66,6 @@ def __init__(self, **kwargs): "align_sequences": True, # align start of sequence to tenths of a second "scanbound": scf.easy_scanbound(scf.INTT_7P, scf.STD_16_BEAM_ANGLE), "wait_for_first_scanbound": False, - "decimation_scheme": create_default_scheme(), } slice_1 = copy.deepcopy(slice_0) diff --git a/normalscan.py b/normalscan.py index 9b1cec1..f9bffa2 100644 --- a/normalscan.py +++ b/normalscan.py @@ -10,7 +10,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Normalscan(ExperimentPrototype): @@ -60,5 +59,4 @@ def __init__(self, **kwargs): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "wait_for_first_scanbound": False, - "decimation_scheme": create_default_scheme(), }) diff --git a/normalscan_13MHz.py b/normalscan_13MHz.py index 90681e8..5ba2979 100644 --- a/normalscan_13MHz.py +++ b/normalscan_13MHz.py @@ -13,7 +13,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Normalscan(ExperimentPrototype): @@ -47,6 +46,5 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), }) diff --git a/normalscan_aligned.py b/normalscan_aligned.py index 38a104c..ddd9c6a 100644 --- a/normalscan_aligned.py +++ b/normalscan_aligned.py @@ -10,7 +10,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Normalscan(ExperimentPrototype): @@ -60,6 +59,5 @@ def __init__(self, **kwargs): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "align_sequences": True, # align start of sequence to tenths of a second - "decimation_scheme": create_default_scheme(), }) diff --git a/normalscan_boresite.py b/normalscan_boresite.py index 7b65247..1fcace0 100644 --- a/normalscan_boresite.py +++ b/normalscan_boresite.py @@ -10,7 +10,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class NormalscanBoresite(ExperimentPrototype): @@ -34,5 +33,4 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), }) diff --git a/normalscan_intn.py b/normalscan_intn.py index b0615e5..6f24511 100644 --- a/normalscan_intn.py +++ b/normalscan_intn.py @@ -10,7 +10,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Normalscan(ExperimentPrototype): @@ -60,6 +59,5 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), }) diff --git a/normalscan_ppo_test.py b/normalscan_ppo_test.py index 7041335..6d5fd02 100644 --- a/normalscan_ppo_test.py +++ b/normalscan_ppo_test.py @@ -12,7 +12,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme def phase_encode(beam_iter, sequence_num, num_pulses): @@ -66,6 +65,5 @@ def __init__(self, **kwargs): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "pulse_phase_offset": phase_encode, - "decimation_scheme": create_default_scheme(), }) diff --git a/normalscan_single_beam.py b/normalscan_single_beam.py index 03f8827..eba794a 100644 --- a/normalscan_single_beam.py +++ b/normalscan_single_beam.py @@ -12,7 +12,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class NormalscanSingleBeam(ExperimentPrototype): @@ -36,5 +35,4 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), }) diff --git a/normalsound.py b/normalsound.py index 9fecb15..e1ec839 100644 --- a/normalsound.py +++ b/normalsound.py @@ -10,7 +10,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class NormalSound(ExperimentPrototype): @@ -47,7 +46,6 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "lag_table": scf.STD_8P_LAG_TABLE, # lag table needed for 8P since not all lags used. - "decimation_scheme": create_default_scheme(), }) sounding_scanbound_spacing = 1.5 # seconds @@ -74,7 +72,6 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "lag_table": scf.STD_8P_LAG_TABLE, # lag table needed for 8P since not all lags used. - "decimation_scheme": create_default_scheme(), }) super().__init__(cpid, txctrfreq=centerfreq, rxctrfreq=centerfreq, comment_string=NormalSound.__doc__) diff --git a/politescan.py b/politescan.py index a90b46c..80f95ec 100644 --- a/politescan.py +++ b/politescan.py @@ -11,7 +11,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Politescan(ExperimentPrototype): @@ -39,6 +38,5 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), "rxonly": True, }) diff --git a/politescan2.py b/politescan2.py index 421bc0b..2d6f640 100644 --- a/politescan2.py +++ b/politescan2.py @@ -16,7 +16,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Politescan2(ExperimentPrototype): @@ -50,7 +49,6 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), "rxonly": True, }) @@ -69,6 +67,5 @@ def __init__(self): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), "rxonly": True, }, interfacing_dict={0: 'CONCURRENT'}) diff --git a/power_meter_mode.py b/power_meter_mode.py index 0295b43..769179f 100644 --- a/power_meter_mode.py +++ b/power_meter_mode.py @@ -11,7 +11,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class PowerMeterMode(ExperimentPrototype): @@ -50,6 +49,5 @@ def __init__(self, **kwargs): "acf": False, "xcf": False, # cross-correlation processing "acfint": False, # interferometer acfs - "decimation_scheme": create_default_scheme(), }) diff --git a/pulse_interfacing_test.py b/pulse_interfacing_test.py index c11b270..63fd466 100644 --- a/pulse_interfacing_test.py +++ b/pulse_interfacing_test.py @@ -14,7 +14,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class PulseInterfacingTest(ExperimentPrototype): @@ -37,7 +36,6 @@ def __init__(self): "rx_beam_order": beams_to_use, "tx_beam_order": beams_to_use, "freq" : 10500, # kHz - "decimation_scheme": create_default_scheme(), } slice_1 = copy.deepcopy(slice_0) diff --git a/pulse_phase_offset_decoding_test.py b/pulse_phase_offset_decoding_test.py index 9a9edc6..c011642 100644 --- a/pulse_phase_offset_decoding_test.py +++ b/pulse_phase_offset_decoding_test.py @@ -12,7 +12,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme def phase_encode(beam_iter, sequence_num, num_pulses): @@ -41,5 +40,4 @@ def __init__(self): "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs "pulse_phase_offset": phase_encode, - "decimation_scheme": create_default_scheme(), }) diff --git a/rbspscan.py b/rbspscan.py index a8c0b79..13c9483 100644 --- a/rbspscan.py +++ b/rbspscan.py @@ -42,7 +42,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class RBSPScan(ExperimentPrototype): @@ -102,7 +101,6 @@ def __init__(self,): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), } super().__init__(cpid) diff --git a/synch_test.py b/synch_test.py index b95dde0..146c623 100644 --- a/synch_test.py +++ b/synch_test.py @@ -9,7 +9,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class SynchTest(ExperimentPrototype): @@ -34,5 +33,4 @@ def __init__(self): "acf": False, "xcf": False, # cross-correlation processing "acfint": False, # interferometer acfs - "decimation_scheme": create_default_scheme(), }) diff --git a/tauscan.py b/tauscan.py index ffc9a86..2eac568 100644 --- a/tauscan.py +++ b/tauscan.py @@ -15,7 +15,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Tauscan(ExperimentPrototype): @@ -52,7 +51,6 @@ def __init__(self): "xcf" : True, "acfint" : True, "comment" : Tauscan.__doc__, - "decimation_scheme": create_default_scheme(), } self.add_slice(slice_1) diff --git a/themisscan.py b/themisscan.py index c271f9c..34fcc68 100644 --- a/themisscan.py +++ b/themisscan.py @@ -12,7 +12,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class ThemisScan(ExperimentPrototype): @@ -69,7 +68,6 @@ def __init__(self,): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), } super().__init__(cpid) diff --git a/twofsound.py b/twofsound.py index c05bb93..473bd02 100644 --- a/twofsound.py +++ b/twofsound.py @@ -12,8 +12,6 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme - class Twofsound(ExperimentPrototype): @@ -56,7 +54,6 @@ def __init__(self, **kwargs): "acf": True, "xcf": True, # cross-correlation processing "acfint": True, # interferometer acfs - "decimation_scheme": create_default_scheme(), } slice_2 = copy.deepcopy(slice_1) diff --git a/widebeam_2tx.py b/widebeam_2tx.py index c56f1fd..a190cc7 100644 --- a/widebeam_2tx.py +++ b/widebeam_2tx.py @@ -15,7 +15,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Widebeam_2tx(ExperimentPrototype): @@ -58,6 +57,5 @@ def __init__(self, **kwargs): "tx_antennas": [7, 8], # Using two tx antennas from the middle of array "align_sequences": True, "scanbound": [i * scf.INTT_7P * 1e-3 for i in range(len(scf.STD_16_BEAM_ANGLE))], - "decimation_scheme": create_default_scheme(), }) diff --git a/widebeam_3tx.py b/widebeam_3tx.py index 18bfba6..7604742 100644 --- a/widebeam_3tx.py +++ b/widebeam_3tx.py @@ -15,7 +15,6 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme class Widebeam_3tx(ExperimentPrototype): @@ -56,6 +55,5 @@ def __init__(self, **kwargs): "tx_beam_order": [0], "freq": freq, # kHz "tx_antennas": [6, 7, 8], # Using three tx antennas from near the middle of array - "decimation_scheme": create_default_scheme(), }) From b8451e46c25104f78240bfb324161732bc3d5036 Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Fri, 14 Apr 2023 19:50:07 +0000 Subject: [PATCH 05/13] Updated decimation_scheme and experiment_exception file paths. --- IB_collab_mode.py | 2 +- experiment_archive/normalscan.py | 2 +- experiment_archive/test_decimation_schemes.py | 2 +- experiment_archive/test_filters_1.py | 2 +- experiment_archive/test_scheme_9.py | 2 +- experiment_archive/test_scheme_9_acfs.py | 2 +- experiment_archive/twofsound.py | 2 +- full_fov_15km.py | 2 +- testing_archive/deprecated_tests/test_beam_order_too_long.py | 2 +- testing_archive/deprecated_tests/test_clrfrqrng_not_list.py | 2 +- .../deprecated_tests/test_first_range_not_float.py | 2 +- testing_archive/deprecated_tests/test_scanbound_bad_len.py | 2 +- testing_archive/deprecated_tests/test_scheme_9.py | 2 +- testing_archive/deprecated_tests/test_scheme_9_acfs.py | 2 +- testing_archive/deprecated_tests/test_too_many_slices.py | 2 +- testing_archive/test_avg_method_dne.py | 2 +- testing_archive/test_bad_interface.py | 2 +- testing_archive/test_bad_interfacing.py | 2 +- testing_archive/test_bad_slice_id.py | 2 +- testing_archive/test_beam_angle_dne.py | 2 +- testing_archive/test_beam_angle_dups.py | 2 +- testing_archive/test_beam_angle_not_increasing.py | 2 +- testing_archive/test_beam_angle_not_list.py | 2 +- testing_archive/test_beam_angle_not_num.py | 2 +- testing_archive/test_beam_order_bad_index.py | 2 +- testing_archive/test_beam_order_dne.py | 2 +- testing_archive/test_beam_order_lists_bad_index.py | 2 +- testing_archive/test_beam_order_lists_not_ints.py | 2 +- testing_archive/test_beam_order_not_ints_or_lists.py | 2 +- testing_archive/test_beam_order_not_list.py | 2 +- testing_archive/test_clrfrqrng_not_2.py | 2 +- testing_archive/test_clrfrqrng_not_inc.py | 2 +- testing_archive/test_clrfrqrng_not_ints.py | 2 +- testing_archive/test_clrfrqrng_too_high.py | 2 +- testing_archive/test_clrfrqrng_too_low.py | 2 +- testing_archive/test_cpid_int.py | 2 +- testing_archive/test_cpid_pos.py | 2 +- testing_archive/test_cpid_unique.py | 2 +- testing_archive/test_del_slice_dne.py | 2 +- testing_archive/test_dm_rate_not_int.py | 2 +- testing_archive/test_edit_slice_bad_param.py | 2 +- testing_archive/test_edit_slice_dne.py | 2 +- testing_archive/test_edit_slice_improperly.py | 2 +- testing_archive/test_finalstage_bad_outputrate.py | 2 +- testing_archive/test_first_range_dne.py | 2 +- testing_archive/test_freq_not_num.py | 2 +- testing_archive/test_freq_restricted.py | 2 +- testing_archive/test_freq_too_high.py | 2 +- testing_archive/test_freq_too_low.py | 2 +- testing_archive/test_int_antenna_dne.py | 2 +- testing_archive/test_int_antenna_dups.py | 2 +- testing_archive/test_intn_not_int.py | 2 +- testing_archive/test_intt_longer_than_scanbound.py | 2 +- testing_archive/test_intt_longer_than_scanbounds.py | 2 +- testing_archive/test_intt_not_num.py | 2 +- testing_archive/test_intt_too_low.py | 2 +- testing_archive/test_lag_table_bad.py | 2 +- testing_archive/test_mismatched_dm_schemes.py | 2 +- testing_archive/test_mismatched_dm_schemes_aveperiod.py | 2 +- testing_archive/test_no_class.py | 2 +- testing_archive/test_no_freq_set.py | 2 +- testing_archive/test_no_inheritance.py | 2 +- testing_archive/test_no_intt_intn.py | 2 +- testing_archive/test_no_slices.py | 2 +- testing_archive/test_num_ranges_dne.py | 2 +- testing_archive/test_num_ranges_not_int.py | 2 +- testing_archive/test_output_rxrate_high.py | 2 +- testing_archive/test_ppo_bad_length.py | 2 +- testing_archive/test_ppo_not_1d.py | 2 +- testing_archive/test_ppo_np.py | 2 +- testing_archive/test_pulse_len_bad.py | 2 +- testing_archive/test_pulse_len_dne.py | 2 +- testing_archive/test_pulse_len_not_int.py | 2 +- testing_archive/test_pulse_len_too_high.py | 2 +- testing_archive/test_pulse_len_too_low.py | 2 +- testing_archive/test_rx_antenna_dne.py | 2 +- testing_archive/test_rx_antenna_dups.py | 2 +- testing_archive/test_rx_int_antenna_invalid.py | 2 +- testing_archive/test_rx_main_antenna_invalid.py | 2 +- testing_archive/test_rxbw_not_divisible.py | 2 +- testing_archive/test_rxonly_dne.py | 2 +- testing_archive/test_rxrate_high.py | 2 +- testing_archive/test_scanbound_but_no_intt.py | 2 +- testing_archive/test_scanbound_dne.py | 2 +- testing_archive/test_scanbound_negative.py | 2 +- testing_archive/test_scanbound_not_increasing.py | 2 +- testing_archive/test_seq_not_increasing.py | 2 +- testing_archive/test_sequence_dne.py | 2 +- testing_archive/test_sequence_not_int.py | 2 +- testing_archive/test_sequence_not_list.py | 2 +- testing_archive/test_slices_beam_order_bad.py | 2 +- testing_archive/test_slices_intn_bad.py | 2 +- testing_archive/test_slices_intt_bad.py | 2 +- testing_archive/test_slices_scanbound_bad.py | 2 +- testing_archive/test_stage0_bad_inputrate.py | 4 ++-- testing_archive/test_stagex_bad_outputrate.py | 4 ++-- testing_archive/test_taps_not_list.py | 4 ++-- testing_archive/test_taps_not_nums.py | 4 ++-- testing_archive/test_tau_dne.py | 2 +- testing_archive/test_tau_not_int.py | 2 +- testing_archive/test_tau_not_multiple.py | 2 +- testing_archive/test_tau_too_small.py | 2 +- testing_archive/test_too_many_dm_stages.py | 2 +- testing_archive/test_too_many_int_antennas.py | 2 +- testing_archive/test_too_many_rx_antennas.py | 2 +- testing_archive/test_too_many_tx_antennas.py | 2 +- testing_archive/test_two_classes.py | 2 +- testing_archive/test_tx_antenna_dne.py | 2 +- testing_archive/test_tx_antenna_dups.py | 2 +- testing_archive/test_tx_antenna_invalid.py | 2 +- testing_archive/test_tx_antenna_pattern_dim_mismatch.py | 2 +- testing_archive/test_tx_antenna_pattern_magnitude.py | 2 +- testing_archive/test_tx_antenna_pattern_not_2d.py | 2 +- testing_archive/test_tx_antenna_pattern_not_callable.py | 2 +- testing_archive/test_tx_antenna_pattern_not_numpy.py | 2 +- testing_archive/test_tx_beam_order_dne.py | 2 +- testing_archive/test_tx_beam_order_list_not_ints.py | 2 +- testing_archive/test_tx_beam_order_listnum_too_high.py | 2 +- .../test_tx_beam_order_mismatch_tx_antenna_pattern.py | 2 +- testing_archive/test_tx_beam_order_not_list.py | 2 +- testing_archive/test_tx_beam_order_not_same_len_as_rx.py | 2 +- testing_archive/test_txbw_not_divisible.py | 2 +- testing_archive/test_txrate_high.py | 2 +- testing_archive/test_unused_param.py | 2 +- testing_archive/test_wait_for_first_scanbound_type.py | 2 +- 125 files changed, 129 insertions(+), 129 deletions(-) diff --git a/IB_collab_mode.py b/IB_collab_mode.py index d812655..e6ec0b0 100644 --- a/IB_collab_mode.py +++ b/IB_collab_mode.py @@ -15,7 +15,7 @@ from experiment_prototype.experiment_prototype import ExperimentPrototype import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation diff --git a/experiment_archive/normalscan.py b/experiment_archive/normalscan.py index 1e2e11c..9fd445e 100644 --- a/experiment_archive/normalscan.py +++ b/experiment_archive/normalscan.py @@ -2,7 +2,7 @@ # write an experiment that creates a new control program. from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import DecimationStage, DecimationScheme +from experiment_prototype.experiment_utils.decimation_scheme import DecimationStage, DecimationScheme from borealis_experiments.test_decimation_schemes import * class Normalscan(ExperimentPrototype): diff --git a/experiment_archive/test_decimation_schemes.py b/experiment_archive/test_decimation_schemes.py index f2273f8..1de9729 100644 --- a/experiment_archive/test_decimation_schemes.py +++ b/experiment_archive/test_decimation_schemes.py @@ -3,7 +3,7 @@ import os import sys -from experiment_prototype.decimation_scheme.decimation_scheme import DecimationStage, DecimationScheme, \ +from experiment_prototype.experiment_utils.decimation_scheme import DecimationStage, DecimationScheme, \ create_firwin_filter_by_num_taps, create_firwin_filter_by_attenuation diff --git a/experiment_archive/test_filters_1.py b/experiment_archive/test_filters_1.py index 604af79..e5dc769 100644 --- a/experiment_archive/test_filters_1.py +++ b/experiment_archive/test_filters_1.py @@ -6,7 +6,7 @@ sys.path.append(os.environ['BOREALISPATH']) # write an experiment that creates a new control program. from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import DecimationStage, DecimationScheme +from experiment_prototype.experiment_utils.decimation_scheme import DecimationStage, DecimationScheme from borealis_experiments.test_decimation_schemes import * class OneBox(ExperimentPrototype): diff --git a/experiment_archive/test_scheme_9.py b/experiment_archive/test_scheme_9.py index f65a163..df6ebad 100644 --- a/experiment_archive/test_scheme_9.py +++ b/experiment_archive/test_scheme_9.py @@ -6,7 +6,7 @@ sys.path.append(os.environ['BOREALISPATH']) # write an experiment that creates a new control program. from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import DecimationStage, DecimationScheme +from experiment_prototype.experiment_utils.decimation_scheme import DecimationStage, DecimationScheme from borealis_experiments.test_decimation_schemes import * class TestScheme9(ExperimentPrototype): diff --git a/experiment_archive/test_scheme_9_acfs.py b/experiment_archive/test_scheme_9_acfs.py index 8a59c8c..73e9af4 100644 --- a/experiment_archive/test_scheme_9_acfs.py +++ b/experiment_archive/test_scheme_9_acfs.py @@ -6,7 +6,7 @@ sys.path.append(os.environ['BOREALISPATH']) # write an experiment that creates a new control program. from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import DecimationStage, DecimationScheme +from experiment_prototype.experiment_utils.decimation_scheme import DecimationStage, DecimationScheme from borealis_experiments.test_decimation_schemes import * class TestScheme9ACFs(ExperimentPrototype): diff --git a/experiment_archive/twofsound.py b/experiment_archive/twofsound.py index 0117338..150027c 100644 --- a/experiment_archive/twofsound.py +++ b/experiment_archive/twofsound.py @@ -9,7 +9,7 @@ #import test from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import DecimationStage, DecimationScheme +from experiment_prototype.experiment_utils.decimation_scheme import DecimationStage, DecimationScheme from borealis_experiments.test_decimation_schemes import * class Twofsound(ExperimentPrototype): diff --git a/full_fov_15km.py b/full_fov_15km.py index bf6ea53..27e9bab 100644 --- a/full_fov_15km.py +++ b/full_fov_15km.py @@ -13,7 +13,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation diff --git a/testing_archive/deprecated_tests/test_beam_order_too_long.py b/testing_archive/deprecated_tests/test_beam_order_too_long.py index 7f26379..41d3763 100644 --- a/testing_archive/deprecated_tests/test_beam_order_too_long.py +++ b/testing_archive/deprecated_tests/test_beam_order_too_long.py @@ -11,7 +11,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/deprecated_tests/test_clrfrqrng_not_list.py b/testing_archive/deprecated_tests/test_clrfrqrng_not_list.py index 6c66b3f..5f1ca0b 100644 --- a/testing_archive/deprecated_tests/test_clrfrqrng_not_list.py +++ b/testing_archive/deprecated_tests/test_clrfrqrng_not_list.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/deprecated_tests/test_first_range_not_float.py b/testing_archive/deprecated_tests/test_first_range_not_float.py index a71bd05..4d264ac 100644 --- a/testing_archive/deprecated_tests/test_first_range_not_float.py +++ b/testing_archive/deprecated_tests/test_first_range_not_float.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/deprecated_tests/test_scanbound_bad_len.py b/testing_archive/deprecated_tests/test_scanbound_bad_len.py index b956a2d..ab6ab8d 100644 --- a/testing_archive/deprecated_tests/test_scanbound_bad_len.py +++ b/testing_archive/deprecated_tests/test_scanbound_bad_len.py @@ -11,7 +11,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/deprecated_tests/test_scheme_9.py b/testing_archive/deprecated_tests/test_scheme_9.py index f65a163..df6ebad 100644 --- a/testing_archive/deprecated_tests/test_scheme_9.py +++ b/testing_archive/deprecated_tests/test_scheme_9.py @@ -6,7 +6,7 @@ sys.path.append(os.environ['BOREALISPATH']) # write an experiment that creates a new control program. from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import DecimationStage, DecimationScheme +from experiment_prototype.experiment_utils.decimation_scheme import DecimationStage, DecimationScheme from borealis_experiments.test_decimation_schemes import * class TestScheme9(ExperimentPrototype): diff --git a/testing_archive/deprecated_tests/test_scheme_9_acfs.py b/testing_archive/deprecated_tests/test_scheme_9_acfs.py index 8a59c8c..73e9af4 100644 --- a/testing_archive/deprecated_tests/test_scheme_9_acfs.py +++ b/testing_archive/deprecated_tests/test_scheme_9_acfs.py @@ -6,7 +6,7 @@ sys.path.append(os.environ['BOREALISPATH']) # write an experiment that creates a new control program. from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import DecimationStage, DecimationScheme +from experiment_prototype.experiment_utils.decimation_scheme import DecimationStage, DecimationScheme from borealis_experiments.test_decimation_schemes import * class TestScheme9ACFs(ExperimentPrototype): diff --git a/testing_archive/deprecated_tests/test_too_many_slices.py b/testing_archive/deprecated_tests/test_too_many_slices.py index ec6f61f..7258f4c 100644 --- a/testing_archive/deprecated_tests/test_too_many_slices.py +++ b/testing_archive/deprecated_tests/test_too_many_slices.py @@ -12,7 +12,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_avg_method_dne.py b/testing_archive/test_avg_method_dne.py index 4ffc120..40f9b6c 100644 --- a/testing_archive/test_avg_method_dne.py +++ b/testing_archive/test_avg_method_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_bad_interface.py b/testing_archive/test_bad_interface.py index aedc2e3..bfcd9b8 100644 --- a/testing_archive/test_bad_interface.py +++ b/testing_archive/test_bad_interface.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException from pydantic import ValidationError diff --git a/testing_archive/test_bad_interfacing.py b/testing_archive/test_bad_interfacing.py index d2cc1b0..4b28b46 100644 --- a/testing_archive/test_bad_interfacing.py +++ b/testing_archive/test_bad_interfacing.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_bad_slice_id.py b/testing_archive/test_bad_slice_id.py index 4dbf9a8..1d26412 100644 --- a/testing_archive/test_bad_slice_id.py +++ b/testing_archive/test_bad_slice_id.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_beam_angle_dne.py b/testing_archive/test_beam_angle_dne.py index d4e35f6..9d893b4 100644 --- a/testing_archive/test_beam_angle_dne.py +++ b/testing_archive/test_beam_angle_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): diff --git a/testing_archive/test_beam_angle_dups.py b/testing_archive/test_beam_angle_dups.py index 5462704..f9cee03 100644 --- a/testing_archive/test_beam_angle_dups.py +++ b/testing_archive/test_beam_angle_dups.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_beam_angle_not_increasing.py b/testing_archive/test_beam_angle_not_increasing.py index 83074d7..d214038 100644 --- a/testing_archive/test_beam_angle_not_increasing.py +++ b/testing_archive/test_beam_angle_not_increasing.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_beam_angle_not_list.py b/testing_archive/test_beam_angle_not_list.py index 5a82724..cf203b8 100644 --- a/testing_archive/test_beam_angle_not_list.py +++ b/testing_archive/test_beam_angle_not_list.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_beam_angle_not_num.py b/testing_archive/test_beam_angle_not_num.py index 92dc37e..ed81170 100644 --- a/testing_archive/test_beam_angle_not_num.py +++ b/testing_archive/test_beam_angle_not_num.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_beam_order_bad_index.py b/testing_archive/test_beam_order_bad_index.py index 3d81c5a..ab38722 100644 --- a/testing_archive/test_beam_order_bad_index.py +++ b/testing_archive/test_beam_order_bad_index.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_beam_order_dne.py b/testing_archive/test_beam_order_dne.py index c3b5523..0fc10a1 100644 --- a/testing_archive/test_beam_order_dne.py +++ b/testing_archive/test_beam_order_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): diff --git a/testing_archive/test_beam_order_lists_bad_index.py b/testing_archive/test_beam_order_lists_bad_index.py index 6f4fe05..a11816e 100644 --- a/testing_archive/test_beam_order_lists_bad_index.py +++ b/testing_archive/test_beam_order_lists_bad_index.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_beam_order_lists_not_ints.py b/testing_archive/test_beam_order_lists_not_ints.py index 4baea38..d629ee1 100644 --- a/testing_archive/test_beam_order_lists_not_ints.py +++ b/testing_archive/test_beam_order_lists_not_ints.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_beam_order_not_ints_or_lists.py b/testing_archive/test_beam_order_not_ints_or_lists.py index ce47548..c7477ed 100644 --- a/testing_archive/test_beam_order_not_ints_or_lists.py +++ b/testing_archive/test_beam_order_not_ints_or_lists.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_beam_order_not_list.py b/testing_archive/test_beam_order_not_list.py index 6e5c8ec..9329c73 100644 --- a/testing_archive/test_beam_order_not_list.py +++ b/testing_archive/test_beam_order_not_list.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_clrfrqrng_not_2.py b/testing_archive/test_clrfrqrng_not_2.py index bba241f..b28d006 100644 --- a/testing_archive/test_clrfrqrng_not_2.py +++ b/testing_archive/test_clrfrqrng_not_2.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_clrfrqrng_not_inc.py b/testing_archive/test_clrfrqrng_not_inc.py index dcf9284..89004e3 100644 --- a/testing_archive/test_clrfrqrng_not_inc.py +++ b/testing_archive/test_clrfrqrng_not_inc.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_clrfrqrng_not_ints.py b/testing_archive/test_clrfrqrng_not_ints.py index de638ba..df534ce 100644 --- a/testing_archive/test_clrfrqrng_not_ints.py +++ b/testing_archive/test_clrfrqrng_not_ints.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_clrfrqrng_too_high.py b/testing_archive/test_clrfrqrng_too_high.py index 57539ad..261db82 100644 --- a/testing_archive/test_clrfrqrng_too_high.py +++ b/testing_archive/test_clrfrqrng_too_high.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_clrfrqrng_too_low.py b/testing_archive/test_clrfrqrng_too_low.py index 4922521..44590c5 100644 --- a/testing_archive/test_clrfrqrng_too_low.py +++ b/testing_archive/test_clrfrqrng_too_low.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_cpid_int.py b/testing_archive/test_cpid_int.py index 0767d15..9bac770 100644 --- a/testing_archive/test_cpid_int.py +++ b/testing_archive/test_cpid_int.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_cpid_pos.py b/testing_archive/test_cpid_pos.py index ff2db75..d6a0fd1 100644 --- a/testing_archive/test_cpid_pos.py +++ b/testing_archive/test_cpid_pos.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_cpid_unique.py b/testing_archive/test_cpid_unique.py index f0533a6..8abb445 100644 --- a/testing_archive/test_cpid_unique.py +++ b/testing_archive/test_cpid_unique.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_del_slice_dne.py b/testing_archive/test_del_slice_dne.py index b18a4a7..bc8aa5c 100644 --- a/testing_archive/test_del_slice_dne.py +++ b/testing_archive/test_del_slice_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_dm_rate_not_int.py b/testing_archive/test_dm_rate_not_int.py index d729958..af29394 100644 --- a/testing_archive/test_dm_rate_not_int.py +++ b/testing_archive/test_dm_rate_not_int.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_edit_slice_bad_param.py b/testing_archive/test_edit_slice_bad_param.py index 0a25135..2ef6eae 100644 --- a/testing_archive/test_edit_slice_bad_param.py +++ b/testing_archive/test_edit_slice_bad_param.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_edit_slice_dne.py b/testing_archive/test_edit_slice_dne.py index 20470a1..96cd1dd 100644 --- a/testing_archive/test_edit_slice_dne.py +++ b/testing_archive/test_edit_slice_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_edit_slice_improperly.py b/testing_archive/test_edit_slice_improperly.py index b125697..be4b68f 100644 --- a/testing_archive/test_edit_slice_improperly.py +++ b/testing_archive/test_edit_slice_improperly.py @@ -6,7 +6,7 @@ """ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): diff --git a/testing_archive/test_finalstage_bad_outputrate.py b/testing_archive/test_finalstage_bad_outputrate.py index a5d3efa..136e1eb 100644 --- a/testing_archive/test_finalstage_bad_outputrate.py +++ b/testing_archive/test_finalstage_bad_outputrate.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_first_range_dne.py b/testing_archive/test_first_range_dne.py index e40d883..f5b6962 100644 --- a/testing_archive/test_first_range_dne.py +++ b/testing_archive/test_first_range_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): diff --git a/testing_archive/test_freq_not_num.py b/testing_archive/test_freq_not_num.py index 0864267..c6ba0c8 100644 --- a/testing_archive/test_freq_not_num.py +++ b/testing_archive/test_freq_not_num.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_freq_restricted.py b/testing_archive/test_freq_restricted.py index 2c060e1..977237b 100644 --- a/testing_archive/test_freq_restricted.py +++ b/testing_archive/test_freq_restricted.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_freq_too_high.py b/testing_archive/test_freq_too_high.py index 2c8eef9..46162c5 100644 --- a/testing_archive/test_freq_too_high.py +++ b/testing_archive/test_freq_too_high.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_freq_too_low.py b/testing_archive/test_freq_too_low.py index e4dc25b..52dad20 100644 --- a/testing_archive/test_freq_too_low.py +++ b/testing_archive/test_freq_too_low.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_int_antenna_dne.py b/testing_archive/test_int_antenna_dne.py index 9b4c2f8..9b6c4ed 100644 --- a/testing_archive/test_int_antenna_dne.py +++ b/testing_archive/test_int_antenna_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_int_antenna_dups.py b/testing_archive/test_int_antenna_dups.py index cf873c2..099af8b 100644 --- a/testing_archive/test_int_antenna_dups.py +++ b/testing_archive/test_int_antenna_dups.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_intn_not_int.py b/testing_archive/test_intn_not_int.py index c541f68..fb32b09 100644 --- a/testing_archive/test_intn_not_int.py +++ b/testing_archive/test_intn_not_int.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_intt_longer_than_scanbound.py b/testing_archive/test_intt_longer_than_scanbound.py index addfff9..35bbc1b 100644 --- a/testing_archive/test_intt_longer_than_scanbound.py +++ b/testing_archive/test_intt_longer_than_scanbound.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_intt_longer_than_scanbounds.py b/testing_archive/test_intt_longer_than_scanbounds.py index a6cad66..ab1f620 100644 --- a/testing_archive/test_intt_longer_than_scanbounds.py +++ b/testing_archive/test_intt_longer_than_scanbounds.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_intt_not_num.py b/testing_archive/test_intt_not_num.py index b911154..4ee83ab 100644 --- a/testing_archive/test_intt_not_num.py +++ b/testing_archive/test_intt_not_num.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_intt_too_low.py b/testing_archive/test_intt_too_low.py index a5d0a82..fba7cda 100644 --- a/testing_archive/test_intt_too_low.py +++ b/testing_archive/test_intt_too_low.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_lag_table_bad.py b/testing_archive/test_lag_table_bad.py index 75f154c..4d9e11f 100644 --- a/testing_archive/test_lag_table_bad.py +++ b/testing_archive/test_lag_table_bad.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_mismatched_dm_schemes.py b/testing_archive/test_mismatched_dm_schemes.py index b69a59b..08b1271 100644 --- a/testing_archive/test_mismatched_dm_schemes.py +++ b/testing_archive/test_mismatched_dm_schemes.py @@ -8,7 +8,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation, create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_mismatched_dm_schemes_aveperiod.py b/testing_archive/test_mismatched_dm_schemes_aveperiod.py index 70d7950..6281264 100644 --- a/testing_archive/test_mismatched_dm_schemes_aveperiod.py +++ b/testing_archive/test_mismatched_dm_schemes_aveperiod.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation, create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_no_class.py b/testing_archive/test_no_class.py index 0821104..80362c8 100644 --- a/testing_archive/test_no_class.py +++ b/testing_archive/test_no_class.py @@ -6,7 +6,7 @@ """ import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme ### class TestExperiment(ExperimentPrototype): diff --git a/testing_archive/test_no_freq_set.py b/testing_archive/test_no_freq_set.py index 02ed61e..21b204e 100644 --- a/testing_archive/test_no_freq_set.py +++ b/testing_archive/test_no_freq_set.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_no_inheritance.py b/testing_archive/test_no_inheritance.py index ff36d40..a4cca97 100644 --- a/testing_archive/test_no_inheritance.py +++ b/testing_archive/test_no_inheritance.py @@ -6,7 +6,7 @@ """ import borealis_experiments.superdarn_common_fields as scf -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_no_intt_intn.py b/testing_archive/test_no_intt_intn.py index 2d4e454..d1df713 100644 --- a/testing_archive/test_no_intt_intn.py +++ b/testing_archive/test_no_intt_intn.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_no_slices.py b/testing_archive/test_no_slices.py index 46b9921..030beae 100644 --- a/testing_archive/test_no_slices.py +++ b/testing_archive/test_no_slices.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_num_ranges_dne.py b/testing_archive/test_num_ranges_dne.py index 020e3b0..03fa748 100644 --- a/testing_archive/test_num_ranges_dne.py +++ b/testing_archive/test_num_ranges_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): diff --git a/testing_archive/test_num_ranges_not_int.py b/testing_archive/test_num_ranges_not_int.py index 51306d9..4f493d7 100644 --- a/testing_archive/test_num_ranges_not_int.py +++ b/testing_archive/test_num_ranges_not_int.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_output_rxrate_high.py b/testing_archive/test_output_rxrate_high.py index 7093f2d..13356fb 100644 --- a/testing_archive/test_output_rxrate_high.py +++ b/testing_archive/test_output_rxrate_high.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_ppo_bad_length.py b/testing_archive/test_ppo_bad_length.py index 8f48330..30d3d50 100644 --- a/testing_archive/test_ppo_bad_length.py +++ b/testing_archive/test_ppo_bad_length.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_ppo_not_1d.py b/testing_archive/test_ppo_not_1d.py index 0807fc7..e9a1060 100644 --- a/testing_archive/test_ppo_not_1d.py +++ b/testing_archive/test_ppo_not_1d.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_ppo_np.py b/testing_archive/test_ppo_np.py index 73b23d6..bd0db8d 100644 --- a/testing_archive/test_ppo_np.py +++ b/testing_archive/test_ppo_np.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_pulse_len_bad.py b/testing_archive/test_pulse_len_bad.py index ebeb92e..e416ed3 100644 --- a/testing_archive/test_pulse_len_bad.py +++ b/testing_archive/test_pulse_len_bad.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_pulse_len_dne.py b/testing_archive/test_pulse_len_dne.py index 69a9d42..db35a6b 100644 --- a/testing_archive/test_pulse_len_dne.py +++ b/testing_archive/test_pulse_len_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): diff --git a/testing_archive/test_pulse_len_not_int.py b/testing_archive/test_pulse_len_not_int.py index c162811..f010af8 100644 --- a/testing_archive/test_pulse_len_not_int.py +++ b/testing_archive/test_pulse_len_not_int.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_pulse_len_too_high.py b/testing_archive/test_pulse_len_too_high.py index 3789ac3..af069ff 100644 --- a/testing_archive/test_pulse_len_too_high.py +++ b/testing_archive/test_pulse_len_too_high.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_pulse_len_too_low.py b/testing_archive/test_pulse_len_too_low.py index 3c3eda8..8ce58ae 100644 --- a/testing_archive/test_pulse_len_too_low.py +++ b/testing_archive/test_pulse_len_too_low.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation from pydantic import ValidationError diff --git a/testing_archive/test_rx_antenna_dne.py b/testing_archive/test_rx_antenna_dne.py index 068c6cd..ea25e72 100644 --- a/testing_archive/test_rx_antenna_dne.py +++ b/testing_archive/test_rx_antenna_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_rx_antenna_dups.py b/testing_archive/test_rx_antenna_dups.py index 2d31f27..10edb24 100644 --- a/testing_archive/test_rx_antenna_dups.py +++ b/testing_archive/test_rx_antenna_dups.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_rx_int_antenna_invalid.py b/testing_archive/test_rx_int_antenna_invalid.py index 119a7c9..79e5fa8 100644 --- a/testing_archive/test_rx_int_antenna_invalid.py +++ b/testing_archive/test_rx_int_antenna_invalid.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_rx_main_antenna_invalid.py b/testing_archive/test_rx_main_antenna_invalid.py index d247354..de50b6e 100644 --- a/testing_archive/test_rx_main_antenna_invalid.py +++ b/testing_archive/test_rx_main_antenna_invalid.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_rxbw_not_divisible.py b/testing_archive/test_rxbw_not_divisible.py index c94ef50..5c5c706 100644 --- a/testing_archive/test_rxbw_not_divisible.py +++ b/testing_archive/test_rxbw_not_divisible.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_rxonly_dne.py b/testing_archive/test_rxonly_dne.py index 771c4f2..6fffe4f 100644 --- a/testing_archive/test_rxonly_dne.py +++ b/testing_archive/test_rxonly_dne.py @@ -10,7 +10,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_rxrate_high.py b/testing_archive/test_rxrate_high.py index 4b1bb2e..2809575 100644 --- a/testing_archive/test_rxrate_high.py +++ b/testing_archive/test_rxrate_high.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_scanbound_but_no_intt.py b/testing_archive/test_scanbound_but_no_intt.py index ebca80f..0d63dc8 100644 --- a/testing_archive/test_scanbound_but_no_intt.py +++ b/testing_archive/test_scanbound_but_no_intt.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_scanbound_dne.py b/testing_archive/test_scanbound_dne.py index 1740178..de2c72a 100644 --- a/testing_archive/test_scanbound_dne.py +++ b/testing_archive/test_scanbound_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_scanbound_negative.py b/testing_archive/test_scanbound_negative.py index 0f089f2..cc6aec0 100644 --- a/testing_archive/test_scanbound_negative.py +++ b/testing_archive/test_scanbound_negative.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_scanbound_not_increasing.py b/testing_archive/test_scanbound_not_increasing.py index 703108f..607fc37 100644 --- a/testing_archive/test_scanbound_not_increasing.py +++ b/testing_archive/test_scanbound_not_increasing.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_seq_not_increasing.py b/testing_archive/test_seq_not_increasing.py index ba72d4a..68688ff 100644 --- a/testing_archive/test_seq_not_increasing.py +++ b/testing_archive/test_seq_not_increasing.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_sequence_dne.py b/testing_archive/test_sequence_dne.py index 602d6e0..ec32736 100644 --- a/testing_archive/test_sequence_dne.py +++ b/testing_archive/test_sequence_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): diff --git a/testing_archive/test_sequence_not_int.py b/testing_archive/test_sequence_not_int.py index d06cb78..60ff864 100644 --- a/testing_archive/test_sequence_not_int.py +++ b/testing_archive/test_sequence_not_int.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_sequence_not_list.py b/testing_archive/test_sequence_not_list.py index e23def7..0e273c8 100644 --- a/testing_archive/test_sequence_not_list.py +++ b/testing_archive/test_sequence_not_list.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_slices_beam_order_bad.py b/testing_archive/test_slices_beam_order_bad.py index fbf1d8b..aa674da 100644 --- a/testing_archive/test_slices_beam_order_bad.py +++ b/testing_archive/test_slices_beam_order_bad.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_slices_intn_bad.py b/testing_archive/test_slices_intn_bad.py index a085b1d..f8b8a51 100644 --- a/testing_archive/test_slices_intn_bad.py +++ b/testing_archive/test_slices_intn_bad.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_slices_intt_bad.py b/testing_archive/test_slices_intt_bad.py index 3d9574b..bbf113b 100644 --- a/testing_archive/test_slices_intt_bad.py +++ b/testing_archive/test_slices_intt_bad.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_slices_scanbound_bad.py b/testing_archive/test_slices_scanbound_bad.py index 63620a7..7e14c0b 100644 --- a/testing_archive/test_slices_scanbound_bad.py +++ b/testing_archive/test_slices_scanbound_bad.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_stage0_bad_inputrate.py b/testing_archive/test_stage0_bad_inputrate.py index 83bad7f..aa0c6b1 100644 --- a/testing_archive/test_stage0_bad_inputrate.py +++ b/testing_archive/test_stage0_bad_inputrate.py @@ -7,9 +7,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_stagex_bad_outputrate.py b/testing_archive/test_stagex_bad_outputrate.py index 65715a3..3211d40 100644 --- a/testing_archive/test_stagex_bad_outputrate.py +++ b/testing_archive/test_stagex_bad_outputrate.py @@ -7,9 +7,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_taps_not_list.py b/testing_archive/test_taps_not_list.py index 2e1e5a2..7aabeae 100644 --- a/testing_archive/test_taps_not_list.py +++ b/testing_archive/test_taps_not_list.py @@ -7,9 +7,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_taps_not_nums.py b/testing_archive/test_taps_not_nums.py index 083c072..d76fd53 100644 --- a/testing_archive/test_taps_not_nums.py +++ b/testing_archive/test_taps_not_nums.py @@ -7,9 +7,9 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_tau_dne.py b/testing_archive/test_tau_dne.py index 78a7d7d..84cc484 100644 --- a/testing_archive/test_tau_dne.py +++ b/testing_archive/test_tau_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme class TestExperiment(ExperimentPrototype): diff --git a/testing_archive/test_tau_not_int.py b/testing_archive/test_tau_not_int.py index 780c736..005f429 100644 --- a/testing_archive/test_tau_not_int.py +++ b/testing_archive/test_tau_not_int.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tau_not_multiple.py b/testing_archive/test_tau_not_multiple.py index f389c93..1465067 100644 --- a/testing_archive/test_tau_not_multiple.py +++ b/testing_archive/test_tau_not_multiple.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tau_too_small.py b/testing_archive/test_tau_too_small.py index 2c5e9ad..76d0184 100644 --- a/testing_archive/test_tau_too_small.py +++ b/testing_archive/test_tau_too_small.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_too_many_dm_stages.py b/testing_archive/test_too_many_dm_stages.py index e06be79..44f5fbc 100644 --- a/testing_archive/test_too_many_dm_stages.py +++ b/testing_archive/test_too_many_dm_stages.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import \ +from experiment_prototype.experiment_utils.decimation_scheme import \ DecimationScheme, DecimationStage, create_firwin_filter_by_attenuation from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_too_many_int_antennas.py b/testing_archive/test_too_many_int_antennas.py index 811ba24..b45ca8e 100644 --- a/testing_archive/test_too_many_int_antennas.py +++ b/testing_archive/test_too_many_int_antennas.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_too_many_rx_antennas.py b/testing_archive/test_too_many_rx_antennas.py index 82d3c3f..bab317b 100644 --- a/testing_archive/test_too_many_rx_antennas.py +++ b/testing_archive/test_too_many_rx_antennas.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_too_many_tx_antennas.py b/testing_archive/test_too_many_tx_antennas.py index 35a4733..5e63c06 100644 --- a/testing_archive/test_too_many_tx_antennas.py +++ b/testing_archive/test_too_many_tx_antennas.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_two_classes.py b/testing_archive/test_two_classes.py index 7c62c30..0d68cbd 100644 --- a/testing_archive/test_two_classes.py +++ b/testing_archive/test_two_classes.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_tx_antenna_dne.py b/testing_archive/test_tx_antenna_dne.py index 3e48cbc..05c59d7 100644 --- a/testing_archive/test_tx_antenna_dne.py +++ b/testing_archive/test_tx_antenna_dne.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_antenna_dups.py b/testing_archive/test_tx_antenna_dups.py index fb0f935..af20d8d 100644 --- a/testing_archive/test_tx_antenna_dups.py +++ b/testing_archive/test_tx_antenna_dups.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_antenna_invalid.py b/testing_archive/test_tx_antenna_invalid.py index 0343928..e133046 100644 --- a/testing_archive/test_tx_antenna_invalid.py +++ b/testing_archive/test_tx_antenna_invalid.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_antenna_pattern_dim_mismatch.py b/testing_archive/test_tx_antenna_pattern_dim_mismatch.py index f084c55..3018c8d 100644 --- a/testing_archive/test_tx_antenna_pattern_dim_mismatch.py +++ b/testing_archive/test_tx_antenna_pattern_dim_mismatch.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_antenna_pattern_magnitude.py b/testing_archive/test_tx_antenna_pattern_magnitude.py index 0e5209d..8718baf 100644 --- a/testing_archive/test_tx_antenna_pattern_magnitude.py +++ b/testing_archive/test_tx_antenna_pattern_magnitude.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_antenna_pattern_not_2d.py b/testing_archive/test_tx_antenna_pattern_not_2d.py index 876ad8f..7b7fdf6 100644 --- a/testing_archive/test_tx_antenna_pattern_not_2d.py +++ b/testing_archive/test_tx_antenna_pattern_not_2d.py @@ -8,7 +8,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_antenna_pattern_not_callable.py b/testing_archive/test_tx_antenna_pattern_not_callable.py index 26657ce..1518f4d 100644 --- a/testing_archive/test_tx_antenna_pattern_not_callable.py +++ b/testing_archive/test_tx_antenna_pattern_not_callable.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_antenna_pattern_not_numpy.py b/testing_archive/test_tx_antenna_pattern_not_numpy.py index 0c6ba23..d01da1d 100644 --- a/testing_archive/test_tx_antenna_pattern_not_numpy.py +++ b/testing_archive/test_tx_antenna_pattern_not_numpy.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_beam_order_dne.py b/testing_archive/test_tx_beam_order_dne.py index f75d0ee..ea25104 100644 --- a/testing_archive/test_tx_beam_order_dne.py +++ b/testing_archive/test_tx_beam_order_dne.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_beam_order_list_not_ints.py b/testing_archive/test_tx_beam_order_list_not_ints.py index de11055..1909948 100644 --- a/testing_archive/test_tx_beam_order_list_not_ints.py +++ b/testing_archive/test_tx_beam_order_list_not_ints.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_beam_order_listnum_too_high.py b/testing_archive/test_tx_beam_order_listnum_too_high.py index 6f90830..ea68130 100644 --- a/testing_archive/test_tx_beam_order_listnum_too_high.py +++ b/testing_archive/test_tx_beam_order_listnum_too_high.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_beam_order_mismatch_tx_antenna_pattern.py b/testing_archive/test_tx_beam_order_mismatch_tx_antenna_pattern.py index 0892595..d7fe1d3 100644 --- a/testing_archive/test_tx_beam_order_mismatch_tx_antenna_pattern.py +++ b/testing_archive/test_tx_beam_order_mismatch_tx_antenna_pattern.py @@ -9,7 +9,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_beam_order_not_list.py b/testing_archive/test_tx_beam_order_not_list.py index c63af44..39a8266 100644 --- a/testing_archive/test_tx_beam_order_not_list.py +++ b/testing_archive/test_tx_beam_order_not_list.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_tx_beam_order_not_same_len_as_rx.py b/testing_archive/test_tx_beam_order_not_same_len_as_rx.py index c348acb..6c3c15c 100644 --- a/testing_archive/test_tx_beam_order_not_same_len_as_rx.py +++ b/testing_archive/test_tx_beam_order_not_same_len_as_rx.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from pydantic import ValidationError diff --git a/testing_archive/test_txbw_not_divisible.py b/testing_archive/test_txbw_not_divisible.py index 246644a..aedffc9 100644 --- a/testing_archive/test_txbw_not_divisible.py +++ b/testing_archive/test_txbw_not_divisible.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_txrate_high.py b/testing_archive/test_txrate_high.py index c19c978..07f2806 100644 --- a/testing_archive/test_txrate_high.py +++ b/testing_archive/test_txrate_high.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_unused_param.py b/testing_archive/test_unused_param.py index 926bbbd..432c69b 100644 --- a/testing_archive/test_unused_param.py +++ b/testing_archive/test_unused_param.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException diff --git a/testing_archive/test_wait_for_first_scanbound_type.py b/testing_archive/test_wait_for_first_scanbound_type.py index bc6219c..b26a995 100644 --- a/testing_archive/test_wait_for_first_scanbound_type.py +++ b/testing_archive/test_wait_for_first_scanbound_type.py @@ -7,7 +7,7 @@ import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype -from experiment_prototype.decimation_scheme.decimation_scheme import create_default_scheme +from experiment_prototype.experiment_utils.decimation_scheme import create_default_scheme from experiment_prototype.experiment_exception import ExperimentException from pydantic import ValidationError From 50358bc2a36aa9655bd9419988e573f8bb30e290 Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Mon, 20 Nov 2023 14:35:39 +0000 Subject: [PATCH 06/13] Added in epop2023 experiment that was in Borealis main branch. --- epop2023.py | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 epop2023.py diff --git a/epop2023.py b/epop2023.py new file mode 100644 index 0000000..f4555f7 --- /dev/null +++ b/epop2023.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +""" +Copyright SuperDARN Canada 2023 +This mode was made for collaboration with the RRI instrument on the CASSIOPE satellite +by request of Dr. Kuldeep Pandey in February 2023. +""" + +import sys +import os +import numpy as np + +BOREALISPATH = os.environ['BOREALISPATH'] +sys.path.append(BOREALISPATH) + +import experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype + + +def boresight(frequency_khz, tx_antennas, antenna_spacing_m): + """tx_antenna_pattern function for boresight transmission.""" + num_antennas = scf.opts.main_antenna_count + pattern = np.zeros((1, num_antennas), dtype=np.complex64) + pattern[0, tx_antennas] = 1.0 + 0.0j + return pattern + + +class Epop2023(ExperimentPrototype): + def __init__(self, **kwargs): + """ + kwargs: + + freq: int, kHz + + """ + cpid = 3813 + super().__init__(cpid) + + num_ranges = scf.STD_NUM_RANGES + if scf.opts.site_id in ["cly", "rkn", "inv"]: + num_ranges = scf.POLARDARN_NUM_RANGES + + # default frequency set here + freq = scf.COMMON_MODE_FREQ_1 + + if kwargs: + if 'freq' in kwargs.keys(): + freq = int(kwargs['freq']) + + self.printing('Frequency set to {}'.format(freq)) + + slice_0 = { # slice_id = 0 + "pulse_sequence": scf.SEQUENCE_7P, + "tau_spacing": scf.TAU_SPACING_7P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": num_ranges, + "first_range": scf.STD_FIRST_RANGE, + "intt": 3500, # duration of an integration, in ms + "beam_angle": [0.0], # boresight only + "rx_beam_order": [0], # boresight only + "tx_beam_order": [0], # only one pattern + "tx_antenna_pattern": boresight, + "freq": freq, # kHz + "align_sequences": True, # align start of sequence to tenths of a second + } + + self.add_slice(slice_0) \ No newline at end of file From d3aa7b4a3f09474e90a22ae2ba99799d81bf7833 Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Mon, 20 Nov 2023 14:38:04 +0000 Subject: [PATCH 07/13] Bugfix with imports in epop2023.py --- epop2023.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/epop2023.py b/epop2023.py index f4555f7..d3a8789 100644 --- a/epop2023.py +++ b/epop2023.py @@ -5,14 +5,9 @@ by request of Dr. Kuldeep Pandey in February 2023. """ -import sys -import os import numpy as np -BOREALISPATH = os.environ['BOREALISPATH'] -sys.path.append(BOREALISPATH) - -import experiments.superdarn_common_fields as scf +import borealis_experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype From 7271ea91174c9b27e000dc3317ce28d035ed4378 Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Mon, 20 Nov 2023 15:01:20 +0000 Subject: [PATCH 08/13] Another tiny bugfix in epop2023.py --- epop2023.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epop2023.py b/epop2023.py index d3a8789..b8b64de 100644 --- a/epop2023.py +++ b/epop2023.py @@ -13,7 +13,7 @@ def boresight(frequency_khz, tx_antennas, antenna_spacing_m): """tx_antenna_pattern function for boresight transmission.""" - num_antennas = scf.opts.main_antenna_count + num_antennas = scf.options.main_antenna_count pattern = np.zeros((1, num_antennas), dtype=np.complex64) pattern[0, tx_antennas] = 1.0 + 0.0j return pattern @@ -31,7 +31,7 @@ def __init__(self, **kwargs): super().__init__(cpid) num_ranges = scf.STD_NUM_RANGES - if scf.opts.site_id in ["cly", "rkn", "inv"]: + if scf.options.site_id in ["cly", "rkn", "inv"]: num_ranges = scf.POLARDARN_NUM_RANGES # default frequency set here From 4a9c45829552f500324396bd657fd908517159cf Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Mon, 20 Nov 2023 15:05:36 +0000 Subject: [PATCH 09/13] Hopefully the last bug with epop2023.py --- epop2023.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epop2023.py b/epop2023.py index b8b64de..e2a1da1 100644 --- a/epop2023.py +++ b/epop2023.py @@ -41,7 +41,7 @@ def __init__(self, **kwargs): if 'freq' in kwargs.keys(): freq = int(kwargs['freq']) - self.printing('Frequency set to {}'.format(freq)) + print('Frequency set to {}'.format(freq)) slice_0 = { # slice_id = 0 "pulse_sequence": scf.SEQUENCE_7P, From 2c7d2b041688f1b4f061d58d914e4bd221257cb7 Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Mon, 20 Nov 2023 16:57:31 +0000 Subject: [PATCH 10/13] Added new multifrequency multistatic full FOV experiment. Untested. --- eeaao.py | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 eeaao.py diff --git a/eeaao.py b/eeaao.py new file mode 100644 index 0000000..31637b5 --- /dev/null +++ b/eeaao.py @@ -0,0 +1,108 @@ +#!/usr/bin/python + +""" + eeaao + ~~~~~~~~~~~~~ + The mode is a flexible multistatic multifrequency full FOV mode. + Transmit and receive frequencies are configured via command line arguments. + + :copyright: 2023 SuperDARN Canada + :author: Remington Rohel +""" +import copy + +import borealis_experiments.superdarn_common_fields as scf +from experiment_prototype.experiment_prototype import ExperimentPrototype + + +class EEAAO(ExperimentPrototype): + """ + This experiment is configurable via arguments. The TX and RX frequencies in kHz must be specified by kwargs. + All TX frequencies specified will also be used as RX frequencies, and at least one frequency must be specified as + either an RX or TX frequency. + """ + def __init__(self, **kwargs): + """ + kwargs: + tx_freqs: str, frequencies in kHz to transmit on. E.g. "10500,12000" + rx_freqs: str, frequencies in kHz to receive on. E.g. "10500,12000" + """ + cpid = 3777 + + num_ranges = scf.STD_NUM_RANGES + + def parse_freqs_from_string(freqs): + freq_list = [] + for freq in freqs.split(','): + freq_list.append(int(freq)) + return freq_list + + tx_freqs = parse_freqs_from_string(kwargs.get('tx_freqs', '')) # Default to no frequencies specified + rx_freqs = parse_freqs_from_string(kwargs.get('rx_freqs', '')) # Default to no frequencies specified + + if len(set(tx_freqs)) != len(kwargs.get('tx_freqs', '').split(',')): + raise ValueError(f"Duplicate TX frequencies specified: {kwargs.get('tx_freqs', '')}") + if len(set(rx_freqs)) != len(kwargs.get('rx_freqs', '').split(',')): + raise ValueError(f"Duplicate RX frequencies specified: {kwargs.get('rx_freqs', '')}") + + all_freqs = set(tx_freqs).union(set(rx_freqs)) + if len(all_freqs) == 0: + raise ValueError("No RX or TX frequencies specified") + + # Calculate center frequency + max_freq = max(all_freqs) + min_freq = min(all_freqs) + center_freq = (max_freq + min_freq) / 2.0 # Center frequency set to middle of the range + + comment_string = f"TX freqs: {tx_freqs}, RX freqs: {rx_freqs}" + + super().__init__(cpid, txctrfreq=center_freq, rxctrfreq=center_freq, comment_string=comment_string) + + default_slice = { + "pulse_sequence": scf.SEQUENCE_7P, + "tau_spacing": scf.TAU_SPACING_7P, + "pulse_len": scf.PULSE_LEN_45KM, + "num_ranges": num_ranges, + "first_range": scf.STD_FIRST_RANGE, + "intt": scf.INTT_7P, # duration of an integration, in ms + "beam_angle": scf.STD_16_BEAM_ANGLE, + "rx_beam_order": [[i for i in range(scf.STD_16_BEAM_ANGLE)]], # All beams + "scanbound": [i * 3.7 for i in range(len(scf.STD_16_BEAM_ANGLE))], # align each aveperiod to 3.7s boundary + "wait_for_first_scanbound": False, + "align_sequences": True, # align start of sequence to tenths of a second + } + + num_antennas = scf.options.main_antenna_count + left_half_antennas = [i for i in range(num_antennas // 2)] + right_half_antennas = [i for i in range(num_antennas // 2, num_antennas)] + all_antennas = [i for i in range(num_antennas)] + + all_slices = [] + for i, freq in enumerate(tx_freqs): + new_slice = copy.deepcopy(default_slice) + new_slice['freq'] = freq + new_slice['tx_antenna_pattern'] = scf.easy_widebeam + if len(tx_freqs) == 2: # Use 8-antenna wide-beam mode if only transmitting on two frequencies + if i == 0: + new_slice['tx_antennas'] = left_half_antennas + else: + new_slice['tx_antennas'] = right_half_antennas + else: # Use 16-antenna wide-beam mode otherwise + new_slice['tx_antennas'] = all_antennas + new_slice['tx_beam_order'] = [0] + new_slice['comment'] = f"TX slice with frequency {freq}" + all_slices.append(new_slice) + + # Add the slices to the experiment + for freq in rx_freqs: + if freq in tx_freqs: # Already listening on this frequency, skip + continue + new_slice = copy.deepcopy(default_slice) + new_slice['freq'] = freq + new_slice['rxonly'] = True + new_slice['comment'] = f"RX slice with frequency {freq}" + all_slices.append(new_slice) + + self.add_slice(all_slices[0]) + for this_slice in all_slices[1:]: + self.add_slice(this_slice, {0: 'CONCURRENT'}) From 92763a3b464f697e93c6349d4ad3c9e22d761c33 Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Mon, 20 Nov 2023 17:56:23 +0000 Subject: [PATCH 11/13] Bugfix with specifying multiple kwargs. --- eeaao.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eeaao.py b/eeaao.py index 31637b5..f3ef5b1 100644 --- a/eeaao.py +++ b/eeaao.py @@ -24,8 +24,8 @@ class EEAAO(ExperimentPrototype): def __init__(self, **kwargs): """ kwargs: - tx_freqs: str, frequencies in kHz to transmit on. E.g. "10500,12000" - rx_freqs: str, frequencies in kHz to receive on. E.g. "10500,12000" + tx_freqs: str, list of frequencies in kHz to transmit on. Format as "[10500 12000]" + rx_freqs: str, list of frequencies in kHz to receive on. Format as "[10600 12200]" """ cpid = 3777 @@ -40,9 +40,9 @@ def parse_freqs_from_string(freqs): tx_freqs = parse_freqs_from_string(kwargs.get('tx_freqs', '')) # Default to no frequencies specified rx_freqs = parse_freqs_from_string(kwargs.get('rx_freqs', '')) # Default to no frequencies specified - if len(set(tx_freqs)) != len(kwargs.get('tx_freqs', '').split(',')): + if len(set(tx_freqs)) != len(kwargs.get('tx_freqs', '').split(' ')): raise ValueError(f"Duplicate TX frequencies specified: {kwargs.get('tx_freqs', '')}") - if len(set(rx_freqs)) != len(kwargs.get('rx_freqs', '').split(',')): + if len(set(rx_freqs)) != len(kwargs.get('rx_freqs', '').split(' ')): raise ValueError(f"Duplicate RX frequencies specified: {kwargs.get('rx_freqs', '')}") all_freqs = set(tx_freqs).union(set(rx_freqs)) @@ -66,7 +66,7 @@ def parse_freqs_from_string(freqs): "first_range": scf.STD_FIRST_RANGE, "intt": scf.INTT_7P, # duration of an integration, in ms "beam_angle": scf.STD_16_BEAM_ANGLE, - "rx_beam_order": [[i for i in range(scf.STD_16_BEAM_ANGLE)]], # All beams + "rx_beam_order": [scf.STD_16_FORWARD_BEAM_ORDER], # All beams "scanbound": [i * 3.7 for i in range(len(scf.STD_16_BEAM_ANGLE))], # align each aveperiod to 3.7s boundary "wait_for_first_scanbound": False, "align_sequences": True, # align start of sequence to tenths of a second From 37a74ea01cec8d9b39f7509d2f1c3f10652a996e Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Tue, 21 Nov 2023 19:42:56 +0000 Subject: [PATCH 12/13] Final little tweaks to eeaao.py --- eeaao.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/eeaao.py b/eeaao.py index f3ef5b1..03efa3f 100644 --- a/eeaao.py +++ b/eeaao.py @@ -24,30 +24,31 @@ class EEAAO(ExperimentPrototype): def __init__(self, **kwargs): """ kwargs: - tx_freqs: str, list of frequencies in kHz to transmit on. Format as "[10500 12000]" - rx_freqs: str, list of frequencies in kHz to receive on. Format as "[10600 12200]" + tx_freqs: str, list of frequencies in kHz to transmit on. Format as "[10500,12000]" + rx_freqs: str, list of frequencies in kHz to receive on. Format as "[10600,12200]" """ cpid = 3777 - num_ranges = scf.STD_NUM_RANGES - def parse_freqs_from_string(freqs): freq_list = [] - for freq in freqs.split(','): - freq_list.append(int(freq)) + if freqs: + for f in freqs.strip('[]').split(','): + freq_list.append(int(f)) return freq_list tx_freqs = parse_freqs_from_string(kwargs.get('tx_freqs', '')) # Default to no frequencies specified rx_freqs = parse_freqs_from_string(kwargs.get('rx_freqs', '')) # Default to no frequencies specified - if len(set(tx_freqs)) != len(kwargs.get('tx_freqs', '').split(' ')): - raise ValueError(f"Duplicate TX frequencies specified: {kwargs.get('tx_freqs', '')}") - if len(set(rx_freqs)) != len(kwargs.get('rx_freqs', '').split(' ')): - raise ValueError(f"Duplicate RX frequencies specified: {kwargs.get('rx_freqs', '')}") - all_freqs = set(tx_freqs).union(set(rx_freqs)) if len(all_freqs) == 0: - raise ValueError("No RX or TX frequencies specified") + raise ValueError(f"No RX or TX frequencies specified.\t" + f"tx_freqs: {kwargs.get('tx_freqs', '')}\t" + f"rx_freqs: {kwargs.get('rx_freqs', '')}") + + if len(set(tx_freqs)) != len(tx_freqs): + raise ValueError(f"Duplicate TX frequencies specified: {tx_freqs}") + if len(set(rx_freqs)) != len(rx_freqs): + raise ValueError(f"Duplicate RX frequencies specified: {rx_freqs}") # Calculate center frequency max_freq = max(all_freqs) @@ -62,7 +63,7 @@ def parse_freqs_from_string(freqs): "pulse_sequence": scf.SEQUENCE_7P, "tau_spacing": scf.TAU_SPACING_7P, "pulse_len": scf.PULSE_LEN_45KM, - "num_ranges": num_ranges, + "num_ranges": scf.STD_NUM_RANGES, "first_range": scf.STD_FIRST_RANGE, "intt": scf.INTT_7P, # duration of an integration, in ms "beam_angle": scf.STD_16_BEAM_ANGLE, From 3fa68c92afd4e8d822ee5ff80d95639bdb2abd70 Mon Sep 17 00:00:00 2001 From: Remington Rohel Date: Tue, 21 Nov 2023 20:02:42 +0000 Subject: [PATCH 13/13] Minor update to docstring explaining kwargs formats. --- eeaao.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eeaao.py b/eeaao.py index 03efa3f..abf3aaa 100644 --- a/eeaao.py +++ b/eeaao.py @@ -24,8 +24,8 @@ class EEAAO(ExperimentPrototype): def __init__(self, **kwargs): """ kwargs: - tx_freqs: str, list of frequencies in kHz to transmit on. Format as "[10500,12000]" - rx_freqs: str, list of frequencies in kHz to receive on. Format as "[10600,12200]" + tx_freqs: str, list of frequencies in kHz to transmit on. Format as "[10500,12000]" or "10500,12000" + rx_freqs: str, list of frequencies in kHz to receive on. Format as "[10600,12200]" or "10600,12200" """ cpid = 3777