diff --git a/.gitignore b/.gitignore index b6e4761..4fd2e63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Byte-compiled / optimized / DLL files __pycache__/ -*.py[cod] +*.py[cod~] *$py.class # C extensions diff --git a/pyDARNio/tests/__init__.py b/pyDARNio/tests/__init__.py new file mode 100644 index 0000000..54b0007 --- /dev/null +++ b/pyDARNio/tests/__init__.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python +# Full license can be found in License.md +# Author: Angeline G. Burrell, NRL +# ---------------------------------------------------------------------------- + +# Import testing utilities +from pydarnio.tests import utils diff --git a/pyDARNio/tests/integration/__init__.py b/pyDARNio/tests/integration/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/test_borealis.py b/pyDARNio/tests/integration/test_borealis.py similarity index 100% rename from tests/integration/test_borealis.py rename to pyDARNio/tests/integration/test_borealis.py diff --git a/tests/integration/test_dmap.py b/pyDARNio/tests/integration/test_dmap.py similarity index 99% rename from tests/integration/test_dmap.py rename to pyDARNio/tests/integration/test_dmap.py index 420a096..d462609 100644 --- a/tests/integration/test_dmap.py +++ b/pyDARNio/tests/integration/test_dmap.py @@ -16,7 +16,7 @@ rawacf_stream = "../testfiles/20170410.1801.00.sas.stream.rawacf.bz2" rawacf_file = "../testfiles/20170410.1801.00.sas.rawacf" -pydarnio_logger = logging.getLogger('pydarnio') +pydarnio_logger = logging.getLogger('pyDARNio') class IntegrationDmap(unittest.TestCase): diff --git a/pyDARNio/tests/integration/test_superdarn.py b/pyDARNio/tests/integration/test_superdarn.py new file mode 100644 index 0000000..3bee749 --- /dev/null +++ b/pyDARNio/tests/integration/test_superdarn.py @@ -0,0 +1,280 @@ +# Copyright (C) 2019 SuperDARN +# Author: Marina Schmidt, Angeline G. Burrell +# -------------------------------------------- + +import logging +import numpy as np +import os + +import pydarnio +from pydarnio import superdarn_exceptions as sdarn_exc +from pydarnio.tests.utils import file_utils + +pydarnio_logger = logging.getLogger('pyDARNio') + + +class TestSDarnReadWrite(file_utils.TestReadWrite): + def setUp(self): + self.test_dir = os.path.join("..", "testdir") + self.read_class = pydarnio.SDarnRead + self.write_class = pydarnio.SDarnWrite + self.read_func = None + self.write_func = None + self.read_dmap = None + self.written_dmap = None + self.temp_file = "temp.file" + self.read_types = ['rawacf', 'fitacf', 'iqdat', 'grid', 'map'] + self.write_types = ['rawacf', 'fitacf', 'iqdat', 'grid', 'map'] + self.file_types = [] + + def tearDown(self): + del self.read_func, self.write_func, self.read_dmap, self.written_dmap + del self.temp_file, self.file_types, self.test_dir, self.read_class + del self.write_class, self.read_types, self.write_types + + +class TestSDarnReadDmapWrite(file_utils.TestReadWrite): + def setUp(self): + self.test_dir = os.path.join("..", "testdir") + self.read_class = pydarnio.SDarnRead + self.write_class = pydarnio.DmapWrite + self.read_func = None + self.write_func = None + self.read_dmap = None + self.written_dmap = None + self.temp_file = "temp.file" + self.read_types = ['rawacf', 'fitacf', 'iqdat', 'grid', 'map'] + self.write_types = ['dmap'] + self.file_types = [] + + def tearDown(self): + del self.read_func, self.write_func, self.read_dmap, self.written_dmap + del self.temp_file, self.file_types, self.test_dir, self.read_class + del self.write_class, self.read_types, self.write_types + + def test_write_missing_success_read_error(self): + """Raise SuperDARNFieldMissingError when reading partially written file + """ + + # Set the missing field name and record number + missing_field = {'rawacf': 'nave', 'fitacf': 'nave', 'iqdat': 'nave', + 'grid': 'stid', 'map': 'stid'} + rnum = 0 + self.set_file_types() + + # Test each of the file types + for val in self.file_types: + with self.subTest(val=val): + # Get the locally stored data and delete a neccesary value + (self.read_dmap, + self.temp_file) = file_utils.load_data_w_filename(val[0]) + del self.read_dmap[rnum][missing_field[val[0]]] + + # Write the partial data + self.write_func = file_utils.set_write_func(self.write_class, + self.read_dmap, + val[1]) + self.write_func(self.temp_file) + + # Read in the patial data + self.set_read_func(val[0]) + + with self.assertRaises( + sdarn_exc.SuperDARNFieldMissingError) as err: + self.written_dmap = self.read_func() + + # Test the error message raised + self.assertEqual(err.exception.fields, {missing_field[val[0]]}) + self.assertEqual(err.exception.record_number, rnum) + + # Remove the the temporary file + self.assertTrue(file_utils.remove_temp_file(self.temp_file)) + + def test_write_extra_read_error(self): + """Raise SuperDARNExtraFieldError when reading file written with extra + field + """ + # Set the missing field name and record number + rnum = 0 + extra_key = 'dummy' + extra_field = {extra_key: pydarnio.DmapScalar( + name=extra_key, value=extra_key, data_type=9, data_type_fmt='s')} + self.set_file_types() + + # Test each of the file types + for val in self.file_types: + with self.subTest(val=val): + # Get the locally stored data and add an extra value + (self.read_dmap, + self.temp_file) = file_utils.load_data_w_filename(val[0]) + self.read_dmap[rnum].update(extra_field) + self.read_dmap[rnum].move_to_end(extra_key, last=False) + + # Write the extra data + self.write_func = file_utils.set_write_func(self.write_class, + self.read_dmap, + val[1]) + self.write_func(self.temp_file) + + # Read in the extra data + self.set_read_func(val[0]) + + with self.assertRaises( + sdarn_exc.SuperDARNExtraFieldError) as err: + self.written_dmap = self.read_func() + + # Test the error message raised + self.assertEqual(err.exception.fields, {extra_key}) + self.assertEqual(err.exception.record_number, rnum) + + # Remove the the temporary file + self.assertTrue(file_utils.remove_temp_file(self.temp_file)) + + def test_write_incorrect_read_rawacf_from_dict(self): + """Raise SuperDARNDataFormatTypeError when reading badly written dict + """ + # Test the only file type that currently has a data dict + self.read_types = ['rawacf_dict'] + self.set_file_types() + + for val in self.file_types: + with self.subTest(val=val): + # Get the locally stored data and add a bad dictionary record + read_dict, self.temp_file = file_utils.load_data_w_filename( + val[0]) + read_dict[0]['stid'] = np.int8(read_dict[0]['stid']) + + # Convert from dict to Dmap + self.read_dmap = pydarnio.dict2dmap(read_dict) + + # Write the Dmap data + self.write_func = file_utils.set_write_func(self.write_class, + self.read_dmap, + val[1]) + self.write_func(self.temp_file) + + # Read from the written file + self.set_read_func(val[0].split('_')[0]) + with self.assertRaises(sdarn_exc.SuperDARNDataFormatTypeError): + self.written_dmap = self.read_func() + + # Remove the temporary file + self.assertTrue(file_utils.remove_temp_file(self.temp_file)) + + +class TestDmapReadSDarnWrite(file_utils.TestReadWrite): + def setUp(self): + self.test_dir = os.path.join("..", "testdir") + self.read_class = pydarnio.DmapRead + self.write_class = pydarnio.SDarnWrite + self.read_func = None + self.write_func = None + self.read_dmap = None + self.written_dmap = None + self.temp_file = "temp.file" + self.read_types = ['rawacf', 'fitacf', 'iqdat', 'grid', 'map'] + self.write_types = ['rawacf', 'fitacf', 'iqdat', 'grid', 'map'] + self.file_types = [] + + def tearDown(self): + del self.read_func, self.write_func, self.read_dmap, self.written_dmap + del self.temp_file, self.file_types, self.test_dir, self.read_class + del self.write_class, self.read_types, self.write_types + + def test_dict2dmap_write_rawacf(self): + """Use dict2dmap to convert a dictionary to DMap then SDarnWrite file + """ + # Test the only file type that currently has a data dict + self.read_types = ['rawacf_dict'] + self.write_types = ['rawacf'] + self.set_file_types() + + for val in self.file_types: + with self.subTest(val=val): + # Get the locally stored data + read_dict, self.temp_file = file_utils.load_data_w_filename( + val[0]) + + # Convert from dict to Dmap + self.read_dmap = pydarnio.dict2dmap(read_dict) + + # Write the Dmap data + self.write_func = file_utils.set_write_func(self.write_class, + self.read_dmap, + val[1]) + self.write_func(self.temp_file) + + # Read in the Dmap data + self.set_read_func(val[0].split('_')[0]) + self.written_dmap = self.read_func() + + # Compare the read and written data + self.dmap_list_compare() + + # Remove the temporary file + self.assertTrue(file_utils.remove_temp_file(self.temp_file)) + + def test_write_incorrect_rawacf_from_dict(self): + """Raise SuperDARNDataFormatTypeError when writing badly formatted dict + """ + # Test the only file type that currently has a data dict + self.read_types = ['rawacf_dict'] + self.write_types = ['rawacf'] + self.set_file_types() + + for val in self.file_types: + with self.subTest(val=val): + # Get the locally stored data and add a bad dictionary record + read_dict, self.temp_file = file_utils.load_data_w_filename( + val[0]) + read_dict[0]['stid'] = np.int8(read_dict[0]['stid']) + + # Convert from dict to Dmap + self.read_dmap = pydarnio.dict2dmap(read_dict) + + # Write the Dmap data + self.write_func = file_utils.set_write_func(self.write_class, + self.read_dmap, + val[1]) + + with self.assertRaises(sdarn_exc.SuperDARNDataFormatTypeError): + self.write_func(self.temp_file) + + # There won't be a temporary file + self.assertFalse(file_utils.remove_temp_file(self.temp_file)) + + def test_DmapRead_SDarnWrite_SDarnRead(self): + """Test read/write/read with DmapRead, SDarnWrite, and SDarnRead + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + test_file_dict = file_utils.get_test_files("good", + test_dir=self.test_dir) + self.set_file_types() + + for val in self.file_types: + with self.subTest(val=val): + # Read in the test file + self.temp_file = test_file_dict[val[0]] + self.set_read_func(val[0]) + self.read_dmap = self.read_func() + + # Write the data + self.temp_file = "{:s}_test.{:s}".format(val[0], val[0]) + self.write_func = file_utils.set_write_func(self.write_class, + self.read_dmap, + val[1]) + self.write_func(self.temp_file) + + # Read in again using SDarnRead + self.read_class = pydarnio.SDarnRead + self.set_read_func(val[0]) + self.written_dmap = self.read_func() + self.read_class = pydarnio.DmapRead # Reset the reading class + + # Assert the read and written data are the same + self.dmap_list_compare() + + # Test the file creation and remove the temp file + self.assertTrue(file_utils.remove_temp_file(self.temp_file)) diff --git a/pyDARNio/tests/unit/__init__.py b/pyDARNio/tests/unit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyDARNio/tests/unit/test_borealis.py b/pyDARNio/tests/unit/test_borealis.py new file mode 100644 index 0000000..0354126 --- /dev/null +++ b/pyDARNio/tests/unit/test_borealis.py @@ -0,0 +1,222 @@ +# Copyright 2019 SuperDARN Canada, University of Saskatchewan +# Author: Marci Detwiller, Angeline Burrell +""" +This test suite is to test the implementation for the following classes: + BorealisRead + BorealisWrite + BorealisConvert +Support for the following Borealis file types: + rawrf + antennas_iq + bfiq + rawacf +And supports conversion of the following Borealis -> SDARN DMap types: + bfiq -> iqdat + rawacf -> rawacf +""" + +import logging +import os + +import pydarnio +from pydarnio.tests.utils import borealis_utils + +pyDARNio_logger = logging.getLogger('pyDARNio') + + +class TestBorealisReadSitev04(borealis_utils.TestReadBorealis): + """ + Testing class for reading Borealis v04 Site data + """ + + def setUp(self): + self.test_file = "fake.file" + self.test_dir = os.path.join("..", "testdir") + self.data = None + self.rec = None + self.arr = None + self.read_func = pydarnio.BorealisRead + self.file_types = ["rawacf", "bfiq", "antennas_iq"] + self.file_struct = "site" + self.version = 4 + + def tearDown(self): + del self.test_file, self.test_dir, self.data, self.rec, self.arr + del self.read_func, self.file_types, self.file_struct, self.version + + +class TestBorealisReadSitev05(borealis_utils.TestReadBorealis): + """ + Testing class for reading Borealis v05 Site data + """ + + def setUp(self): + self.test_file = "fake.file" + self.test_dir = os.path.join("..", "testdir") + self.data = None + self.rec = None + self.arr = None + self.read_func = pydarnio.BorealisRead + self.file_types = ["rawacf", "bfiq", "antennas_iq"] + self.file_struct = "site" + self.version = 5 + + def tearDown(self): + del self.test_file, self.test_dir, self.data, self.rec, self.arr + del self.read_func, self.file_types, self.file_struct, self.version + + +class TestBorealisReadArrayv04(borealis_utils.TestReadBorealis): + """ + Testing class for reading Borealis v04 array data + """ + + def setUp(self): + self.test_file = "fake.file" + self.test_dir = os.path.join("..", "testdir") + self.data = None + self.rec = None + self.arr = None + self.read_func = pydarnio.BorealisRead + self.file_types = ["rawacf", "bfiq", "antennas_iq"] + self.file_struct = "array" + self.version = 4 + + def tearDown(self): + del self.test_file, self.test_dir, self.data, self.rec, self.arr + del self.read_func, self.file_types, self.file_struct, self.version + + +class TestBorealisReadArrayv05(borealis_utils.TestReadBorealis): + """ + Testing class for reading Borealis v05 Array data + """ + + def setUp(self): + self.test_file = "fake.file" + self.test_dir = os.path.join("..", "testdir") + self.data = None + self.rec = None + self.arr = None + self.read_func = pydarnio.BorealisRead + self.file_types = ["rawacf", "bfiq", "antennas_iq"] + self.file_struct = "array" + self.version = 5 + + def tearDown(self): + del self.test_file, self.test_dir, self.data, self.rec, self.arr + del self.read_func, self.file_types, self.file_struct, self.version + + +class TestBorealisWriteSite(borealis_utils.TestWriteBorealis): + """ + Tests BorealisWrite class + """ + + def setUp(self): + self.write_func = pydarnio.BorealisWrite + self.read_func = pydarnio.BorealisRead + self.data_type = None + self.data = [] + self.temp_data = [] + self.nrec = 0 + self.temp_file = "not_a_file.acf" + self.file_types = ["rawacf", "bfiq", "antennas_iq"] + self.file_struct = "site" + + def tearDown(self): + del self.write_func, self.data_type, self.data + del self.temp_file, self.file_types, self.file_struct, self.nrec + + +class TestBorealisWriteArray(borealis_utils.TestWriteBorealis): + """ + Tests BorealisWrite class + """ + + def setUp(self): + self.write_func = pydarnio.BorealisWrite + self.read_func = pydarnio.BorealisRead + self.data_type = None + self.data = [] + self.temp_data = [] + self.nrec = 0 + self.temp_file = "not_a_file.acf" + self.file_types = ["rawacf", "bfiq", "antennas_iq"] + self.file_struct = "array" + + def tearDown(self): + del self.write_func, self.data_type, self.data + del self.temp_file, self.file_types, self.file_struct, self.nrec + + +class TestBorealisConvertSitev04(borealis_utils.TestConvertBorealis): + """ + Tests BorealisConvert class for V04 Site data conversion + """ + + def setUp(self): + self.test_file = "fake.file" + self.temp_file = "fake.temp" + self.test_dir = os.path.join("..", "testdir") + self.file_types = ["rawacf", "bfiq"] + self.file_struct = "site" + self.version = 4 + + def tearDown(self): + del self.test_file, self.test_dir, self.file_types, self.file_struct + del self.version, self.temp_file + + +class TestBorealisConvertArrayv04(borealis_utils.TestConvertBorealis): + """ + Tests BorealisConvert class for V04 Array data conversion + """ + + def setUp(self): + self.test_file = "fake.file" + self.temp_file = "fake.temp" + self.test_dir = os.path.join("..", "testdir") + self.file_types = ["rawacf", "bfiq"] + self.file_struct = "array" + self.version = 4 + + def tearDown(self): + del self.test_file, self.test_dir, self.file_types, self.file_struct + del self.version, self.temp_file + + +class TestBorealisConvertSitev05(borealis_utils.TestConvertBorealis): + """ + Tests BorealisConvert class for V05 Site data conversion + """ + + def setUp(self): + self.test_file = "fake.file" + self.temp_file = "fake.temp" + self.test_dir = os.path.join("..", "testdir") + self.file_types = ["rawacf", "bfiq"] + self.file_struct = "site" + self.version = 5 + + def tearDown(self): + del self.test_file, self.test_dir, self.file_types, self.file_struct + del self.version, self.temp_file + + +class TestBorealisConvertArrayv05(borealis_utils.TestConvertBorealis): + """ + Tests BorealisConvert class for V05 Array data conversion + """ + + def setUp(self): + self.test_file = "fake.file" + self.temp_file = "fake.temp" + self.test_dir = os.path.join("..", "testdir") + self.file_types = ["rawacf", "bfiq"] + self.file_struct = "array" + self.version = 5 + + def tearDown(self): + del self.test_file, self.test_dir, self.file_types, self.file_struct + del self.version, self.temp_file diff --git a/pyDARNio/tests/unit/test_conversions.py b/pyDARNio/tests/unit/test_conversions.py new file mode 100644 index 0000000..983c7a1 --- /dev/null +++ b/pyDARNio/tests/unit/test_conversions.py @@ -0,0 +1,175 @@ +# Copyright (C) 2019 SuperDARN Canada, University of Saskatchewan +# Author: Marina Schmidt + + +import unittest +import numpy as np +from collections import OrderedDict + +import pydarnio +from pydarnio import DmapScalar, DmapArray + + +class Test_Conversions(unittest.TestCase): + """ + Class to test the conversion functions + """ + def setUp(self): + """ + Creates the testing data + + Attributes + ---------- + dmap_list : List[dict] + List of dictionaries containing fields and values + dmap_records : List[dict] + List of ordered dictionaries containing dmap data structure + DmapScalar and DmapArray + """ + self.dmap_list = [{'stid': 1, 'channel': 0, + 'ptab': np.array([0, 9, 12, 20, 22, 26, 27], + dtype=np.int64)}, + {'bmnum': np.int16(15), 'combf': "$Id: twofsound", + 'pwr0': np.array([58.081821, 52.241421, 32.936508, + 35.562561, 35.344330, 31.501854, + 25.313326, 13.731517, 3.482957, + -5.032664, -9.496454, 3.254651], + dtype=np.float32)}, + {'radar.revision.major': np.int8(1), + 'radar.revision.minor': np.int8(18), + 'float test': float(3.5), + 'float2 test': 3.65, + 'channel': 'a', + 'double test': np.array([[2.305015, 2.0251], + [16548548, 78687686]], + dtype=np.float64)}, + {'time.us': 508473, + 'negative int': -42, + 'long int': np.int64(215610516132151613), + 'unsigned char': np.uint8(3), + 'unsigned short': np.uint16(45), + 'unsigned int': np.uint32(100), + 'unsigned long': np.uint64(1250000000000), + 'list test': [np.int64(1), np.int64(2), + np.int64(34), np.int64(45)]}] + self.dmap_records = \ + [OrderedDict([('stid', DmapScalar('stid', 1, 3, 'i')), + ('channel', DmapScalar('channel', 0, 3, 'i')), + ('ptab', DmapArray('ptab', + np.array([0, 9, 12, 20, 22, 26, + 27], dtype=np.int64), + 10, 'q', 1, [7]))]), + OrderedDict([('bmnum', DmapScalar('bmnum', 15, 2, 'h')), + ('combf', DmapScalar('combf', "$Id: twofsound", 9, + 's')), + ('pwr0', DmapArray('pwr0', + np.array([58.081821, 52.241421, + 32.936508, 35.562561, + 35.344330, 31.501854, + 25.313326, 13.731517, + 3.482957, -5.032664, + -9.496454, 3.254651], + dtype=np.float32), + 4, 'f', 1, [12]))]), + OrderedDict([('radar.revision.major', + DmapScalar('radar.revision.major', np.int8(1), + 1, 'c')), + ('radar.revision.minor', + DmapScalar('radar.revision.minor', np.int8(18), + 1, 'c')), + ('float test', + DmapScalar('float test', float(3.5), 4, 'f')), + ('float2 test', + DmapScalar('float2 test', 3.65, 4, 'f')), + ('channel', DmapScalar('channel', 'a', 9, 's')), + ('double test', + DmapArray('double test', + np.array([[2.305015, 2.0251], + [16548548, 78687686]], + dtype=np.float64), 8, + 'd', 2, [2, 2]))]), + OrderedDict([('time.us', DmapScalar('time.us', 508473, 3, 'i')), + ('negative int', + DmapScalar('negative int', -42, 3, 'i')), + ('long int', + DmapScalar('long int', + np.int64(215610516132151613), 10, 'q')), + ('unsigned char', + DmapScalar('unsigned char', np.uint8(3), 16, 'B')), + ('unsigned short', + DmapScalar('unsigned short', np.uint16(45), + 17, 'H')), + ('unsigned int', + DmapScalar('unsigned int', np.uint32(100), + 18, 'I')), + ('unsigned long', + DmapScalar('unsigned long', + np.uint64(1250000000000), 19, 'Q')), + ('list test', + DmapArray('list test', np.array([1, 2, 34, 45], + dtype=np.int64), + 10, 'q', 1, [4]))])] + self.array_attrs = ['name', 'data_type', 'data_type_fmt', 'dimension'] + + def tearDown(self): + """ Clean up the testing environment + """ + del self.dmap_list, self.dmap_records, self.array_attrs + + def dmap_compare(self, dmap1: list): + """ + Evaluate equivalency of an input dmap data structure to dmap_records + """ + # Quick simple tests that can be done before looping + # over the list + self.assertEqual(len(dmap1), len(self.dmap_records)) + + # NamedTuple are comparison capabilities + for record1, record2 in zip(dmap1, self.dmap_records): + self.assertSetEqual(set(record1), set(record2)) + for field, val_obj in record1.items(): + if isinstance(val_obj, DmapScalar): + self.compare_dmap_attrs(val_obj, record2[field], + self.array_attrs[:-1]) + self.assertEqual(val_obj, record2[field]) + else: + self.compare_dmap_attrs(val_obj, record2[field], + self.array_attrs) + self.assertTrue(np.array_equal(val_obj.value, + record2[field].value)) + + def compare_dmap_attrs(self, dmaparr1, dmaparr2, attr_list): + """ + Evaluates equivalency of DmapArray array attributes + """ + for val in attr_list: + with self.subTest(val=val): + # Ensure each array has the desired attribute + self.assertTrue(hasattr(dmaparr1, val)) + self.assertTrue(hasattr(dmaparr2, val)) + + # Ensure the attributes in each array are the same + self.assertEqual(getattr(dmaparr1, val), + getattr(dmaparr2, val)) + + def test_dict2dmap(self): + """ + From utils package, testing dict2dmap function + """ + dmap_records_test = pydarnio.dict2dmap(self.dmap_list) + self.dmap_compare(dmap_records_test) + + def test_dmap2dict(self): + """ + From utils package, testing dmap2dict function + """ + # need to break up the list of dictionaries to properly + # compare each field value + dmap_list_test = pydarnio.dmap2dict(self.dmap_records) + for j in range(len(dmap_list_test)): + for key, value in dmap_list_test[j].items(): + if isinstance(value, np.ndarray): + self.assertTrue(np.array_equal(value, + self.dmap_list[j][key])) + else: + self.assertEqual(value, self.dmap_list[j][key]) diff --git a/pyDARNio/tests/unit/test_dmap.py b/pyDARNio/tests/unit/test_dmap.py new file mode 100644 index 0000000..b86c170 --- /dev/null +++ b/pyDARNio/tests/unit/test_dmap.py @@ -0,0 +1,99 @@ +# Copyright (C) 2019 SuperDARN Canada, University of Saskatchewan +# Author: Marina Schmidt, Angeline Burrell + +import collections +import logging +import numpy as np +import os + +import pydarnio +from pydarnio.tests.utils import file_utils + +pyDARNio_logger = logging.getLogger('pyDARNio') + + +class TestDmapRead(file_utils.TestRead): + """ + Testing class for DmapRead class + """ + def setUp(self): + self.test_file = "somefile.rawacf" + self.test_dir = os.path.join("..", "testfiles") + self.data = None + self.rec = None + self.read_func = pydarnio.DmapRead + self.file_types = ["rawacf", "fitacf"] + self.corrupt_read_type = "records" + + def tearDown(self): + del self.test_file, self.test_dir, self.data, self.rec + del self.read_func, self.file_types, self.corrupt_read_type + + def test_read_dmap_file(self): + """ + Tests DmapRead test read_dmap. + + Behaviour: raising no exceptions + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + # Load the data and read in the first record + test_file_dict = file_utils.get_test_files("good", + test_dir=self.test_dir) + self.test_file = test_file_dict['fitacf'] + self.load_file_record(file_type='records') + + # Test the first record + self.assertIsInstance(self.rec, collections.deque) + self.assertIsInstance(self.rec[0], collections.OrderedDict) + self.assertIsInstance(self.rec[4]['bmnum'], pydarnio.DmapScalar) + self.assertIsInstance(self.rec[1]['ptab'], pydarnio.DmapArray) + self.assertIsInstance(self.rec[7]['channel'].value, int) + self.assertIsInstance(self.rec[2]['ltab'].value, np.ndarray) + self.assertEqual(self.rec[0]['ptab'].dimension, 1) + self.assertEqual(self.rec[50]['gflg'].value[1], 0) + + +class TestDmapWrite(file_utils.TestWrite): + """ Testing DmapWrite class""" + def setUp(self): + self.write_class = pydarnio.DmapWrite + self.write_func = None + self.data_type = "dmap" + self.data = [] + self.temp_file = "not_a_file.acf" + self.file_types = ["dmap"] + + def tearDown(self): + del self.write_class, self.write_func, self.data_type, self.data + del self.temp_file, self.file_types + + def test_bad_scalar_to_bytes(self): + """ + Test raises DmapCharError when attempting to write char instead of int8 + """ + self.data = [{'channel': pydarnio.DmapScalar('channel', 'c', 1, 'c')}] + darn = self.write_class(self.data) + with self.assertRaises(pydarnio.dmap_exceptions.DmapCharError): + darn.dmap_scalar_to_bytes(self.data[0]['channel']) + + def test_bad_array_to_byes(self): + """ + Test raises appropriate Dmap Error when writing unsupported array types + """ + + self.data = [{'xcf': pydarnio.DmapArray('xcf', np.array(['dog', 'cat', + 'rat']), + 9, 's', 1, [3])}, + {'channel': pydarnio.DmapArray('channel', + np.array(['d', 'c', 'r']), + 1, 'c', 1, [3])}] + errors = [pydarnio.dmap_exceptions.DmapDataError, + pydarnio.dmap_exceptions.DmapCharError] + for i, val in enumerate(errors): + with self.subTest(val=val): + array = [dat_val for dat_val in self.data[i].values()][0] + darn = self.write_class([self.data[i]]) + with self.assertRaises(val): + darn.dmap_array_to_bytes(array) diff --git a/pyDARNio/tests/unit/test_superdarn.py b/pyDARNio/tests/unit/test_superdarn.py new file mode 100644 index 0000000..dcf115d --- /dev/null +++ b/pyDARNio/tests/unit/test_superdarn.py @@ -0,0 +1,468 @@ +# Copyright (C) 2019 SuperDARN Canada, University of Saskatchewan +# Author: Marina Schmidt, Angeline Burrell +""" +This test suite is to test the implementation for the following classes: + SDarnRead + DarnUtilities + SDarnWrite +Support for the following SuperDARN file types: + iqdat + rawacf + fitacf + grid + map +""" + +import collections +import logging +import numpy as np +import os +import unittest + +import pydarnio +from pydarnio import superdarn_exceptions as sdarn_exp +from pydarnio.tests.utils import file_utils + +pydarnio_logger = logging.getLogger('pydarnio') + + +class TestSDarnRead(file_utils.TestRead): + """ + Testing class for SDarnRead class + """ + def setUp(self): + self.test_file = "somefile.rawacf" + self.test_dir = os.path.join("..", "testfiles") + self.data = None + self.rec = None + self.read_func = pydarnio.SDarnRead + self.file_types = ["rawacf", "fitacf", "iqdat", "grid", "map"] + self.corrupt_read_type = "rawacf" + + def tearDown(self): + del self.test_file, self.test_dir, self.data, self.rec + del self.read_func, self.file_types, self.corrupt_read_type + + def test_read_iqdat(self): + """ + Test reading records from iqdat. + + Checks: + - returns correct data structures + - returns expected values + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + # Load the data and read in the first record + test_file_dict = file_utils.get_test_files("good", + test_dir=self.test_dir) + self.test_file = test_file_dict['iqdat'] + self.load_file_record(file_type='iqdat') + + # Test the first record + self.assertIsInstance(self.rec, collections.deque) + self.assertIsInstance(self.rec[0], collections.OrderedDict) + self.assertIsInstance(self.rec[0]['rxrise'], pydarnio.DmapScalar) + self.assertIsInstance(self.rec[3]['tsc'], pydarnio.DmapArray) + self.assertIsInstance(self.rec[5]['mppul'].value, int) + self.assertIsInstance(self.rec[6]['tnoise'].value, np.ndarray) + self.assertEqual(self.rec[7]['channel'].value, 0) + self.assertEqual(self.rec[10]['data'].dimension, 1) + + def test_read_rawacf(self): + """ + Test reading records from rawacf. + + Checks: + - returns correct data structures + - returns expected values + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + # Load the data and read in the first record + test_file_dict = file_utils.get_test_files("good", + test_dir=self.test_dir) + self.test_file = test_file_dict['rawacf'] + self.load_file_record(file_type='rawacf') + + # Test the first record + self.assertIsInstance(self.rec, collections.deque) + self.assertIsInstance(self.rec[0], collections.OrderedDict) + self.assertIsInstance(self.rec[4]['channel'], pydarnio.DmapScalar) + self.assertIsInstance(self.rec[1]['ptab'], pydarnio.DmapArray) + self.assertIsInstance(self.rec[7]['channel'].value, int) + self.assertIsInstance(self.rec[2]['xcfd'].value, np.ndarray) + self.assertEqual(self.rec[0]['xcfd'].dimension, 3) + + def test_read_fitacf(self): + """ + Test reading records from fitacf. + + Checks: + - returns correct data structures + - returns expected values + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + # Load the data and read in the first record + test_file_dict = file_utils.get_test_files("good", + test_dir=self.test_dir) + self.test_file = test_file_dict['fitacf'] + self.load_file_record(file_type='fitacf') + + # Test the first record + self.assertIsInstance(self.rec, collections.deque) + self.assertIsInstance(self.rec[0], collections.OrderedDict) + self.assertIsInstance(self.rec[4]['bmnum'], pydarnio.DmapScalar) + self.assertIsInstance(self.rec[1]['ptab'], pydarnio.DmapArray) + self.assertIsInstance(self.rec[7]['channel'].value, int) + self.assertIsInstance(self.rec[2]['ltab'].value, np.ndarray) + self.assertEqual(self.rec[0]['ptab'].dimension, 1) + + def test_read_grid(self): + """ + Test reading records from grid file. + + Checks: + - returns correct data structures + - returns expected values + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + # Load the data and read in the first record + test_file_dict = file_utils.get_test_files("good", + test_dir=self.test_dir) + self.test_file = test_file_dict['grid'] + self.load_file_record(file_type='grid') + + # Test the first record + self.assertIsInstance(self.rec, collections.deque) + self.assertIsInstance(self.rec[0], collections.OrderedDict) + self.assertIsInstance(self.rec[4]['start.year'], pydarnio.DmapScalar) + self.assertIsInstance(self.rec[1]['v.max'], pydarnio.DmapArray) + self.assertIsInstance(self.rec[7]['end.day'].value, int) + self.assertIsInstance(self.rec[2]['stid'].value, np.ndarray) + self.assertEqual(self.rec[0]['nvec'].dimension, 1) + + def test_read_map(self): + """ + Test reading records from map file. + + Checks: + - returns correct data structures + - returns expected values + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + # Load the data and read in the first record + test_file_dict = file_utils.get_test_files("good", + test_dir=self.test_dir) + self.test_file = test_file_dict['map'] + self.load_file_record(file_type='map') + + # Test the first record + self.assertIsInstance(self.rec, collections.deque) + self.assertIsInstance(self.rec[0], collections.OrderedDict) + self.assertIsInstance(self.rec[2]['IMF.flag'], + pydarnio.io.datastructures.DmapScalar) + self.assertIsInstance(self.rec[3]['stid'], pydarnio.DmapArray) + self.assertIsInstance(self.rec[8]['IMF.flag'].value, int) + self.assertIsInstance(self.rec[10]['stid'].value, np.ndarray) + self.assertEqual(self.rec[3]['stid'].dimension, 1) + # this will be file dependent... future working test project. + self.assertEqual(self.rec[0]['stid'].shape[0], 14) + + +class TestSDarnUtilities(unittest.TestCase): + """ + Testing DarnUtilities class. + + Notes + ----- + All methods in this class are static so there is no constructor testing + """ + def setUp(self): + self.tdicts = [{'a': 's', 'c': 'i', 'd': 'f'}, + {'rst': '4.1', 'stid': 3, 'vel': [2.3, 4.5]}, + {'fitacf': 'f', 'rawacf': 's', 'map': 'm'}] + + def tearDown(self): + del self.tdicts + + def test_dict_key_diff(self): + """ + Test the difference in keys between two dictionaries, order dependent + """ + self.tdicts[1] = {'1': 'a', 'c': 2, 'z': 'fun', 'd': 'dog'} + + for val in [(self.tdicts[0], self.tdicts[1], {'a'}), + (self.tdicts[1], self.tdicts[0], {'1', 'z'})]: + with self.subTest(val=val): + out = pydarnio.SDarnUtilities.dict_key_diff(val[0], val[1]) + self.assertEqual(val[2], out) + + def test_dict_list2set(self): + """ + Test conversion of lists of dictionaries into concatenated full sets + + Expected behaviour + ------------------ + Returns only a single set the comprises of the dictionary keys + given in the list + """ + dict_keys = {'a', 'c', 'd', 'rst', 'stid', 'vel', 'fitacf', 'rawacf', + 'map'} + out = pydarnio.SDarnUtilities.dict_list2set(self.tdicts) + self.assertEqual(dict_keys, out) + + def test_extra_field_check_pass(self): + """ + Test extra_field_check success + + Method - this method checks if there are differences in the key sets of + dictionaries that when passed a record and field names it will indicate + if there is an extra field in the record key set + + Expected behaviour + ------------------ + Silent success - if there are no differences in the key set then + nothing is returned or raised + """ + out = {'a': 3, 'c': 3, 'd': 3, 'rst': 1, 'vel': 'd'} + pydarnio.SDarnUtilities.extra_field_check(self.tdicts, out, 1) + + def test_extra_field_check_fail(self): + """ + Test extra_field_check failur raises SuperDARNExtraFieldError + + Method - this method checks if there are differences in the key sets + of dictionaries that when passed a record and field names it will + indicate if there is an extra field in the record key set + + Expected behaviour + ----------------- + Raises SuperDARNExtraFieldError because there are differences between + the two dictionary sets + """ + out = {'a': 3, 'b': 3, 'c': 2, 'd': 3, 'rst': 1, 'vel': 'd'} + with self.assertRaises(sdarn_exp.SuperDARNExtraFieldError) as err: + pydarnio.SDarnUtilities.extra_field_check(self.tdicts, out, 1) + + self.assertEqual(err.exception.fields, {'b'}) + + def test_missing_field_check_pass(self): + """ + Testing missing_field_check - Reverse idea of the extra_field_check, + should find missing fields in a record when compared to a key set of + SuperDARN field names + + Expected behaviour + ------------------ + Nothing - if there is not differences then nothing happens + """ + in_list = [dict(self.tdicts[0]), + {'a': 3, 'c': 2, 'd': 2, 'stid': 's', 'rst': 1, 'vel': 'd'}, + dict(self.tdicts[1])] + in_list[0].update(self.tdicts[-1]) + in_list[2].update(self.tdicts[2]) + for val in in_list: + with self.subTest(val=val): + pydarnio.SDarnUtilities.missing_field_check(self.tdicts, + val, 1) + + def test_missing_field_check_fail(self): + """ + Test raises SuperDARNFieldMissingError with appropriate fields missing + + Method - Reverse idea of the extra_field_check, should find missing + fields in a record when compared to a key set of SuperDARN field names + + Expected behaviour + ------------------ + Raise SuperDARNFieldMissingError - raised when there is a difference + between dictionary key sets + """ + in_list = [({'a': 3, 'b': 3, 'd': 2, 'stid': 's', 'vel': 'd'}, + {'c', 'rst'}), + ({'a': 3, 'b': 3, 'd': 2, 'stid': 's', 'rst': 1, + 'vel': 'd', 'fitacf': 3, 'map': 4}, {'c', 'rawacf'})] + + for val in in_list: + with self.subTest(val=val): + with self.assertRaises( + sdarn_exp.SuperDARNFieldMissingError) as err: + pydarnio.SDarnUtilities.missing_field_check(self.tdicts, + val[0], 1) + + # Items in tdicts, but not in rdict + self.assertEqual(err.exception.fields, val[1]) + + def test_incorrect_types_check_pass(self): + """ + Test incorrect_types_check - this method checks if the field data + format type is not correct to specified SuperDARN field type. + + Note + ---- + This method only works on pydarnio DMAP record data structure + + Expected Behaviour + ------------------ + Nothing - should not return or raise anything if the fields + are the correct data format type + """ + rdict = {'a': pydarnio.DmapScalar('a', 1, 1, self.tdicts[0]['a']), + 'c': pydarnio.DmapScalar('a', 1, 1, self.tdicts[0]['c']), + 'd': pydarnio.DmapArray('a', np.array([2.4, 2.4]), 1, + self.tdicts[0]['d'], 1, [3]), + 'fitacf': pydarnio.DmapScalar('a', 1, 1, + self.tdicts[-1]['fitacf']), + 'rawacf': pydarnio.DmapScalar('a', 1, 1, + self.tdicts[-1]['rawacf']), + 'map': pydarnio.DmapScalar('a', 1, 1, + self.tdicts[-1]['map'])} + + pydarnio.SDarnUtilities.incorrect_types_check([self.tdicts[0], + self.tdicts[-1]], + rdict, 1) + + def test_incorrect_types_check_fail(self): + """ + Test incorrect_types_check - this method checks if the field data + format type is not correct to specified SuperDARN field type. + + Note + ---- + This method only works on pyDARNio DMAP record data structure + + Expected Behaviour + ------------------ + Raises SuperDARNDataFormatTypeError - because the field format types + should not be the same. + """ + rdict = {'a': pydarnio.DmapScalar('a', 1, 1, self.tdicts[0]['a']), + 'c': pydarnio.DmapScalar('a', 1, 1, self.tdicts[0]['c']), + 'd': pydarnio.DmapArray('a', np.array([2.4, 2.4]), 1, + self.tdicts[0]['d'], 1, [3]), + 'fitacf': pydarnio.DmapScalar('a', 1, 1, + self.tdicts[-1]['rawacf']), + 'rawacf': pydarnio.DmapScalar('a', 1, 1, + self.tdicts[-1]['rawacf']), + 'map': pydarnio.DmapScalar('a', 1, 1, + self.tdicts[-1]['map'])} + + with self.assertRaises(sdarn_exp.SuperDARNDataFormatTypeError) as err: + pydarnio.SDarnUtilities.incorrect_types_check([self.tdicts[0], + self.tdicts[-1]], + rdict, 1) + + self.assertEqual(err.exception.incorrect_params, {'fitacf': 'f'}) + + +class TestSDarnWrite(file_utils.TestWrite): + """ + Tests SDarnWrite class + """ + def setUp(self): + """ Runs before every test to create the test environment + """ + self.write_class = pydarnio.SDarnWrite + self.write_func = None + self.data_type = "rawacf" + self.data = [] + self.temp_file = "not_a_file.acf" + self.file_types = ["rawacf", "fitacf", "iqdat", "grid", "map"] + + def tearDown(self): + """ Runs after every test to clean up the test environment + """ + del self.write_class, self.write_func, self.data_type, self.data + del self.temp_file, self.file_types + + def test_SDarnWrite_missing_field(self): + """ + Test raises SuperDARNFieldMissingError when required data is missing + """ + missing_fields = {"rawacf": "nave", "fitacf": "stid", + "iqdat": "chnnum", "map": "IMF.Kp", + "grid": "start.year"} + rnum = 0 + + for val in missing_fields.keys(): + with self.subTest(val=val): + # Set up the data, removing a required value + self.data_type = val + self.load_data_w_filename() + del self.data[rnum][missing_fields[val]] + + # Attempt to write the data + self.set_write_func() + with self.assertRaises( + sdarn_exp.SuperDARNFieldMissingError) as err: + self.write_func(self.temp_file) + + # Evaluate the error message + self.assertEqual(err.exception.fields, {missing_fields[val]}) + self.assertEqual(err.exception.record_number, rnum) + + def test_extra_field(self): + """ + Raises SuperDARNExtraFieldErrorSuperDARNExtraFieldError with extra data + """ + rnum = 0 + extra_name = "dummy" + extra_field = pydarnio.DmapArray(extra_name, np.array([1, 2]), chr(1), + 'c', 1, [2]) + test_file_dict = file_utils.get_test_files("good") + + for val in test_file_dict.keys(): + with self.subTest(val=val): + # Set up the data, adding and extra data field + self.data_type = val + self.load_data_w_filename() + self.data[rnum][extra_name] = extra_field + + # Attempt to write the data + self.set_write_func() + with self.assertRaises( + sdarn_exp.SuperDARNExtraFieldError) as err: + self.write_func(self.temp_file) + + # Evaluate the error message + self.assertEqual(err.exception.fields, {extra_name}) + self.assertEqual(err.exception.record_number, rnum) + + def test_incorrect_data_format(self): + """ + Test raises SuperDARNDataFormatTypeError for writing with bad format + """ + rnum = 0 + incorrect_param = {"rawacf": "scan", "fitacf": "ltab", + "iqdat": "lagfr", "map": "IMF.Bx", "grid": "v.min"} + incorrect_type = {"rawacf": "c", "fitacf": "s", "iqdat": "d", + "map": "i", "grid": "d"} + + for val in incorrect_type.keys(): + with self.subTest(val=val): + # Set up the data, adding and extra data field + self.data_type = val + self.load_data_w_filename() + self.data[rnum][incorrect_param[val]] = \ + self.data[rnum][incorrect_param[val]]._replace( + data_type_fmt=incorrect_type[val]) + + # Attempt to write the data + self.set_write_func() + with self.assertRaises( + sdarn_exp.SuperDARNDataFormatTypeError) as err: + self.write_func(self.temp_file) + + # Evaluate the error message + self.assertEqual(err.exception.incorrect_params.keys(), + {incorrect_param[val]}) + self.assertEqual(err.exception.record_number, rnum) diff --git a/pyDARNio/tests/utils/__init__.py b/pyDARNio/tests/utils/__init__.py new file mode 100644 index 0000000..f50b194 --- /dev/null +++ b/pyDARNio/tests/utils/__init__.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python +# Copyright (C) 2020 +# Full license can be found in License.md +# Author: Angeline G. Burrell, NRL +# ---------------------------------------------------------------------------- + +# Import data sets +from pydarnio.tests.utils import data_sets + +# Import testing utilities +from pydarnio.tests.utils import borealis_utils +from pydarnio.tests.utils import file_utils diff --git a/pyDARNio/tests/utils/borealis_utils.py b/pyDARNio/tests/utils/borealis_utils.py new file mode 100644 index 0000000..d98995d --- /dev/null +++ b/pyDARNio/tests/utils/borealis_utils.py @@ -0,0 +1,471 @@ +# Author: Angeline Burrell + +from collections import OrderedDict +import copy +import numpy as np +import os +import tables +import unittest + +import pydarnio +import pydarnio.exceptions.borealis_exceptions as bor_exc + +from pydarnio.tests.utils.file_utils import get_test_files, remove_temp_file +import pydarnio.tests.utils.data_sets.borealis_rawacf_data_sets as bor_rawacf +import pydarnio.tests.utils.data_sets.borealis_bfiq_data_sets as bor_bfiq +import pydarnio.tests.utils.data_sets.borealis_antennas_iq_data_sets \ + as bor_antennas_iq + + +def get_borealis_type(file_type, file_struct, version): + """ Helper function to build input needed for get_test_files + + Parameters + ---------- + file_type : str + Standard file_type input for get_test_files + file_struct : str + Borealis file structure (accepts 'array' or 'site') + version : int + Borealis version number + + Returns + ------- + borealis_type : str + Borealis-style input for get_test_files + """ + borealis_type = "borealis-v{:02d}{:s}_{:s}".format( + version, "" if file_struct == "array" else file_struct, file_type) + return borealis_type + + +class TestReadBorealis(unittest.TestCase): + """ + Testing class for reading Borealis data + """ + + def setUp(self): + self.test_file = "fake.file" + self.test_dir = os.path.join("..", "testdir") + self.data = None + self.rec = None + self.arr = None + self.read_func = pydarnio.BorealisRead + self.file_types = ["rawacf", "bfiq", "antennas_iq", "rawrf"] + self.file_struct = "site" + self.version = 4 + + def tearDown(self): + del self.test_file, self.test_dir, self.data, self.rec, self.arr + del self.read_func, self.file_types, self.file_struct, self.version + + def load_file_record(self, file_type=''): + """ Load a test file data record or array + + Parameters + ---------- + file_type : str + One of self.file_types + """ + # Load the data with the current test file + self.data = self.read_func(self.test_file, file_type, self.file_struct) + + # Read the data + self.rec = self.data.records + self.arr = self.data.arrays + + def test_return_reader(self): + """ + Test ability of return_reader function to determin the file structure + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + test_file_dict = get_test_files(get_borealis_type( + "good", self.file_struct, self.version), test_dir=self.test_dir) + + for val in self.file_types: + with self.subTest(val=val): + self.test_file = test_file_dict[val] + self.load_file_record(val) + + # Site information and data arrays require different commands + if self.file_struct == "site": + dkey = [rkey for rkey in self.rec.keys()][0] + self.assertIsInstance(self.rec[dkey]['num_slices'], + np.int64) + else: + self.assertIsInstance(self.arr['num_slices'], np.ndarray) + + def test_incorrect_filepath(self): + """ + Test raise OSError with bad filename or path + """ + for val in ["bad_dir", self.test_dir]: + with self.subTest(val=val): + # Create a test filename with path + self.test_file = os.path.join(val, self.test_file) + + # Assert correct error and message for bad filename + self.assertRaises(OSError, self.read_func, + self.test_file, self.file_types[0], + self.file_struct) + + def test_empty_file(self): + """ + Tests raise OSError or HDF5ExtError with an empty file + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + self.test_file = get_test_files("empty", test_dir=self.test_dir)[0] + self.assertRaises((OSError, tables.exceptions.HDF5ExtError), + self.read_func, self.test_file, self.file_types[0], + self.file_struct) + + def test_wrong_borealis_filetype(self): + """ + Test raises Borealis Error when specifying the wrong filetype. + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + wrong_filetype_exceptions = (bor_exc.BorealisExtraFieldError, + bor_exc.BorealisFieldMissingError, + bor_exc.BorealisDataFormatTypeError) + test_file_dict = get_test_files(get_borealis_type( + "good", self.file_struct, self.version), test_dir=self.test_dir) + + for i, val in enumerate(self.file_types): + with self.subTest(val=val): + # Use a file that is not of the current file type + self.test_file = test_file_dict[self.file_types[i - 1]] + + # Load the file, specifying the current file type + with self.assertRaises(wrong_filetype_exceptions): + self.load_file_record(val) + + def test_wrong_borealis_file_structure(self): + """ + Test raises BorealisStructureError when specifying wrong file structure + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + # Load the good files with the current file structure + test_file_dict = get_test_files(get_borealis_type( + "good", self.file_struct, self.version), test_dir=self.test_dir) + + # Change the file structure + if self.file_struct == "site": + self.file_struct = "array" + else: + self.file_struct = "site" + + # Cycle through the different file types + for val in self.file_types: + with self.subTest(val=val): + self.test_file = test_file_dict[val] + + # Attempt to load the test file with the wrong structure + with self.assertRaises(bor_exc.BorealisStructureError): + self.load_file_record(val) + + def test_read_good_data(self): + """ Test successful reading of Borealis data + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + test_file_dict = get_test_files(get_borealis_type( + "good", self.file_struct, self.version), test_dir=self.test_dir) + + for val in self.file_types: + with self.subTest(val=val): + # Set and load the test file data + self.test_file = test_file_dict[val] + self.load_file_record(val) + + # Test the first data record + first_record = self.rec[self.data.record_names[0]] + self.assertIsInstance(self.rec, OrderedDict) + self.assertIsInstance(first_record, dict) + self.assertIsInstance(first_record['num_slices'], np.int64) + + # Tset the first data array + self.assertIsInstance(self.arr, dict) + self.assertIsInstance(self.arr['num_slices'], np.ndarray) + self.assertIsInstance(self.arr['num_slices'][0], np.int64) + + +class TestWriteBorealis(unittest.TestCase): + """ Testing class for writing classes + """ + def setUp(self): + self.write_func = None + self.read_func = None + self.data_type = None + self.data = [] + self.temp_data = [] + self.nrec = 0 + self.temp_file = "not_a_file.acf" + self.file_types = ["rawacf", "bfiq", "antennas_iq", "rawrf"] + self.file_struct = "site" + + def tearDown(self): + del self.write_func, self.data_type, self.data + del self.temp_file, self.file_types, self.file_struct, self.nrec + + def load_data_w_filename(self): + """ Utility for loading data and constructing a temporary filename + """ + if self.data_type == "bfiq": + self.nrec = bor_bfiq.num_records + if self.file_struct == "site": + self.data = copy.deepcopy( + bor_bfiq.borealis_site_bfiq_data) + else: + self.data = copy.deepcopy( + bor_bfiq.borealis_array_bfiq_data) + elif self.data_type == "antennas_iq": + self.nrec = bor_antennas_iq.num_records + if self.file_struct == "site": + self.data = copy.deepcopy( + bor_antennas_iq.borealis_site_antennas_iq_data) + else: + self.data = copy.deepcopy( + bor_antennas_iq.borealis_array_antennas_iq_data) + elif self.data_type == "rawacf": + self.nrec = bor_rawacf.num_records + if self.file_struct == "site": + self.data = copy.deepcopy( + bor_rawacf.borealis_site_rawacf_data) + else: + self.data = copy.deepcopy( + bor_rawacf.borealis_array_rawacf_data) + + self.temp_file = "{:s}_{:s}_test.{:s}.hdf5".format( + self.data_type, self.file_struct, self.data_type) + + def load_temp_file(self, file_type=''): + """ Load a test file data record or array + + Parameters + ---------- + file_type : str + One of self.file_types + """ + # Load the data with the current test file + self.temp_data = self.read_func(self.temp_file, self.data_type, + self.file_struct) + + def test_writing_success(self): + """ + Tests Borealis file writing and reading + """ + for val in self.file_types: + with self.subTest(val=val): + # Load the sample data + self.data_type = val + self.load_data_w_filename() + + # Write the temporary file + self.write_func(self.temp_file, self.data, val, + self.file_struct) + + # Read the temporary file + self.load_temp_file(file_type=val) + + # Test that the data sets are the same + self.assertListEqual( + sorted([dkey for dkey in self.data.keys()]), + sorted([dkey for dkey in self.temp_data.keys()])) + + for dkey, temp_val in self.temp_data.items(): + if isinstance(temp_val, dict): + self.assertDictEqual(temp_val, self.data[dkey]) + elif isinstance(temp_val, OrderedDict): + self.assertDictEqual(dict(temp_val), + dict(self.data[dkey])) + elif isinstance(temp_val, np.ndarray): + self.assertTrue((temp_val == self.data[dkey]).all()) + else: + self.assertEqual(temp_val, self.data[dkey]) + + # Remove the temporary file + self.assertTrue(remove_temp_file(self.temp_file)) + + def test_missing_field(self): + """ + Test raises BorealisFieldMissingError when missing required field + """ + missing_field = 'num_slices' + + for val in self.file_types: + with self.subTest(val=val): + # Load the sample data + self.data_type = val + self.load_data_w_filename() + + # Remove a required field + dkeys = [dkey for dkey in self.data.keys()] + del self.data[dkeys[0]][missing_field] + + # Test raises appropriate error + with self.assertRaises( + bor_exc.BorealisFieldMissingError) as err: + self.write_func(self.temp_file, self.data, val, + self.file_struct) + + self.assertEqual(err.fields, {missing_field}) + + # Remove the temporary file, if it was created + remove_temp_file(self.temp_file) + + def test_extra_field(self): + """ + Test raises BorealisFieldMissingError when unknown field supplied + """ + extra_field = 'dummy' + + for val in self.file_types: + with self.subTest(val=val): + # Load the sample data + self.data_type = val + self.load_data_w_filename() + + # Add a fake field + dkeys = [dkey for dkey in self.data.keys()] + self.data[dkeys[0]][extra_field] = extra_field + + # Test raises appropriate error + with self.assertRaises( + bor_exc.BorealisExtraFieldError) as err: + self.write_func(self.temp_file, self.data, val, + self.file_struct) + + self.assertEqual(err.fields, {extra_field}) + self.assertEqual(err.record_name, dkeys[0]) + + # Remove the temporary file, if it was created + remove_temp_file(self.temp_file) + + def test_incorrect_data_format(self): + """ + Test raises BorealisDataFormatTypeError with badly formatted data + """ + bad_data_key = {'rawacf': 'scan_start_marker', + 'bfiq': 'first_range_rrt', + 'antenna_iq': 'num_slices'} + bad_data_val = {'rawacf': 1, 'bfiq': 5, 'antenna_iq': 'a'} + bad_data_msg = {'rawacf': "", + 'bfiq': "", + 'antenna_iq': ""} + + for val in self.file_types: + with self.subTest(val=val): + # Load the sample data + self.data_type = val + self.load_data_w_filename() + + # Add a fake field + dkeys = [dkey for dkey in self.data.keys()] + self.data[dkeys[0]][bad_data_key[val]] = bad_data_val[val] + + # Test raises appropriate error + with self.assertRaises( + bor_exc.BorealisDataFormatTypeError) as err: + self.write_func(self.temp_file, self.data, val, + self.file_struct) + + self.assertGreater( + err.incorrect_types[bad_data_key[val]].find( + bad_data_msg[val]), 0) + self.assertEqual(err.record_name, dkeys[0]) + + # Remove the temporary file, if it was created + remove_temp_file(self.temp_file) + + def test_wrong_borealis_filetype(self): + """ + Test raises Borealis Error when specifying the wrong filetype. + """ + wrong_filetype_exceptions = (bor_exc.BorealisExtraFieldError, + bor_exc.BorealisFieldMissingError, + bor_exc.BorealisDataFormatTypeError) + + for i, val in enumerate(self.file_types): + with self.subTest(val=val): + # Load the sample data that is not of the current file type + self.data_type = self.file_types[i - 1] + self.load_data_w_filename() + + # Try to write the data, specifying the current file type + with self.assertRaises(wrong_filetype_exceptions): + self.write_func(self.temp_file, self.data, val, + self.file_struct) + + # Remove the temporary file, if it was created + remove_temp_file(self.temp_file) + + def test_wrong_borealis_file_structure(self): + """ + Test raises BorealisStructureError when specifying wrong file structure + """ + # Get the opposite of the current structure + fstruct = "site" if self.file_struct == "array" else "array" + + # Cycle through the different file types + for val in self.file_types: + with self.subTest(val=val): + # Load the sample data for the current structure + self.data_type = val + self.load_data_w_filename() + + # Attempt to write the test data with the wrong structure + with self.assertRaises(bor_exc.BorealisStructureError): + self.write_func(self.temp_file, self.data, val, fstruct) + + # Remove the temporary file, if it was created + remove_temp_file(self.temp_file) + + +class TestConvertBorealis(unittest.TestCase): + """ + Testing class for converting Borealis data to standard SuperDARN data + """ + + def setUp(self): + self.test_file = "fake.file" + self.temp_file = "fake.temp" + self.test_dir = os.path.join("..", "testdir") + self.file_types = ["rawacf", "bfiq"] + self.file_struct = "site" + self.version = 4 + + def tearDown(self): + del self.test_file, self.test_dir, self.file_types, self.file_struct + del self.version, self.temp_file + + def test_convert_to_dmap(self): + """ Test successful conversion of Borealis data to DMap types + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + test_file_dict = get_test_files(get_borealis_type( + "good", self.file_struct, self.version), test_dir=self.test_dir) + + for val in self.file_types: + with self.subTest(val=val): + # Set the test file data + self.test_file = test_file_dict[val] + self.temp_file = "{:s}.temp.dmap".format(self.test_file) + + # Run the data convertion + pydarnio.BorealisConvert( + self.test_file, val, self.temp_file, + borealis_file_structure=self.file_struct) + + # Test that the file was created + self.assertTrue(remove_temp_file(self.temp_file)) diff --git a/pyDARNio/tests/utils/data_sets/__init__.py b/pyDARNio/tests/utils/data_sets/__init__.py new file mode 100644 index 0000000..c312dbf --- /dev/null +++ b/pyDARNio/tests/utils/data_sets/__init__.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# Full license can be found in License.md +# Author: Angeline G. Burrell, NRL +# ---------------------------------------------------------------------------- + +# Import Borealis data sets +from pydarnio.tests.utils.data_sets import borealis_antennas_iq_data_sets +from pydarnio.tests.utils.data_sets import borealis_bfiq_data_sets +from pydarnio.tests.utils.data_sets import borealis_rawacf_data_sets + +# Import SuperDARN data sets +from pydarnio.tests.utils.data_sets import dmap_data_sets +from pydarnio.tests.utils.data_sets import fitacf_data_sets +from pydarnio.tests.utils.data_sets import grid_data_sets +from pydarnio.tests.utils.data_sets import iqdat_data_sets +from pydarnio.tests.utils.data_sets import map_data_sets +from pydarnio.tests.utils.data_sets import rawacf_data_sets diff --git a/tests/unit/borealis_antennas_iq_data_sets.py b/pyDARNio/tests/utils/data_sets/borealis_antennas_iq_data_sets.py similarity index 100% rename from tests/unit/borealis_antennas_iq_data_sets.py rename to pyDARNio/tests/utils/data_sets/borealis_antennas_iq_data_sets.py diff --git a/tests/integration/borealis_bfiq_data_sets.py b/pyDARNio/tests/utils/data_sets/borealis_bfiq_data_sets.py similarity index 100% rename from tests/integration/borealis_bfiq_data_sets.py rename to pyDARNio/tests/utils/data_sets/borealis_bfiq_data_sets.py diff --git a/tests/integration/borealis_rawacf_data_sets.py b/pyDARNio/tests/utils/data_sets/borealis_rawacf_data_sets.py similarity index 100% rename from tests/integration/borealis_rawacf_data_sets.py rename to pyDARNio/tests/utils/data_sets/borealis_rawacf_data_sets.py diff --git a/tests/integration/dmap_data_sets.py b/pyDARNio/tests/utils/data_sets/dmap_data_sets.py similarity index 100% rename from tests/integration/dmap_data_sets.py rename to pyDARNio/tests/utils/data_sets/dmap_data_sets.py diff --git a/tests/integration/fitacf_data_sets.py b/pyDARNio/tests/utils/data_sets/fitacf_data_sets.py similarity index 100% rename from tests/integration/fitacf_data_sets.py rename to pyDARNio/tests/utils/data_sets/fitacf_data_sets.py diff --git a/pyDARNio/tests/utils/data_sets/grid_data_sets.py b/pyDARNio/tests/utils/data_sets/grid_data_sets.py new file mode 100644 index 0000000..001ebb5 --- /dev/null +++ b/pyDARNio/tests/utils/data_sets/grid_data_sets.py @@ -0,0 +1,630 @@ +# Copyright (C) 2019 SuperDARN +# Author: Marina Schmidt + +""" +Test data sets for DmapWrite +""" +import numpy as np + +from collections import OrderedDict + +from pydarnio import DmapScalar, DmapArray + +grid_data = [ + OrderedDict([('start.year', + DmapScalar(name='start.year', value=2018, data_type=2, + data_type_fmt='h')), + ('start.month', DmapScalar(name='start.month', value=2, + data_type=2, data_type_fmt='h')), + ('start.day', DmapScalar(name='start.day', value=20, + data_type=2, data_type_fmt='h')), + ('start.hour', DmapScalar(name='start.hour', value=0, + data_type=2, data_type_fmt='h')), + ('start.minute', DmapScalar(name='start.minute', value=6, + data_type=2, data_type_fmt='h')), + ('start.second', DmapScalar(name='start.second', + value=0.0040569305419921875, + data_type=8, data_type_fmt='d')), + ('end.year', DmapScalar(name='end.year', value=2018, + data_type=2, data_type_fmt='h')), + ('end.month', DmapScalar(name='end.month', value=2 + , data_type=2, data_type_fmt='h')), + ('end.day', DmapScalar(name='end.day', value=20, data_type=2, + data_type_fmt='h')), + ('end.hour', DmapScalar(name='end.hour', value=0, data_type=2, + data_type_fmt='h')), + ('end.minute', DmapScalar(name='end.minute', value=8, + data_type=2, data_type_fmt='h')), + ('end.second', DmapScalar(name='end.second', + value=0.0040569305419921875, + data_type=8, data_type_fmt='d')), + ('stid', DmapArray(name='stid', + value=np.array([65], dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('channel', DmapArray(name='channel', + value=np.array([0], dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('nvec', DmapArray(name='nvec', + value=np.array([45], dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('freq', DmapArray(name='freq', + value=np.array([11348.719], + dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('major.revision', DmapArray(name='major.revision', + value=np.array([2], + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('minor.revision', DmapArray(name='minor.revision', + value=np.array([0], + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('program.id', DmapArray(name='program.id', + value=np.array([3505], + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('noise.mean', DmapArray(name='noise.mean', + value=np.array([10.59375], + dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('noise.sd', DmapArray(name='noise.sd', + value=np.array([1.5636357], + dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('gsct', DmapArray(name='gsct', + value=np.array([1], dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('v.min', DmapArray(name='v.min', + value=np.array([35.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('v.max', DmapArray(name='v.max', + value=np.array([2500.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('p.min', DmapArray(name='p.min', + value=np.array([3.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('p.max', DmapArray(name='p.max', + value=np.array([60.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('w.min', DmapArray(name='w.min', + value=np.array([10.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('w.max', DmapArray(name='w.max', + value=np.array([1000.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('ve.min', DmapArray(name='ve.min', + value=np.array([0.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('ve.max', DmapArray(name='ve.max', + value=np.array([200.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('vector.mlat', DmapArray(name='vector.mlat', + value=np.array([72.5, 73.5, 74.5, + 79.5, 79.5, 80.5, + 73.5, 74.5, 80.5, + 72.5, 79.5, 80.5, + 82.5, 82.5, 83.5, + 81.5, 84.5, 82.5, + 80.5, 81.5, 79.5, + 81.5, 73.5, 80.5, + 83.5, 79.5, 80.5, + 81.5, 82.5, 83.5, + 79.5, 81.5, 72.5, + 80.5, 78.5, 79.5, + 80.5, 79.5, 80.5, + 73.5, 74.5, 78.5, + 79.5, 78.5, 79.5], + dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[45])), + ('vector.mlon', + DmapArray(name='vector.mlon', + value=np.array( + [335., 333.52942, 331.875, 319.0909, 313.63635, + 308.1356, 337.05884, 335.625, 314.23727, + 338.33334, 324.54544, 320.339, 310.21277, + 317.87234, 311.7073, 329.43396, 313.7143, + 333.1915, 338.64407, 336.2264, 340.9091, + 343.01886, 340.58823, 344.74576, 346.82925, + 346.36365, 350.84744, 349.8113, 356.17023, + 355.60974, 351.81818, 356.60376, 341.66666, + 356.94916, 352.5, 357.27274, 3.0508475, + 2.7272727, 9.152542, 344.11765, 346.875, 2.5, + 8.181818, 7.5, 13.636364], dtype=np.float32), + data_type=4, data_type_fmt='f', dimension=1, + shape=[45])), + ('vector.kvect', + DmapArray(name='vector.kvect', + value=np.array([150.48602, 150.38976, 149.73271, + -44.11724, -48.90261, -52.720737, + 168.25351, 159.23058, -44.17332, + 174.83675, 149.24484, 145.81033, + 133.7058, 143.56154, 139.32442, + 166.77945, 143.30453, 175.14447, + 179.95691, 175.5118, -172.71599, + -172.94543, -163.22404, -167.09595, + -164.52101, -161.34946, -155.4211, + -159.47032, -153.30176, -153.61163, + -149.5504, -146.24246, -149.24686, + -143.59334, -142.18036, -138.36761, + -132.77902, -129.27661, -123.71623, + -143.01823, -140.66672, -125.94862, + -121.524704, -120.69907, + -114.96321], dtype=np.float32), + data_type=4, data_type_fmt='f', dimension=1, + shape=[45])), + ('vector.stid', DmapArray(name='vector.stid', + value=np.full(shape=(45,), + fill_value=65, + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[45])), + ('vector.channel', DmapArray(name='vector.channel', + value=np.zeros(shape=(45,), + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[45])), + ('vector.index', + DmapArray(name='vector.index', + value=np.array([72100, 73094, 74088, 79058, 79057, + 80050, 73095, 74089, 80051, 72101, + 79059, 80052, 82040, 82041, 83035, + 81048, 84030, 82043, 80055, 81049, + 79062, 81050, 73096, 80056, 83039, + 79063, 80057, 81051, 82046, 83040, + 79064, 81052, 72102, 80058, 78070, + 79065, 80000, 79000, 80001, 73097, + 74092, 78000, 79001, 78001, 79002], + dtype=np.int32), data_type=3, + data_type_fmt='i', dimension=1, shape=[45])), + ('vector.vel.median', + DmapArray(name='vector.vel.median', + value=np.array( + [211.40865, 287.75946, 230.77419, 187.97984, + 257.93872, 260.47934, 178.85757, 232.12292, + 237.11732, 157.37292, 122.41863, 100.79391, + 46.440826, 54.64365, 61.027603, 90.12276, + 114.797516, 106.21644, 172.39407, 132.68246, + 205.91148, 207.2965, 116.40394, 219.84409, + 223.87404, 234.68289, 242.02846, 253.77455, + 248.37881, 231.41563, 215.56255, 250.5544, + 103.61616, 230.06058, 220.61739, 232.87077, + 236.41026, 244.11392, 243.74884, 66.45725, + 60.761314, 239.27852, 245.77727, 253.88075, + 260.77255], dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[45])), + ('vector.vel.sd', + DmapArray(name='vector.vel.sd', + value=np.array([31.622776, 35.35534, 35.35534, + 63.331505, 40.82483, 50., + 17.149858, 25.897175, 57.988403, + 21.821789, 53.313816, 130.36421, + 57.735027, 50., 50., 50., 70.71068, + 50., 28.867514, 50., 44.72136, + 40.82483, 18.898224, 44.72136, + 44.72136, 40.82483, 35.35534, + 70.71068, 57.735027, 70.71068, + 50., 50., 30.151134, 28.867514, + 57.735027, 35.35534, 35.35534, + 31.622776, 50., 40.82483, 50., + 44.72136, 40.82483, 50., 44.72136], + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[45]))]), + OrderedDict([('start.year', DmapScalar(name='start.year', value=2018, + data_type=2, data_type_fmt='h')), + ('start.month', DmapScalar(name='start.month', value=2, + data_type=2, data_type_fmt='h')), + ('start.day', DmapScalar(name='start.day', value=20, + data_type=2, data_type_fmt='h')), + ('start.hour', DmapScalar(name='start.hour', value=13, + data_type=2, data_type_fmt='h')), + ('start.minute', DmapScalar(name='start.minute', value=23, + data_type=2, data_type_fmt='h')), + ('start.second', DmapScalar(name='start.second', + value=0.011981964111328125, + data_type=8, data_type_fmt='d')), + ('end.year', DmapScalar(name='end.year', value=2018, + data_type=2, data_type_fmt='h')), + ('end.month', DmapScalar(name='end.month', value=2, + data_type=2, data_type_fmt='h')), + ('end.day', DmapScalar(name='end.day', value=20, data_type=2, + data_type_fmt='h')), + ('end.hour', DmapScalar(name='end.hour', value=13, + data_type=2, data_type_fmt='h')), + ('end.minute', DmapScalar(name='end.minute', value=25, + data_type=2, data_type_fmt='h')), + ('end.second', DmapScalar(name='end.second', + value=0.011981964111328125, + data_type=8, data_type_fmt='d')), + ('stid', DmapArray(name='stid', + value=np.array([65], dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('channel', DmapArray(name='channel', + value=np.array([0], dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('nvec', DmapArray(name='nvec', + value=np.array([32], dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('freq', DmapArray(name='freq', + value=np.array([11355.719], + dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('major.revision', DmapArray(name='major.revision', + value=np.array([2], + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('minor.revision', DmapArray(name='minor.revision', + value=np.array([0], + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('program.id', DmapArray(name='program.id', + value=np.array([3505], + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('noise.mean', DmapArray(name='noise.mean', + value=np.array([14.8125], + dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('noise.sd', DmapArray(name='noise.sd', + value=np.array([5.087161], + dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('gsct', DmapArray(name='gsct', + value=np.array([1], dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('v.min', DmapArray(name='v.min', + value=np.array([35.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('v.max', DmapArray(name='v.max', + value=np.array([2500.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('p.min', DmapArray(name='p.min', + value=np.array([3.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('p.max', DmapArray(name='p.max', + value=np.array([60.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('w.min', DmapArray(name='w.min', + value=np.array([10.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('w.max', DmapArray(name='w.max', + value=np.array([1000.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('ve.min', DmapArray(name='ve.min', + value=np.array([0.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('ve.max', DmapArray(name='ve.max', + value=np.array([200.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('vector.mlat', + DmapArray(name='vector.mlat', + value=np.array([75.5, 76.5, 77.5, 79.5, 74.5, 75.5, + 76.5, 77.5, 83.5, 84.5, 84.5, 85.5, + 76.5, 77.5, 86.5, 86.5, 75.5, 74.5, + 76.5, 75.5, 74.5, 78.5, 75.5, 77.5, + 76.5, 78.5, 77.5, 73.5, 74.5, 75.5, + 76.5, 77.5], dtype=np.float32), + data_type=4, data_type_fmt='f', dimension=1, + shape=[32])), + ('vector.mlon', + DmapArray(name='vector.mlon', + value=np.array( + [330., 327.85715, 325.3846, 313.63635, 335.625, + 334., 332.14285, 330., 267.80487, 272.57144, + 262.2857, 263.57144, 336.42856, 334.6154, + 270., 253.63637, 338., 339.375, 340.7143, + 342., 343.125, 347.5, 346., 348.46155, + 349.2857, 352.5, 353.07693, 344.11765, + 346.875, 350., 353.57144, 357.69232], + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[32])), + ('vector.kvect', + DmapArray(name='vector.kvect', + value=np.array( + [148.69537, 141.54613, 142.8571, 131.84319, + 170.03053, 160.40012, 157.37341, 89.2536, + -93.46017, -87.30513, -92.89313, -85.86758, + 8.765994, -11.932242, -77.360016, -86.02396, + 141.57924, 17.019497, 6.932431, 17.441008, + 25.992363, 27.482807, 32.788364, 31.261826, + 36.400013, 37.104523, 41.330643, 37.179756, + 38.110252, 41.75692, 45.872223, 49.977745], + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[32])), + ('vector.stid', DmapArray(name='vector.stid', + value=np.full(shape=(32,), + fill_value=65, + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[32])), + ('vector.channel', DmapArray(name='vector.channel', + value=np.zeros(shape=(32,), + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[32])), + ('vector.index', + DmapArray(name='vector.index', + value=np.array([75082, 76076, 77070, 79057, 74089, + 75083, 76077, 77071, 83030, 84026, + 84025, 85020, 76078, 77072, 86016, + 86015, 75084, 74090, 76079, 75085, + 74091, 78069, 75086, 77075, 76081, + 78070, 77076, 73097, 74092, 75087, + 76082, 77077], dtype=np.int32), + data_type=3, data_type_fmt='i', dimension=1, + shape=[32])), + ('vector.vel.median', + DmapArray(name='vector.vel.median', + value=np.array( + [86.22557, 55.99529, 77.1204, 138.94217, + 53.439465, 83.13799, 65.69839, 8.872497, + 140.93784, 136.43436, 125.74353, 107.80217, + 10.187439, 137.04274, 118.45908, 98.89083, + 5.5379543, 81.491165, 50.020416, 95.97311, + 182.38617, 154.7921, 158.80106, 146.97353, + 85.35316, 205.68631, 121.89034, 218.41821, + 200.13217, 186.16425, 74.23934, 202.2707], + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[32])), + ('vector.vel.sd', + DmapArray(name='vector.vel.sd', + value=np.array( + [31.622776, 45.96998, 57.735027, 70.71068, + 22.96239, 25.858837, 33.51713, 53.530884, + 70.71068, 70.71068, 50., 40.82483, 23.570227, + 31.957285, 57.735027, 70.71068, 22.566723, + 27.893995, 23.570227, 26.726124, 22.094053, + 74.42324, 22.941574, 37.93341, 27.748476, + 49.585766, 31.773098, 58.097965, 31.622776, + 35.35534, 31.622776, 34.513107], + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[32]))]), + OrderedDict([('start.year', DmapScalar(name='start.year', value=2018, + data_type=2, data_type_fmt='h')), + ('start.month', DmapScalar(name='start.month', value=2, + data_type=2, data_type_fmt='h')), + ('start.day', DmapScalar(name='start.day', value=20, + data_type=2, data_type_fmt='h')), + ('start.hour', DmapScalar(name='start.hour', value=23, + data_type=2, data_type_fmt='h')), + ('start.minute', DmapScalar(name='start.minute', value=50, + data_type=2, data_type_fmt='h')), + ('start.second', DmapScalar(name='start.second', + value=0.025077104568481445, + data_type=8, data_type_fmt='d')), + ('end.year', DmapScalar(name='end.year', value=2018, + data_type=2, data_type_fmt='h')), + ('end.month', DmapScalar(name='end.month', value=2, + data_type=2, data_type_fmt='h')), + ('end.day', DmapScalar(name='end.day', value=20, data_type=2, + data_type_fmt='h')), + ('end.hour', DmapScalar(name='end.hour', value=23, + data_type=2, data_type_fmt='h')), + ('end.minute', DmapScalar(name='end.minute', value=52, + data_type=2, data_type_fmt='h')), + ('end.second', DmapScalar(name='end.second', + value=0.025077104568481445, + data_type=8, data_type_fmt='d')), + ('stid', DmapArray(name='stid', + value=np.array([65], dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('channel', DmapArray(name='channel', + value=np.array([0], dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('nvec', DmapArray(name='nvec', + value=np.array([48], dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('freq', DmapArray(name='freq', + value=np.array([11333.656], + dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('major.revision', DmapArray(name='major.revision', + value=np.array([2], + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('minor.revision', DmapArray(name='minor.revision', + value=np.array([0], + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('program.id', DmapArray(name='program.id', + value=np.array([3505], + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('noise.mean', DmapArray(name='noise.mean', + value=np.array([12.53125], + dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('noise.sd', DmapArray(name='noise.sd', + value=np.array([1.5820909], + dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('gsct', DmapArray(name='gsct', + value=np.array([1], dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[1])), + ('v.min', DmapArray(name='v.min', + value=np.array([35.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('v.max', DmapArray(name='v.max', + value=np.array([2500.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('p.min', DmapArray(name='p.min', + value=np.array([3.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('p.max', DmapArray(name='p.max', + value=np.array([60.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('w.min', DmapArray(name='w.min', + value=np.array([10.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('w.max', DmapArray(name='w.max', + value=np.array([1000.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('ve.min', DmapArray(name='ve.min', + value=np.array([0.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('ve.max', DmapArray(name='ve.max', + value=np.array([200.], dtype=np.float32), + data_type=4, data_type_fmt='f', + dimension=1, shape=[1])), + ('vector.mlat', + DmapArray(name='vector.mlat', + value=np.array( + [79.5, 79.5, 80.5, 79.5, 80.5, 81.5, 80.5, + 81.5, 82.5, 80.5, 81.5, 82.5, 82.5, 83.5, + 84.5, 80.5, 81.5, 83.5, 84.5, 81.5, 82.5, + 84.5, 82.5, 83.5, 84.5, 80.5, 81.5, 82.5, + 83.5, 84.5, 81.5, 82.5, 83.5, 80.5, 81.5, + 82.5, 83.5, 80.5, 81.5, 82.5, 80.5, 81.5, + 81.5, 79.5, 80.5, 80.5, 79.5, 79.5], + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[48])), + ('vector.mlon', + DmapArray(name='vector.mlon', + value=np.array( + [319.0909, 313.63635, 314.23727, 324.54544, + 320.339, 315.84906, 326.44067, 322.6415, + 317.87234, 332.54236, 329.43396, 325.53192, + 333.1915, 329.26828, 324., 338.64407, + 336.2264, 338.04877, 334.2857, 343.01886, + 340.85107, 344.57144, 348.51065, 346.82925, + 354.85715, 350.84744, 349.8113, 356.17023, + 355.60974, 5.142857, 356.60376, 3.8297873, + 4.390244, 356.94916, 3.3962264, 11.489362, + 13.170732, 3.0508475, 10.18868, 19.148935, + 9.152542, 16.981133, 23.773584, 8.181818, + 15.254237, 21.355932, 13.636364, 19.09091], + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[48])), + ('vector.kvect', + DmapArray(name='vector.kvect', + value=np.array( + [1.3776143e+02, 1.3067482e+02, 1.3548923e+02, + 1.5051083e+02, 1.4419740e+02, 1.4045711e+02, + 1.5574120e+02, 1.5187080e+02, 1.4506064e+02, + 1.6567052e+02, 1.6373940e+02, 1.5515234e+02, + -5.0249748e+00, -1.6617077e+01, + -1.8794113e+01, 1.7961696e+02, 1.7558623e+02, + -8.2697503e-02, -6.7042108e+00, 9.9063320e+00, + 4.3262248e+00, 6.0504212e+00, 1.6758739e+01, + 1.5605538e+01, 2.2159294e+01, 2.5681110e+01, + 2.0525904e+01, 2.8494555e+01, 2.7147511e+01, + 3.3622570e+01, 3.1760328e+01, 4.1792263e+01, + 3.9918575e+01, 3.5687832e+01, 4.3404911e+01, + 5.2630638e+01, 5.2512428e+01, 4.8060982e+01, + 5.4476559e+01, 6.0645481e+01, 5.5574818e+01, + 6.2865593e+01, 7.1008202e+01, 5.8256989e+01, + 6.3870285e+01, 7.1036896e+01, 6.4951691e+01, + 7.0386543e+01], dtype=np.float32), + data_type=4, data_type_fmt='f', dimension=1, + shape=[48])), + ('vector.stid', DmapArray(name='vector.stid', + value=np.full(shape=(48,), + fill_value=65, + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[48])), + ('vector.channel', DmapArray(name='vector.channel', + value=np.zeros(shape=(48,), + dtype=np.int16), + data_type=2, data_type_fmt='h', + dimension=1, shape=[48])), + ('vector.index', + DmapArray(name='vector.index', + value=np.array( + [79058, 79057, 80051, 79059, 80052, 81046, + 80053, 81047, 82041, 80054, 81048, 82042, + 82043, 83037, 84031, 80055, 81049, 83038, + 84032, 81050, 82044, 84033, 82045, 83039, + 84034, 80057, 81051, 82046, 83040, 84000, + 81052, 82000, 83000, 80058, 81000, 82001, + 83001, 80000, 81001, 82002, 80001, 81002, + 81003, 79001, 80002, 80003, 79002, 79003], + dtype=np.int32), data_type=3, + data_type_fmt='i', dimension=1, shape=[48])), + ('vector.vel.median', + DmapArray(name='vector.vel.median', + value=np.array( + [168.87584, 378.16104, 390.48422, 264.72037, + 340.24277, 261.96246, 166.4799, 175.58917, + 170.59193, 100.241035, 117.02003, 113.83192, + 110.63128, 124.69313, 85.883835, 59.58456, + 29.183453, 149.87598, 87.57454, 106.41398, + 144.1112, 100.86157, 209.35103, 177.68849, + 153.74188, 261.6218, 219.8409, 224.89569, + 188.59256, 165.06386, 293.19037, 210.94766, + 194.56616, 271.47748, 303.23712, 199.45433, + 204.04663, 253.03906, 293.68582, 228.18443, + 280.49426, 255.60298, 223.19438, 196.14743, + 268.67493, 253.27917, 202.5746, 262.70676], + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[48])), + ('vector.vel.sd', + DmapArray(name='vector.vel.sd', + value=np.array( + [65.60137, 56.20039, 39.431385, 52.887394, + 69.346954, 43.638535, 52.373154, 39.7046, + 39.206783, 44.322094, 31.622776, 39.10426, + 42.038414, 50., 44.72136, 35.902393, + 50.005493, 28.867514, 40.82483, 32.031635, + 40.82483, 40.82483, 40.82483, 40.82483, + 35.35534, 48.513336, 41.15344, 35.35534, + 40.82483, 44.72136, 35.531113, 35.35534, + 35.35534, 36.263626, 35.35534, 40.82483, + 40.82483, 40.907024, 35.35534, 40.82483, + 40.82483, 40.82483, 40.82483, 40.82483, 50., + 35.35534, 44.72136, 57.735027], + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[48]))])] diff --git a/tests/integration/iqdat_data_sets.py b/pyDARNio/tests/utils/data_sets/iqdat_data_sets.py similarity index 100% rename from tests/integration/iqdat_data_sets.py rename to pyDARNio/tests/utils/data_sets/iqdat_data_sets.py diff --git a/tests/unit/map_data_sets.py b/pyDARNio/tests/utils/data_sets/map_data_sets.py similarity index 89% rename from tests/unit/map_data_sets.py rename to pyDARNio/tests/utils/data_sets/map_data_sets.py index 70022ae..066c9d3 100644 --- a/tests/unit/map_data_sets.py +++ b/pyDARNio/tests/utils/data_sets/map_data_sets.py @@ -12,177 +12,345 @@ map_data = [OrderedDict([ ('start.year', DmapScalar(name='start.year', value=2017, data_type=2, data_type_fmt='h')), - ('start.month', DmapScalar(name='start.month', value=1, data_type=2, data_type_fmt='h')), - ('start.day', DmapScalar(name='start.day', value=14, data_type=2, data_type_fmt='h')), - ('start.hour', DmapScalar(name='start.hour', value=0, data_type=2, data_type_fmt='h')), - ('start.minute', DmapScalar(name='start.minute', value=4, data_type=2, data_type_fmt='h')), - ('start.second', DmapScalar(name='start.second', value=0.0, data_type=8, data_type_fmt='d')), - ('end.year', DmapScalar(name='end.year', value=2017, data_type=2, data_type_fmt='h')), - ('end.month', DmapScalar(name='end.month', value=1, data_type=2, data_type_fmt='h')), - ('end.day', DmapScalar(name='end.day', value=14, data_type=2, data_type_fmt='h')), - ('end.hour', DmapScalar(name='end.hour', value=0, data_type=2, data_type_fmt='h')), - ('end.minute', DmapScalar(name='end.minute', value=6, data_type=2, data_type_fmt='h')), - ('end.second', DmapScalar(name='end.second', value=0.0, data_type=8, data_type_fmt='d')), - ('map.major.revision', DmapScalar(name='map.major.revision', value=1, data_type=2, data_type_fmt='h')), - ('map.minor.revision', DmapScalar(name='map.minor.revision', value=13, data_type=2, data_type_fmt='h')), - ('source', DmapScalar(name='source', value='map_fit', data_type=9, data_type_fmt='s')), - ('doping.level', DmapScalar(name='doping.level', value=1, data_type=2, data_type_fmt='h')), - ('model.wt', DmapScalar(name='model.wt', value=1, data_type=2, data_type_fmt='h')), - ('error.wt', DmapScalar(name='error.wt', value=1, data_type=2, data_type_fmt='h')), - ('IMF.flag', DmapScalar(name='IMF.flag', value=9, data_type=2, data_type_fmt='h')), - ('IMF.delay', DmapScalar(name='IMF.delay', value=10, data_type=2, data_type_fmt='h')), - ('IMF.Bx', DmapScalar(name='IMF.Bx', value=2.5199999809265137, data_type=8, data_type_fmt='d')), - ('IMF.By', DmapScalar(name='IMF.By', value=-1.5099999904632568, data_type=8, data_type_fmt='d')), - ('IMF.Bz', DmapScalar(name='IMF.Bz', value=0.699999988079071, data_type=8, data_type_fmt='d')), - ('IMF.Vx', DmapScalar(name='IMF.Vx', value=0.0, data_type=8, data_type_fmt='d')), - ('IMF.tilt', DmapScalar(name='IMF.tilt', value=-23.665531158447266, data_type=8, data_type_fmt='d')), - ('IMF.Kp', DmapScalar(name='IMF.Kp', value=0.0, data_type=8, data_type_fmt='d')), - ('model.angle', DmapScalar(name='model.angle', value='Bang 295 deg.', data_type=9, data_type_fmt='s')), - ('model.level', DmapScalar(name='model.level', value='Esw 0.7 mV/m', data_type=9, data_type_fmt='s')), - ('model.tilt', DmapScalar(name='model.tilt', value='tilt -20.0 deg.', data_type=9, data_type_fmt='s')), - ('model.name', DmapScalar(name='model.name', value='TS18', data_type=9, data_type_fmt='s')), - ('hemisphere', DmapScalar(name='hemisphere', value=1, data_type=2, data_type_fmt='h')), - ('noigrf', DmapScalar(name='noigrf', value=0, data_type=2, data_type_fmt='h')), - ('fit.order', DmapScalar(name='fit.order', value=8, data_type=2, data_type_fmt='h')), - ('latmin', DmapScalar(name='latmin', value=65.0, data_type=4, data_type_fmt='f')), - ('chi.sqr', DmapScalar(name='chi.sqr', value=39.80883844039058, data_type=8, data_type_fmt='d')), - ('chi.sqr.dat', DmapScalar(name='chi.sqr.dat', value=30.363247800324267, data_type=8, data_type_fmt='d')), - ('rms.err', DmapScalar(name='rms.err', value=62.66932120313692, data_type=8, data_type_fmt='d')), - ('lon.shft', DmapScalar(name='lon.shft', value=0.0, data_type=4, data_type_fmt='f')), - ('lat.shft', DmapScalar(name='lat.shft', value=0.0, data_type=4, data_type_fmt='f')), - ('mlt.start', DmapScalar(name='mlt.start', value=18.76207989601823, data_type=8, data_type_fmt='d')), - ('mlt.end', DmapScalar(name='mlt.end', value=18.795821413533837, data_type=8, data_type_fmt='d')), - ('mlt.av', DmapScalar(name='mlt.av', value=18.77894573725918, data_type=8, data_type_fmt='d')), - ('pot.drop', DmapScalar(name='pot.drop', value=19267.26768244645, data_type=8, data_type_fmt='d')), - ('pot.drop.err', DmapScalar(name='pot.drop.err', value=62573716.41237898, data_type=8, data_type_fmt='d')), - ('pot.max', DmapScalar(name='pot.max', value=5843.063179706099, data_type=8, data_type_fmt='d')), - ('pot.max.err', DmapScalar(name='pot.max.err', value=44885041.9018604, data_type=8, data_type_fmt='d')), - ('pot.min', DmapScalar(name='pot.min', value=-13424.204502740353, data_type=8, data_type_fmt='d')), - ('pot.min.err', DmapScalar(name='pot.min.err', value=43598199.49407387, data_type=8, data_type_fmt='d')), - ('stid', DmapArray(name='stid', value=np.array([209, 208, 33, 66, 66, 207, 206, 205, 204, 10, 10, 64, 64, - 3, 7, 16, 6, 6, 5, 5, 8], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('channel', DmapArray(name='channel', value=np.array([1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 4, 1, 1, 2, 1, 2, 0], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('nvec', DmapArray(name='nvec', value=np.array([0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 1, 7, 7, 0, 5, 0, 8, - 22, 14, 0, 11], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('freq', DmapArray(name='freq', value=np.array([13666.159, 13858.704, 10844.5, 12325., 12325., - 14729.725, 14728.45, 11626.714, 11533.381, 11211.875, - 11166.5, 12391., 12391., 10261.375, 10540.219, - 10870., 10609., 13193.5, 10665.5625, 13160.3125, - 9415.533], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('major.revision', DmapArray(name='major.revision', value=np.array([2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('minor.revision', DmapArray(name='minor.revision', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('program.id', DmapArray(name='program.id', value=np.array([-157, -157, -3300, -3560, -3560, -191, -191, -3300, - -3300, 153, -26007, -3560, -3560, -3300, -157, -157, - -3505, -3505, -3505, -3505, -3300], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('noise.mean', DmapArray(name='noise.mean', value=np.array([1.4022727e+01, 2.0227272e+01, 3.4999999e-01, 4.7000000e+03, - 4.7000000e+03, 2.3575001e+01, 1.5775000e+01, 7.9142860e+01, - 1.3233333e+02, 1.8137500e+02, 4.7500000e+01, 1.4750000e+03, - 1.4750000e+03, 1.9093750e+02, 7.3187500e+01, 3.2500000e+00, - 1.3775000e+02, 2.5937500e+01, 1.1887500e+02, 4.9875000e+01, - 8.4800000e+02], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('noise.sd', DmapArray(name='noise.sd', value=np.array([1.0980033e+00, 2.1252029e+00, 6.5383482e-01, 0.0000000e+00, - 0.0000000e+00, 4.0908990e+00, 1.1613951e+00, 9.1510382e+00, - 5.2862206e+01, 1.1835456e+01, 0.0000000e+00, 0.0000000e+00, - 0.0000000e+00, 3.6617054e+01, 7.3155947e+00, 4.2691240e-01, - 1.2339292e+02, 4.8921971e+00, 6.0997822e+01, 7.1382660e+01, - 2.5427649e+03], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('gsct', DmapArray(name='gsct', value=np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('v.min', DmapArray(name='v.min', value=np.array([35., 35., 35., 35., 35., 35., 35., 35., 35., 35., 35., 35., 35., - 35., 35., 35., 35., 35., 35., 35., 35.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('v.max', DmapArray(name='v.max', value=np.array([2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., - 2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., - 2500., 2500., 2500.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('p.min', DmapArray(name='p.min', value=np.array([3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., - 3., 3., 3., 3.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('p.max', DmapArray(name='p.max', value=np.array([60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., - 60., 60., 60., 60., 60., 60., 60., 60.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('w.min', DmapArray(name='w.min', value=np.array([10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., - 10., 10., 10., 10., 10., 10., 10., 10.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('w.max', DmapArray(name='w.max', value=np.array([1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., - 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., - 1000., 1000., 1000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('ve.min', DmapArray(name='ve.min', value=np.array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('ve.max', DmapArray(name='ve.max', value=np.array([1000000., 1000000., 1000000., 1000000., 1000000., 1000000., - 1000000., 1000000., 1000000., 1000000., 1000000., 1000000., - 1000000., 1000000., 1000000., 1000000., 1000000., 1000000., - 1000000., 1000000., 1000000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('vector.mlat', DmapArray(name='vector.mlat', value=np.array([78.5, 78.5, 79.5, 79.5, 81.5, 81.5, 80.5, 78.5, 78.5, 79.5, 79.5, - 81.5, 81.5, 80.5, 63.5, 73.5, 78.5, 78.5, 79.5, 80.5, 81.5, 82.5, - 73.5, 78.5, 78.5, 79.5, 80.5, 81.5, 82.5, 78.5, 77.5, 78.5, 77.5, - 77.5, 79.5, 79.5, 80.5, 79.5, 80.5, 79.5, 80.5, 81.5, 69.5, 69.5, - 70.5, 71.5, 71.5, 71.5, 72.5, 70.5, 71.5, 72.5, 70.5, 71.5, 72.5, - 73.5, 70.5, 71.5, 72.5, 73.5, 71.5, 72.5, 70.5, 72.5, 69.5, 70.5, - 70.5, 71.5, 72.5, 73.5, 71.5, 73.5, 70.5, 71.5, 72.5, 73.5, 72.5, - 70.5, 68.5, 67.5, 68.5, 69.5, 68.5, 69.5, 69.5, 68.5, 70.5, 69.5, - 70.5], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[89])), - ('vector.mlon', DmapArray(name='vector.mlon', value=np.array([12.5, 7.5, 8.181818, 2.7272727, 343.01886, - 322.6415, 320.339, 12.5, 7.5, 8.181818, - 2.7272727, 343.01886, 322.6415, 320.339, 103.97516, - 280.58823, 282.5, 287.5, 286.36365, 289.8305, - 288.67926, 294.89362, 280.58823, 282.5, 287.5, - 286.36365, 289.8305, 288.67926, 294.89362, 302.5, - 302.30768, 307.5, 306.92307, 311.53845, 302.72726, - 308.18182, 308.1356, 313.63635, 314.23727, 319.0909, - 320.339, 329.43396, 278.57144, 281.42856, 286.5, - 285.78946, 288.94736, 292.10526, 291.66666, 295.5, - 295.26315, 295., 298.5, 298.42105, 298.33334, - 298.2353, 301.5, 301.57895, 301.66666, 301.7647, - 304.73685, 305., 304.5, 308.33334, 315.7143, - 316.5, 313.5, 314.21054, 315., 312.35294, - 317.3684, 315.88235, 319.5, 320.5263, 318.33334, - 319.41177, 321.66666, 325.5, 53.18182, 58.695652, - 55.909092, 52.857143, 58.636364, 55.714287, 58.57143, - 61.363636, 58.5, 61.42857, 61.5], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[89])), - ('vector.kvect', DmapArray(name='vector.kvect', value=np.array([129.11713, 126.74036, 129.43018, -59.188175, - 98.50512, 80.42348, 75.69116, 129.11713, - 126.74036, 129.43018, -59.188175, 98.50512, - 80.42348, 75.69116, 5.3487244, 10.402584, - 14.785839, 15.429902, -35.943424, 20.576845, - 20.34991, 21.785473, 10.402584, 14.785839, - 15.429902, -35.943424, 20.576845, 20.34991, - 21.785473, 48.44863, 53.48781, -123.236755, - -119.82997, -118.107376, 3.8013902, 12.560586, - 13.944878, 22.161648, 24.005245, 31.447266, - 33.86883, 40.17791, -49.860504, -46.643433, - -30.441378, -28.282873, -24.79395, -17.491783, - -14.234547, 171.96645, -8.580771, -8.799448, - -179.43964, -2.5106738, -0.3186142, -0.5526578, - -170.8527, 7.261834, 7.6403155, 7.9380827, - 13.710478, 10.7870865, -163.56581, -161.49174, - -7.7182574, -6.8226385, -10.626968, -10.920318, - -8.530712, -11.8747835, -2.9404123, -5.600803, - 0.2846103, 3.424564, 0.5950424, 0.6806656, - 6.334974, -160.16771, 127.07647, -43.32296, - 132.45633, 129.95958, -33.12576, -35.21408, - -31.327961, -24.226963, 152.3547, -20.693926, - 159.82927], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[89])), - ('vector.stid', DmapArray(name='vector.stid', value=np.array([66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 10, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 7, 7, 7, 7, 7, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[89])), - ('vector.channel', DmapArray(name='vector.channel', value=np.array([1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[89])), - ('vector.index', DmapArray(name='vector.index', value=np.array([78002, 78001, 79001, 79000, 81050, 81047, 80052, 78002, 78001, - 79001, 79000, 81050, 81047, 80052, 63046, 73079, 78056, 78057, - 79052, 80047, 81042, 82038, 73079, 78056, 78057, 79052, 80047, - 81042, 82038, 78060, 77065, 78061, 77066, 77067, 79055, 79056, - 80050, 79057, 80051, 79058, 80052, 81048, 69097, 69098, 70095, - 71090, 71091, 71092, 72087, 70098, 71093, 72088, 70099, 71094, - 72089, 73084, 70100, 71095, 72090, 73085, 71096, 72091, 70101, - 72092, 69110, 70105, 70104, 71099, 72094, 73088, 71100, 73089, - 70106, 71101, 72095, 73090, 72096, 70108, 68019, 67022, 68020, - 69018, 68021, 69019, 69020, 68022, 70019, 69021, 70020], - dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[89])), + ('start.month', DmapScalar(name='start.month', value=1, data_type=2, + data_type_fmt='h')), + ('start.day', DmapScalar(name='start.day', value=14, data_type=2, + data_type_fmt='h')), + ('start.hour', DmapScalar(name='start.hour', value=0, data_type=2, + data_type_fmt='h')), + ('start.minute', DmapScalar(name='start.minute', value=4, data_type=2, + data_type_fmt='h')), + ('start.second', DmapScalar(name='start.second', value=0.0, data_type=8, + data_type_fmt='d')), + ('end.year', DmapScalar(name='end.year', value=2017, data_type=2, + data_type_fmt='h')), + ('end.month', DmapScalar(name='end.month', value=1, data_type=2, + data_type_fmt='h')), + ('end.day', DmapScalar(name='end.day', value=14, data_type=2, + data_type_fmt='h')), + ('end.hour', DmapScalar(name='end.hour', value=0, data_type=2, + data_type_fmt='h')), + ('end.minute', DmapScalar(name='end.minute', value=6, data_type=2, + data_type_fmt='h')), + ('end.second', DmapScalar(name='end.second', value=0.0, data_type=8, + data_type_fmt='d')), + ('map.major.revision', DmapScalar(name='map.major.revision', value=1, + data_type=2, data_type_fmt='h')), + ('map.minor.revision', DmapScalar(name='map.minor.revision', value=13, + data_type=2, data_type_fmt='h')), + ('source', DmapScalar(name='source', value='map_fit', data_type=9, + data_type_fmt='s')), + ('doping.level', DmapScalar(name='doping.level', value=1, data_type=2, + data_type_fmt='h')), + ('model.wt', DmapScalar(name='model.wt', value=1, data_type=2, + data_type_fmt='h')), + ('error.wt', DmapScalar(name='error.wt', value=1, data_type=2, + data_type_fmt='h')), + ('IMF.flag', DmapScalar(name='IMF.flag', value=9, data_type=2, + data_type_fmt='h')), + ('IMF.delay', DmapScalar(name='IMF.delay', value=10, data_type=2, + data_type_fmt='h')), + ('IMF.Bx', DmapScalar(name='IMF.Bx', value=2.5199999809265137, data_type=8, + data_type_fmt='d')), + ('IMF.By', DmapScalar(name='IMF.By', value=-1.5099999904632568, + data_type=8, data_type_fmt='d')), + ('IMF.Bz', DmapScalar(name='IMF.Bz', value=0.699999988079071, data_type=8, + data_type_fmt='d')), + ('IMF.Vx', DmapScalar(name='IMF.Vx', value=0.0, data_type=8, + data_type_fmt='d')), + ('IMF.tilt', DmapScalar(name='IMF.tilt', value=-23.665531158447266, + data_type=8, data_type_fmt='d')), + ('IMF.Kp', DmapScalar(name='IMF.Kp', value=0.0, data_type=8, + data_type_fmt='d')), + ('model.angle', DmapScalar(name='model.angle', value='Bang 295 deg.', + data_type=9, data_type_fmt='s')), + ('model.level', DmapScalar(name='model.level', value='Esw 0.7 mV/m', + data_type=9, data_type_fmt='s')), + ('model.tilt', DmapScalar(name='model.tilt', value='tilt -20.0 deg.', + data_type=9, data_type_fmt='s')), + ('model.name', DmapScalar(name='model.name', value='TS18', data_type=9, + data_type_fmt='s')), + ('hemisphere', DmapScalar(name='hemisphere', value=1, data_type=2, + data_type_fmt='h')), + ('noigrf', DmapScalar(name='noigrf', value=0, data_type=2, + data_type_fmt='h')), + ('fit.order', DmapScalar(name='fit.order', value=8, data_type=2, + data_type_fmt='h')), + ('latmin', DmapScalar(name='latmin', value=65.0, data_type=4, + data_type_fmt='f')), + ('chi.sqr', DmapScalar(name='chi.sqr', value=39.80883844039058, + data_type=8, data_type_fmt='d')), + ('chi.sqr.dat', DmapScalar(name='chi.sqr.dat', value=30.363247800324267, + data_type=8, data_type_fmt='d')), + ('rms.err', DmapScalar(name='rms.err', value=62.66932120313692, + data_type=8, data_type_fmt='d')), + ('lon.shft', DmapScalar(name='lon.shft', value=0.0, data_type=4, + data_type_fmt='f')), + ('lat.shft', DmapScalar(name='lat.shft', value=0.0, data_type=4, + data_type_fmt='f')), + ('mlt.start', DmapScalar(name='mlt.start', value=18.76207989601823, + data_type=8, data_type_fmt='d')), + ('mlt.end', DmapScalar(name='mlt.end', value=18.795821413533837, + data_type=8, data_type_fmt='d')), + ('mlt.av', DmapScalar(name='mlt.av', value=18.77894573725918, data_type=8, + data_type_fmt='d')), + ('pot.drop', DmapScalar(name='pot.drop', value=19267.26768244645, + data_type=8, data_type_fmt='d')), + ('pot.drop.err', DmapScalar(name='pot.drop.err', value=62573716.41237898, + data_type=8, data_type_fmt='d')), + ('pot.max', DmapScalar(name='pot.max', value=5843.063179706099, + data_type=8, data_type_fmt='d')), + ('pot.max.err', DmapScalar(name='pot.max.err', value=44885041.9018604, + data_type=8, data_type_fmt='d')), + ('pot.min', DmapScalar(name='pot.min', value=-13424.204502740353, + data_type=8, data_type_fmt='d')), + ('pot.min.err', DmapScalar(name='pot.min.err', value=43598199.49407387, + data_type=8, data_type_fmt='d')), + ('stid', DmapArray(name='stid', + value=np.array([209, 208, 33, 66, 66, 207, 206, 205, + 204, 10, 10, 64, 64, 3, 7, 16, 6, 6, 5, + 5, 8], dtype=np.int16), data_type=2, + data_type_fmt='h', dimension=1, shape=[21])), + ('channel', DmapArray(name='channel', + value=np.array([1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 2, 1, + 0, 0, 4, 1, 1, 2, 1, 2, 0], + dtype=np.int16), data_type=2, + data_type_fmt='h', dimension=1, shape=[21])), + ('nvec', DmapArray(name='nvec', + value=np.array([0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 1, 7, 7, + 0, 5, 0, 8, 22, 14, 0, 11], + dtype=np.int16), data_type=2, + data_type_fmt='h', dimension=1, shape=[21])), + ('freq', DmapArray(name='freq', + value=np.array([13666.159, 13858.704, 10844.5, 12325., + 12325., 14729.725, 14728.45, 11626.714, + 11533.381, 11211.875, 11166.5, 12391., + 12391., 10261.375, 10540.219, 10870., + 10609., 13193.5, 10665.5625, 13160.3125, + 9415.533], dtype=np.float32), + data_type=4, data_type_fmt='f', dimension=1, + shape=[21])), + ('major.revision', DmapArray(name='major.revision', + value=np.full(shape=(21,), fill_value=2, + dtype=np.int16), data_type=2, + data_type_fmt='h', dimension=1, shape=[21])), + ('minor.revision', DmapArray(name='minor.revision', + value=np.zeros(shape=(21,), dtype=np.int16), + data_type=2, data_type_fmt='h', dimension=1, + shape=[21])), + ('program.id', DmapArray(name='program.id', + value=np.array([-157, -157, -3300, -3560, -3560, + -191, -191, -3300, -3300, 153, + -26007, -3560, -3560, -3300, -157, + -157, -3505, -3505, -3505, -3505, + -3300], dtype=np.int16), + data_type=2, data_type_fmt='h', dimension=1, + shape=[21])), + ('noise.mean', DmapArray(name='noise.mean', + value=np.array([1.4022727e+01, 2.0227272e+01, + 3.4999999e-01, 4.7000000e+03, + 4.7000000e+03, 2.3575001e+01, + 1.5775000e+01, 7.9142860e+01, + 1.3233333e+02, 1.8137500e+02, + 4.7500000e+01, 1.4750000e+03, + 1.4750000e+03, 1.9093750e+02, + 7.3187500e+01, 3.2500000e+00, + 1.3775000e+02, 2.5937500e+01, + 1.1887500e+02, 4.9875000e+01, + 8.4800000e+02], dtype=np.float32), + data_type=4, data_type_fmt='f', dimension=1, + shape=[21])), + ('noise.sd', DmapArray(name='noise.sd', + value=np.array([1.0980033e+00, 2.1252029e+00, + 6.5383482e-01, 0.0000000e+00, + 0.0000000e+00, 4.0908990e+00, + 1.1613951e+00, 9.1510382e+00, + 5.2862206e+01, 1.1835456e+01, + 0.0000000e+00, 0.0000000e+00, + 0.0000000e+00, 3.6617054e+01, + 7.3155947e+00, 4.2691240e-01, + 1.2339292e+02, 4.8921971e+00, + 6.0997822e+01, 7.1382660e+01, + 2.5427649e+03], dtype=np.float32), + data_type=4, data_type_fmt='f', dimension=1, + shape=[21])), + ('gsct', DmapArray(name='gsct', value=np.ones(shape=(21,), dtype=np.int16), + data_type=2, data_type_fmt='h', dimension=1, + shape=[21])), + ('v.min', DmapArray(name='v.min', + value=np.full(shape=(21,), fill_value=32.0, + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[21])), + ('v.max', DmapArray(name='v.max', + value=np.full(shape=(21,), fill_value=2500.0, + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[21])), + ('p.min', DmapArray(name='p.min', + value=np.full(shape=(21,), fill_value=3.0, + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[21])), + ('p.max', DmapArray(name='p.max', + value=np.full(shape=(21,), fill_value=60.0, + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[21])), + ('w.min', DmapArray(name='w.min', + value=np.full(shape=(21,), fill_value=10.0, + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[21])), + ('w.max', DmapArray(name='w.max', + value=np.full(shape=(21,), fill_value=1000.0, + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[21])), + ('ve.min', DmapArray(name='ve.min', + value=np.zeros(shape=(21,), dtype=np.float32), + data_type=4, data_type_fmt='f', dimension=1, + shape=[21])), + ('ve.max', DmapArray(name='ve.max', + value=np.full(shape=(21,), fill_value=1000000.0, + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[21])), + ('vector.mlat', DmapArray(name='vector.mlat', + value=np.array([78.5, 78.5, 79.5, 79.5, 81.5, + 81.5, 80.5, 78.5, 78.5, 79.5, + 79.5, 81.5, 81.5, 80.5, 63.5, + 73.5, 78.5, 78.5, 79.5, 80.5, + 81.5, 82.5, 73.5, 78.5, 78.5, + 79.5, 80.5, 81.5, 82.5, 78.5, + 77.5, 78.5, 77.5, 77.5, 79.5, + 79.5, 80.5, 79.5, 80.5, 79.5, + 80.5, 81.5, 69.5, 69.5, 70.5, + 71.5, 71.5, 71.5, 72.5, 70.5, + 71.5, 72.5, 70.5, 71.5, 72.5, + 73.5, 70.5, 71.5, 72.5, 73.5, + 71.5, 72.5, 70.5, 72.5, 69.5, + 70.5, 70.5, 71.5, 72.5, 73.5, + 71.5, 73.5, 70.5, 71.5, 72.5, + 73.5, 72.5, 70.5, 68.5, 67.5, + 68.5, 69.5, 68.5, 69.5, 69.5, + 68.5, 70.5, 69.5, 70.5], + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[89])), + ('vector.mlon', DmapArray(name='vector.mlon', + value=np.array([12.5, 7.5, 8.181818, 2.7272727, + 343.01886, 322.6415, 320.339, + 12.5, 7.5, 8.181818, 2.7272727, + 343.01886, 322.6415, 320.339, + 103.97516, 280.58823, 282.5, + 287.5, 286.36365, 289.8305, + 288.67926, 294.89362, 280.58823, + 282.5, 287.5, 286.36365, + 289.8305, 288.67926, 294.89362, + 302.5, 302.30768, 307.5, + 306.92307, 311.53845, 302.72726, + 308.18182, 308.1356, 313.63635, + 314.23727, 319.0909, 320.339, + 329.43396, 278.57144, 281.42856, + 286.5, 285.78946, 288.94736, + 292.10526, 291.66666, 295.5, + 295.26315, 295., 298.5, + 298.42105, 298.33334, 298.2353, + 301.5, 301.57895, 301.66666, + 301.7647, 304.73685, 305.0, + 304.5, 308.33334, 315.7143, + 316.5, 313.5, 314.21054, 315.0, + 312.35294, 317.3684, 315.88235, + 319.5, 320.5263, 318.33334, + 319.41177, 321.66666, 325.5, + 53.18182, 58.695652, 55.909092, + 52.857143, 58.636364, 55.714287, + 58.57143, 61.363636, 58.5, + 61.42857, 61.5], + dtype=np.float32), data_type=4, + data_type_fmt='f', dimension=1, shape=[89])), + ('vector.kvect', DmapArray(name='vector.kvect', + value=np.array([129.11713, 126.74036, 129.43018, + -59.188175, 98.50512, 80.42348, + 75.69116, 129.11713, 126.74036, + 129.43018, -59.188175, 98.50512, + 80.42348, 75.69116, 5.3487244, + 10.402584, 14.785839, 15.429902, + -35.943424, 20.576845, 20.34991, + 21.785473, 10.402584, 14.785839, + 15.429902, -35.943424, + 20.576845, 20.34991, 21.785473, + 48.44863, 53.48781, -123.236755, + -119.82997, -118.107376, + 3.8013902, 12.560586, 13.944878, + 22.161648, 24.005245, 31.447266, + 33.86883, 40.17791, -49.860504, + -46.643433, -30.441378, + -28.282873, -24.79395, + -17.491783, -14.234547, + 171.96645, -8.580771, -8.799448, + -179.43964, -2.5106738, + -0.3186142, -0.5526578, + -170.8527, 7.261834, 7.6403155, + 7.9380827, 13.710478, + 10.7870865, -163.56581, + -161.49174, -7.7182574, + -6.8226385, -10.626968, + -10.920318, -8.530712, + -11.8747835, -2.9404123, + -5.600803, 0.2846103, 3.424564, + 0.5950424, 0.6806656, 6.334974, + -160.16771, 127.07647, + -43.32296, 132.45633, 129.95958, + -33.12576, -35.21408, + -31.327961, -24.226963, + 152.3547, -20.693926, + 159.82927], dtype=np.float32), + data_type=4, data_type_fmt='f', dimension=1, + shape=[89])), + ('vector.stid', DmapArray(name='vector.stid', + value=np.array([66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 10, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 7, 7, 7, 7, + 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8], dtype=np.int16), data_type=2, + data_type_fmt='h', dimension=1, shape=[89])), + ('vector.channel', DmapArray(name='vector.channel', + value=np.array([1, 1, 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 2, 1, 1, 1, 1, 1, + 1, 1, 0, 0, 0, 0, 0, 0, 0, 4, + 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0], + dtype=np.int16), data_type=2, + data_type_fmt='h', dimension=1, shape=[89])), + ('vector.index', DmapArray(name='vector.index', + value=np.array([78002, 78001, 79001, 79000, + 81050, 81047, 80052, 78002, + 78001, 79001, 79000, 81050, + 81047, 80052, 63046, 73079, + 78056, 78057, 79052, 80047, + 81042, 82038, 73079, 78056, + 78057, 79052, 80047, 81042, + 82038, 78060, 77065, 78061, + 77066, 77067, 79055, 79056, + 80050, 79057, 80051, 79058, + 80052, 81048, 69097, 69098, + 70095, 71090, 71091, 71092, + 72087, 70098, 71093, 72088, + 70099, 71094, 72089, 73084, + 70100, 71095, 72090, 73085, + 71096, 72091, 70101, 72092, + 69110, 70105, 70104, 71099, + 72094, 73088, 71100, 73089, + 70106, 71101, 72095, 73090, + 72096, 70108, 68019, 67022, + 68020, 69018, 68021, 69019, + 69020, 68022, 70019, 69021, + 70020], dtype=np.int32), + data_type=3, data_type_fmt='i', dimension=1, + shape=[89])), ('vector.vel.median', DmapArray(name='vector.vel.median', value=np.array([99.77544, 215.3899, 52.910847, 82.5198, 127.99508, 392.20102, 323.5969, 99.77544, 215.3899, 52.910847, 82.5198, 127.99508, 392.20102, 323.5969, 36.895718, diff --git a/tests/unit/rawacf_data_sets.py b/pyDARNio/tests/utils/data_sets/rawacf_data_sets.py similarity index 84% rename from tests/unit/rawacf_data_sets.py rename to pyDARNio/tests/utils/data_sets/rawacf_data_sets.py index a772269..f7d145e 100644 --- a/tests/unit/rawacf_data_sets.py +++ b/pyDARNio/tests/utils/data_sets/rawacf_data_sets.py @@ -3,12 +3,12 @@ """ Test data sets for DmapWrite """ -import numpy as np - from collections import OrderedDict +import numpy as np from pydarnio import DmapScalar, DmapArray + rawacf_data = [OrderedDict([('radar.revision.major', DmapScalar(name='radar.revision.major', value=1, data_type=1, data_type_fmt='c')), @@ -268,3 +268,93 @@ 43.419353], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[6])), ('xcfd', DmapArray(name='xcfd', value=np.array([77.70968, 234.38708, -25.419353, 18.354837, -78.48387, -201.45161], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[6]))])] + + +rawacf_dict_data = [{'radar.revision.major': np.int8(1), + 'radar.revision.minor': np.int8(18), + 'origin.code': np.int8(0), + 'origin.time': 'Mon Apr 18: 01: 03 2017', + 'origin.command': 'twofsound -fast -xcf 1 -p7', + 'cp': np.int16(3505), + 'stid': np.int16(5), + 'time.yr': np.int16(2017), + 'time.mo': np.int16(4), + 'time.dy': np.int16(10), + 'time.hr': np.int16(18), + 'time.mt': np.int16(1), + 'time.sc': np.int16(0), + 'time.us': 35565, + 'txpow': np.int16(9000), + 'nave': np.int16(32), + 'atten': np.int16(0), + 'lagfr': np.int16(1200), + 'smsep': np.int16(300), + 'ercod': np.int16(0), + 'stat.agc': np.int16(0), + 'stat.lopwr': np.int16(0), + 'noise.search': 27.822126388549805, + 'noise.mean': 505125.4375, + 'channel': np.int16(2), + 'bmnum': np.int16(0), + 'bmazm': -1.2000000476837158, + 'scan': np.int16(1), + 'offset': np.int16(0), + 'rxrise': np.int16(100), + 'intt.sc': np.int16(3), + 'intt.us': 500000, + 'txpl': np.int16(300), + 'mpinc': np.int16(2400), + 'mppul': np.int16(7), + 'mplgs': np.int16(18), + 'nrang': np.int16(75), + 'frang': np.int16(180), + 'rsep': np.int16(45), + 'xcf': np.int16(1), + 'tfreq': np.int16(13078), + 'mxpwr': 1073741824, + 'lvmax': 20000, + 'rawacf.revision.major': 0, + 'rawacf.revision.minor': 0, + 'combf': '$Id: twofsound.c,v 1.0016/11/08 20:00:00' + ' KKrieger Exp $', + 'thr': 0.0, + 'ptab': np.array([0, 9, 12, 20, 22, 26, 27], + dtype=np.int16), + 'ltab': np.array([0, 0, 26, 27, 20, 22, 12, 22, 26, + 22, 27, 20, 26, 20, 27, 12, 20, + 0, 9, 12, 22, 9, 20, 0, 12, 9, + 22, 12, 26, 12, 27, 9, 26, 27, 27, 27], + dtype=np.int16), + 'slist': np.array([0, 2, 3, 4, 5, 6, 7, 0, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74], dtype=np.int16), + 'pwr0': np.array([98.4375, 235.3125, 160.5, 59.1875, + 43.65625, 65.40625, 62.03125, 46.25, + 72.84375, 60.0625, 47.40625, 61.0625, + 62.5625, 60.46875, 59.53125, 42.84375, + 39.78125, 40.9375, 51.6875, 55.125, + 37.03125, 56.15625, 51.71875, 50.40625, + 58.46875, 59.21875, 61.90625, 61.71875, + 53.84375, 51.5625, 55.4375, 38.8125, + 93.09375, 279.8125, 267.59375, 417.875, + 1232.4062, 281.125, 126.3125, 60.65625, + 62.12, 118.5, 351.5625, 778.96875, + 126.53125, 151.46875, 82.21875, 86.625, + 61.4375, 69, 92.71875, 61.15625, + 72.0625, 77.84375, 49.84375, 69.28125, + 61.15625, 72.125, 69.125, 66.8125, + 59.625, 71.21875, 62.34375, 57.28125, + 54.96875, 52.65625, 61.84375, 56.34375, + 75.875, 97.25, 80.125, 44.5625, + 52.53125, 81.40625, 86.03125], + dtype=np.float32), + 'acfd': np.array([98.4375, 0, 26.59375, -8.5, + 28.90625, -3.5625], dtype=np.float32), + 'xcfd': np.array([-11., 14.875, 0.84375, 2.375, + 72.21875, 4.21875], dtype=np.float32)}] + diff --git a/pyDARNio/tests/utils/file_utils.py b/pyDARNio/tests/utils/file_utils.py new file mode 100644 index 0000000..5c6c430 --- /dev/null +++ b/pyDARNio/tests/utils/file_utils.py @@ -0,0 +1,678 @@ +# Copyright (C) 2020 NRL +# Author: Angeline Burrell + +import bz2 +import collections +import copy +from glob import glob +import numpy as np +import os +import unittest + +import pydarnio + +from pydarnio.tests.utils.data_sets import dmap_data_sets +from pydarnio.tests.utils.data_sets import fitacf_data_sets +from pydarnio.tests.utils.data_sets import grid_data_sets +from pydarnio.tests.utils.data_sets import iqdat_data_sets +from pydarnio.tests.utils.data_sets import map_data_sets +from pydarnio.tests.utils.data_sets import rawacf_data_sets + + +def get_test_files(test_file_type, test_dir=os.path.join("..", "testfiles")): + """ Generate a dictionary containing the test filenames + + Parameters + ---------- + test_file_type : str + Accepts 'good', 'stream', 'empty', and 'corrupt', along with + 'borealis-vXX_' or 'borealis-vXX-site_' as a prefix to these options + test_dir : str + Directory containing the test files + (default=os.path.join('..', 'testfiles')) + + Returns + ------- + test_files : list or dict + Dict of good files with keys pertaining to the file type, a list + of corrupt files, or a list of stream files + + """ + # Ensure the test file type is lowercase + test_file_type = test_file_type.lower() + + # See if this is a borealis test + test_subdir = test_file_type.split('_') + if len(test_subdir) > 1: + # Only the last bit specifies test_file_type + test_file_type = test_subdir[-1] + + # Keep the first part of the specifier intact and extend the + # test directory + test_dir = os.path.join(test_dir, '_'.join(test_subdir[:-1])) + + # Get a list of the available test files + files = glob("ls {:s}".format(os.path.join(test_dir, test_file_type, "*"))) + + # Prepare the test files in the necessary output format + if test_file_type == "good": + test_files = dict() + for fname in files: + # Split the filename by periods to get the SuperDARN file extention + split_fname = fname.split(".") + + # HDF5 and netCDF versions of these files will have the SuperDARN + # file type as the second to the last element in the split list + # and Borealis site files have the SuperDARN file type as the + # third element + if split_fname[-1] in ['hd5f', 'h5', 'nc']: + ext = split_fname[-2] + elif(split_fname[-1] == 'site' + and split_fname[-2] in ['hd5f', 'h5', 'nc']): + ext = "_".join(["site", split_fname[-3]]) + else: + ext = split_fname[-1] + + # Save the filename, with keys organizing them by SuperDARN + # file extension + test_files[ext] = fname + else: + # The files don't need to be organized, just return in a list + test_files = files + + return test_files + + +def remove_temp_file(temp_file): + """ Utility for removing temporary files + + Parameters + ---------- + temp_file : str + Name of temporary file + + Returns + ------- + bool + True if file was removed, False if it did not exist + """ + if os.path.isfile(temp_file): + os.remove(temp_file) + return True + else: + return False + + +def load_data_w_filename(data_type): + """ Utility for loading data and constructing a temporary filename + + Parameters + ---------- + data_type : str + Accepts 'rawacf', 'fitacf', 'iqdat', 'grid', 'map', 'dmap', and + 'rawacf_dict' + + Returns + ------- + data : list, dict + Data from data_set files + temp_file : str + Temporary output filename built from data_type + """ + # Copy the data from the data_set files + if data_type == "rawacf": + data = copy.deepcopy(rawacf_data_sets.rawacf_data) + elif data_type == "rawacf_dict": + data = copy.deepcopy(rawacf_data_sets.rawacf_dict_data) + elif data_type == "fitacf": + data = copy.deepcopy(fitacf_data_sets.fitacf_data) + elif data_type == "iqdat": + data = copy.deepcopy(iqdat_data_sets.iqdat_data) + elif data_type == "grid": + data = copy.deepcopy(grid_data_sets.grid_data) + elif data_type == "map": + data = copy.deepcopy(map_data_sets.map_data) + elif data_type == "dmap": + data = copy.deepcopy(dmap_data_sets.dmap_data) + else: + raise ValueError('unknown data type {:}'.format(data_type)) + + # Build a temporary filename + temp_file = "{:s}_test.{:s}".format(data_type, data_type) + + return data, temp_file + + +def set_write_func(write_class, data, data_type): + """ Utility to retrieve the writing function from a writing class + + Parameters + ---------- + write_class : SDarnWrite or DMapWrite + pyDARNio writing class object + data : DMap data class + An appropriate data class for the writing class + data_type : str + Accepts 'rawacf', 'fitacf', 'iqdat', 'grid', 'map', 'dmap', and + 'dmap_stream' + + Returns + ------- + write_func : function + Function for writing files + """ + darn = write_class(data) + write_func = getattr(darn, "write_{:s}".format(data_type)) + return write_func + + +class TestRead(unittest.TestCase): + """ Testing class for reading classes + """ + + def setUp(self): + self.test_file = "fake.file" + self.test_dir = os.path.join("..", "testdir") + self.data = None + self.rec = None + self.read_func = None + self.file_types = ["rawacf", "fitacf", "fit", "iqdat", "grid", "map"] + self.corrupt_read_type = "rawacf" + + def tearDown(self): + del self.test_file, self.test_dir, self.data, self.rec + del self.read_func, self.file_types, self.corrupt_read_type + + def load_file_record(self, file_type='', stream=False): + """ Load a test file data record + """ + # Load the data with the current test file + self.data = self.read_func(self.test_file, stream=stream) + + # Read the data + local_read_func = getattr(self.data, "read_{:s}".format(file_type)) + _ = local_read_func() + self.rec = self.data.get_dmap_records + + def test_incorrect_filepath(self): + """ + Test raise FileNotFoundError with bad filename or path + """ + for val in ["bad_dir", self.test_dir]: + with self.subTest(val=val): + # Create a test filename with path + self.test_file = os.path.join(val, self.test_file) + + # Assert correct error and message for bad filename + self.assertRaises(FileNotFoundError, self.read_func, + self.test_file) + + def test_empty_file(self): + """ + Tests raise EmptyFileError with an empty file + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + self.test_file = get_test_files("empty", test_dir=self.test_dir)[0] + self.assertRaises(pydarnio.dmap_exceptions.EmptyFileError, + self.read_func, self.test_file) + + def test_good_open_file(self): + """ + Test file opening, reading, and converting to a bytearray + + Checks: + - bytearray instance is created from reading in the file + - bytearray is not empty + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + test_file_dict = get_test_files("good", test_dir=self.test_dir) + for val in self.file_types: + with self.subTest(val=val): + # Load the file + self.test_file = test_file_dict[val] + self.data = self.read_func(self.test_file) + + # Test the file data + self.assertIsInstance(self.data.dmap_bytearr, bytearray) + self.assertGreater(self.data.dmap_end_bytes, 0) + + def test_file_integrity(self): + """ + Tests test_initial_data_integrity to ensure no file corruption + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + test_file_dict = get_test_files("good", test_dir=self.test_dir) + for val in self.file_types: + with self.subTest(val=val): + self.test_file = test_file_dict[val] + self.data = self.read_func(self.test_file) + self.data.test_initial_data_integrity() + + def test_corrupt_files(self): + """ + Test raises a dmap_exceptions Error when readig a corrupt file + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + corrupt_files = get_test_files("corrupt", test_dir=self.test_dir) + + for val in [(corrupt_files[0], + pydarnio.dmap_exceptions.DmapDataTypeError), + (corrupt_files[1], + pydarnio.dmap_exceptions.NegativeByteError)]: + with self.subTest(val=val): + self.test_file = val[0] + with self.assertRaises(val[1]): + self.local_file_record(self.corrupt_read_type) + + def test_corrupt_file_integrity(self): + """ + Test raises a dmap_exceptions when checking integrity of a corrupt file + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + corrupt_files = get_test_files("corrupt", test_dir=self.test_dir) + + for val in [(corrupt_files[0], + pydarnio.dmap_exceptions.MismatchByteError), + (corrupt_files[1], + pydarnio.dmap_exceptions.NegativeByteError)]: + with self.subTest(val=val): + self.data = self.read_func(val[0]) + with self.assertRaises(val[1]): + self.data.test_initial_data_integrity() + + def test_read_stream(self): + """ + Test successful read of a stream formed from a bzip2 file + + Checks: + - returns correct data structures + - returns expected values + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + # bz2 opens the compressed file into a data + # stream of bytes without actually uncompressing the file + self.test_file = get_test_files("stream", test_dir=self.test_dir)[0] + with bz2.open(self.test_file) as fp: + self.test_file = fp.read() + + self.local_file_record(self.corrupt_read_type, stream=True) + + # Test the output of the first record + self.assertIsInstance(self.rec, collections.deque) + self.assertIsInstance(self.rec[0], collections.OrderedDict) + self.assertIsInstance(self.rec[4]['channel'], pydarnio.DmapScalar) + self.assertIsInstance(self.rec[1]['ptab'], pydarnio.DmapArray) + self.assertIsInstance(self.rec[7]['channel'].value, int) + self.assertIsInstance(self.rec[2]['xcfd'].value, np.ndarray) + self.assertEqual(self.rec[0]['xcfd'].dimension, 3) + + def test_dmap_read_corrupt_stream(self): + """ + Test raises pydmap exception when reading a corrupted stream from + a compressed file + + Method - Read in a compressed file from a good stream, then insert + some random bytes to produce a corrupt stream. + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + # Open the data stream + self.test_file = get_test_files("stream", test_dir=self.test_dir)[0] + with bz2.open(self.test_file) as fp: + self.test_file = fp.read() + + # Load and corrupt data, converting to byte array for mutability + # since bytes are immutable. + self.data = bytearray(self.test_file[0:36]) + self.data[36:40] = bytearray(str(os.urandom(4)).encode('utf-8')) + self.data[40:] = self.test_file[37:] + + # Assert data from corrupted stream is corrupted + with self.assertRaises(pydarnio.dmap_exceptions.DmapDataError): + self.local_file_record(self.corrupt_read_type, stream=True) + + +class TestWrite(unittest.TestCase): + """ Testing class for writing classes + """ + def setUp(self): + self.write_class = None + self.write_func = None + self.data_type = None + self.data = [] + self.temp_file = "not_a_file.acf" + self.file_types = ["rawacf", "fitacf", "dmap", "iqdat", "grid", "map"] + + def tearDown(self): + del self.write_class, self.write_func, self.data_type, self.data + del self.temp_file, self.file_types + + def test_darn_write_constructor(self): + """ + Tests SDarnWrite constructor for different file types + + Expected behaviour + ------------------ + Contains file name of the data if given to it. + """ + for val in self.file_types: + with self.subTest(val=val): + self.data, self.temp_file = load_data_w_filename(val) + darn = self.write_class(self.data, self.temp_file) + self.assertEqual(darn.filename, self.temp_file) + self.assertFalse(remove_temp_file(self.temp_file)) + + def test_incorrect_filename_input_using_write_methods(self): + """ + Test raises FilenameRequiredError when no filename is given to write + """ + for val in self.file_types: + with self.subTest(val=val): + self.data, self.temp_file = load_data_w_filename(val) + + # Attempt to write data without a filename + self.write_func = set_write_func(self.write_class, self.data, + val) + with self.assertRaises( + pydarnio.dmap_exceptions.FilenameRequiredError): + self.write_func() + + self.assertFalse(remove_temp_file(self.temp_file)) + + def test_empty_record(self): + """ + Test raises DmapDataError if an empty record is given + """ + with self.assertRaises(pydarnio.dmap_exceptions.DmapDataError): + self.write_func = set_write_func(self.write_class, self.data, + "rawacf") + self.write_func(self.temp_file) + + self.assertFalse(remove_temp_file(self.temp_file)) + + def test_writing_success(self): + """ + Test successful file writing and removal of temporary file + """ + for val in self.file_types: + with self.subTest(val=val): + self.data_type = val + self.data, self.temp_file = load_data_w_filename(val) + self.write_func = set_write_func(self.write_class, self.data, + val) + + # Only testing the file is created since it should only be + # created at the last step after all checks have passed. + # Testing the integrity of the insides of the file will be part + # of integration testing since we need SDarnRead for that. + self.write_func(self.temp_file) + self.assertTrue(remove_temp_file(self.temp_file)) + + +class TestReadWrite(unittest.TestCase): + def setUp(self): + self.test_dir = os.path.join("..", "testdir") + self.read_class = None + self.write_class = None + self.read_func = None + self.write_func = None + self.read_dmap = None + self.written_dmap = None + self.temp_file = "temp.file" + self.read_types = ['rawacf', 'fitacf', 'iqdat', 'fit', 'grid', 'map'] + self.write_types = ['dmap'] + self.file_types = [] + + def tearDown(self): + del self.read_func, self.write_func, self.read_dmap, self.written_dmap + del self.temp_file, self.read_types, self.test_dir, self.read_class + del self.write_class, self.write_types, self.file_types + + def set_file_types(self): + """ Function to set read/write type pairs + """ + self.file_types = [] + for rtype in self.read_types: + for wtype in self.write_types: + if wtype in self.read_types: + # If this write type is also a read type, they should match + new_set = (rtype, rtype) + else: + # If the write type is not a read type, assign as is + new_set = (rtype, wtype) + + if new_set not in self.file_types: + self.file_types.append(new_set) + + def set_read_func(self, file_type='', stream=False): + """ Get the reading function from the temporary file + + Parameters + ---------- + file_type : str + File type from self.file_types + stream : bool + True if stream from compressed file, False if a file + (default=False) + + """ + # Load the data with the current test file + data = self.read_class(self.temp_file, stream) + + # Read the data + if hasattr(data, "read_{:s}".format(file_type)): + # SDarn reading functions or specific Dmap reading function + self.read_func = getattr(data, "read_{:s}".format(file_type)) + else: + # Standard Dmap/SDarn reading function + self.read_func = getattr(data, "read_records") + + def dmap_list_compare(self): + """ Compare two lists of DMap objects + """ + # Test that the list lenghts are equal + self.assertEqual(len(self.read_dmap), len(self.written_dmap)) + + # Check each list item + for record1, record2 in zip(self.read_dmap, self.written_dmap): + self.assertEqual(set(record1), set(record2)) + + for field, val_obj in record1.items(): + comp_vals = [val_obj, record2[field]] + + # If this is a DMap type, get the value + for i, val in enumerate(comp_vals): + if isinstance(val, pydarnio.DmapScalar): + self.assess_DmapType(val, 'scalar') + comp_vals[i] = val.value + elif isinstance(val, pydarnio.DmapArray): + self.assess_DmapType(val, 'array') + comp_vals[i] = val.value.reshape(val.shape) + + # Compare the two values as dictated by their types + if isinstance(comp_vals[0], np.ndarray): + self.assertTrue(np.array_equal(*comp_vals) + | np.allclose(*comp_vals, equal_nan=True)) + else: + self.assertEqual(*comp_vals) + + def assess_DmapType(self, dmap_record, dmap_type="array"): + """ Test to see that all Dmap descriptive attributes are present + + Parameters + ---------- + dmap_record : pyDARNio.DmapArray or pyDARNio.DmapScalar + Dmap object to assess + dmap_type : str + Accepts 'scalar' or 'array' (default='array') + """ + dmap_attrs = ['name', 'data_type', 'data_type_fmt', 'value'] + if dmap_type.lower() == 'array': + dmap_attrs.append('dimension') + + # Test the descriptive attributes + for val in dmap_attrs: + with self.subTest(val=val): + self.assertTrue(hasattr(dmap_record, val)) + + def test_read_write(self): + """ Test the ability to write data read in from a file + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + test_file_dict = get_test_files("good", test_dir=self.test_dir) + self.set_file_types() + + for val in self.file_types: + with self.subTest(val=val): + # Read in the test file + self.temp_file = test_file_dict[val[0]] + self.set_read_func(val[0]) + self.read_dmap = self.read_func() + + # Write the data + self.temp_file = "{:s}_test.{:s}".format(val[0], val[0]) + self.write_func = set_write_func(self.write_class, + self.read_dmap, val[1]) + self.write_func(self.temp_file) + + # Test the file creation and remove the temp file + self.assertTrue(remove_temp_file(self.temp_file)) + + def test_write_read(self): + """ Test the consistency of data written to a file + """ + self.set_file_types() + + for val in self.file_types: + with self.subTest(val=val): + # Get the locally stored data + self.written_dmap, self.temp_file = load_data_w_filename( + val[0]) + + # Get the writting functiton and create the temp file + self.write_func = set_write_func(self.write_class, + self.written_dmap, val[1]) + self.write_func(self.temp_file) + + # Read the temp file + self.set_read_func(val[0]) + self.read_dmap = self.read_func() + + # Assert the read and written data are the same + self.dmap_list_compare() + + # Remove the temp file + self.assertTrue(remove_temp_file(self.temp_file)) + + def test_read_stream_write_file(self): + """ + Test successful read of a bz2 file stream and writing to a file + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + # bz2 opens the compressed file into a data + # stream of bytes without actually uncompressing the file + stream_files = get_test_files("stream", test_dir=self.test_dir) + for val in stream_files: + with self.subTest(val=val): + # Open the streaming file + file_parts = stream_files.split(".") + with bz2.open(val) as fp: + self.temp_file = fp.read() + + # Read from the streaming file + self.set_read_func(file_parts[-2], stream=True) + self.read_dmap = self.read_func() + + # Write from the streaming file + self.temp_file = "{:s}_test.{:s}".format(file_parts[-2], + file_parts[-2]) + if file_parts[-2] in self.write_types: + wtype = file_parts[-2] + else: + wtype = self.write_types[0] + self.write_func = set_write_func(self.write_class, + self.read_dmap, wtype) + self.write_func(self.temp_file) + + # Read from the written file + self.set_read_func(file_parts[-2], stream=False) + self.written_dmap = self.read_func() + + # Compare the read and written data + self.dmap_list_compare() + + # Remove the the temporary file + self.assertTrue(remove_temp_file(self.temp_file)) + + def test_read_stream_write_stream(self): + """ + Test successful read of a bz2 file stream and writing as a stream + """ + if not os.path.isdir(self.test_dir): + self.skipTest('test directory is not included with pyDARNio') + + # bz2 opens the compressed file into a data + # stream of bytes without actually uncompressing the file + stream_files = get_test_files("stream", test_dir=self.test_dir) + for val in stream_files: + with self.subTest(val=val): + # Open the streaming file + file_parts = stream_files.split(".") + with bz2.open(val) as fp: + self.temp_file = fp.read() + + # Read from the streaming file + self.set_read_func(file_parts[-2], stream=True) + self.read_dmap = self.read_func() + + # Write from the streaming file + self.write_func = set_write_func(self.write_class, + self.read_dmap, "dmap_stream") + self.temp_file = self.write_func(self.read_dmap) + + # Read from the written file + self.set_read_func(file_parts[-2], stream=True) + self.written_dmap = self.read_func() + + # Compare the read and written data + self.dmap_list_compare() + + def test_write_stream_read_stream(self): + """ + Test successful writing as a stream and then reading from the stream + """ + self.set_file_types() + + for val in self.file_types: + with self.subTest(val=val): + # Get the locally stored data + (self.read_dmap, self.temp_file) = load_data_w_filename(val[0]) + + # Write the streaming file + self.write_func = set_write_func(self.write_class, + self.read_dmap, "dmap_stream") + self.temp_file = self.write_func(self.read_dmap) + + # Read from the streaming file + self.set_read_func(val[0], stream=True) + self.written_dmap = self.read_func() + + # Compare the read and written data + self.dmap_list_compare() diff --git a/pydarnio/borealis/base_format.py b/pydarnio/borealis/base_format.py index 73c3591..8eb3078 100644 --- a/pydarnio/borealis/base_format.py +++ b/pydarnio/borealis/base_format.py @@ -1194,4 +1194,3 @@ def find_max_pulse_phase_offset(records: OrderedDict) -> int: max_ppo_shape = tmp.max(axis=0) return list(max_ppo_shape) - diff --git a/pydarnio/borealis/borealis_site.py b/pydarnio/borealis/borealis_site.py index 5c703a6..afa0a38 100644 --- a/pydarnio/borealis/borealis_site.py +++ b/pydarnio/borealis/borealis_site.py @@ -369,7 +369,7 @@ def __init__(self, filename: str, self.borealis_filetype = borealis_filetype self.filename = filename self.compression = hdf5_compression - self._record_names = sorted(list(borealis_records.keys())) + self._record_names = sorted([bkey for bkey in borealis_records.keys()]) # get the version of the file - split by the dash, first part should be # 'vX.X' diff --git a/pydarnio/dmap/dmap.py b/pydarnio/dmap/dmap.py index 7c2eeb7..6e6ad21 100644 --- a/pydarnio/dmap/dmap.py +++ b/pydarnio/dmap/dmap.py @@ -1150,7 +1150,7 @@ def dmap_array_to_bytes(self, array: DmapArray) -> bytes: for size in array.shape: array_shape_bytes += struct.pack('i', size) - array_data_bytes = array_value.tostring() + array_data_bytes = array_value.tobytes() array_total_bytes = array_name_bytes + array_type_bytes + \ array_dim_bytes + array_shape_bytes + array_data_bytes diff --git a/pydarnio/exceptions/dmap_exceptions.py b/pydarnio/exceptions/dmap_exceptions.py index b02399e..b565f62 100644 --- a/pydarnio/exceptions/dmap_exceptions.py +++ b/pydarnio/exceptions/dmap_exceptions.py @@ -24,10 +24,10 @@ def __init__(self, cursor: int, expected_value: int = 0, rec_num: int = 0, message=''): self.cursor = cursor if message == '': - self.message = "Error: Cursor is at {cursor} and"\ - "it needs to be {expected}. Failed at record {rec}"\ - "".format(cursor=cursor, expected=expected_value, - rec=rec_num) + self.message = "".join( + ["Error: Cursor is at {cursor} and it ".format(cursor=cursor), + "needs to be {expected}. Failed at record {rec}".format( + expected=expected_value, rec=rec_num)]) else: self.message = message super().__init__(self.message) @@ -45,7 +45,7 @@ class EmptyFileError(Exception): """ def __init__(self, filename: str): self.filename = filename - self.message = "Error: {} is empty or"\ + self.message = "Error: {} is empty or" \ " please check this is the correct file".format(filename) super().__init__(self.message) pyDARNio_logger.error(self.message) diff --git a/setup.py b/setup.py index 033d787..69cf2a5 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,10 @@ long_description = f.read() +this_directory = path.abspath(path.dirname(__file__)) +with open(path.join(this_directory, 'README.md'), encoding='utf-8') as fin: + long_description = fin.read() + # Setup information setup( name="pydarnio", diff --git a/tests/integration/grid_data_sets.py b/tests/integration/grid_data_sets.py deleted file mode 100644 index 011f29f..0000000 --- a/tests/integration/grid_data_sets.py +++ /dev/null @@ -1,263 +0,0 @@ -# Copyright (C) 2019 SuperDARN -# Author: Marina Schmidt - -""" -Test data sets for DmapWrite -""" -import numpy as np - -from collections import OrderedDict - -from pydarnio import DmapScalar, DmapArray - -grid_data = \ - [OrderedDict([('start.year', - DmapScalar(name='start.year', value=2018, data_type=2, data_type_fmt='h')), - ('start.month', DmapScalar(name='start.month', value=2, data_type=2, data_type_fmt='h')), - ('start.day', DmapScalar(name='start.day', value=20, data_type=2, data_type_fmt='h')), - ('start.hour', DmapScalar(name='start.hour', value=0, data_type=2, data_type_fmt='h')), - ('start.minute', DmapScalar(name='start.minute', value=6, data_type=2, data_type_fmt='h')), - ('start.second', DmapScalar(name='start.second', value=0.0040569305419921875, data_type=8, data_type_fmt='d')), - ('end.year', DmapScalar(name='end.year', value=2018, data_type=2, data_type_fmt='h')), - ('end.month', DmapScalar(name='end.month', value=2, data_type=2, data_type_fmt='h')), - ('end.day', DmapScalar(name='end.day', value=20, data_type=2, data_type_fmt='h')), - ('end.hour', DmapScalar(name='end.hour', value=0, data_type=2, data_type_fmt='h')), - ('end.minute', DmapScalar(name='end.minute', value=8, data_type=2, data_type_fmt='h')), - ('end.second', DmapScalar(name='end.second', value=0.0040569305419921875, data_type=8, data_type_fmt='d')), - ('stid', DmapArray(name='stid', value=np.array([65], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('channel', DmapArray(name='channel', value=np.array([0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('nvec', DmapArray(name='nvec', value=np.array([45], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('freq', DmapArray(name='freq', value=np.array([11348.719], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('major.revision', DmapArray(name='major.revision', value=np.array([2], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('minor.revision', DmapArray(name='minor.revision', value=np.array([0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('program.id', DmapArray(name='program.id', value=np.array([3505], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('noise.mean', DmapArray(name='noise.mean', value=np.array([10.59375], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('noise.sd', DmapArray(name='noise.sd', value=np.array([1.5636357], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('gsct', DmapArray(name='gsct', value=np.array([1], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('v.min', DmapArray(name='v.min', value=np.array([35.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('v.max', DmapArray(name='v.max', value=np.array([2500.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('p.min', DmapArray(name='p.min', value=np.array([3.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('p.max', DmapArray(name='p.max', value=np.array([60.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('w.min', DmapArray(name='w.min', value=np.array([10.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('w.max', DmapArray(name='w.max', value=np.array([1000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('ve.min', DmapArray(name='ve.min', value=np.array([0.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('ve.max', DmapArray(name='ve.max', value=np.array([200.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('vector.mlat', DmapArray(name='vector.mlat', value=np.array([72.5, 73.5, 74.5, 79.5, 79.5, 80.5, 73.5, 74.5, 80.5, 72.5, 79.5, - 80.5, 82.5, 82.5, 83.5, 81.5, 84.5, 82.5, 80.5, 81.5, 79.5, 81.5, - 73.5, 80.5, 83.5, 79.5, 80.5, 81.5, 82.5, 83.5, 79.5, 81.5, 72.5, - 80.5, 78.5, 79.5, 80.5, 79.5, 80.5, 73.5, 74.5, 78.5, 79.5, 78.5, - 79.5], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[45])), - ('vector.mlon', DmapArray(name='vector.mlon', value=np.array([335., 333.52942, 331.875, 319.0909, 313.63635, - 308.1356, 337.05884, 335.625, 314.23727, 338.33334, - 324.54544, 320.339, 310.21277, 317.87234, 311.7073, - 329.43396, 313.7143, 333.1915, 338.64407, 336.2264, - 340.9091, 343.01886, 340.58823, 344.74576, 346.82925, - 346.36365, 350.84744, 349.8113, 356.17023, 355.60974, - 351.81818, 356.60376, 341.66666, 356.94916, 352.5, - 357.27274, 3.0508475, 2.7272727, 9.152542, 344.11765, - 346.875, 2.5, 8.181818, 7.5, 13.636364], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[45])), - ('vector.kvect', DmapArray(name='vector.kvect', value=np.array([150.48602, 150.38976, 149.73271, -44.11724, -48.90261, - -52.720737, 168.25351, 159.23058, -44.17332, 174.83675, - 149.24484, 145.81033, 133.7058, 143.56154, 139.32442, - 166.77945, 143.30453, 175.14447, 179.95691, 175.5118, - -172.71599, -172.94543, -163.22404, -167.09595, -164.52101, - -161.34946, -155.4211, -159.47032, -153.30176, -153.61163, - -149.5504, -146.24246, -149.24686, -143.59334, -142.18036, - -138.36761, -132.77902, -129.27661, -123.71623, -143.01823, - -140.66672, -125.94862, -121.524704, -120.69907, -114.96321], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[45])), - ('vector.stid', DmapArray(name='vector.stid', value=np.array([65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[45])), - ('vector.channel', DmapArray(name='vector.channel', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[45])), - ('vector.index', DmapArray(name='vector.index', value=np.array([72100, 73094, 74088, 79058, 79057, 80050, 73095, 74089, 80051, - 72101, 79059, 80052, 82040, 82041, 83035, 81048, 84030, 82043, - 80055, 81049, 79062, 81050, 73096, 80056, 83039, 79063, 80057, - 81051, 82046, 83040, 79064, 81052, 72102, 80058, 78070, 79065, - 80000, 79000, 80001, 73097, 74092, 78000, 79001, 78001, 79002], - dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[45])), - ('vector.vel.median', DmapArray(name='vector.vel.median', value=np.array([211.40865, 287.75946, 230.77419, 187.97984, 257.93872, - 260.47934, 178.85757, 232.12292, 237.11732, 157.37292, - 122.41863, 100.79391, 46.440826, 54.64365, 61.027603, - 90.12276, 114.797516, 106.21644, 172.39407, 132.68246, - 205.91148, 207.2965, 116.40394, 219.84409, 223.87404, - 234.68289, 242.02846, 253.77455, 248.37881, 231.41563, - 215.56255, 250.5544, 103.61616, 230.06058, 220.61739, - 232.87077, 236.41026, 244.11392, 243.74884, 66.45725, - 60.761314, 239.27852, 245.77727, 253.88075, 260.77255], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[45])), - ('vector.vel.sd', DmapArray(name='vector.vel.sd', value=np.array([31.622776, 35.35534, 35.35534, 63.331505, 40.82483, - 50., 17.149858, 25.897175, 57.988403, 21.821789, - 53.313816, 130.36421, 57.735027, 50., 50., - 50., 70.71068, 50., 28.867514, 50., - 44.72136, 40.82483, 18.898224, 44.72136, 44.72136, - 40.82483, 35.35534, 70.71068, 57.735027, 70.71068, - 50., 50., 30.151134, 28.867514, 57.735027, - 35.35534, 35.35534, 31.622776, 50., 40.82483, - 50., 44.72136, 40.82483, 50., 44.72136], - dtype=np.float32), data_type=4, data_type_fmt='f', - dimension=1, shape=[45]))]), - OrderedDict([('start.year', DmapScalar(name='start.year', value=2018, data_type=2, data_type_fmt='h')), - ('start.month', DmapScalar(name='start.month', value=2, data_type=2, data_type_fmt='h')), - ('start.day', DmapScalar(name='start.day', value=20, data_type=2, data_type_fmt='h')), - ('start.hour', DmapScalar(name='start.hour', value=13, data_type=2, data_type_fmt='h')), - ('start.minute', DmapScalar(name='start.minute', value=23, data_type=2, data_type_fmt='h')), - ('start.second', DmapScalar(name='start.second', value=0.011981964111328125, data_type=8, data_type_fmt='d')), - ('end.year', DmapScalar(name='end.year', value=2018, data_type=2, data_type_fmt='h')), - ('end.month', DmapScalar(name='end.month', value=2, data_type=2, data_type_fmt='h')), - ('end.day', DmapScalar(name='end.day', value=20, data_type=2, data_type_fmt='h')), - ('end.hour', DmapScalar(name='end.hour', value=13, data_type=2, data_type_fmt='h')), - ('end.minute', DmapScalar(name='end.minute', value=25, data_type=2, data_type_fmt='h')), - ('end.second', DmapScalar(name='end.second', value=0.011981964111328125, data_type=8, data_type_fmt='d')), - ('stid', DmapArray(name='stid', value=np.array([65], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('channel', DmapArray(name='channel', value=np.array([0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('nvec', DmapArray(name='nvec', value=np.array([32], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('freq', DmapArray(name='freq', value=np.array([11355.719], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('major.revision', DmapArray(name='major.revision', value=np.array([2], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('minor.revision', DmapArray(name='minor.revision', value=np.array([0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('program.id', DmapArray(name='program.id', value=np.array([3505], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('noise.mean', DmapArray(name='noise.mean', value=np.array([14.8125], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('noise.sd', DmapArray(name='noise.sd', value=np.array([5.087161], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('gsct', DmapArray(name='gsct', value=np.array([1], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('v.min', DmapArray(name='v.min', value=np.array([35.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('v.max', DmapArray(name='v.max', value=np.array([2500.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('p.min', DmapArray(name='p.min', value=np.array([3.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('p.max', DmapArray(name='p.max', value=np.array([60.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('w.min', DmapArray(name='w.min', value=np.array([10.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('w.max', DmapArray(name='w.max', value=np.array([1000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('ve.min', DmapArray(name='ve.min', value=np.array([0.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('ve.max', DmapArray(name='ve.max', value=np.array([200.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('vector.mlat', DmapArray(name='vector.mlat', value=np.array([75.5, 76.5, 77.5, 79.5, 74.5, 75.5, 76.5, 77.5, 83.5, 84.5, 84.5, - 85.5, 76.5, 77.5, 86.5, 86.5, 75.5, 74.5, 76.5, 75.5, 74.5, 78.5, - 75.5, 77.5, 76.5, 78.5, 77.5, 73.5, 74.5, 75.5, 76.5, 77.5], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[32])), - ('vector.mlon', DmapArray(name='vector.mlon', value=np.array([330., 327.85715, 325.3846, 313.63635, 335.625, 334., - 332.14285, 330., 267.80487, 272.57144, 262.2857, 263.57144, - 336.42856, 334.6154, 270., 253.63637, 338., 339.375, - 340.7143, 342., 343.125, 347.5, 346., 348.46155, - 349.2857, 352.5, 353.07693, 344.11765, 346.875, 350., - 353.57144, 357.69232], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[32])), - ('vector.kvect', DmapArray(name='vector.kvect', value=np.array([148.69537, 141.54613, 142.8571, 131.84319, 170.03053, - 160.40012, 157.37341, 89.2536, -93.46017, -87.30513, - -92.89313, -85.86758, 8.765994, -11.932242, -77.360016, - -86.02396, 141.57924, 17.019497, 6.932431, 17.441008, - 25.992363, 27.482807, 32.788364, 31.261826, 36.400013, - 37.104523, 41.330643, 37.179756, 38.110252, 41.75692, - 45.872223, 49.977745], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[32])), - ('vector.stid', DmapArray(name='vector.stid', value=np.array([65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[32])), - ('vector.channel', DmapArray(name='vector.channel', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[32])), - ('vector.index', DmapArray(name='vector.index', value=np.array([75082, 76076, 77070, 79057, 74089, 75083, 76077, 77071, 83030, - 84026, 84025, 85020, 76078, 77072, 86016, 86015, 75084, 74090, - 76079, 75085, 74091, 78069, 75086, 77075, 76081, 78070, 77076, - 73097, 74092, 75087, 76082, 77077], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[32])), - ('vector.vel.median', DmapArray(name='vector.vel.median', value=np.array([86.22557, 55.99529, 77.1204, 138.94217, 53.439465, - 83.13799, 65.69839, 8.872497, 140.93784, 136.43436, - 125.74353, 107.80217, 10.187439, 137.04274, 118.45908, - 98.89083, 5.5379543, 81.491165, 50.020416, 95.97311, - 182.38617, 154.7921, 158.80106, 146.97353, 85.35316, - 205.68631, 121.89034, 218.41821, 200.13217, 186.16425, - 74.23934, 202.2707], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[32])), - ('vector.vel.sd', DmapArray(name='vector.vel.sd', value=np.array([31.622776, 45.96998, 57.735027, 70.71068, 22.96239, 25.858837, - 33.51713, 53.530884, 70.71068, 70.71068, 50., 40.82483, - 23.570227, 31.957285, 57.735027, 70.71068, 22.566723, 27.893995, - 23.570227, 26.726124, 22.094053, 74.42324, 22.941574, 37.93341, - 27.748476, 49.585766, 31.773098, 58.097965, 31.622776, 35.35534, - 31.622776, 34.513107], dtype=np.float32), data_type=4, - data_type_fmt='f', dimension=1, - shape=[32]))]), - OrderedDict([('start.year', DmapScalar(name='start.year', value=2018, data_type=2, data_type_fmt='h')), - ('start.month', DmapScalar(name='start.month', value=2, data_type=2, data_type_fmt='h')), - ('start.day', DmapScalar(name='start.day', value=20, data_type=2, data_type_fmt='h')), - ('start.hour', DmapScalar(name='start.hour', value=23, data_type=2, data_type_fmt='h')), - ('start.minute', DmapScalar(name='start.minute', value=50, data_type=2, data_type_fmt='h')), - ('start.second', DmapScalar(name='start.second', value=0.025077104568481445, data_type=8, data_type_fmt='d')), - ('end.year', DmapScalar(name='end.year', value=2018, data_type=2, data_type_fmt='h')), - ('end.month', DmapScalar(name='end.month', value=2, data_type=2, data_type_fmt='h')), - ('end.day', DmapScalar(name='end.day', value=20, data_type=2, data_type_fmt='h')), - ('end.hour', DmapScalar(name='end.hour', value=23, data_type=2, data_type_fmt='h')), - ('end.minute', DmapScalar(name='end.minute', value=52, data_type=2, data_type_fmt='h')), - ('end.second', DmapScalar(name='end.second', value=0.025077104568481445, data_type=8, data_type_fmt='d')), - ('stid', DmapArray(name='stid', value=np.array([65], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('channel', DmapArray(name='channel', value=np.array([0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('nvec', DmapArray(name='nvec', value=np.array([48], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('freq', DmapArray(name='freq', value=np.array([11333.656], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('major.revision', DmapArray(name='major.revision', value=np.array([2], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('minor.revision', DmapArray(name='minor.revision', value=np.array([0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('program.id', DmapArray(name='program.id', value=np.array([3505], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('noise.mean', DmapArray(name='noise.mean', value=np.array([12.53125], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('noise.sd', DmapArray(name='noise.sd', value=np.array([1.5820909], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('gsct', DmapArray(name='gsct', value=np.array([1], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('v.min', DmapArray(name='v.min', value=np.array([35.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('v.max', DmapArray(name='v.max', value=np.array([2500.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('p.min', DmapArray(name='p.min', value=np.array([3.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('p.max', DmapArray(name='p.max', value=np.array([60.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('w.min', DmapArray(name='w.min', value=np.array([10.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('w.max', DmapArray(name='w.max', value=np.array([1000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('ve.min', DmapArray(name='ve.min', value=np.array([0.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('ve.max', DmapArray(name='ve.max', value=np.array([200.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('vector.mlat', DmapArray(name='vector.mlat', value=np.array([79.5, 79.5, 80.5, 79.5, 80.5, 81.5, 80.5, 81.5, 82.5, 80.5, 81.5, - 82.5, 82.5, 83.5, 84.5, 80.5, 81.5, 83.5, 84.5, 81.5, 82.5, 84.5, - 82.5, 83.5, 84.5, 80.5, 81.5, 82.5, 83.5, 84.5, 81.5, 82.5, 83.5, - 80.5, 81.5, 82.5, 83.5, 80.5, 81.5, 82.5, 80.5, 81.5, 81.5, 79.5, - 80.5, 80.5, 79.5, 79.5], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[48])), - ('vector.mlon', DmapArray(name='vector.mlon', value=np.array([319.0909, 313.63635, 314.23727, 324.54544, 320.339, - 315.84906, 326.44067, 322.6415, 317.87234, 332.54236, - 329.43396, 325.53192, 333.1915, 329.26828, 324., - 338.64407, 336.2264, 338.04877, 334.2857, 343.01886, - 340.85107, 344.57144, 348.51065, 346.82925, 354.85715, - 350.84744, 349.8113, 356.17023, 355.60974, 5.142857, - 356.60376, 3.8297873, 4.390244, 356.94916, 3.3962264, - 11.489362, 13.170732, 3.0508475, 10.18868, 19.148935, - 9.152542, 16.981133, 23.773584, 8.181818, 15.254237, - 21.355932, 13.636364, 19.09091], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[48])), - ('vector.kvect', DmapArray(name='vector.kvect', value=np.array([1.3776143e+02, 1.3067482e+02, 1.3548923e+02, 1.5051083e+02, - 1.4419740e+02, 1.4045711e+02, 1.5574120e+02, 1.5187080e+02, - 1.4506064e+02, 1.6567052e+02, 1.6373940e+02, 1.5515234e+02, - -5.0249748e+00, -1.6617077e+01, -1.8794113e+01, 1.7961696e+02, - 1.7558623e+02, -8.2697503e-02, -6.7042108e+00, 9.9063320e+00, - 4.3262248e+00, 6.0504212e+00, 1.6758739e+01, 1.5605538e+01, - 2.2159294e+01, 2.5681110e+01, 2.0525904e+01, 2.8494555e+01, - 2.7147511e+01, 3.3622570e+01, 3.1760328e+01, 4.1792263e+01, - 3.9918575e+01, 3.5687832e+01, 4.3404911e+01, 5.2630638e+01, - 5.2512428e+01, 4.8060982e+01, 5.4476559e+01, 6.0645481e+01, - 5.5574818e+01, 6.2865593e+01, 7.1008202e+01, 5.8256989e+01, - 6.3870285e+01, 7.1036896e+01, 6.4951691e+01, 7.0386543e+01], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[48])), - ('vector.stid', DmapArray(name='vector.stid', value=np.array([65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[48])), - ('vector.channel', DmapArray(name='vector.channel', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[48])), - ('vector.index', DmapArray(name='vector.index', value=np.array([79058, 79057, 80051, 79059, 80052, 81046, 80053, 81047, 82041, - 80054, 81048, 82042, 82043, 83037, 84031, 80055, 81049, 83038, - 84032, 81050, 82044, 84033, 82045, 83039, 84034, 80057, 81051, - 82046, 83040, 84000, 81052, 82000, 83000, 80058, 81000, 82001, - 83001, 80000, 81001, 82002, 80001, 81002, 81003, 79001, 80002, - 80003, 79002, 79003], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[48])), - ('vector.vel.median', DmapArray(name='vector.vel.median', value=np.array([168.87584, 378.16104, 390.48422, 264.72037, 340.24277, - 261.96246, 166.4799, 175.58917, 170.59193, 100.241035, - 117.02003, 113.83192, 110.63128, 124.69313, 85.883835, - 59.58456, 29.183453, 149.87598, 87.57454, 106.41398, - 144.1112, 100.86157, 209.35103, 177.68849, 153.74188, - 261.6218, 219.8409, 224.89569, 188.59256, 165.06386, - 293.19037, 210.94766, 194.56616, 271.47748, 303.23712, - 199.45433, 204.04663, 253.03906, 293.68582, 228.18443, - 280.49426, 255.60298, 223.19438, 196.14743, 268.67493, - 253.27917, 202.5746, 262.70676], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[48])), - ('vector.vel.sd', DmapArray(name='vector.vel.sd', value=np.array([65.60137, 56.20039, 39.431385, 52.887394, 69.346954, 43.638535, - 52.373154, 39.7046, 39.206783, 44.322094, 31.622776, 39.10426, - 42.038414, 50., 44.72136, 35.902393, 50.005493, 28.867514, - 40.82483, 32.031635, 40.82483, 40.82483, 40.82483, 40.82483, - 35.35534, 48.513336, 41.15344, 35.35534, 40.82483, 44.72136, - 35.531113, 35.35534, 35.35534, 36.263626, 35.35534, 40.82483, - 40.82483, 40.907024, 35.35534, 40.82483, 40.82483, 40.82483, - 40.82483, 40.82483, 50., 35.35534, 44.72136, 57.735027], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[48]))])] diff --git a/tests/integration/map_data_sets.py b/tests/integration/map_data_sets.py deleted file mode 100644 index 70022ae..0000000 --- a/tests/integration/map_data_sets.py +++ /dev/null @@ -1,2681 +0,0 @@ -# Copyright (C) 2019 SuperDARN -# Author: Marina Schmidt - -""" -Test data sets for DmapWrite -""" -import numpy as np - -from collections import OrderedDict - -from pydarnio import DmapScalar, DmapArray -map_data = [OrderedDict([ - ('start.year', DmapScalar(name='start.year', value=2017, - data_type=2, data_type_fmt='h')), - ('start.month', DmapScalar(name='start.month', value=1, data_type=2, data_type_fmt='h')), - ('start.day', DmapScalar(name='start.day', value=14, data_type=2, data_type_fmt='h')), - ('start.hour', DmapScalar(name='start.hour', value=0, data_type=2, data_type_fmt='h')), - ('start.minute', DmapScalar(name='start.minute', value=4, data_type=2, data_type_fmt='h')), - ('start.second', DmapScalar(name='start.second', value=0.0, data_type=8, data_type_fmt='d')), - ('end.year', DmapScalar(name='end.year', value=2017, data_type=2, data_type_fmt='h')), - ('end.month', DmapScalar(name='end.month', value=1, data_type=2, data_type_fmt='h')), - ('end.day', DmapScalar(name='end.day', value=14, data_type=2, data_type_fmt='h')), - ('end.hour', DmapScalar(name='end.hour', value=0, data_type=2, data_type_fmt='h')), - ('end.minute', DmapScalar(name='end.minute', value=6, data_type=2, data_type_fmt='h')), - ('end.second', DmapScalar(name='end.second', value=0.0, data_type=8, data_type_fmt='d')), - ('map.major.revision', DmapScalar(name='map.major.revision', value=1, data_type=2, data_type_fmt='h')), - ('map.minor.revision', DmapScalar(name='map.minor.revision', value=13, data_type=2, data_type_fmt='h')), - ('source', DmapScalar(name='source', value='map_fit', data_type=9, data_type_fmt='s')), - ('doping.level', DmapScalar(name='doping.level', value=1, data_type=2, data_type_fmt='h')), - ('model.wt', DmapScalar(name='model.wt', value=1, data_type=2, data_type_fmt='h')), - ('error.wt', DmapScalar(name='error.wt', value=1, data_type=2, data_type_fmt='h')), - ('IMF.flag', DmapScalar(name='IMF.flag', value=9, data_type=2, data_type_fmt='h')), - ('IMF.delay', DmapScalar(name='IMF.delay', value=10, data_type=2, data_type_fmt='h')), - ('IMF.Bx', DmapScalar(name='IMF.Bx', value=2.5199999809265137, data_type=8, data_type_fmt='d')), - ('IMF.By', DmapScalar(name='IMF.By', value=-1.5099999904632568, data_type=8, data_type_fmt='d')), - ('IMF.Bz', DmapScalar(name='IMF.Bz', value=0.699999988079071, data_type=8, data_type_fmt='d')), - ('IMF.Vx', DmapScalar(name='IMF.Vx', value=0.0, data_type=8, data_type_fmt='d')), - ('IMF.tilt', DmapScalar(name='IMF.tilt', value=-23.665531158447266, data_type=8, data_type_fmt='d')), - ('IMF.Kp', DmapScalar(name='IMF.Kp', value=0.0, data_type=8, data_type_fmt='d')), - ('model.angle', DmapScalar(name='model.angle', value='Bang 295 deg.', data_type=9, data_type_fmt='s')), - ('model.level', DmapScalar(name='model.level', value='Esw 0.7 mV/m', data_type=9, data_type_fmt='s')), - ('model.tilt', DmapScalar(name='model.tilt', value='tilt -20.0 deg.', data_type=9, data_type_fmt='s')), - ('model.name', DmapScalar(name='model.name', value='TS18', data_type=9, data_type_fmt='s')), - ('hemisphere', DmapScalar(name='hemisphere', value=1, data_type=2, data_type_fmt='h')), - ('noigrf', DmapScalar(name='noigrf', value=0, data_type=2, data_type_fmt='h')), - ('fit.order', DmapScalar(name='fit.order', value=8, data_type=2, data_type_fmt='h')), - ('latmin', DmapScalar(name='latmin', value=65.0, data_type=4, data_type_fmt='f')), - ('chi.sqr', DmapScalar(name='chi.sqr', value=39.80883844039058, data_type=8, data_type_fmt='d')), - ('chi.sqr.dat', DmapScalar(name='chi.sqr.dat', value=30.363247800324267, data_type=8, data_type_fmt='d')), - ('rms.err', DmapScalar(name='rms.err', value=62.66932120313692, data_type=8, data_type_fmt='d')), - ('lon.shft', DmapScalar(name='lon.shft', value=0.0, data_type=4, data_type_fmt='f')), - ('lat.shft', DmapScalar(name='lat.shft', value=0.0, data_type=4, data_type_fmt='f')), - ('mlt.start', DmapScalar(name='mlt.start', value=18.76207989601823, data_type=8, data_type_fmt='d')), - ('mlt.end', DmapScalar(name='mlt.end', value=18.795821413533837, data_type=8, data_type_fmt='d')), - ('mlt.av', DmapScalar(name='mlt.av', value=18.77894573725918, data_type=8, data_type_fmt='d')), - ('pot.drop', DmapScalar(name='pot.drop', value=19267.26768244645, data_type=8, data_type_fmt='d')), - ('pot.drop.err', DmapScalar(name='pot.drop.err', value=62573716.41237898, data_type=8, data_type_fmt='d')), - ('pot.max', DmapScalar(name='pot.max', value=5843.063179706099, data_type=8, data_type_fmt='d')), - ('pot.max.err', DmapScalar(name='pot.max.err', value=44885041.9018604, data_type=8, data_type_fmt='d')), - ('pot.min', DmapScalar(name='pot.min', value=-13424.204502740353, data_type=8, data_type_fmt='d')), - ('pot.min.err', DmapScalar(name='pot.min.err', value=43598199.49407387, data_type=8, data_type_fmt='d')), - ('stid', DmapArray(name='stid', value=np.array([209, 208, 33, 66, 66, 207, 206, 205, 204, 10, 10, 64, 64, - 3, 7, 16, 6, 6, 5, 5, 8], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('channel', DmapArray(name='channel', value=np.array([1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 4, 1, 1, 2, 1, 2, 0], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('nvec', DmapArray(name='nvec', value=np.array([0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 1, 7, 7, 0, 5, 0, 8, - 22, 14, 0, 11], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('freq', DmapArray(name='freq', value=np.array([13666.159, 13858.704, 10844.5, 12325., 12325., - 14729.725, 14728.45, 11626.714, 11533.381, 11211.875, - 11166.5, 12391., 12391., 10261.375, 10540.219, - 10870., 10609., 13193.5, 10665.5625, 13160.3125, - 9415.533], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('major.revision', DmapArray(name='major.revision', value=np.array([2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('minor.revision', DmapArray(name='minor.revision', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('program.id', DmapArray(name='program.id', value=np.array([-157, -157, -3300, -3560, -3560, -191, -191, -3300, - -3300, 153, -26007, -3560, -3560, -3300, -157, -157, - -3505, -3505, -3505, -3505, -3300], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('noise.mean', DmapArray(name='noise.mean', value=np.array([1.4022727e+01, 2.0227272e+01, 3.4999999e-01, 4.7000000e+03, - 4.7000000e+03, 2.3575001e+01, 1.5775000e+01, 7.9142860e+01, - 1.3233333e+02, 1.8137500e+02, 4.7500000e+01, 1.4750000e+03, - 1.4750000e+03, 1.9093750e+02, 7.3187500e+01, 3.2500000e+00, - 1.3775000e+02, 2.5937500e+01, 1.1887500e+02, 4.9875000e+01, - 8.4800000e+02], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('noise.sd', DmapArray(name='noise.sd', value=np.array([1.0980033e+00, 2.1252029e+00, 6.5383482e-01, 0.0000000e+00, - 0.0000000e+00, 4.0908990e+00, 1.1613951e+00, 9.1510382e+00, - 5.2862206e+01, 1.1835456e+01, 0.0000000e+00, 0.0000000e+00, - 0.0000000e+00, 3.6617054e+01, 7.3155947e+00, 4.2691240e-01, - 1.2339292e+02, 4.8921971e+00, 6.0997822e+01, 7.1382660e+01, - 2.5427649e+03], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('gsct', DmapArray(name='gsct', value=np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[21])), - ('v.min', DmapArray(name='v.min', value=np.array([35., 35., 35., 35., 35., 35., 35., 35., 35., 35., 35., 35., 35., - 35., 35., 35., 35., 35., 35., 35., 35.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('v.max', DmapArray(name='v.max', value=np.array([2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., - 2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., - 2500., 2500., 2500.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('p.min', DmapArray(name='p.min', value=np.array([3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., - 3., 3., 3., 3.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('p.max', DmapArray(name='p.max', value=np.array([60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., - 60., 60., 60., 60., 60., 60., 60., 60.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('w.min', DmapArray(name='w.min', value=np.array([10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., - 10., 10., 10., 10., 10., 10., 10., 10.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('w.max', DmapArray(name='w.max', value=np.array([1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., - 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., - 1000., 1000., 1000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('ve.min', DmapArray(name='ve.min', value=np.array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('ve.max', DmapArray(name='ve.max', value=np.array([1000000., 1000000., 1000000., 1000000., 1000000., 1000000., - 1000000., 1000000., 1000000., 1000000., 1000000., 1000000., - 1000000., 1000000., 1000000., 1000000., 1000000., 1000000., - 1000000., 1000000., 1000000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[21])), - ('vector.mlat', DmapArray(name='vector.mlat', value=np.array([78.5, 78.5, 79.5, 79.5, 81.5, 81.5, 80.5, 78.5, 78.5, 79.5, 79.5, - 81.5, 81.5, 80.5, 63.5, 73.5, 78.5, 78.5, 79.5, 80.5, 81.5, 82.5, - 73.5, 78.5, 78.5, 79.5, 80.5, 81.5, 82.5, 78.5, 77.5, 78.5, 77.5, - 77.5, 79.5, 79.5, 80.5, 79.5, 80.5, 79.5, 80.5, 81.5, 69.5, 69.5, - 70.5, 71.5, 71.5, 71.5, 72.5, 70.5, 71.5, 72.5, 70.5, 71.5, 72.5, - 73.5, 70.5, 71.5, 72.5, 73.5, 71.5, 72.5, 70.5, 72.5, 69.5, 70.5, - 70.5, 71.5, 72.5, 73.5, 71.5, 73.5, 70.5, 71.5, 72.5, 73.5, 72.5, - 70.5, 68.5, 67.5, 68.5, 69.5, 68.5, 69.5, 69.5, 68.5, 70.5, 69.5, - 70.5], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[89])), - ('vector.mlon', DmapArray(name='vector.mlon', value=np.array([12.5, 7.5, 8.181818, 2.7272727, 343.01886, - 322.6415, 320.339, 12.5, 7.5, 8.181818, - 2.7272727, 343.01886, 322.6415, 320.339, 103.97516, - 280.58823, 282.5, 287.5, 286.36365, 289.8305, - 288.67926, 294.89362, 280.58823, 282.5, 287.5, - 286.36365, 289.8305, 288.67926, 294.89362, 302.5, - 302.30768, 307.5, 306.92307, 311.53845, 302.72726, - 308.18182, 308.1356, 313.63635, 314.23727, 319.0909, - 320.339, 329.43396, 278.57144, 281.42856, 286.5, - 285.78946, 288.94736, 292.10526, 291.66666, 295.5, - 295.26315, 295., 298.5, 298.42105, 298.33334, - 298.2353, 301.5, 301.57895, 301.66666, 301.7647, - 304.73685, 305., 304.5, 308.33334, 315.7143, - 316.5, 313.5, 314.21054, 315., 312.35294, - 317.3684, 315.88235, 319.5, 320.5263, 318.33334, - 319.41177, 321.66666, 325.5, 53.18182, 58.695652, - 55.909092, 52.857143, 58.636364, 55.714287, 58.57143, - 61.363636, 58.5, 61.42857, 61.5], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[89])), - ('vector.kvect', DmapArray(name='vector.kvect', value=np.array([129.11713, 126.74036, 129.43018, -59.188175, - 98.50512, 80.42348, 75.69116, 129.11713, - 126.74036, 129.43018, -59.188175, 98.50512, - 80.42348, 75.69116, 5.3487244, 10.402584, - 14.785839, 15.429902, -35.943424, 20.576845, - 20.34991, 21.785473, 10.402584, 14.785839, - 15.429902, -35.943424, 20.576845, 20.34991, - 21.785473, 48.44863, 53.48781, -123.236755, - -119.82997, -118.107376, 3.8013902, 12.560586, - 13.944878, 22.161648, 24.005245, 31.447266, - 33.86883, 40.17791, -49.860504, -46.643433, - -30.441378, -28.282873, -24.79395, -17.491783, - -14.234547, 171.96645, -8.580771, -8.799448, - -179.43964, -2.5106738, -0.3186142, -0.5526578, - -170.8527, 7.261834, 7.6403155, 7.9380827, - 13.710478, 10.7870865, -163.56581, -161.49174, - -7.7182574, -6.8226385, -10.626968, -10.920318, - -8.530712, -11.8747835, -2.9404123, -5.600803, - 0.2846103, 3.424564, 0.5950424, 0.6806656, - 6.334974, -160.16771, 127.07647, -43.32296, - 132.45633, 129.95958, -33.12576, -35.21408, - -31.327961, -24.226963, 152.3547, -20.693926, - 159.82927], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[89])), - ('vector.stid', DmapArray(name='vector.stid', value=np.array([66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 10, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 7, 7, 7, 7, 7, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[89])), - ('vector.channel', DmapArray(name='vector.channel', value=np.array([1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[89])), - ('vector.index', DmapArray(name='vector.index', value=np.array([78002, 78001, 79001, 79000, 81050, 81047, 80052, 78002, 78001, - 79001, 79000, 81050, 81047, 80052, 63046, 73079, 78056, 78057, - 79052, 80047, 81042, 82038, 73079, 78056, 78057, 79052, 80047, - 81042, 82038, 78060, 77065, 78061, 77066, 77067, 79055, 79056, - 80050, 79057, 80051, 79058, 80052, 81048, 69097, 69098, 70095, - 71090, 71091, 71092, 72087, 70098, 71093, 72088, 70099, 71094, - 72089, 73084, 70100, 71095, 72090, 73085, 71096, 72091, 70101, - 72092, 69110, 70105, 70104, 71099, 72094, 73088, 71100, 73089, - 70106, 71101, 72095, 73090, 72096, 70108, 68019, 67022, 68020, - 69018, 68021, 69019, 69020, 68022, 70019, 69021, 70020], - dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[89])), - ('vector.vel.median', DmapArray(name='vector.vel.median', value=np.array([99.77544, 215.3899, 52.910847, 82.5198, 127.99508, - 392.20102, 323.5969, 99.77544, 215.3899, 52.910847, - 82.5198, 127.99508, 392.20102, 323.5969, 36.895718, - 128.16359, 103.803276, 182.86656, 1.4650353, 23.724642, - 129.05513, 123.55807, 128.16359, 103.803276, 182.86656, - 1.4650353, 23.724642, 129.05513, 123.55807, 72.101685, - 65.82962, 28.527603, 23.7973, 56.065643, 169.72243, - 181.25015, 164.01581, 156.00787, 173.28802, 179.80249, - 189.60582, 134.25577, 49.080173, 48.94149, 67.7719, - 83.58945, 33.24323, 17.462973, 62.645405, 42.72127, - 17.935667, 156.88533, 45.470776, 14.881177, 98.745285, - 115.07141, 19.48309, 45.464436, 74.73737, 75.81823, - 43.134506, 22.63102, 46.704475, 72.51477, 62.100323, - 69.959984, 76.3948, 54.83884, 68.74596, 68.72718, - 53.669647, 60.858982, 51.84929, 58.899475, 67.21233, - 70.210464, 61.24785, 60.452534, 60.991394, 104.52381, - 127.66232, 51.36577, 140.50201, 38.991135, 98.566246, - 102.76139, 115.36635, 112.34254, 78.04833], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[89])), - ('vector.vel.sd', DmapArray(name='vector.vel.sd', value=np.array([42.054012, 160.19165, 70.71068, 50., 70.71068, - 68.65198, 127.36315, 42.054012, 160.19165, 70.71068, - 50., 70.71068, 68.65198, 127.36315, 295.50583, - 40.82483, 37.796448, 100., 63.885418, 49.323708, - 39.667286, 178.05035, 40.82483, 37.796448, 100., - 63.885418, 49.323708, 39.667286, 178.05035, 70.71068, - 82.662, 53.454773, 88.7573, 82.06793, 57.735027, - 73.18553, 57.878773, 80.28192, 71.34064, 70.10293, - 113.82425, 100., 70.71068, 100., 100., - 70.71068, 54.847595, 57.298336, 154.79018, 100., - 77.14055, 66.736824, 57.735027, 45.80771, 44.72136, - 70.71068, 40.82483, 70.71068, 57.735027, 100., - 57.735027, 50., 57.735027, 100., 70.71068, - 57.735027, 70.71068, 70.71068, 40.82483, 70.71068, - 44.72136, 70.71068, 70.71068, 70.71068, 70.71068, - 57.735027, 70.71068, 57.735027, 84.41536, 40.82483, - 117.6106, 50., 57.735027, 60.956856, 38.57085, - 33.67731, 70.71068, 40.82483, 83.710365], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[89])), - ('vector.pwr.median', DmapArray(name='vector.pwr.median', value=np.array([12.020864, 8.436173, 6.368714, 3.4813535, 3.3061142, - 6.977922, 8.622206, 12.020864, 8.436173, 6.368714, - 3.4813535, 3.3061142, 6.977922, 8.622206, 11.008076, - 5.8998528, 14.996987, 18.542154, 23.70802, 20.34961, - 20.49331, 17.722939, 5.8998528, 14.996987, 18.542154, - 23.70802, 20.34961, 20.49331, 17.722939, 12.711495, - 12.3488655, 15.366644, 14.629335, 14.7651615, 14.870189, - 20.181046, 15.190267, 26.764128, 22.953423, 20.747616, - 23.061329, 12.5650425, 13.255072, 17.586943, 6.708887, - 9.552614, 8.199282, 9.951045, 16.64614, 24.736055, - 27.513706, 18.292982, 21.876774, 22.112955, 21.374758, - 21.609388, 14.6345415, 16.063173, 23.740139, 3.4498565, - 16.252897, 12.667518, 16.966154, 4.758166, 18.248867, - 17.759777, 17.379284, 16.138014, 15.894702, 14.125072, - 16.957937, 14.593018, 20.037302, 18.422047, 15.093561, - 15.002298, 15.551381, 16.49599, 6.824984, 5.4222775, - 5.819059, 6.875608, 7.0464234, 6.1657, 7.83585, - 10.373894, 6.0377607, 10.727633, 8.441171], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[89])), - ('vector.pwr.sd', DmapArray(name='vector.pwr.sd', value=np.array([2.9716492, 2.5911295, 0.8651986, 0.8357553, 0.70710677, - 0.6677814, 1.5986296, 2.9716492, 2.5911295, 0.8651986, - 0.8357553, 0.70710677, 0.6677814, 1.5986296, 0.9425483, - 0.7672574, 1.9533918, 7.183474, 2.7958872, 2.6007054, - 2.5271974, 5.045496, 0.7672574, 1.9533918, 7.183474, - 2.7958872, 2.6007054, 2.5271974, 5.045496, 1.4944818, - 1.5813323, 1.1246344, 1.5732502, 1.6344824, 2.2086701, - 2.2610147, 2.31329, 3.1210737, 4.4017267, 2.8361902, - 5.5484157, 3.7147055, 2.0483086, 3.3797894, 3.9405043, - 3.3613513, 2.6824377, 2.7160861, 4.084683, 5.5073767, - 4.7600527, 2.5975323, 2.6413317, 1.7139584, 2.0286996, - 2.794874, 1.8620113, 2.8370574, 2.799381, 7.71888, - 2.2496476, 2.3470678, 1.65513, 3.0560327, 1.8865502, - 1.2103523, 1.0413201, 0.86635345, 1.0522352, 0.87908375, - 0.72047585, 1.8196553, 1.0431454, 2.3102932, 1.9258243, - 1.4123337, 3.0371532, 2.7577698, 1.3675249, 0.41742203, - 1.689589, 0.89981765, 1.4888601, 0.81451905, 0.5682208, - 0.5297635, 1.1637084, 0.78525424, 1.1505332], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[89])), - ('vector.wdt.median', DmapArray(name='vector.wdt.median', value=np.array([30.64896, 149.83405, 102.861534, 59.741768, 31.820633, - 281.86752, 506.39774, 30.64896, 149.83405, 102.861534, - 59.741768, 31.820633, 281.86752, 506.39774, 12.094862, - 80.4876, 75.32737, 220.98145, 168.86945, 173.99786, - 165.36102, 100.742874, 80.4876, 75.32737, 220.98145, - 168.86945, 173.99786, 165.36102, 100.742874, 126.892715, - 119.28996, 139.22276, 188.92767, 188.70514, 61.007248, - 75.54186, 119.82788, 120.99094, 158.60014, 115.40409, - 107.172035, 136.26068, 22.029945, 61.229572, 32.39298, - 42.55644, 59.423492, 41.790157, 109.91337, 55.50634, - 16.371037, 57.93027, 27.364954, 32.824524, 58.709152, - 37.77864, 20.613598, 45.529892, 43.43238, 42.554886, - 36.93185, 60.91924, 21.553364, 37.650467, 13.573819, - 14.751927, 31.870153, 24.482826, 45.678574, 56.511772, - 22.661568, 51.696354, 18.303429, 23.589903, 36.128464, - 55.190887, 36.965225, 11.545395, 57.119465, 113.131676, - 73.16147, 39.42096, 197.7295, 62.803055, 97.009315, - 157.03384, 78.18895, 121.749245, 194.03691], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[89])), - ('vector.wdt.sd', DmapArray(name='vector.wdt.sd', value=np.array([15.878354, 44.664906, 40.95876, 42.22232, 9.05464, - 42.82575, 92.51689, 15.878354, 44.664906, 40.95876, - 42.22232, 9.05464, 42.82575, 92.51689, 3.6975808, - 13.445775, 16.581064, 53.12997, 26.524681, 29.509798, - 20.236872, 89.641014, 13.445775, 16.581064, 53.12997, - 26.524681, 29.509798, 20.236872, 89.641014, 38.603687, - 34.944992, 26.527067, 36.980644, 37.267105, 29.023672, - 34.74559, 23.054657, 30.854773, 48.49477, 11.701066, - 78.57783, 93.01469, 10.2563, 19.793447, 16.716127, - 9.9121895, 16.938435, 12.131156, 37.617626, 14.337264, - 19.79586, 22.19102, 7.641867, 9.636985, 13.359726, - 26.653004, 5.8690877, 15.885321, 15.874997, 23.467981, - 9.868851, 11.268962, 5.6104393, 19.067427, 5.754005, - 5.445473, 7.4007096, 10.967734, 4.5883193, 20.242498, - 6.938803, 16.244501, 5.013838, 8.963341, 7.4184194, - 10.019829, 6.741252, 2.7615125, 16.041115, 16.997458, - 18.566751, 10.045751, 27.482153, 15.825891, 8.10759, - 13.692567, 18.471773, 14.516933, 33.614853], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[89])), - ('N', DmapArray(name='N', value=np.array([0., 1., 1., 1., 2., 2., 2., 2., 2., 3., 3., 3., 3., 3., 3., 3., 4., - 4., 4., 4., 4., 4., 4., 4., 4., 5., 5., 5., 5., 5., 5., 5., 5., 5., - 5., 5., 6., 6., 6., 6., 6., 6., 6., 6., 6., 6., 6., 6., 6., 7., 7., - 7., 7., 7., 7., 7., 7., 7., 7., 7., 7., 7., 7., 7., 8., 8., 8., 8., - 8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8.]), data_type=8, data_type_fmt='d', dimension=1, shape=[81])), - ('N+1', DmapArray(name='N+1', value=np.array([0., 0., 1., -1., 0., 1., -1., 2., -2., 0., 1., -1., 2., - -2., 3., -3., 0., 1., -1., 2., -2., 3., -3., 4., -4., 0., - 1., -1., 2., -2., 3., -3., 4., -4., 5., -5., 0., 1., -1., - 2., -2., 3., -3., 4., -4., 5., -5., 6., -6., 0., 1., -1., - 2., -2., 3., -3., 4., -4., 5., -5., 6., -6., 7., -7., 0., - 1., -1., 2., -2., 3., -3., 4., -4., 5., -5., 6., -6., 7., - -7., 8., -8.]), data_type=8, data_type_fmt='d', dimension=1, shape=[81])), - ('N+2', DmapArray(name='N+2', value=np.array([-1.87985788e+03, -5.25455578e+02, 7.34976182e+03, 4.60063321e+02, - 1.16108413e+03, 4.10597251e+02, 5.73789084e+02, -4.00022789e+02, - -3.40961920e+02, -2.53292305e+02, -8.16818748e+02, 4.99699160e+02, - 4.92047706e+01, 8.63599601e+01, 8.02989478e+00, 3.47325104e+01, - -2.65229291e+02, 5.58099528e+01, 4.53168116e+01, -5.28274707e+01, - -4.28019921e+01, -2.74729845e+00, 1.33866508e+01, -6.75561706e-01, - -3.54368913e+00, -1.74933308e+02, 5.80719819e+01, -3.47811456e+01, - -2.35852639e+01, -8.18198981e+00, 5.37999156e-01, 6.54706288e-01, - 2.00765426e-01, 3.19712621e-01, -9.82768280e-03, 4.69035624e-01, - -1.21197611e+02, -3.10953305e+01, -6.30553786e+01, 4.80808524e+00, - 5.40455631e+00, 9.16552686e-01, 9.02678837e-01, -4.20819472e-01, - -2.15849188e-01, 3.08326291e-02, -7.43570129e-02, -3.73547566e-03, - -5.19329651e-03, -3.11766897e+01, -1.58631595e+01, -1.60789342e+01, - 9.02922327e-01, 3.93930074e+00, -5.62681408e-02, 2.73370609e-01, - -6.36601638e-02, -7.66955777e-02, 4.29521253e-03, 2.59589748e-02, - -8.25728531e-04, -1.71987461e-03, 1.06591891e-03, 2.53343554e-04, - 1.20342772e+02, 1.04870635e+01, 1.35318592e+01, -1.44177415e+00, - -2.33744202e+00, -4.10396391e-01, -4.45695304e-01, -1.00364525e-01, - -1.12275568e-02, 1.70968714e-02, -2.65583340e-04, 4.03834291e-04, - 8.27998151e-04, -2.12393605e-05, 4.37798633e-04, -2.09865296e-05, - -1.66173832e-04]), data_type=8, data_type_fmt='d', dimension=1, shape=[81])), - ('N+3', DmapArray(name='N+3', value=np.array([0., 446.25956945, 430.56801553, 474.88121279, - 512.05373126, 544.76348364, 164.81717422, 348.62663569, - 332.82790256, 113.35364619, 135.32941143, 925.37665641, - 970.0031281, 127.51301943, 100.25954605, 93.51259687, - 132.55543484, 931.99339414, 940.21106642, 697.1192844, - 499.62472684, 130.50234497, 115.5316264, 38.93427215, - 45.60593925, 32.54697823, 58.67880176, 284.65370538, - 329.39696057, 55.52096911, 69.84811705, 47.48239583, - 79.53955355, 25.7864817, 20.71436972, 84.12649898, - 71.32975837, 126.31111413, 229.67625056, 71.02563583, - 167.0958733, 95.6528262, 99.86000357, 11.82047898, - 13.24008491, 24.51988487, 28.54019195, 31.06820222, - 18.3546919, 176.47928673, 135.89032253, 35.76737716, - 47.17945736, 11.93060292, 18.50192018, 145.23466467, - 114.95000709, 27.1470072, 48.18102695, 54.38961214, - 35.58597655, 25.98667699, 29.93153895, 47.57386642, - 7.72354962, 58.51827938, 36.457769, 6.06903791, - 59.62845045, 22.79743348, 112.69526169, 2.66483676, - 3.37533937, 3.6768796, 9.03344469, 6.36666691, - 53.77172536, 5.84389725, 41.47168975, 8.15236129, - 22.21913617]), data_type=8, data_type_fmt='d', dimension=1, shape=[81])), - ('model.mlat', DmapArray(name='model.mlat', value=np.array([77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, - 77.5, 77.5, 77.5, 77.5, 77.5, 80., 75., 80., 75., 80., 75., - 80., 75., 80., 75., 80., 75., 80., 75., 80., 75., 80., - 75., 80., 75., 80., 75., 80., 75., 80., 75., 80., 75., - 82.5, 72.5, 82.5, 72.5, 82.5, 72.5, 82.5, 72.5, 82.5, 72.5, 82.5, - 72.5, 82.5, 72.5, 82.5, 72.5, 82.5, 72.5, 82.5, 72.5, 82.5, 72.5, - 82.5, 72.5, 85., 70., 85., 70., 85., 70., 85., 70., 85., - 70., 85., 70., 85., 70., 85., 70., 85., 70., 85., 70., - 87.5, 67.5, 87.5, 67.5, 87.5, 67.5, 87.5, 67.5, 87.5, 67.5, 87.5, - 67.5, 87.5, 67.5, 87.5, 67.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, - 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, - 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, - 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, - 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, - 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, - 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, - 65.5, 65.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, - 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, - 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, - 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, - 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, - 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 67.5, 67.5, 67.5, - 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, - 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, - 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, - 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, - 67.5, 67.5, 67.5, 67.5, 67.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, - 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, - 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, - 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, - 68.5, 68.5, 68.5, 68.5, 68.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, - 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, - 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, - 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 70.5, 70.5, - 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, - 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, - 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 71.5, 71.5, 71.5, 71.5, 71.5, - 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, - 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, 72.5, 72.5, 72.5, 72.5, - 72.5, 72.5, 72.5, 72.5, 72.5, 72.5, 72.5, 72.5, 72.5, 72.5, 72.5, - 72.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[449])), - ('model.mlon', DmapArray(name='model.mlon', value=np.array([78.31581, 100.81581, 123.31581, 145.81581, - 168.31581, -169.18417, -146.68419, -124.18417, - -101.68419, -79.184204, -56.68417, -34.18417, - -11.684186, 10.815814, 33.315845, 55.815815, - 78.31581, 78.31581, 104.0301, 104.0301, - 129.74438, 129.74438, 155.45868, 155.45868, - -178.82704, -178.82704, -153.11276, -153.11276, - -127.39847, -127.39847, -101.68419, -101.68419, - -75.969894, -75.969894, -50.25561, -50.25561, - -24.541334, -24.541334, 1.1729611, 1.1729611, - 26.887255, 26.887255, 52.60155, 52.60155, - 78.31581, 78.31581, 108.31581, 108.31581, - 138.31581, 138.31581, 168.31581, 168.31581, - -161.68419, -161.68419, -131.68419, -131.68419, - -101.68419, -101.68419, -71.68417, -71.68417, - -41.684185, -41.684185, -11.684186, -11.684186, - 18.315813, 18.315813, 48.315815, 48.315815, - 78.31581, 78.31581, 114.31581, 114.31581, - 150.31581, 150.31581, -173.68417, -173.68417, - -137.68419, -137.68419, -101.68419, -101.68419, - -65.68417, -65.68417, -29.684187, -29.684187, - 6.315814, 6.315814, 42.315845, 42.315845, - 78.31581, 78.31581, 123.31581, 123.31581, - 168.31581, 168.31581, -146.68419, -146.68419, - -101.68419, -101.68419, -56.68417, -56.68417, - -11.684186, -11.684186, 33.315845, 33.315845, - 167.91946, 170.33557, 172.75168, 175.16779, - 177.5839, 180., 182.4161, 184.83221, - 187.24832, 189.66443, 192.08054, 194.49664, - 196.91275, 199.32886, 201.74496, 204.16107, - 206.57718, 208.99329, 211.4094, 213.8255, - 216.24161, 218.65771, 221.07382, 223.48993, - 225.90604, 228.32214, 230.73825, 233.15436, - 235.57047, 237.98657, 240.40268, 242.81879, - 245.2349, 247.651, 250.06711, 252.48322, - 254.89932, 257.31543, 259.73154, 262.14764, - 264.56375, 266.97986, 269.39597, 271.81207, - 274.22818, 276.6443, 279.0604, 281.4765, - 283.8926, 286.30872, 288.72482, 291.14093, - 293.55704, 295.97314, 298.38925, 300.80536, - 303.22147, 305.63757, 308.05368, 310.4698, - 312.8859, 315.302, 317.7181, 320.13422, - 322.55032, 324.96643, 327.38254, 329.79865, - 332.21475, 334.63086, 337.04697, 339.46307, - 341.87918, 344.2953, 178.75, 181.25, - 183.75, 186.25, 188.75, 191.25, - 193.75, 196.25, 198.75, 201.25, - 203.75, 206.25, 208.75, 211.25, - 213.75, 216.25, 218.75, 221.25, - 223.75, 226.25, 228.75, 231.25, - 233.75, 236.25, 238.75, 241.25, - 243.75, 246.25, 248.75, 251.25, - 253.75, 256.25, 258.75, 261.25, - 263.75, 266.25, 268.75, 271.25, - 273.75, 276.25, 278.75, 281.25, - 283.75, 286.25, 288.75, 291.25, - 293.75, 296.25, 298.75, 301.25, - 303.75, 306.25, 308.75, 311.25, - 313.75, 316.25, 318.75, 321.25, - 323.75, 326.25, 328.75, 186.52159, - 189.13028, 191.73897, 194.34766, 196.95634, - 199.56503, 202.17372, 204.78241, 207.3911, - 209.99979, 212.60847, 215.21716, 217.82585, - 220.43454, 223.04323, 225.65192, 228.2606, - 230.8693, 233.47798, 236.08667, 238.69536, - 241.30405, 243.91273, 246.52142, 249.13011, - 251.7388, 254.34749, 256.95618, 259.56488, - 262.17358, 264.7823, 267.391, 269.9997, - 272.6084, 275.2171, 277.8258, 280.4345, - 283.0432, 285.65192, 288.26062, 290.86932, - 293.47803, 296.08673, 298.69543, 301.30414, - 303.91284, 306.52155, 309.13025, 311.73895, - 314.34766, 316.95636, 319.56506, 192.27287, - 195.00015, 197.72743, 200.45471, 203.18199, - 205.90927, 208.63655, 211.36383, 214.09111, - 216.81839, 219.54567, 222.27295, 225.00023, - 227.72751, 230.45479, 233.18207, 235.90935, - 238.63663, 241.3639, 244.09119, 246.81847, - 249.54575, 252.27303, 255.0003, 257.72757, - 260.45483, 263.1821, 265.90936, 268.63663, - 271.3639, 274.09116, 276.81842, 279.5457, - 282.27295, 285.0002, 287.72748, 290.45474, - 293.182, 295.90927, 298.63654, 301.3638, - 304.09106, 306.81833, 309.5456, 198.57147, - 201.42862, 204.28577, 207.14291, 210.00006, - 212.85721, 215.71436, 218.5715, 221.42865, - 224.2858, 227.14294, 230.00009, 232.85724, - 235.71439, 238.57153, 241.42868, 244.28583, - 247.14297, 250.00012, 252.85727, 255.71442, - 258.57156, 261.4287, 264.28586, 267.143, - 270.00015, 272.8573, 275.71445, 278.5716, - 281.42874, 284.2859, 287.14304, 290.00018, - 292.85733, 295.71448, 298.57162, 301.42877, - 205.5, 208.5, 211.5, 214.5, - 217.5, 220.5, 223.5, 226.5, - 229.5, 232.5, 235.5, 238.5, - 241.5, 244.5, 247.5, 250.5, - 253.5, 256.5, 259.5, 262.5, - 265.5, 268.5, 271.5, 274.5, - 277.5, 280.5, 283.5, 286.5, - 289.5, 292.5, 213.15804, 216.31593, - 219.47383, 222.63173, 225.78963, 228.94753, - 232.10542, 235.26332, 238.42122, 241.57912, - 244.73701, 247.89491, 251.05281, 254.21071, - 257.3686, 260.5265, 263.6844, 266.8423, - 270.00018, 273.15808, 276.31598, 279.47388, - 282.63177, 221.66656, 224.9999, 228.33322, - 231.66655, 234.99988, 238.3332, 241.66653, - 244.99986, 248.33319, 251.66652, 254.99985, - 258.3332, 261.66653, 264.99988, 268.33322, - 271.66656, 231.17667, 234.70609, 238.2355, - 241.76492, 245.29434, 248.82376, 252.35318, - 255.8826], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[449])), - ('model.kvect', DmapArray(name='model.kvect', value=np.array([-173.27231, -169.42711, -137.49045, -122.11198, -179.79451, - 71.14638, 54.467495, 32.028492, 22.568804, 17.241365, - -8.551449, -35.739292, -22.055166, -16.678186, 178.0631, - -170.80824, -176.5763, 179.12292, -152.49483, -164.85222, - -117.9633, -174.76096, -113.92851, 86.86597, -101.683784, - 81.47321, -60.75551, 74.6489, 6.547856, 70.1015, - 62.18515, -57.952953, 59.97691, -70.778564, 58.234226, - -72.904396, 61.4116, -74.23391, 63.000637, -70.57433, - 116.40586, -105.25926, 158.61877, -173.41486, 174.31187, - -163.72304, -147.56653, 163.33464, -115.200264, 82.7611, - -114.660286, 83.51281, -111.83703, 70.215805, 41.13548, - 46.809837, 50.91715, -95.201866, 32.070076, -69.829605, - 46.82312, -77.41506, 46.57815, -74.94877, 90.33597, - -80.15849, 135.26569, -115.634735, 165.07346, -121.50053, - -153.97087, 114.208, -114.12856, 74.5652, -128.0976, - 82.21613, -103.15821, 11.107209, -52.476025, 151.47508, - -8.935457, -71.72044, 24.390665, -77.77959, 63.392616, - -78.43927, 126.62051, -92.14801, 153.85768, -100.021774, - -149.29092, 98.11776, -134.15497, 68.32576, -114.85845, - -82.87387, -72.15114, -96.09199, -17.297731, -48.895363, - 37.395977, -81.331535, 95.88658, -89.43802, 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45., 45., - 45., 45., 45., 45.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[449])), - ('model.vel.median', DmapArray(name='model.vel.median', value=np.array([164.37001, 144.4182, 111.6802, 76.18948, 26.849833, - 62.68982, 104.02898, 125.13581, 124.216415, 110.73902, - 124.23926, 90.71832, 111.55808, 18.180555, 101.87685, - 178.73128, 199.97534, 136.56638, 155.4227, 135.12387, - 136.24905, 40.028084, 155.2327, 93.14429, 135.56819, - 160.77866, 90.841194, 183.61456, 87.66636, 123.16649, - 187.14647, 88.763565, 287.8928, 210.99916, 304.6076, - 259.16595, 241.4968, 270.0123, 201.1169, 263.58664, - 148.74966, 125.87634, 193.59549, 137.9592, 184.34528, - 127.11131, 151.84915, 93.48708, 128.04561, 117.56609, - 170.19772, 139.56061, 101.639015, 83.70615, 40.48232, - 18.259249, 92.13855, 37.28276, 199.83879, 126.51025, - 270.49442, 214.70067, 267.83804, 273.5456, 207.16963, - 291.6921, 223.30486, 158.15736, 172.59886, 146.75648, - 127.38526, 86.2416, 111.0307, 67.48102, 187.95747, - 46.685127, 160.16747, 7.619689, 141.46652, 6.4901104, - 172.97711, 53.26518, 250.24512, 147.2204, 248.25624, - 245.27962, 206.0576, 296.3981, 155.5495, 136.25525, - 101.662926, 63.232567, 112.7237, 14.133491, 192.49449, - 21.087547, 180.08508, 13.551803, 176.52094, 9.491631, - 228.3919, 114.812126, 206.57722, 265.59735, 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[449])), - ('boundary.mlat', DmapArray(name='boundary.mlat', value=np.array([65.01199, 65., 65., 65., 65., 65., - 65., 65., 65., 65., 65., 65., - 65., 65., 65., 65., 65., 65., - 65., 65., 65., 65., 65., 65., - 65., 65., 65., 65., 65., 65., - 65., 65.01296, 65.138985, 65.39556, 65.77489, 66.265434, - 66.8523, 67.51766, 68.241295, 69.001205, 69.77432, 70.53713, - 71.26648, 71.940186, 72.53779, 73.04113, 73.43492, 73.707184, - 73.849655, 73.86368, 73.79261, 73.64699, 73.429306, 73.143295, - 72.79384, 72.38692, 71.9295, 71.429405, 70.895195, 70.33601, - 69.76142, 69.18125, 68.60543, 68.04381, 67.506004, 67.00121, - 66.53807, 66.12451, 65.76759, 65.47344, 65.24708, 65.09238, - 65.01199], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[73])), - ('boundary.mlon', DmapArray(name='boundary.mlon', value=np.array([0., 5., 10., 15., 20., 25., 30., 35., 40., 45., 50., - 55., 60., 65., 70., 75., 80., 85., 90., 95., 100., 105., - 110., 115., 120., 125., 130., 135., 140., 145., 150., 155., 160., - 165., 170., 175., 180., 185., 190., 195., 200., 205., 210., 215., - 220., 225., 230., 235., 240., 245., 250., 255., 260., 265., 270., - 275., 280., 285., 290., 295., 300., 305., 310., 315., 320., 325., - 330., 335., 340., 345., 350., 355., 360.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[73]))]), - OrderedDict([('start.year', DmapScalar(name='start.year', value=2017, data_type=2, data_type_fmt='h')), - ('start.month', DmapScalar(name='start.month', value=1, data_type=2, data_type_fmt='h')), - ('start.day', DmapScalar(name='start.day', value=14, data_type=2, data_type_fmt='h')), - ('start.hour', DmapScalar(name='start.hour', value=11, data_type=2, data_type_fmt='h')), - ('start.minute', DmapScalar(name='start.minute', value=42, data_type=2, data_type_fmt='h')), - ('start.second', DmapScalar(name='start.second', value=0.0, data_type=8, data_type_fmt='d')), - ('end.year', DmapScalar(name='end.year', value=2017, data_type=2, data_type_fmt='h')), - ('end.month', DmapScalar(name='end.month', value=1, data_type=2, data_type_fmt='h')), - ('end.day', DmapScalar(name='end.day', value=14, data_type=2, data_type_fmt='h')), - ('end.hour', DmapScalar(name='end.hour', value=11, data_type=2, data_type_fmt='h')), - ('end.minute', DmapScalar(name='end.minute', value=44, data_type=2, data_type_fmt='h')), - ('end.second', DmapScalar(name='end.second', value=0.0, data_type=8, data_type_fmt='d')), - ('map.major.revision', DmapScalar(name='map.major.revision', value=1, data_type=2, data_type_fmt='h')), - ('map.minor.revision', DmapScalar(name='map.minor.revision', value=13, data_type=2, data_type_fmt='h')), - ('source', DmapScalar(name='source', value='map_fit', data_type=9, data_type_fmt='s')), - ('doping.level', DmapScalar(name='doping.level', value=1, data_type=2, data_type_fmt='h')), - ('model.wt', DmapScalar(name='model.wt', value=1, data_type=2, data_type_fmt='h')), - ('error.wt', DmapScalar(name='error.wt', value=1, data_type=2, data_type_fmt='h')), - ('IMF.flag', DmapScalar(name='IMF.flag', value=9, data_type=2, data_type_fmt='h')), - ('IMF.delay', DmapScalar(name='IMF.delay', value=10, data_type=2, data_type_fmt='h')), - ('IMF.Bx', DmapScalar(name='IMF.Bx', value=1.4600000381469727, data_type=8, data_type_fmt='d')), - ('IMF.By', DmapScalar(name='IMF.By', value=-1.840000033378601, data_type=8, data_type_fmt='d')), - ('IMF.Bz', DmapScalar(name='IMF.Bz', value=0.5699999928474426, data_type=8, data_type_fmt='d')), - ('IMF.Vx', DmapScalar(name='IMF.Vx', value=0.0, data_type=8, data_type_fmt='d')), - ('IMF.tilt', DmapScalar(name='IMF.tilt', value=-19.163267135620117, data_type=8, data_type_fmt='d')), - ('IMF.Kp', DmapScalar(name='IMF.Kp', value=0.0, data_type=8, data_type_fmt='d')), - ('model.angle', DmapScalar(name='model.angle', value='Bang 287 deg.', data_type=9, data_type_fmt='s')), - ('model.level', DmapScalar(name='model.level', value='Esw 0.9 mV/m', data_type=9, data_type_fmt='s')), - ('model.tilt', DmapScalar(name='model.tilt', value='tilt -19.2 deg.', data_type=9, data_type_fmt='s')), - ('model.name', DmapScalar(name='model.name', value='TS18', data_type=9, data_type_fmt='s')), - ('hemisphere', DmapScalar(name='hemisphere', value=1, data_type=2, data_type_fmt='h')), - ('noigrf', DmapScalar(name='noigrf', value=0, data_type=2, data_type_fmt='h')), - ('fit.order', DmapScalar(name='fit.order', value=8, data_type=2, data_type_fmt='h')), - ('latmin', DmapScalar(name='latmin', value=73.0, data_type=4, data_type_fmt='f')), - ('chi.sqr', DmapScalar(name='chi.sqr', value=40.48764047478706, data_type=8, data_type_fmt='d')), - ('chi.sqr.dat', DmapScalar(name='chi.sqr.dat', value=25.957579879191133, data_type=8, data_type_fmt='d')), - ('rms.err', DmapScalar(name='rms.err', value=75.53626253595937, data_type=8, data_type_fmt='d')), - ('lon.shft', DmapScalar(name='lon.shft', value=0.0, data_type=4, data_type_fmt='f')), - ('lat.shft', DmapScalar(name='lat.shft', value=0.0, data_type=4, data_type_fmt='f')), - ('mlt.start', DmapScalar(name='mlt.start', value=6.911511683642474, data_type=8, data_type_fmt='d')), - ('mlt.end', DmapScalar(name='mlt.end', value=6.947183770543991, data_type=8, data_type_fmt='d')), - ('mlt.av', DmapScalar(name='mlt.av', value=6.929345381208993, data_type=8, data_type_fmt='d')), - ('pot.drop', DmapScalar(name='pot.drop', value=22334.075953569765, data_type=8, data_type_fmt='d')), - ('pot.drop.err', DmapScalar(name='pot.drop.err', value=79910379.69427456, data_type=8, data_type_fmt='d')), - ('pot.max', DmapScalar(name='pot.max', value=5742.3513459540245, data_type=8, data_type_fmt='d')), - ('pot.max.err', DmapScalar(name='pot.max.err', value=57430034.99928604, data_type=8, data_type_fmt='d')), - ('pot.min', DmapScalar(name='pot.min', value=-16591.72460761574, data_type=8, data_type_fmt='d')), - ('pot.min.err', DmapScalar(name='pot.min.err', value=55564915.75503295, data_type=8, data_type_fmt='d')), - ('stid', DmapArray(name='stid', value=np.array([209, 208, 33, 66, 66, 66, 207, 206, 205, 204, 10, 10, 64, - 64, 64, 3, 7, 16, 6, 6, 5, 5, 8], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('channel', DmapArray(name='channel', value=np.array([1, 1, 0, 1, 2, 0, 0, 0, 0, 0, 1, 2, 1, 2, 0, 0, 4, 1, 1, 2, 1, 2, - 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('nvec', DmapArray(name='nvec', value=np.array([0, 0, 5, 3, 0, 0, 0, 0, 2, 1, 0, 2, 17, 21, 18, 0, 0, - 0, 0, 0, 2, 1, 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('freq', DmapArray(name='freq', value=np.array([10866.137, 10963.046, 10872.1, 10665.75, 12664.875, - 11673.875, 10525.15, 10513.9, 11083.523, 10821., - 12405.031, 12377.5, 10393.75, 12349.875, 11368.0625, - 10272.5625, 10618.781, 10917.156, 10667.875, 13209.375, - 10717.875, 13157.875, 12434.866], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('major.revision', DmapArray(name='major.revision', value=np.array([2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('minor.revision', DmapArray(name='minor.revision', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('program.id', DmapArray(name='program.id', value=np.array([-157, -157, -3300, -3505, -3505, -3505, -191, -191, - -3300, -3300, 153, -26007, -3505, -3505, -3505, -3300, - -157, -157, -3505, -3505, -3505, -3505, -3300], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('noise.mean', DmapArray(name='noise.mean', value=np.array([24.204546, 35.06818, 0., 87., 44.5625, - 66.21875, 38.5, 31.3, 81.85714, 104.57143, - 376.875, 59.5, 589.875, 428.25, 513.78125, - 205.4375, 133.09375, 3.25, 52.3125, 26.125, - 68.9375, 33.5625, 116.86667], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('noise.sd', DmapArray(name='noise.sd', value=np.array([9.929984, 6.8085203, 0., 16.397408, 11.230365, - 12.034061, 8.523318, 4.934785, 18.375153, 31.817293, - 17.124378, 0., 157.47574, 69.852974, 99.019, - 39.766457, 19.818037, 0.4330127, 13.87317, 5.035809, - 10.720709, 3.9995117, 13.826866], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('gsct', DmapArray(name='gsct', value=np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('v.min', DmapArray(name='v.min', value=np.array([35., 35., 35., 35., 35., 35., 35., 35., 35., 35., 35., 35., 35., - 35., 35., 35., 35., 35., 35., 35., 35., 35., 35.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('v.max', DmapArray(name='v.max', value=np.array([2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., - 2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., - 2500., 2500., 2500., 2500., 2500.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('p.min', DmapArray(name='p.min', value=np.array([3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., - 3., 3., 3., 3., 3., 3.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('p.max', DmapArray(name='p.max', value=np.array([60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., - 60., 60., 60., 60., 60., 60., 60., 60., 60., 60.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('w.min', DmapArray(name='w.min', value=np.array([10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., - 10., 10., 10., 10., 10., 10., 10., 10., 10., 10.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('w.max', DmapArray(name='w.max', value=np.array([1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., - 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., - 1000., 1000., 1000., 1000., 1000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('ve.min', DmapArray(name='ve.min', value=np.array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('ve.max', DmapArray(name='ve.max', value=np.array([1000000., 1000000., 1000000., 1000000., 1000000., 1000000., - 1000000., 1000000., 1000000., 1000000., 1000000., 1000000., - 1000000., 1000000., 1000000., 1000000., 1000000., 1000000., - 1000000., 1000000., 1000000., 1000000., 1000000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('vector.mlat', DmapArray(name='vector.mlat', value=np.array([48.5, 48.5, 48.5, 49.5, 50.5, 78.5, 78.5, 79.5, 50.5, 50.5, 50.5, - 80.5, 80.5, 74.5, 75.5, 76.5, 77.5, 78.5, 73.5, 74.5, 75.5, 76.5, - 75.5, 77.5, 74.5, 76.5, 75.5, 76.5, 74.5, 75.5, 73.5, 74.5, 75.5, - 76.5, 76.5, 75.5, 74.5, 77.5, 76.5, 73.5, 78.5, 75.5, 77.5, 74.5, - 76.5, 75.5, 76.5, 73.5, 74.5, 76.5, 75.5, 74.5, 75.5, 76.5, 78.5, - 73.5, 74.5, 75.5, 76.5, 76.5, 75.5, 77.5, 74.5, 76.5, 75.5, 76.5, - 73.5, 74.5, 75.5, 62.5, 62.5, 62.5], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[72])), - ('vector.mlon', DmapArray(name='vector.mlon', value=np.array([354.72803, 353.22177, 357.7406, 356.15384, 356.06985, - 342.5, 337.5, 340.9091, 332.48907, 334.06113, - 330.91702, 112.881355, 118.98305, 279.375, 282., - 280.7143, 283.84616, 282.5, 277.05884, 275.625, - 274., 272.14285, 278., 279.23077, 283.125, - 285., 286., 289.2857, 286.875, 290., - 277.05884, 275.625, 274., 276.42856, 272.14285, - 278., 279.375, 279.23077, 280.7143, 280.58823, - 282.5, 282., 283.84616, 283.125, 285., - 286., 289.2857, 284.11765, 286.875, 293.57144, - 290., 279.375, 282., 280.7143, 282.5, - 277.05884, 275.625, 274., 276.42856, 272.14285, - 278., 279.23077, 283.125, 285., 286., - 289.2857, 284.11765, 286.875, 290., 322.0482, - 324.21686, 322.0482], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[72])), - ('vector.kvect', DmapArray(name='vector.kvect', value=np.array([120.619965, 114.16712, 150.1617, 148.10854, - 147.78667, 79.675125, -106.031364, 82.783424, - 43.987873, 47.207905, 9.341812, 15.464102, - 16.46858, 8.0395975, -154.78372, -176.5838, - -168.08682, -169.86893, 164.8704, 168.7067, - 165.63148, 164.07368, 3.3102305, -177.61816, - -158.89728, -158.57843, -149.99455, -144.93524, - -144.2029, -140.09685, 162.93774, 169.40605, - 166.63026, 172.58745, 164.1245, 11.808436, - 4.0608783, -177.75594, 177.52074, 0.29934117, - -170.5252, -157.18234, -171.47296, -165.69777, - -143.64986, -150.15121, -140.132, 33.02801, - -144.2385, -137.036, -140.21983, 3.5565605, - -155.1715, 26.201145, -170.22702, 157.30347, - 5.21256, 166.60945, 171.42961, 164.10957, - 0.86286217, -177.8286, -160.01924, -156.6369, - -150.21112, -145.82999, 33.245956, -144.07158, - -140.12569, 38.006264, 46.42999, 34.697296], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[72])), - ('vector.stid', DmapArray(name='vector.stid', value=np.array([33, 33, 33, 33, 33, 66, 66, 66, 205, 205, 204, 10, 10, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 5, 5, 5], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[72])), - ('vector.channel', DmapArray(name='vector.channel', value=np.array([0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 2], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[72])), - ('vector.index', DmapArray(name='vector.index', value=np.array([48235, 48234, 48237, 49231, 50226, 78068, 78067, 79062, 50211, - 50212, 50210, 80018, 80019, 74074, 75070, 76065, 77061, 78056, - 73078, 74073, 75068, 76063, 75069, 77060, 74075, 76066, 75071, - 76067, 74076, 75072, 73078, 74073, 75068, 76064, 76063, 75069, - 74074, 77060, 76065, 73079, 78056, 75070, 77061, 74075, 76066, - 75071, 76067, 73080, 74076, 76068, 75072, 74074, 75070, 76065, - 78056, 73078, 74073, 75068, 76064, 76063, 75069, 77060, 74075, - 76066, 75071, 76067, 73080, 74076, 75072, 62148, 62149, 62148], - dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[72])), - ('vector.vel.median', DmapArray(name='vector.vel.median', value=np.array([50.51609, 74.48807, 42.838432, 46.420494, 53.421284, - 85.02915, 448.79108, 126.621315, 75.82619, 93.22276, - 45.140907, 356.03937, 329.20172, 14.62475, 61.109962, - 48.223255, 77.530014, 114.89341, 38.06708, 74.40873, - 51.443203, 53.359436, 60.597984, 97.1685, 92.729454, - 75.15623, 133.5373, 83.171524, 162.23004, 207.17174, - 46.96556, 79.02203, 83.36251, 74.33765, 68.13405, - 29.391708, 44.260033, 107.59511, 36.95411, 53.28903, - 113.394684, 65.288795, 42.128334, 41.897133, 5.371359, - 134.3708, 53.069237, 75.16937, 169.9045, 138.97963, - 167.9651, 58.13389, 55.26261, 16.244907, 108.12285, - 9.446914, 5.465262, 72.36233, 53.453957, 61.186234, - 90.06229, 92.51483, 80.24682, 40.154827, 113.24507, - 82.117874, 61.7994, 130.90132, 161.50693, 55.35917, - 48.97753, 65.132805], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[72])), - ('vector.vel.sd', DmapArray(name='vector.vel.sd', value=np.array([31.622776, 44.72136, 50., 37.796448, 50., - 278.60883, 99.94989, 283.3491, 50., 50., - 50., 50.85487, 78.11448, 38.944534, 40.03687, - 44.26899, 39.759117, 37.796448, 36.425163, 44.72136, - 57.735027, 70.71068, 32.41939, 37.796448, 33.820942, - 35.68957, 31.622776, 40.82483, 47.39453, 44.72136, - 70.67096, 56.77651, 54.157173, 33.333332, 70.71068, - 34.65658, 35.283722, 44.72136, 45.35697, 54.17652, - 35.35534, 42.09567, 39.158436, 31.60423, 36.422253, - 32.029182, 47.94692, 44.72136, 53.543396, 57.735027, - 44.72136, 30.009706, 27.91338, 31.456175, 27.73501, - 36.2899, 35.44239, 37.492718, 23.628567, 50., - 23.51722, 31.622776, 23.061832, 24.29233, 22.36068, - 30.151134, 35.35534, 33.444263, 31.622776, 35.35534, - 57.735027, 50.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[72])), - ('vector.pwr.median', DmapArray(name='vector.pwr.median', value=np.array([13.303211, 14.115065, 13.980465, 8.955337, 5.7535777, - 5.2088466, 11.088415, 8.678539, 12.789442, 8.213984, - 8.306604, 13.758322, 21.602419, 30.950472, 30.661892, - 21.288618, 14.219456, 6.7331085, 24.856895, 29.44155, - 22.971365, 12.114163, 23.991705, 17.058994, 30.940872, - 29.480164, 25.541338, 9.476672, 21.393305, 18.156796, - 30.295118, 37.752663, 23.270142, 21.759031, 15.582794, - 23.889055, 32.461403, 20.22392, 25.97021, 26.536835, - 10.811323, 31.49643, 21.46162, 25.816118, 28.103432, - 24.095278, 10.971813, 20.892778, 20.066164, 8.629856, - 21.989809, 31.651388, 29.041138, 22.928967, 8.571136, - 29.886507, 31.877008, 21.886793, 19.607672, 14.1780615, - 22.65529, 18.852839, 30.876818, 28.202662, 24.349676, - 11.172522, 31.09039, 21.024012, 18.43886, 10.7381, - 6.1580667, 8.816631], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[72])), - ('vector.pwr.sd', DmapArray(name='vector.pwr.sd', value=np.array([1.2486675, 1.5138438, 2.6701841, 1.2327976, 1.2963861, - 2.4906166, 2.0097835, 3.1540172, 1.8190244, 1.2805853, - 1.2662221, 2.164495, 3.2247007, 1.3882724, 0.9493534, - 1.2881757, 1.2589653, 0.5301572, 1.7921745, 2.4058206, - 1.9923127, 1.2957034, 1.4706441, 1.1931453, 1.2754729, - 1.7479966, 1.2638013, 1.6901295, 1.3605559, 2.5658917, - 2.1555426, 2.706794, 1.629318, 1.244524, 1.9516773, - 1.4537199, 1.6939343, 1.4297953, 1.2252754, 2.6463375, - 0.9601495, 1.2277254, 1.400129, 1.3749076, 1.3918313, - 1.6382705, 1.8058287, 2.4820876, 2.0909755, 1.9739202, - 2.2881446, 1.0994177, 0.8143218, 0.8508405, 0.49355423, - 2.0240753, 1.7156327, 1.3349987, 1.0332305, 1.5001069, - 0.9708142, 1.0387113, 0.9057026, 1.097484, 1.0113089, - 1.2195346, 2.2698612, 1.0562108, 1.6167803, 1.3399103, - 1.6085843, 1.4735821], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[72])), - ('vector.wdt.median', DmapArray(name='vector.wdt.median', value=np.array([35.653206, 18.023663, 22.435802, 49.120056, 47.51494, - 182.84894, 145.14948, 148.7138, 12.855337, 23.347654, - 25.250992, 162.59618, 171.21889, 159.4081, 133.44394, - 78.193535, 108.740234, 78.71749, 40.636772, 124.33089, - 91.82084, 87.85066, 138.05858, 61.8736, 124.05025, - 131.66142, 89.239426, 107.33645, 155.15381, 109.553635, - 117.37038, 148.51901, 134.08131, 64.59443, 47.334393, - 112.171234, 132.88264, 56.533337, 64.657776, 111.11654, - 49.67904, 115.200455, 90.843445, 160.95848, 84.20555, - 96.73987, 108.97769, 133.54263, 110.14022, 90.04887, - 137.51468, 124.00109, 111.96224, 101.9238, 88.70007, - 91.691895, 127.54158, 128.52841, 67.86899, 58.928364, - 134.05783, 64.36469, 81.82445, 108.63522, 115.339836, - 105.31412, 130.74193, 107.386444, 120.70656, 38.142162, - 66.342186, 47.986843], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[72])), - ('vector.wdt.sd', DmapArray(name='vector.wdt.sd', value=np.array([4.0537863, 4.8575735, 7.682171, 8.688845, 14.511243, - 22.117714, 24.71151, 38.229828, 9.390244, 11.926883, - 3.3431156, 19.628296, 28.686604, 13.266889, 15.205723, - 13.86343, 17.509815, 9.182422, 7.533179, 19.143475, - 21.64939, 16.168163, 10.562382, 9.613544, 16.021687, - 13.552665, 13.733099, 13.872613, 24.00671, 12.532263, - 17.166538, 19.17228, 14.260732, 8.624377, 11.678201, - 11.910555, 12.318269, 13.483343, 11.092806, 15.029184, - 8.144637, 13.110218, 11.626022, 12.112032, 8.403342, - 12.602143, 11.729783, 21.715136, 21.435654, 17.067263, - 19.544792, 10.097772, 8.623186, 8.298724, 6.7784166, - 13.896165, 12.166417, 11.185599, 6.4659615, 9.9295635, - 7.658403, 8.653706, 7.8890753, 7.1590643, 8.089971, - 9.02479, 14.334436, 17.821472, 12.122388, 4.616395, - 16.536638, 17.283165], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[72])), - ('N', DmapArray(name='N', value=np.array([0., 1., 1., 1., 2., 2., 2., 2., 2., 3., 3., 3., 3., 3., 3., 3., 4., - 4., 4., 4., 4., 4., 4., 4., 4., 5., 5., 5., 5., 5., 5., 5., 5., 5., - 5., 5., 6., 6., 6., 6., 6., 6., 6., 6., 6., 6., 6., 6., 6., 7., 7., - 7., 7., 7., 7., 7., 7., 7., 7., 7., 7., 7., 7., 7., 8., 8., 8., 8., - 8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8.]), data_type=8, data_type_fmt='d', dimension=1, shape=[81])), - ('N+1', DmapArray(name='N+1', value=np.array([0., 0., 1., -1., 0., 1., -1., 2., -2., 0., 1., -1., 2., - -2., 3., -3., 0., 1., -1., 2., -2., 3., -3., 4., -4., 0., - 1., -1., 2., -2., 3., -3., 4., -4., 5., -5., 0., 1., -1., - 2., -2., 3., -3., 4., -4., 5., -5., 6., -6., 0., 1., -1., - 2., -2., 3., -3., 4., -4., 5., -5., 6., -6., 7., -7., 0., - 1., -1., 2., -2., 3., -3., 4., -4., 5., -5., 6., -6., 7., - -7., 8., -8.]), data_type=8, data_type_fmt='d', dimension=1, shape=[81])), - ('N+2', DmapArray(name='N+2', value=np.array([-2.86751467e+03, -4.44598295e+01, -8.92783558e+03, -1.71020115e+03, - 2.33426185e+03, -5.18785802e+02, -5.21529681e+02, -5.88303291e+02, - -3.82857841e+02, -6.29430062e+02, 7.54813010e+02, -6.47683859e+02, - -3.23787100e+01, 1.60443804e+02, -3.72056489e+00, -2.87914616e+01, - -4.12455153e+02, 5.97216843e+01, -6.59114126e+01, -1.43415230e+01, - -6.66700944e+01, -3.41632506e+00, -2.80258766e+00, 3.98577237e+00, - 2.51258205e-02, -4.66852602e+01, -7.83355106e+01, 1.30920434e+02, - -2.25235360e+01, 1.25756046e+01, 4.80901001e-02, 6.31554047e-01, - -8.48742500e-01, 5.05030766e-01, -5.06060016e-02, -4.63300343e-01, - 1.13854310e+02, -4.03467263e+01, 2.15405673e+01, 9.56883481e+00, - 3.29887218e+00, 1.12774943e+00, -1.05575711e+00, 1.71559152e-01, - -2.58172694e-01, 1.11493703e-02, 3.95760997e-02, 6.18199873e-03, - -3.01602195e-02, 2.20867646e+01, 6.77863048e+01, 1.06754057e+01, - 4.03721491e+00, -1.09395163e+00, -3.86466811e-01, 2.85760963e-01, - -5.13235742e-02, 2.10461371e-01, -7.64231009e-03, 5.49062557e-03, - -2.12084792e-03, 4.30500387e-04, -2.89622808e-03, 1.15557312e-04, - 1.33365268e+02, 1.01241915e+01, -3.34463506e+01, -3.66882230e+00, - -4.55496420e-01, 2.24272906e-01, -8.25938159e-02, -5.82866347e-02, - -8.89281435e-02, -1.37649385e-02, -2.07402972e-02, 1.02499825e-04, - -1.30162712e-03, 8.48008064e-04, -1.82010097e-04, 1.46624671e-05, - 1.02634691e-04]), data_type=8, data_type_fmt='d', dimension=1, shape=[81])), - ('N+3', DmapArray(name='N+3', value=np.array([0., 343.39231213, 332.12796869, 377.80647352, - 305.80297838, 201.16328551, 511.6155095, 103.01287853, - 434.69490608, 74.99654554, 98.57607527, 761.02886343, - 785.27167274, 33.1717586, 67.03748909, 62.34788403, - 101.70492443, 830.45317264, 249.81363408, 168.18550711, - 172.52324945, 130.40400331, 63.38508956, 12.08180773, - 21.8521365, 28.01692542, 25.04304124, 223.17411842, - 233.00147676, 35.90596249, 51.95939064, 29.09380536, - 43.15221137, 17.02384395, 16.02705194, 78.82230636, - 78.25530908, 59.89255621, 29.89597935, 136.35862826, - 174.12869042, 76.65708563, 69.08814347, 7.26443936, - 6.87767225, 19.52518826, 28.49809384, 15.44044447, - 18.10031592, 125.52509831, 49.87490404, 61.12941281, - 41.39892569, 53.51736897, 37.13072182, 113.57468336, - 91.92346086, 43.89959057, 9.20456731, 7.08617604, - 18.96184597, 16.17551103, 12.68920836, 27.28643611, - 8.02232176, 45.87241354, 9.72816419, 36.23943808, - 40.88802113, 10.44242725, 76.75537733, 17.01512001, - 1.01029763, 0.92481257, 1.7917324, 3.07319967, - 2.12365641, 14.89456718, 6.96783488, 29.36178144, - 27.38611566]), data_type=8, data_type_fmt='d', dimension=1, shape=[81])), - ('model.mlat', DmapArray(name='model.mlat', value=np.array([81.5, 81.5, 81.5, 81.5, 81.5, 81.5, 81.5, 81.5, 81.5, 81.5, 81.5, - 81.5, 81.5, 81.5, 81.5, 81.5, 83.2, 79.8, 83.2, 79.8, 83.2, 79.8, - 83.2, 79.8, 83.2, 79.8, 83.2, 79.8, 83.2, 79.8, 83.2, 79.8, 83.2, - 79.8, 83.2, 79.8, 83.2, 79.8, 83.2, 79.8, 83.2, 79.8, 83.2, 79.8, - 84.9, 78.1, 84.9, 78.1, 84.9, 78.1, 84.9, 78.1, 84.9, 78.1, 84.9, - 78.1, 84.9, 78.1, 84.9, 78.1, 84.9, 78.1, 84.9, 78.1, 84.9, 78.1, - 84.9, 78.1, 86.6, 76.4, 86.6, 76.4, 86.6, 76.4, 86.6, 76.4, 86.6, - 76.4, 86.6, 76.4, 86.6, 76.4, 86.6, 76.4, 86.6, 76.4, 86.6, 76.4, - 88.3, 74.7, 88.3, 74.7, 88.3, 74.7, 88.3, 74.7, 88.3, 74.7, 88.3, - 74.7, 88.3, 74.7, 88.3, 74.7, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, - 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, - 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, - 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, - 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 73.5, 74.5, - 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, - 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, - 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, 74.5, - 74.5, 74.5, 74.5, 74.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, - 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, - 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, - 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, - 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, - 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, - 77.5, 77.5, 77.5, 77.5, 78.5, 78.5, 78.5, 78.5, 78.5, 78.5, 78.5, - 78.5], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[265])), - ('model.mlon', DmapArray(name='model.mlon', value=np.array([-103.94018, -81.44018, -58.94018, -36.44018, - -13.940181, 8.559827, 31.05982, 53.559834, - 76.05982, 98.55981, 121.05984, 143.55983, - 166.05981, -171.44019, -148.94016, -126.44018, - -103.94018, -103.94018, -78.22589, -78.22589, - -52.51161, -52.51161, -26.79732, -26.79732, - -1.0830334, -1.0830334, 24.631247, 24.631247, - 50.34554, 50.34554, 76.05982, 76.05982, - 101.77412, 101.77412, 127.488396, 127.488396, - 153.20267, 153.20267, 178.91696, 178.91696, - -155.36874, -155.36874, -129.65445, -129.65445, - -103.94018, -103.94018, -73.94018, -73.94018, - -43.94018, -43.94018, -13.940181, -13.940181, - 16.05982, 16.05982, 46.05982, 46.05982, - 76.05982, 76.05982, 106.05984, 106.05984, - 136.05981, 136.05981, 166.05981, 166.05981, - -163.94019, -163.94019, -133.94019, -133.94019, - -103.94018, -103.94018, -67.94018, -67.94018, - -31.94018, -31.94018, 4.059827, 4.059827, - 40.05982, 40.05982, 76.05982, 76.05982, - 112.05984, 112.05984, 148.05981, 148.05981, - -175.94019, -175.94019, -139.94016, -139.94016, - -103.94018, -103.94018, -58.94018, -58.94018, - -13.940181, -13.940181, 31.05982, 31.05982, - 76.05982, 76.05982, 121.05984, 121.05984, - 166.05981, 166.05981, -148.94016, -148.94016, - 1.7647059, 5.294118, 8.82353, 12.3529415, - 15.882353, 19.411764, 22.941175, 26.470587, - 29.999998, 33.52941, 37.058823, 40.588234, - 44.117645, 47.647057, 51.176468, 54.70588, - 58.23529, 61.7647, 65.29411, 68.823524, - 72.352936, 75.88235, 79.41176, 82.94117, - 86.47058, 89.99999, 93.5294, 97.058815, - 100.58823, 104.11764, 107.64705, 111.17646, - 114.70587, 118.23528, 121.764694, 125.294106, - 128.82352, 132.35294, 135.88235, 139.41177, - 142.9412, 146.47061, 150.00003, 153.52945, - 157.05887, 347.6475, 351.1769, 354.70633, - 358.23575, 1.875, 5.625, 9.375, - 13.125, 16.875, 20.625, 24.375, - 28.125, 31.875, 35.625, 39.375, - 43.125, 46.875, 50.625, 54.375, - 58.125, 61.875, 65.625, 69.375, - 73.125, 76.875, 80.625, 84.375, - 88.125, 91.875, 95.625, 99.375, - 103.125, 106.875, 110.625, 114.375, - 118.125, 121.875, 125.625, 129.375, - 133.125, 136.875, 140.625, 14., - 18., 22., 26., 30., - 34., 38., 42., 46., - 50., 54., 58., 62., - 66., 70., 74., 78., - 82., 86., 90., 94., - 98., 102., 106., 110., - 114., 118., 122., 126., - 23.571426, 27.85714, 32.142853, 36.428566, - 40.71428, 44.999992, 49.285706, 53.57142, - 57.857132, 62.142845, 66.42856, 70.71427, - 74.999985, 79.2857, 83.57141, 87.857124, - 92.14284, 96.42855, 100.714264, 104.99998, - 109.28569, 113.5714, 34.615387, 39.23077, - 43.846153, 48.461536, 53.07692, 57.692303, - 62.307686, 66.92307, 71.53846, 76.15385, - 80.76923, 85.38462, 90.00001, 94.615395, - 99.23078, 47.5, 52.5, 57.5, - 62.5, 67.5, 72.5, 77.5, - 82.5], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[265])), - ('model.kvect', DmapArray(name='model.kvect', value=np.array([179.20883, -171.78842, -147.07774, -141.716, - 118.24017, 74.47881, 62.99268, 43.81312, - 24.337126, 3.1245577, -21.102512, -43.64854, - -27.70306, -18.069008, 169.81468, 178.18596, - 179.2462, 179.16006, -156.72421, -170.67552, - -125.121574, 141.48265, -116.46832, 87.82282, - -105.407135, 80.077835, -28.200483, 74.63014, - 32.30409, 69.19039, 58.725468, -54.91582, - 59.60832, -70.856926, 57.45584, -72.52315, - 61.599094, -72.9938, 66.644775, -71.49556, - 117.80353, -102.2115, 155.4111, -167.63353, - 174.85872, -161.08827, -149.79355, 152.51611, - -121.274506, 84.094696, -118.96106, 83.69831, - -119.69199, 69.80752, 39.729847, 47.0404, - 51.438602, -94.243744, 39.83212, -70.64163, - 49.31065, -75.66834, 54.442005, -74.789764, - 90.552124, -81.19016, 136.4111, -111.93168, - 162.62842, -124.41582, -159.47514, 110.256325, - -131.07263, 78.836334, -133.04237, 79.77744, - -99.15406, 39.362347, -41.625965, 155.09265, - -1.4795303, -71.31487, 33.506466, -76.78877, - 67.53643, -78.95786, 119.20874, -92.229324, - 138.80272, -99.574974, -176.34497, 99.25938, - -146.92873, 77.05153, -110.509445, -82.52274, - -57.36609, -96.68923, -1.22461, -46.952763, - 45.830334, -81.57208, 91.556114, -89.371056, - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45., 45., 45., 45., - 45.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[265])), - ('model.vel.median', DmapArray(name='model.vel.median', value=np.array([273.0426, 228.41983, 152.61353, 72.180336, 51.962376, - 141.99324, 206.08696, 220.23645, 192.29938, 171.79361, - 205.7497, 174.53307, 181.65588, 28.7444, 167.35106, - 278.28818, 314.48474, 233.80144, 241.96277, 199.74329, - 198.60345, 67.38212, 197.2697, 171.73509, 138.60808, - 249.88158, 68.89932, 277.46732, 178.09438, 184.91472, - 332.55206, 110.63923, 462.06198, 310.13446, 475.8984, - 406.19772, 373.56973, 425.7862, 323.65732, 421.48544, - 259.88257, 230.39491, 320.43823, 210.52504, 296.14523, - 205.79869, 246.92812, 140.47789, 203.48358, 181.59952, - 234.6433, 206.65387, 132.0949, 128.45001, 86.94873, - 29.17182, 212.86389, 58.477432, 367.00104, 177.30219, - 469.67767, 315.47372, 447.20178, 416.4875, 368.76633, - 450.5274, 359.16562, 263.2604, 275.70078, 204.35614, - 224.1459, 142.28206, 177.75572, 104.79132, 262.61472, - 75.67149, 218.35202, 13.550782, 219.40205, 9.154115, - 304.19473, 72.97159, 401.42017, 222.49307, 430.95026, - 370.5139, 349.74814, 435.2755, 285.39056, 207.58173, - 202.16327, 87.88787, 200.5604, 30.34887, 267.4461, - 33.00024, 261.47867, 22.839878, 285.07526, 13.443621, - 371.9178, 179.4039, 366.0665, 405.09082, 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1.], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[265])), - ('boundary.mlat', DmapArray(name='boundary.mlat', value=np.array([74.4605, 74.932846, 75.4381, 75.96092, 76.48542, 76.99565, - 77.47613, 77.91225, 78.29074, 78.600136, 78.83101, 78.97635, - 79.03175, 79.01157, 78.939926, 78.81825, 78.64863, 78.43397, - 78.17793, 77.88491, 77.55991, 77.208496, 76.836685, 76.45083, - 76.05753, 75.663536, 75.275566, 74.90027, 74.54407, 74.21305, - 73.91288, 73.648705, 73.42503, 73.2457, 73.11376, 73.03149, - 73.00028, 73., 73., 73., 73., 73., - 73., 73., 73., 73., 73., 73., - 73., 73., 73., 73., 73., 73., - 73., 73., 73., 73., 73., 73., - 73., 73., 73., 73., 73., 73., - 73., 73.036736, 73.16349, 73.376915, 73.67054, 74.03543, - 74.4605], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[73])), - ('boundary.mlon', DmapArray(name='boundary.mlon', value=np.array([0., 5., 10., 15., 20., 25., 30., 35., 40., 45., 50., - 55., 60., 65., 70., 75., 80., 85., 90., 95., 100., 105., - 110., 115., 120., 125., 130., 135., 140., 145., 150., 155., 160., - 165., 170., 175., 180., 185., 190., 195., 200., 205., 210., 215., - 220., 225., 230., 235., 240., 245., 250., 255., 260., 265., 270., - 275., 280., 285., 290., 295., 300., 305., 310., 315., 320., 325., - 330., 335., 340., 345., 350., 355., 360.], dtype=np.float32), - data_type=4, data_type_fmt='f', - dimension=1, - shape=[73]))]), - OrderedDict([('start.year', DmapScalar(name='start.year', value=2017, data_type=2, data_type_fmt='h')), - ('start.month', DmapScalar(name='start.month', value=1, data_type=2, data_type_fmt='h')), - ('start.day', DmapScalar(name='start.day', value=14, data_type=2, data_type_fmt='h')), - ('start.hour', DmapScalar(name='start.hour', value=23, data_type=2, data_type_fmt='h')), - ('start.minute', DmapScalar(name='start.minute', value=42, data_type=2, data_type_fmt='h')), - ('start.second', DmapScalar(name='start.second', value=0.0, data_type=8, data_type_fmt='d')), - ('end.year', DmapScalar(name='end.year', value=2017, data_type=2, data_type_fmt='h')), - ('end.month', DmapScalar(name='end.month', value=1, data_type=2, data_type_fmt='h')), - ('end.day', DmapScalar(name='end.day', value=14, data_type=2, data_type_fmt='h')), - ('end.hour', DmapScalar(name='end.hour', value=23, data_type=2, data_type_fmt='h')), - ('end.minute', DmapScalar(name='end.minute', value=44, data_type=2, data_type_fmt='h')), - ('end.second', DmapScalar(name='end.second', value=0.0, data_type=8, data_type_fmt='d')), - ('map.major.revision', DmapScalar(name='map.major.revision', value=1, data_type=2, data_type_fmt='h')), - ('map.minor.revision', DmapScalar(name='map.minor.revision', value=13, data_type=2, data_type_fmt='h')), - ('source', DmapScalar(name='source', value='map_fit', data_type=9, data_type_fmt='s')), - ('doping.level', DmapScalar(name='doping.level', value=1, data_type=2, data_type_fmt='h')), - ('model.wt', DmapScalar(name='model.wt', value=1, data_type=2, data_type_fmt='h')), - ('error.wt', DmapScalar(name='error.wt', value=1, data_type=2, data_type_fmt='h')), - ('IMF.flag', DmapScalar(name='IMF.flag', value=9, data_type=2, data_type_fmt='h')), - ('IMF.delay', DmapScalar(name='IMF.delay', value=10, data_type=2, data_type_fmt='h')), - ('IMF.Bx', DmapScalar(name='IMF.Bx', value=2.380000114440918, data_type=8, data_type_fmt='d')), - ('IMF.By', DmapScalar(name='IMF.By', value=0.25, data_type=8, data_type_fmt='d')), - ('IMF.Bz', DmapScalar(name='IMF.Bz', value=-3.2899999618530273, data_type=8, data_type_fmt='d')), - ('IMF.Vx', DmapScalar(name='IMF.Vx', value=0.0, data_type=8, data_type_fmt='d')), - ('IMF.tilt', DmapScalar(name='IMF.tilt', value=-22.574230194091797, data_type=8, data_type_fmt='d')), - ('IMF.Kp', DmapScalar(name='IMF.Kp', value=0.0, data_type=8, data_type_fmt='d')), - ('model.angle', DmapScalar(name='model.angle', value='Bang 176 deg.', data_type=9, data_type_fmt='s')), - ('model.level', DmapScalar(name='model.level', value='Esw 1.5 mV/m', data_type=9, data_type_fmt='s')), - ('model.tilt', DmapScalar(name='model.tilt', value='tilt -20.0 deg.', data_type=9, data_type_fmt='s')), - ('model.name', DmapScalar(name='model.name', value='TS18', data_type=9, data_type_fmt='s')), - ('hemisphere', DmapScalar(name='hemisphere', value=1, data_type=2, data_type_fmt='h')), - ('noigrf', DmapScalar(name='noigrf', value=0, data_type=2, data_type_fmt='h')), - ('fit.order', DmapScalar(name='fit.order', value=8, data_type=2, data_type_fmt='h')), - ('latmin', DmapScalar(name='latmin', value=63.0, data_type=4, data_type_fmt='f')), - ('chi.sqr', DmapScalar(name='chi.sqr', value=186.98501983842345, data_type=8, data_type_fmt='d')), - ('chi.sqr.dat', DmapScalar(name='chi.sqr.dat', value=140.47171942560558, data_type=8, data_type_fmt='d')), - ('rms.err', DmapScalar(name='rms.err', value=59.27411242626262, data_type=8, data_type_fmt='d')), - ('lon.shft', DmapScalar(name='lon.shft', value=0.0, data_type=4, data_type_fmt='f')), - ('lat.shft', DmapScalar(name='lat.shft', value=0.0, data_type=4, data_type_fmt='f')), - ('mlt.start', DmapScalar(name='mlt.start', value=18.390373360089775, data_type=8, data_type_fmt='d')), - ('mlt.end', DmapScalar(name='mlt.end', value=18.423737757189517, data_type=8, data_type_fmt='d')), - ('mlt.av', DmapScalar(name='mlt.av', value=18.407052242075395, data_type=8, data_type_fmt='d')), - ('pot.drop', DmapScalar(name='pot.drop', value=48796.18463253425, data_type=8, data_type_fmt='d')), - ('pot.drop.err', DmapScalar(name='pot.drop.err', value=6225382.94103925, data_type=8, data_type_fmt='d')), - ('pot.max', DmapScalar(name='pot.max', value=24185.217552567323, data_type=8, data_type_fmt='d')), - ('pot.max.err', DmapScalar(name='pot.max.err', value=3890183.6312074685, data_type=8, data_type_fmt='d')), - ('pot.min', DmapScalar(name='pot.min', value=-24610.967079966922, data_type=8, data_type_fmt='d')), - ('pot.min.err', DmapScalar(name='pot.min.err', value=4860232.924260726, data_type=8, data_type_fmt='d')), - ('stid', DmapArray(name='stid', value=np.array([209, 208, 33, 66, 66, 66, 207, 206, 205, 204, 10, 10, 64, - 64, 64, 3, 7, 16, 6, 6, 5, 5, 8], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('channel', DmapArray(name='channel', value=np.array([1, 1, 0, 1, 2, 0, 0, 0, 0, 0, 1, 2, 1, 2, 0, 0, 4, 1, 1, 2, 1, 2, - 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('nvec', DmapArray(name='nvec', value=np.array([0, 0, 0, 47, 20, 36, 0, 0, 0, 0, 0, 0, 61, 75, 73, 0, 0, - 0, 15, 34, 38, 25, 14], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('freq', DmapArray(name='freq', value=np.array([13728.409, 13846.546, 11512., 10690.5625, 12645.3125, - 11665.656, 14725., 14734.075, 11594.857, 11590.19, - 11217.9375, 11166., 10378.25, 12343.0625, 11363.375, - 10268.4375, 10514.375, 10874.75, 10618.75, 13202.3125, - 10697.375, 13168.6875, 9389.333], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('major.revision', DmapArray(name='major.revision', value=np.array([2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('minor.revision', DmapArray(name='minor.revision', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('program.id', DmapArray(name='program.id', value=np.array([-157, -157, -3300, -3505, -3505, -3505, -191, -191, - -3300, -3300, 153, -26007, -3505, -3505, -3505, -3300, - -157, -157, -3505, -3505, -3505, -3505, -3300], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('noise.mean', DmapArray(name='noise.mean', value=np.array([1.4295455e+01, 1.9659090e+01, 5.5000001e-01, 1.0931250e+02, - 5.8937500e+01, 8.5187500e+01, 2.7700001e+01, 1.3775000e+01, - 1.0238095e+02, 7.4400000e+02, 1.8306250e+02, 4.8000000e+01, - 6.4512500e+02, 1.0331250e+03, 6.5956250e+02, 1.7325000e+02, - 1.0259375e+02, 3.1250000e+00, 2.0181250e+02, 4.8687500e+01, - 1.0001250e+03, 3.2062500e+01, 2.0786667e+02], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('noise.sd', DmapArray(name='noise.sd', value=np.array([1.1926947e+00, 1.6055204e+00, 5.8949131e-01, 9.8787575e+00, - 1.1354893e+01, 8.7351284e+00, 7.4100084e+00, 1.1613951e+00, - 2.0185984e+01, 7.8589014e+02, 1.2451491e+01, 0.0000000e+00, - 2.2577863e+02, 1.3172302e+03, 2.4998164e+02, 3.8809631e+01, - 2.0367304e+01, 3.3071890e-01, 2.5345172e+02, 4.7248966e+01, - 3.4248984e+03, 4.2495403e+00, 9.6914307e+01], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('gsct', DmapArray(name='gsct', value=np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[23])), - ('v.min', DmapArray(name='v.min', value=np.array([35., 35., 35., 35., 35., 35., 35., 35., 35., 35., 35., 35., 35., - 35., 35., 35., 35., 35., 35., 35., 35., 35., 35.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('v.max', DmapArray(name='v.max', value=np.array([2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., - 2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., 2500., - 2500., 2500., 2500., 2500., 2500.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('p.min', DmapArray(name='p.min', value=np.array([3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., - 3., 3., 3., 3., 3., 3.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('p.max', DmapArray(name='p.max', value=np.array([60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., - 60., 60., 60., 60., 60., 60., 60., 60., 60., 60.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('w.min', DmapArray(name='w.min', value=np.array([10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., - 10., 10., 10., 10., 10., 10., 10., 10., 10., 10.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('w.max', DmapArray(name='w.max', value=np.array([1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., - 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., 1000., - 1000., 1000., 1000., 1000., 1000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('ve.min', DmapArray(name='ve.min', value=np.array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('ve.max', DmapArray(name='ve.max', value=np.array([1000000., 1000000., 1000000., 1000000., 1000000., 1000000., - 1000000., 1000000., 1000000., 1000000., 1000000., 1000000., - 1000000., 1000000., 1000000., 1000000., 1000000., 1000000., - 1000000., 1000000., 1000000., 1000000., 1000000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[23])), - ('vector.mlat', DmapArray(name='vector.mlat', value=np.array([78.5, 79.5, 80.5, 81.5, 80.5, 78.5, 77.5, 77.5, 76.5, 78.5, 77.5, - 78.5, 78.5, 79.5, 78.5, 79.5, 79.5, 78.5, 79.5, 80.5, 80.5, 81.5, - 81.5, 82.5, 82.5, 82.5, 81.5, 82.5, 82.5, 81.5, 81.5, 79.5, 80.5, - 83.5, 83.5, 83.5, 83.5, 83.5, 83.5, 84.5, 84.5, 81.5, 84.5, 84.5, - 84.5, 85.5, 85.5, 79.5, 79.5, 79.5, 79.5, 80.5, 79.5, 80.5, 80.5, - 81.5, 80.5, 80.5, 81.5, 81.5, 80.5, 82.5, 81.5, 81.5, 79.5, 80.5, - 81.5, 79.5, 80.5, 81.5, 80.5, 77.5, 77.5, 79.5, 78.5, 78.5, 79.5, - 78.5, 79.5, 79.5, 79.5, 80.5, 80.5, 81.5, 81.5, 80.5, 82.5, 82.5, - 81.5, 82.5, 82.5, 81.5, 81.5, 79.5, 80.5, 83.5, 83.5, 84.5, 84.5, - 81.5, 84.5, 85.5, 85.5, 79.5, 80.5, 81.5, 82.5, 80.5, 81.5, 81.5, - 82.5, 82.5, 83.5, 80.5, 83.5, 84.5, 81.5, 82.5, 85.5, 80.5, 82.5, - 83.5, 84.5, 85.5, 79.5, 81.5, 84.5, 86.5, 80.5, 82.5, 83.5, 84.5, - 85.5, 86.5, 83.5, 85.5, 84.5, 85.5, 79.5, 81.5, 83.5, 84.5, 80.5, - 82.5, 83.5, 84.5, 78.5, 81.5, 82.5, 83.5, 77.5, 79.5, 80.5, 81.5, - 82.5, 78.5, 79.5, 80.5, 77.5, 78.5, 79.5, 77.5, 78.5, 79.5, 81.5, - 82.5, 82.5, 83.5, 84.5, 85.5, 86.5, 83.5, 84.5, 85.5, 86.5, 86.5, - 87.5, 82.5, 85.5, 87.5, 88.5, 82.5, 83.5, 84.5, 85.5, 86.5, 88.5, - 89.5, 84.5, 86.5, 87.5, 88.5, 82.5, 83.5, 84.5, 85.5, 86.5, 87.5, - 81.5, 83.5, 85.5, 86.5, 87.5, 82.5, 84.5, 85.5, 81.5, 83.5, 84.5, - 85.5, 85.5, 82.5, 83.5, 84.5, 84.5, 78.5, 81.5, 82.5, 83.5, 83.5, - 84.5, 79.5, 80.5, 81.5, 82.5, 82.5, 83.5, 83.5, 78.5, 79.5, 80.5, - 81.5, 80.5, 77.5, 78.5, 79.5, 77.5, 78.5, 79.5, 81.5, 82.5, 80.5, - 81.5, 81.5, 82.5, 82.5, 83.5, 84.5, 85.5, 83.5, 84.5, 85.5, 86.5, - 86.5, 81.5, 82.5, 85.5, 87.5, 82.5, 83.5, 84.5, 85.5, 86.5, 88.5, - 89.5, 81.5, 84.5, 86.5, 87.5, 88.5, 80.5, 82.5, 83.5, 84.5, 85.5, - 86.5, 87.5, 83.5, 85.5, 86.5, 84.5, 85.5, 79.5, 81.5, 83.5, 84.5, - 85.5, 80.5, 82.5, 83.5, 84.5, 84.5, 78.5, 81.5, 82.5, 83.5, 83.5, - 77.5, 79.5, 80.5, 81.5, 82.5, 78.5, 79.5, 80.5, 81.5, 77.5, 78.5, - 79.5, 77.5, 78.5, 79.5, 80.5, 81.5, 81.5, 69.5, 70.5, 76.5, 82.5, - 77.5, 70.5, 77.5, 77.5, 70.5, 77.5, 78.5, 85.5, 67.5, 68.5, 69.5, - 78.5, 78.5, 68.5, 71.5, 80.5, 67.5, 69.5, 70.5, 71.5, 68.5, 69.5, - 70.5, 71.5, 67.5, 68.5, 72.5, 69.5, 70.5, 71.5, 72.5, 69.5, 70.5, - 71.5, 72.5, 73.5, 70.5, 71.5, 72.5, 73.5, 71.5, 70.5, 68.5, 69.5, - 70.5, 70.5, 71.5, 69.5, 71.5, 70.5, 76.5, 77.5, 70.5, 71.5, 74.5, - 75.5, 76.5, 77.5, 69.5, 74.5, 75.5, 76.5, 70.5, 71.5, 74.5, 68.5, - 69.5, 70.5, 71.5, 70.5, 67.5, 68.5, 69.5, 70.5, 68.5, 69.5, 67.5, - 68.5, 69.5, 69.5, 68.5, 69.5, 70.5, 70.5, 71.5, 72.5, 73.5, 69.5, - 71.5, 70.5, 71.5, 68.5, 69.5, 70.5, 69.5, 68.5, 69.5, 68.5, 69.5, - 67.5, 68.5, 67.5, 67.5, 66.5, 67.5, 67.5, 67.5, 69.5, 75.5, 75.5, - 67.5, 77.5, 76.5, 76.5, 75.5, 77.5, 76.5, 78.5, 78.5], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[438])), - ('vector.mlon', DmapArray(name='vector.mlon', value=np.array([7.5, 8.181818, 3.0508475, 322.6415, 320.339, - 2.5, 325.3846, 320.76923, 319.2857, 327.5, - 316.15384, 322.5, 317.5, 324.54544, 312.5, - 319.0909, 313.63635, 307.5, 308.18182, 314.23727, - 308.1356, 315.84906, 309.0566, 333.1915, 325.53192, - 317.87234, 302.26416, 310.21277, 302.5532, 295.4717, - 288.67926, 13.636364, 9.152542, 329.26828, 320.4878, - 338.04877, 311.7073, 302.92682, 346.82925, 324., - 313.7143, 10.18868, 344.57144, 334.2857, 303.42856, - 327.85715, 315., 357.27274, 2.7272727, 313.63635, - 8.181818, 320.339, 308.18182, 314.23727, 3.0508475, - 322.6415, 308.1356, 302.0339, 315.84906, 309.0566, - 295.9322, 317.87234, 302.26416, 295.4717, 13.636364, - 9.152542, 10.18868, 8.181818, 3.0508475, 322.6415, - 320.339, 325.3846, 320.76923, 357.27274, 322.5, - 317.5, 324.54544, 312.5, 319.0909, 313.63635, - 308.18182, 314.23727, 308.1356, 315.84906, 309.0566, - 295.9322, 325.53192, 317.87234, 302.26416, 310.21277, - 302.5532, 295.4717, 288.67926, 13.636364, 9.152542, - 320.4878, 311.7073, 324., 313.7143, 10.18868, - 344.57144, 327.85715, 315., 286.36365, 289.8305, - 288.67926, 294.89362, 265.42374, 268.30188, 261.50943, - 264.2553, 256.59573, 259.02438, 271.52542, 267.80487, - 262.2857, 275.09433, 271.9149, 263.57144, 277.6271, - 279.57446, 276.58536, 272.57144, 276.42856, 280.9091, - 281.88678, 282.85715, 286.36365, 283.72882, 287.23404, - 285.36584, 293.14285, 289.2857, 302.72726, 294.14633, - 302.14285, 303.42856, 315., 291.81818, 295.4717, - 302.92682, 313.7143, 295.9322, 302.5532, 311.7073, - 324., 292.5, 302.26416, 310.21277, 320.4878, - 293.07693, 297.27274, 302.0339, 309.0566, 317.87234, - 297.5, 302.72726, 308.1356, 297.69232, 302.5, - 308.18182, 302.30768, 307.5, 313.63635, 261.50943, - 264.2553, 256.59573, 259.02438, 252., 237.85715, - 220.90909, 267.80487, 262.2857, 250.71428, 253.63637, - 237.27272, 236.25, 271.9149, 263.57144, 258.75, - 220., 279.57446, 276.58536, 272.57144, 276.42856, - 270., 260., 300., 282.85715, 286.36365, - 281.25, 300., 287.23404, 285.36584, 293.14285, - 289.2857, 302.72726, 303.75, 288.67926, 294.14633, - 302.14285, 319.0909, 326.25, 294.89362, 303.42856, - 315., 295.4717, 302.92682, 313.7143, 327.85715, - 340.7143, 302.5532, 311.7073, 324., 334.2857, - 292.5, 302.26416, 310.21277, 320.4878, 329.26828, - 344.57144, 297.27274, 302.0339, 309.0566, 317.87234, - 325.53192, 338.04877, 346.82925, 297.5, 302.72726, - 308.1356, 315.84906, 314.23727, 297.69232, 302.5, - 308.18182, 302.30768, 307.5, 313.63635, 288.67926, - 294.89362, 265.42374, 268.30188, 261.50943, 264.2553, - 256.59573, 259.02438, 252., 237.85715, 267.80487, - 262.2857, 250.71428, 253.63637, 237.27272, 275.09433, - 271.9149, 263.57144, 258.75, 279.57446, 276.58536, - 272.57144, 276.42856, 270., 260., 300., - 281.88678, 282.85715, 286.36365, 281.25, 300., - 283.72882, 287.23404, 285.36584, 293.14285, 289.2857, - 302.72726, 303.75, 294.14633, 302.14285, 319.0909, - 303.42856, 315., 291.81818, 295.4717, 302.92682, - 313.7143, 327.85715, 295.9322, 302.5532, 311.7073, - 324., 334.2857, 292.5, 302.26416, 310.21277, - 320.4878, 329.26828, 293.07693, 297.27274, 302.0339, - 309.0566, 317.87234, 297.5, 302.72726, 308.1356, - 315.84906, 297.69232, 302.5, 308.18182, 302.30768, - 307.5, 313.63635, 253.22034, 254.71698, 247.92453, - 292.85715, 292.5, 285., 256.59573, 283.84616, - 295.5, 293.07693, 288.46155, 298.5, 297.69232, - 297.5, 327.85715, 288.26086, 287.72726, 287.14285, - 242.5, 237.5, 290.45456, 285.78946, 241.01695, - 293.47827, 290., 289.5, 288.94736, 293.18182, - 292.85715, 292.5, 292.10526, 296.08694, 295.9091, - 291.66666, 295.7143, 295.5, 295.26315, 295., - 298.57144, 298.5, 298.42105, 298.33334, 298.2353, - 301.5, 301.57895, 301.66666, 301.7647, 304.73685, - 304.5, 315., 315.7143, 316.5, 313.5, - 314.21054, 318.57144, 317.3684, 319.5, 327.85715, - 330., 325.5, 326.8421, 328.125, 330., - 332.14285, 334.6154, 327.14285, 331.875, 334., - 336.42856, 328.5, 330., 335.625, 328.63635, - 330., 331.5, 333.1579, 334.5, 330., - 331.36365, 332.85715, 337.5, 334.0909, 335.7143, - 332.6087, 336.81818, 338.57144, 341.42856, 315., - 315.7143, 316.5, 313.5, 314.21054, 315., - 312.35294, 318.57144, 317.3684, 319.5, 320.5263, - 320.45456, 321.42856, 322.5, 324.2857, 331.36365, - 332.85715, 334.0909, 335.7143, 332.6087, 336.81818, - 335.21738, 337.82608, 336.25, 340.43478, 58.695652, - 61.304348, 58.57143, 314., 310., 63.913044, - 311.53845, 310.7143, 306.42856, 306., 302.30768, - 297.85715, 297.5, 292.5], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[438])), - ('vector.kvect', DmapArray(name='vector.kvect', value=np.array([1.10865547e+02, 1.19076164e+02, 1.33050308e+02, 8.04370804e+01, - 7.42804184e+01, 1.03103668e+02, 6.32659569e+01, 6.14004517e+01, - 5.71761932e+01, 6.79327393e+01, 5.86902885e+01, 6.66033859e+01, - 6.34230537e+01, 7.10824890e+01, 6.07252502e+01, 6.80311050e+01, - 6.45047455e+01, 5.90446587e+01, 6.30774612e+01, 7.02194290e+01, - 6.54866791e+01, 7.60665207e+01, 7.07853165e+01, 9.57690582e+01, - 8.88511429e+01, 8.27158661e+01, 6.65838165e+01, 7.70930176e+01, - 7.06632996e+01, 6.35050087e+01, 5.64999237e+01, -2.59029236e+01, - -2.16487541e+01, 1.01608276e+02, 8.98829346e+01, 1.11263947e+02, - 8.19886551e+01, 7.50235672e+01, 1.23506866e+02, 9.99047165e+01, - 8.92942200e+01, 1.45236099e+02, 1.22023148e+02, 1.12941566e+02, - 8.21289749e+01, 1.05462708e+02, 9.82490158e+01, 1.07509445e+02, - 1.11604782e+02, 6.47750244e+01, 1.17024864e+02, 7.35327530e+01, - 6.33059807e+01, 7.03889618e+01, 1.32459595e+02, 7.92473602e+01, - 6.66634827e+01, 6.13210068e+01, 7.53899689e+01, 7.03141174e+01, - 5.86842537e+01, 8.18927155e+01, 6.34664803e+01, 5.97469444e+01, - -2.39533672e+01, -3.05633640e+01, 1.43868423e+02, 1.26688591e+02, - 1.32332932e+02, 7.99248962e+01, 7.42895813e+01, 6.32659569e+01, - 6.08087120e+01, 1.07546288e+02, 6.63003693e+01, 6.33692665e+01, - 6.99475479e+01, 6.13102493e+01, 6.79909210e+01, 6.46054153e+01, - 6.31528282e+01, 7.02771149e+01, 6.56720352e+01, 7.59617081e+01, - 7.00901871e+01, 5.86844521e+01, 8.70919342e+01, 8.27443008e+01, - 6.51338654e+01, 7.76727219e+01, 7.15669174e+01, 6.10171623e+01, - 5.64258385e+01, -2.57153816e+01, -2.70302525e+01, 8.80120392e+01, - 8.25726547e+01, 9.91215591e+01, 9.04839630e+01, 1.44803024e+02, - 1.22791649e+02, 1.05462708e+02, 9.81919022e+01, 1.62280827e+01, - 2.03362045e+01, 1.72138786e+01, 2.60655384e+01, -2.20459728e+01, - -2.06863079e+01, -2.52659779e+01, -2.28478851e+01, -2.91125259e+01, - -2.88066216e+01, -1.37104712e+01, -1.59655676e+01, -2.10000896e+01, - -8.45907402e+00, -8.74974060e+00, -1.83776608e+01, -3.66923356e+00, - -3.01779192e-02, -6.23802364e-01, -6.23691607e+00, -2.92052031e+00, - 9.40531445e+00, 5.32720709e+00, 3.32213187e+00, 5.03744411e+00, - 1.17475109e+01, 1.25308113e+01, 1.07828074e+01, 1.93472557e+01, - 1.62385654e+01, 2.54078789e+01, 2.21625843e+01, 3.01702461e+01, - 3.45859070e+01, 4.58774300e+01, 2.83500576e+01, 2.95511799e+01, - 3.73979492e+01, 4.90453682e+01, 3.23927917e+01, 3.94817619e+01, - 4.67548714e+01, 5.82334900e+01, 3.35495453e+01, 4.15335693e+01, - 5.07277832e+01, 5.62114067e+01, 3.58903046e+01, 4.03823433e+01, - 4.23415871e+01, 5.16082077e+01, 5.89045029e+01, 4.39498787e+01, - 4.79983673e+01, 5.50101967e+01, 4.74479332e+01, 5.23930779e+01, - 5.89504585e+01, 5.22983742e+01, 5.80514069e+01, 6.31665573e+01, - -2.52659779e+01, -2.27113247e+01, -2.91125259e+01, -3.00538826e+01, - -3.91578903e+01, -5.09856148e+01, -6.16338196e+01, -1.59914951e+01, - -2.24950542e+01, -3.29418640e+01, -3.02125225e+01, -4.83476486e+01, - -4.98490829e+01, -8.60475254e+00, -2.01130619e+01, -2.29248734e+01, - -5.82459450e+01, 2.14722705e+00, -6.07847512e-01, -6.24478340e+00, - -3.03168821e+00, -9.53754807e+00, -2.20857124e+01, -4.33143759e+00, - 6.47411489e+00, 5.38871670e+00, 7.71017933e+00, 1.37108612e+01, - 1.26051207e+01, 1.07950163e+01, 1.95007381e+01, 1.62615700e+01, - 2.83764019e+01, 3.05527153e+01, 1.70575047e+01, 2.22267342e+01, - 3.01750221e+01, 4.87054596e+01, 4.76652374e+01, 2.60584164e+01, - 3.45110588e+01, 4.79445534e+01, 2.95710754e+01, 3.75300140e+01, - 4.91321144e+01, 6.15447388e+01, 7.21431274e+01, 3.94576988e+01, - 4.67807198e+01, 6.02263985e+01, 7.08537369e+01, 3.80808945e+01, - 4.20798836e+01, 5.07754593e+01, 5.79311028e+01, 6.86921616e+01, - 8.09328842e+01, 4.10364304e+01, 4.70694199e+01, 5.19358978e+01, - 5.89957962e+01, 6.55554962e+01, 7.90832367e+01, 8.49199600e+01, - 4.42199326e+01, 4.83798752e+01, 5.45725632e+01, 6.07184296e+01, - 6.22681999e+01, 4.78018303e+01, 5.20335808e+01, 5.86290627e+01, - 5.22983742e+01, 5.84691429e+01, 6.41390305e+01, 1.68930721e+01, - 2.59169788e+01, -2.24235744e+01, -2.07274933e+01, -2.52659779e+01, - -2.28027096e+01, -2.91125259e+01, -2.94831581e+01, -3.91802521e+01, - -5.08149414e+01, -1.61312008e+01, -2.24402313e+01, -3.30081596e+01, - -3.03655033e+01, -4.71785088e+01, -9.07779217e+00, -8.65913486e+00, - -2.01127739e+01, -2.17185173e+01, -1.59833968e-01, -5.36977172e-01, - -6.23838806e+00, -2.91151381e+00, -9.52303982e+00, -2.30684052e+01, - -3.51785660e+01, 5.27129698e+00, 3.32519627e+00, 5.37816858e+00, - 7.69519329e+00, 1.36570730e+01, 1.27923355e+01, 1.24726934e+01, - 1.08028717e+01, 1.90648632e+01, 1.62699108e+01, 2.71064453e+01, - 2.94047165e+01, 2.21717644e+01, 3.02037716e+01, 4.88500481e+01, - 3.45093536e+01, 4.78463364e+01, 3.01600094e+01, 2.98549500e+01, - 3.74380531e+01, 4.90700378e+01, 6.07392769e+01, 3.30571938e+01, - 3.96740608e+01, 4.67433281e+01, 6.02286491e+01, 7.00997772e+01, - 3.47443657e+01, 4.13169365e+01, 5.08366165e+01, 5.78920174e+01, - 6.56231995e+01, 3.79557419e+01, 4.02142372e+01, 4.04576569e+01, - 5.10478020e+01, 5.89723930e+01, 4.41355400e+01, 4.74634933e+01, - 5.57378426e+01, 5.97849274e+01, 4.76845055e+01, 5.19272041e+01, - 5.88643036e+01, 5.22983742e+01, 5.81658630e+01, 6.42553940e+01, - -5.77136269e+01, -5.97130547e+01, -6.17989159e+01, -1.60868549e+01, - -1.30100946e+01, -1.94571457e+01, -5.23604965e+01, -2.02575455e+01, - -7.79580879e+00, -1.19613285e+01, -1.24913149e+01, -2.82239294e+00, - -4.45601940e+00, -4.65731239e+00, 3.26905251e+01, -3.39387932e+01, - -3.06778336e+01, -2.82509022e+01, -7.68850861e+01, -7.95446930e+01, - -2.45237064e+01, -2.55788326e+01, -7.45754623e+01, -1.85508118e+01, - -2.30009689e+01, -2.39727345e+01, -2.21966877e+01, -1.46268511e+01, - -1.53882685e+01, -1.59729996e+01, -1.51413555e+01, -1.03216667e+01, - -8.67370987e+00, -1.43939438e+01, -7.49674797e+00, -7.88651037e+00, - -8.28717518e+00, -8.75325108e+00, -3.75428319e-01, -6.60953522e-01, - -1.26374304e+00, -1.39820829e-01, -5.10147989e-01, 9.21896839e+00, - 7.25776482e+00, 7.64672804e+00, 7.93808270e+00, 1.37208729e+01, - 1.64513912e+01, -1.01940441e+01, -8.14112854e+00, -6.86610746e+00, - -1.06280193e+01, -1.09273100e+01, -1.63021553e+00, -4.21626759e+00, - 2.92700028e+00, -1.63856293e+02, -1.62918777e+02, -1.58593384e+02, - -1.57710648e+02, -1.59266388e+02, -1.57371613e+02, -1.56474701e+02, - -1.55138107e+02, -1.53003372e+02, -1.52844284e+02, -1.51908035e+02, - -1.48911255e+02, -1.53284393e+02, -1.51990997e+02, -1.46317184e+02, - -1.47159576e+02, -1.46534500e+02, -1.48059021e+02, -1.44682358e+02, - -1.39719513e+02, -1.39898071e+02, -1.39146332e+02, -1.39967850e+02, - -1.33741745e+02, -1.33472015e+02, -1.33251755e+02, -1.33954697e+02, - -1.28247864e+02, -1.27356918e+02, -1.23242111e+02, -1.01940441e+01, - -7.73606873e+00, -6.96434975e+00, -1.06320915e+01, -1.09151707e+01, - -1.13528414e+01, -1.17668371e+01, 7.68898055e-02, -3.56261182e+00, - 2.84655476e+00, 4.38429976e+00, 7.44479752e+00, 7.73338604e+00, - 1.08056860e+01, 1.52920132e+01, 4.29481125e+01, 3.96520081e+01, - 4.65603294e+01, 4.66602364e+01, 4.82813339e+01, 5.32827721e+01, - 5.33162346e+01, 5.92624969e+01, 5.79341583e+01, 6.18908386e+01, - -4.26589890e+01, -2.81405754e+01, 1.48370712e+02, 4.55930786e+01, - 4.31262817e+01, -1.86877975e+01, 4.41778412e+01, 4.28173180e+01, - 4.07600136e+01, 3.91020889e+01, 3.83261528e+01, 3.57410698e+01, - 3.51404152e+01, 3.29835434e+01], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[438])), - ('vector.stid', DmapArray(name='vector.stid', value=np.array([66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, - 66, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[438])), - ('vector.channel', DmapArray(name='vector.channel', value=np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[438])), - ('vector.index', DmapArray(name='vector.index', value=np.array([78001, 79001, 80000, 81047, 80052, 78000, 77070, 77069, 76074, - 78065, 77068, 78064, 78063, 79059, 78062, 79058, 79057, 78061, - 79056, 80051, 80050, 81046, 81045, 82043, 82042, 82041, 81044, - 82040, 82039, 81043, 81042, 79002, 80001, 83037, 83036, 83038, - 83035, 83034, 83039, 84031, 84030, 81001, 84033, 84032, 84029, - 85025, 85024, 79065, 79000, 79057, 79001, 80052, 79056, 80051, - 80000, 81047, 80050, 80049, 81046, 81045, 80048, 82041, 81044, - 81043, 79002, 80001, 81001, 79001, 80000, 81047, 80052, 77070, - 77069, 79065, 78064, 78063, 79059, 78062, 79058, 79057, 79056, - 80051, 80050, 81046, 81045, 80048, 82042, 82041, 81044, 82040, - 82039, 81043, 81042, 79002, 80001, 83036, 83035, 84031, 84030, - 81001, 84033, 85025, 85024, 79052, 80047, 81042, 82038, 80043, - 81039, 81038, 82034, 82033, 83029, 80044, 83030, 84025, 81040, - 82035, 85020, 80045, 82036, 83031, 84026, 85021, 79051, 81041, - 84027, 86017, 80046, 82037, 83032, 84028, 85022, 86018, 83033, - 85023, 84029, 85024, 79053, 81043, 83034, 84030, 80048, 82039, - 83035, 84031, 78058, 81044, 82040, 83036, 77063, 79054, 80049, - 81045, 82041, 78059, 79055, 80050, 77064, 78060, 79056, 77065, - 78061, 79057, 81038, 82034, 82033, 83029, 84024, 85018, 86013, - 83030, 84025, 85019, 86015, 86014, 87010, 82035, 85020, 87011, - 88005, 82036, 83031, 84026, 85021, 86016, 88006, 89002, 84027, - 86017, 87012, 88007, 82037, 83032, 84028, 85022, 86018, 87013, - 81042, 83033, 85023, 86019, 87014, 82038, 84029, 85024, 81043, - 83034, 84030, 85025, 85026, 82039, 83035, 84031, 84032, 78058, - 81044, 82040, 83036, 83037, 84033, 79054, 80049, 81045, 82041, - 82042, 83038, 83039, 78059, 79055, 80050, 81046, 80051, 77064, - 78060, 79056, 77065, 78061, 79057, 81042, 82038, 80043, 81039, - 81038, 82034, 82033, 83029, 84024, 85018, 83030, 84025, 85019, - 86015, 86014, 81040, 82035, 85020, 87011, 82036, 83031, 84026, - 85021, 86016, 88006, 89002, 81041, 84027, 86017, 87012, 88007, - 80046, 82037, 83032, 84028, 85022, 86018, 87013, 83033, 85023, - 86019, 84029, 85024, 79053, 81043, 83034, 84030, 85025, 80048, - 82039, 83035, 84031, 84032, 78058, 81044, 82040, 83036, 83037, - 77063, 79054, 80049, 81045, 82041, 78059, 79055, 80050, 81046, - 77064, 78060, 79056, 77065, 78061, 79057, 80041, 81037, 81036, - 69102, 70097, 76066, 82033, 77061, 70098, 77063, 77062, 70099, - 77064, 78059, 85025, 67110, 68105, 69100, 78048, 78047, 68106, - 71090, 80039, 67112, 69101, 70096, 71091, 68107, 69102, 70097, - 71092, 67113, 68108, 72087, 69103, 70098, 71093, 72088, 69104, - 70099, 71094, 72089, 73084, 70100, 71095, 72090, 73085, 71096, - 70101, 68115, 69110, 70105, 70104, 71099, 69111, 71100, 70106, - 76076, 77071, 70108, 71103, 74087, 75082, 76077, 77072, 69114, - 74088, 75083, 76078, 70109, 71104, 74089, 68120, 69115, 70110, - 71105, 70111, 67126, 68121, 69116, 70112, 68122, 69117, 67127, - 68123, 69118, 69119, 68115, 69110, 70105, 70104, 71099, 72094, - 73088, 69111, 71100, 70106, 71101, 68117, 69112, 70107, 69113, - 68121, 69116, 68122, 69117, 67127, 68123, 67128, 67129, 66134, - 67130, 67022, 67023, 69020, 75078, 75077, 67024, 77067, 76072, - 76071, 75076, 77065, 76069, 78059, 78058], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[438])), - ('vector.vel.median', DmapArray(name='vector.vel.median', value=np.array([47.916485, 23.529634, 158.78973, 180.4676, 224.42957, - 43.389313, 153.1968, 236.55264, 317.76764, 295.97546, - 327.7354, 360.50717, 390.35748, 336.7973, 334.2944, - 345.9591, 352.14026, 390.33755, 332.39465, 218.42473, - 218.12735, 165.46092, 151.79211, 160.86974, 157.7561, - 157.52724, 78.81582, 132.02307, 110.440346, 104.57816, - 248.47186, 97.97779, 51.739223, 234.00703, 200.43855, - 221.04779, 181.45363, 163.95839, 193.7694, 234.93736, - 217.61142, 162.97256, 214.10948, 238.42506, 212.23352, - 239.3921, 237.42888, 109.40644, 113.99546, 353.48895, - 19.527506, 254.0072, 297.85413, 280.88177, 187.4689, - 205.16142, 293.81253, 80.78416, 244.15176, 252.10396, - 79.61129, 148.45898, 92.338745, 83.40066, 59.017773, - 109.92657, 156.59576, 28.90551, 204.71715, 176.09091, - 229.24062, 153.1968, 224.09897, 100.8972, 341.0613, - 389.6386, 317.89987, 360.59842, 328.7103, 365.0893, - 326.69174, 254.96442, 271.78232, 162.7885, 192.70992, - 88.86238, 133.44984, 140.75946, 93.80535, 129.70032, - 105.17795, 96.56385, 206.64397, 82.12847, 75.94959, - 204.86978, 193.8181, 239.69618, 224.5988, 177.06856, - 221.22774, 245.62564, 240.48132, 255.19981, 147.17786, - 232.754, 231.14905, 256.4526, 271.0187, 297.34335, - 294.55865, 271.0352, 275.0512, 240.9583, 270.76166, - 279.69888, 257.89288, 275.8635, 261.58542, 224.20422, - 284.26, 271.1784, 265.3844, 250.96706, 265.86917, - 288.62866, 249.94328, 242.34981, 170.33885, 281.22903, - 263.29706, 237.40744, 236.51317, 224.01268, 256.5346, - 224.74786, 230.82787, 217.42004, 222.18892, 134.84209, - 228.31303, 217.36186, 95.28395, 150.03654, 223.96574, - 218.1346, 394.6308, 92.358154, 157.14813, 208.64821, - 312.18805, 237.17268, 85.1687, 127.353134, 186.28072, - 312.44876, 221.87561, 158.28088, 144.49547, 239.16962, - 195.68803, 222.56688, 147.27467, 186.02199, 269.81335, - 271.51013, 277.62292, 277.0288, 283.70334, 322.54053, - 366.55087, 267.6965, 272.6031, 283.32825, 280.45654, - 344.53018, 298.98602, 270.57022, 265.81073, 247.48529, - 196.63203, 268.94446, 250.40074, 238.16695, 229.71663, - 233.42348, 214.3904, 170.70297, 229.877, 220.09561, - 199.23439, 194.6189, 242.21399, 251.02338, 238.48476, - 228.19432, 213.81392, 206.71768, 195.11423, 251.80933, - 223.16292, 215.52875, 206.13725, 205.0479, 227.3026, - 218.34138, 101.85566, 208.57036, 221.1912, 231.15479, - 238.48386, 138.30121, 210.66298, 228.1355, 225.53972, - 456.65237, 89.078316, 140.86154, 219.55884, 232.9692, - 205.56897, 387.88416, 204.51341, 134.4006, 169.24316, - 187.89584, 219.30974, 205.56897, 428.23657, 368.59177, - 222.69153, 184.11615, 301.66525, 297.25327, 417.29413, - 326.9069, 331.24683, 351.3156, 292.7491, 203.74779, - 207.21281, 253.07616, 267.6241, 308.9609, 323.7149, - 352.01752, 287.31033, 289.4631, 340.31226, 278.30783, - 278.38025, 293.21246, 298.82697, 355.08267, 268.55075, - 296., 273.23102, 245.85793, 297.66574, 261.8393, - 249.9401, 248.38922, 236.65053, 225.8774, 228.20226, - 301.31345, 236.1105, 235.59941, 203.08011, 194.6134, - 141.94579, 276.0265, 262.84894, 239.62111, 246.05333, - 228.1085, 214.87302, 255.84174, 233.55455, 228.72539, - 234.82083, 224.94003, 215.92015, 110.92151, 218.39171, - 220.76399, 234.23846, 115.94695, 128.97835, 219.30315, - 221.91791, 229.1196, 407.21362, 85.2854, 135.71274, - 222.20212, 237.32787, 328.02036, 300.18936, 64.87274, - 100.11739, 184.1562, 370.51486, 330.95807, 125.79477, - 148.77936, 195.26396, 333.08087, 234.91685, 290.5519, - 70.5785, 290.84888, 209.70271, 223.24872, 235.75711, - 56.696266, 48.643745, 449.534, 222.79037, 385.5664, - 49.277027, 437.62634, 439.91357, 49.277065, 456.6833, - 439.91357, 158.28867, 95.76864, 111.816185, 129.15378, - 271.98477, 273.50375, 107.28721, 159.50125, 271.97272, - 83.36128, 108.13875, 98.50925, 141.35397, 67.1477, - 76.70922, 85.80655, 103.36783, 62.68698, 47.824146, - 172.42694, 52.5263, 70.36932, 92.46254, 143.17018, - 61.729786, 58.878998, 77.78931, 106.138565, 122.36633, - 40.59343, 57.48697, 81.46287, 110.174644, 42.699528, - 36.682167, 47.440777, 45.71447, 63.67174, 78.44924, - 97.14556, 42.840996, 82.39631, 56.14831, 98.681526, - 64.83341, 60.5994, 62.934303, 91.26959, 154.15001, - 148.63158, 91.08098, 68.739784, 119.34455, 143.98125, - 170.84222, 81.69145, 75.45548, 249.65146, 78.935135, - 89.32732, 98.36413, 107.58242, 153.7442, 88.23703, - 96.65665, 125.70058, 179.62498, 121.58778, 157.19254, - 93.269554, 160.09569, 197.45348, 215.40955, 74.55911, - 126.203575, 121.122856, 148.63974, 189.9855, 225.81334, - 140.47772, 72.143425, 142.15448, 96.51027, 84.56356, - 62.66489, 66.007545, 82.25379, 56.757793, 68.21307, - 78.27014, 74.887184, 105.77819, 65.905266, 93.77606, - 65.73925, 91.739685, 57.223095, 110.22553, 268.87, - 157.3716, 176.01067, 142.5899, 98.40771, 89.06637, - 283.76065, 181.45337, 106.506584, 76.96088, 173.51282, - 98.40771, 313.84622, 229.22986], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[438])), - ('vector.vel.sd', DmapArray(name='vector.vel.sd', value=np.array([44.72136, 41.53975, 35.35534, 44.72136, 50., - 57.735027, 70.71068, 59.649197, 139.10443, 72.73076, - 62.13955, 57.874474, 56.510468, 50., 50., - 55.689854, 60.520336, 70.71068, 57.735027, 44.72136, - 87.02999, 50., 56.645473, 57.735027, 44.72136, - 57.735027, 87.75003, 44.72136, 50., 100., - 70.71068, 50., 45.806877, 50., 40.82483, - 44.72136, 70.71068, 44.72136, 40.82483, 50., - 40.82483, 135.90488, 57.735027, 44.72136, 100., - 100., 70.71068, 44.72136, 44.72136, 70.71068, - 34.937073, 70.71068, 57.735027, 44.72136, 38.164764, - 50., 100., 57.735027, 60.56861, 65.63155, - 70.71068, 148.84584, 70.71068, 70.71068, 38.19085, - 41.63433, 212.11053, 25.78608, 26.646658, 33.333332, - 36.026394, 70.71068, 42.917076, 31.622776, 51.275227, - 39.771885, 50., 43.868164, 38.573444, 40.82483, - 40.82483, 31.622776, 46.71825, 38.16565, 39.031773, - 50., 44.72136, 40.82483, 35.35534, 33.333332, - 57.735027, 40.82483, 57.735027, 27.38309, 31.49078, - 35.35534, 57.735027, 44.72136, 33.333332, 118.35223, - 70.71068, 70.71068, 50., 50., 44.72136, - 50., 44.72136, 70.71068, 50., 100., - 44.72136, 100., 57.735027, 44.72136, 50., - 50., 44.72136, 50., 100., 53.762978, - 57.735027, 44.72136, 70.71068, 44.72136, 80.726295, - 44.72136, 70.71068, 70.71068, 52.44852, 50., - 57.735027, 57.735027, 57.735027, 57.735027, 44.72136, - 50., 50., 70.71068, 39.525806, 40.82483, - 50., 50., 44.72136, 50., 70.71068, - 100., 49.18762, 50., 44.72136, 70.71068, - 69.18808, 50.175713, 50., 50., 70.71068, - 52.328518, 59.440598, 57.342953, 118.1326, 51.945377, - 65.72191, 157.59445, 121.03647, 100., 100., - 44.72136, 100., 57.735027, 57.735027, 50., - 100., 50., 44.72136, 57.735027, 57.735027, - 57.735027, 57.735027, 50., 57.735027, 44.72136, - 100., 70.71068, 44.72136, 70.71068, 44.72136, - 70.71068, 70.71068, 70.71068, 57.735027, 57.735027, - 70.71068, 57.735027, 50., 57.735027, 57.735027, - 57.735027, 50., 57.735027, 50., 44.72136, - 50., 57.735027, 100., 44.72136, 50., - 50., 44.72136, 50., 50., 70.71068, - 57.735027, 50., 70.71068, 70.71068, 50., - 70.71068, 62.56833, 44.72136, 57.735027, 50., - 100., 57.735027, 138.8778, 61.3431, 70.71068, - 57.735027, 70.71068, 100., 44.7614, 48.540573, - 95.63417, 51.852562, 59.273067, 55.734337, 65.30647, - 93.24505, 144.29774, 173.63925, 81.17322, 35.35534, - 31.622776, 70.71068, 35.35534, 70.71068, 31.622776, - 70.71068, 44.72136, 40.82483, 35.35534, 35.35534, - 31.622776, 40.82483, 40.82483, 44.72136, 37.796448, - 35.35534, 40.82483, 35.35534, 40.82483, 31.622776, - 50., 31.622776, 50., 57.735027, 70.71068, - 37.796448, 50., 40.82483, 50., 57.735027, - 51.984135, 35.35534, 40.82483, 44.72136, 40.82483, - 37.796448, 50., 31.622776, 35.35534, 57.735027, - 35.35534, 35.35534, 35.11605, 28.867514, 35.35534, - 35.35534, 57.735027, 40.82483, 35.35534, 50., - 50., 37.796448, 36.529644, 35.35534, 31.622776, - 40.82483, 50., 46.478127, 36.233498, 41.889183, - 40.06488, 50., 34.110474, 42.40125, 63.939384, - 47.454502, 58.78396, 48.90903, 59.433136, 83.66833, - 101.970726, 68.209785, 100., 100., 100., - 57.735027, 70.71068, 103.04946, 57.735027, 72.74515, - 70.71068, 72.53832, 100., 70.71068, 71.174225, - 162.97974, 100., 70.71068, 57.735027, 70.71068, - 70.71068, 100., 50., 100., 70.71068, - 50., 57.735027, 70.71068, 50., 70.71068, - 40.82483, 50., 50., 57.735027, 57.735027, - 70.71068, 70.71068, 57.735027, 70.71068, 57.735027, - 50., 50., 44.72136, 44.72136, 70.71068, - 40.82483, 70.71068, 70.71068, 100., 57.735027, - 57.735027, 100., 44.72136, 57.735027, 70.71068, - 70.71068, 57.735027, 50., 40.82483, 70.71068, - 70.71068, 70.71068, 70.71068, 70.71068, 100., - 70.71068, 70.71068, 57.735027, 70.71068, 100., - 57.735027, 57.735027, 70.71068, 57.735027, 44.72136, - 57.735027, 70.71068, 50., 70.71068, 57.735027, - 50., 70.71068, 57.735027, 57.735027, 50., - 57.735027, 70.71068, 50., 100., 100., - 70.71068, 57.735027, 70.71068, 70.72579, 57.884987, - 100., 100., 44.72687, 40.82483, 57.735027, - 70.71068, 50., 70.71068, 70.71068, 70.71068, - 100., 57.735027, 50., 70.71068, 44.72136, - 44.72136, 50., 70.71068, 100., 37.796448, - 37.31675, 57.735027, 152.93852, 100., 44.72136, - 180.54376, 166.69289, 83.329994, 100., 63.61733, - 100., 83.43489, 114.83622], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[438])), - ('vector.pwr.median', DmapArray(name='vector.pwr.median', value=np.array([13.247197, 20.308197, 21.036922, 27.968304, 25.426373, - 13.1918125, 6.022373, 8.521123, 9.816186, 9.272192, - 13.848626, 15.956799, 13.3505535, 23.336021, 21.555946, - 23.78788, 25.247866, 28.809742, 25.046183, 26.101337, - 25.92983, 24.523392, 20.618385, 16.044886, 17.795885, - 21.096884, 18.520634, 18.908514, 16.072773, 15.716357, - 13.252299, 25.242159, 22.905613, 16.903206, 18.134108, - 9.187226, 22.95945, 14.418486, 10.722886, 13.39095, - 9.925728, 8.672311, 18.23836, 18.36461, 8.587427, - 21.078606, 8.04102, 18.955524, 19.260975, 11.764458, - 17.634235, 20.896425, 12.406878, 15.873758, 13.474343, - 21.961779, 8.425227, 13.500149, 20.482027, 18.096643, - 8.670338, 26.507092, 19.810911, 8.637921, 15.173723, - 21.67938, 15.2548685, 22.009712, 16.109352, 26.67688, - 25.499645, 6.022373, 7.0301533, 15.011401, 11.915428, - 17.568977, 24.794296, 19.915281, 24.10753, 25.176954, - 23.692455, 25.678375, 21.799063, 25.143509, 21.666563, - 12.430135, 18.56782, 22.114002, 20.23905, 21.080925, - 17.994223, 12.197099, 13.698498, 19.85039, 21.427736, - 20.355234, 17.838312, 10.4297695, 10.348707, 13.435864, - 10.842082, 8.805604, 10.078782, 19.964638, 15.589578, - 17.633932, 11.773929, 11.17263, 15.009463, 18.54373, - 14.500418, 10.922096, 9.658517, 13.988205, 11.6334095, - 6.4524336, 12.772451, 12.140322, 5.6737742, 11.4179125, - 12.840577, 11.044656, 9.516062, 6.137716, 18.10169, - 17.622822, 7.738885, 9.8769, 15.662325, 12.01111, - 10.973692, 10.278609, 10.4569845, 7.540961, 9.386692, - 10.686135, 11.663904, 10.750483, 16.692968, 13.490481, - 10.624124, 9.507796, 14.515976, 13.217519, 8.897864, - 10.750483, 17.426573, 12.03775, 8.891593, 8.212128, - 14.021437, 15.545878, 14.194898, 9.123041, 9.786468, - 20.49284, 13.818748, 11.401301, 20.184738, 16.321774, - 10.609293, 22.620213, 18.10415, 8.612041, 12.033231, - 12.604638, 10.895518, 13.171477, 11.4994, 10.434268, - 13.020032, 16.187397, 14.166649, 10.644242, 11.25641, - 9.688308, 7.1832557, 13.726665, 13.229016, 8.836782, - 6.9560328, 21.570879, 13.794559, 13.414833, 12.837198, - 10.571548, 7.765552, 6.9560328, 12.858784, 12.724533, - 9.2778845, 6.620263, 17.233685, 11.615881, 13.502, - 11.522538, 13.616542, 12.131161, 14.451069, 10.444167, - 13.052724, 12.956157, 15.2397995, 14.386873, 12.399899, - 15.861754, 13.893911, 14.704731, 13.797935, 14.636333, - 7.3283906, 16.431864, 14.442129, 14.948579, 14.650946, - 17.846891, 12.122725, 15.350293, 14.407747, 14.640827, - 11.863537, 19.608551, 16.043652, 12.367842, 12.372149, - 15.539501, 12.990545, 8.018597, 21.644522, 19.117393, - 14.004017, 12.042163, 11.999391, 21.617075, 21.867647, - 15.001448, 24.06589, 11.973205, 12.129476, 20.518892, - 14.548076, 14.976907, 16.366179, 16.469362, 14.961859, - 11.68915, 12.351836, 10.493233, 14.701727, 13.156972, - 7.737902, 13.3564205, 13.4810095, 13.445572, 12.945311, - 12.210083, 11.567, 10.897415, 12.748938, 13.24456, - 14.401476, 12.227283, 10.156682, 8.001798, 6.820602, - 20.067093, 13.110173, 13.568986, 15.642549, 8.899445, - 20.24417, 14.263151, 9.961486, 11.455379, 14.336627, - 15.088517, 13.891392, 12.475603, 14.042167, 14.275335, - 11.322828, 13.56649, 14.899878, 15.481491, 13.193807, - 12.553904, 14.110402, 15.794587, 15.905923, 12.39337, - 14.430971, 12.708641, 18.661215, 14.556185, 14.02092, - 16.481342, 16.144686, 17.098637, 15.066769, 11.87304, - 12.075973, 13.109338, 24.772333, 17.228354, 10.674473, - 12.452402, 21.565445, 20.920055, 12.388723, 25.845173, - 16.561094, 10.40716, 11.303304, 10.362743, 13.884418, - 12.516957, 13.613238, 26.471682, 11.632522, 23.232069, - 14.906007, 24.054678, 24.24273, 14.906007, 21.178795, - 26.471682, 8.205519, 8.423465, 11.318596, 13.258823, - 15.643094, 15.57995, 9.926713, 10.379876, 15.739753, - 14.415474, 19.564579, 10.195036, 7.8968186, 22.563732, - 23.197256, 16.52543, 18.342205, 22.263193, 18.29228, - 6.809272, 21.669838, 23.98109, 17.767805, 7.6800065, - 27.452576, 27.910076, 23.137636, 13.759499, 15.038779, - 26.606369, 33.734005, 17.82217, 17.17645, 24.662376, - 27.754211, 13.388675, 20.115168, 18.388422, 16.176054, - 13.455223, 21.873041, 16.020794, 19.84249, 17.80034, - 15.499822, 18.776407, 16.213362, 15.479374, 16.250917, - 19.051973, 15.007358, 23.30393, 16.07392, 16.472618, - 21.68006, 23.020948, 16.937216, 17.355381, 20.643246, - 24.02481, 23.544664, 18.098011, 12.830661, 20.016872, - 15.768193, 16.503899, 12.685437, 16.135033, 17.295477, - 16.303452, 17.679308, 15.031949, 8.138184, 23.005785, - 30.096739, 25.563572, 23.751932, 21.693802, 15.297381, - 13.189714, 23.226727, 21.13569, 29.703722, 19.637522, - 18.354439, 20.342169, 6.536595, 9.204053, 8.1956, - 4.548767, 7.7656517, 4.9264283, 4.2435417, 5.9534183, - 7.223122, 6.746652, 6.2055326, 7.2072577, 9.027217, - 7.4366884, 8.775337, 13.887002, 14.020751, 6.200475, - 9.650218, 10.923283, 14.208736, 15.544811, 10.660264, - 14.020751, 6.524754, 10.8326645], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[438])), - ('vector.pwr.sd', DmapArray(name='vector.pwr.sd', value=np.array([0.94666594, 2.51142, 1.745465, 1.0969911, 0.7587264, - 0.8586435, 0.70729965, 0.7637705, 1.2541754, 1.7333559, - 1.3176136, 3.6599817, 2.7132432, 1.5234969, 2.169187, - 1.260356, 1.3549703, 1.4799466, 1.1098174, 0.9417587, - 1.4836701, 1.6544824, 1.1851027, 0.8122235, 0.6352849, - 1.4738091, 1.7027837, 1.0357575, 1.083925, 3.053133, - 0.9152221, 2.127933, 1.8341249, 1.9490241, 1.538764, - 1.7434213, 2.6677988, 1.1794564, 2.10015, 2.0093777, - 0.8150675, 4.2442107, 5.1920543, 3.071996, 1.5534905, - 5.2180905, 1.7721732, 2.5441415, 2.3024738, 1.861254, - 2.2126741, 3.3029916, 3.1110067, 1.5110472, 2.1674736, - 1.738322, 4.2193284, 1.8203679, 1.5837641, 1.1989315, - 2.0023603, 5.5328894, 2.8331983, 1.9955329, 1.5382199, - 1.9333135, 5.836251, 1.5156052, 1.2830538, 1.1880518, - 1.4933245, 0.70710677, 0.4366539, 2.1771452, 2.203773, - 1.9123272, 0.98143154, 2.2239432, 1.1824975, 1.53658, - 2.8492026, 1.2224172, 1.5078756, 1.3652575, 1.0920166, - 1.3709626, 1.2743523, 1.3101562, 0.8254201, 0.84298885, - 1.1582359, 1.382006, 0.89630187, 1.0722786, 1.3038523, - 1.1945946, 2.4116883, 0.79971015, 0.62757045, 3.4786735, - 1.2164835, 1.4818672, 1.0354029, 1.7679569, 1.5707421, - 2.1243017, 1.2468965, 2.52275, 2.0565023, 4.298679, - 1.1641856, 1.3121489, 0.8711478, 0.971479, 0.68318176, - 0.96974325, 1.0992234, 1.1336917, 1., 1.0015514, - 1.5713502, 0.84370923, 1.5078595, 1.0776871, 2.0338106, - 1.6572785, 1.1983937, 1.5881004, 1.9254446, 1.8777874, - 1.4490795, 0.8850106, 0.9898018, 1.1083274, 0.9184775, - 0.74622864, 0.79941756, 1.1609495, 1.0329754, 0.9755769, - 0.9878841, 1.0757186, 0.97727776, 1.1052454, 1.2569999, - 2.410817, 1.7870511, 1.3638797, 1.040006, 1.3762873, - 2.20661, 1.1823279, 1.044753, 1.0510712, 1.1534296, - 1.3213727, 1.0613261, 1.078421, 1.9050508, 1.5167258, - 1.3493376, 2.8392172, 1.7550075, 1.616423, 2.2798886, - 0.99852455, 2.4939578, 1.2373912, 1.0797013, 1.2724836, - 2.463881, 1.5291944, 1.0108246, 1.3997461, 1.3540186, - 1.4907651, 0.8643932, 1.5015165, 1.2770002, 0.9299946, - 1., 3.5055687, 0.908299, 1.9314404, 1.1076396, - 1.3953979, 0.9129777, 0.70710677, 1.2735956, 1.4104323, - 1.5704625, 0.8313586, 2.357951, 1.4895555, 1.6975679, - 1.4137645, 1.2498792, 1.2976662, 2.4383965, 1.2944432, - 1.7594244, 1.0606298, 2.3324819, 1.7407038, 1.2281404, - 1.150495, 1.4937675, 1.3551943, 0.9672569, 1.4003423, - 1.2964637, 1.4284467, 1.5663828, 1.2479908, 1.0673923, - 3.6012824, 1.35062, 1.0607244, 0.9113452, 1.0058135, - 2.3159993, 2.635264, 1.6492095, 1.1859813, 1.6808517, - 1.0542216, 1.5981667, 1.6677158, 2.075922, 1.1759857, - 1.2232499, 1.4654236, 1.1577033, 2.6563473, 1.6433517, - 1.8149437, 2.6500058, 3.9599323, 1.6782521, 1.5389255, - 0.9434176, 1.9166732, 0.89253515, 1.6975961, 0.950445, - 1.8689307, 1.4737495, 1.2075651, 0.55083394, 1.0231465, - 1.3549178, 1.433186, 1.0328267, 0.6815177, 0.826342, - 0.7327322, 1.8086456, 0.6052814, 0.91948205, 0.7143392, - 2.1613195, 1.1228406, 1.9793909, 0.699998, 0.7335352, - 1.5093398, 2.2143786, 1.5757611, 1.3921938, 1.07264, - 2.1478841, 1.5002486, 1.0633618, 1.2496938, 1.2234203, - 1.5124655, 1.3716182, 0.82135284, 1.0710759, 0.93555486, - 0.894531, 1.020064, 1.0291474, 0.89983165, 0.84445804, - 1.1807474, 1.0881155, 1.1099823, 0.75230706, 1.3623878, - 1.0550973, 0.9616502, 1.527303, 0.8982445, 0.7995022, - 1.1796408, 0.77850366, 1.9570419, 1.4088227, 0.98722523, - 0.9674628, 1.571546, 1.1611878, 1.0582885, 1.1692126, - 1.2215917, 1.1975541, 0.9921033, 1.3104409, 1.337934, - 1.456388, 1.6687819, 2.4749737, 2.8314648, 3.2581847, - 1.0314846, 1.3078167, 4.2480507, 1.6175735, 2.2246304, - 1.1360952, 2.896895, 3.0981097, 0.87578577, 2.4841275, - 5.2247744, 1.3558353, 1.7992548, 1.5243719, 3.7067163, - 0.89446557, 1.2462792, 2.3294795, 3.7214067, 0.77995926, - 1.4795644, 3.1391613, 3.8380146, 2.3672676, 2.1810613, - 1.3825146, 1.9548124, 1.9606103, 3.3638327, 3.8050556, - 2.3878012, 2.5947418, 2.5687432, 2.4716508, 2.0229678, - 1.324143, 1.5172216, 2.3772295, 1.9543221, 2.8305845, - 0.95850813, 2.7664971, 2.129702, 3.3947043, 2.4300117, - 1.61526, 5.085161, 0.5520093, 1.1097093, 1.4168891, - 1.6930234, 0.9292166, 1.0292971, 0.84485894, 2.6266768, - 2.6419249, 3.6068182, 2.4439316, 1.7929637, 2.680217, - 2.4080384, 2.5646334, 2.0576742, 1.7103965, 2.7001, - 1.362004, 2.5232775, 2.7774122, 1.1167085, 1.3728356, - 2.2912707, 2.8532088, 2.1211755, 3.3692067, 1.4207854, - 1.3378224, 2.0476515, 1.9644446, 1.2999401, 1.2447524, - 1.4581165, 2.2284055, 2.0538852, 4.9113317, 3.5732956, - 2.3390124, 2.825827, 2.558464, 2.5125797, 1.9491516, - 1.7640692, 4.807175, 2.0410874, 3.1843488, 4.1720686, - 4.699292, 3.4566479, 3.7915888, 2.9073174, 1.5213386, - 2.8608582, 1.3364918, 0.7577136, 1.721278, 0.8566376, - 0.9959403, 0.9496932, 1.4627607, 1., 0.7461648, - 0.88824564, 0.6555107, 2.999094, 3.3070266, 1.0680814, - 2.5993135, 2.8044653, 1.5634079, 3.0837324, 1.6574095, - 2.2711449, 1.6186136, 1.9073055], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[438])), - ('vector.wdt.median', DmapArray(name='vector.wdt.median', value=np.array([101.60677, 85.14287, 49.41853, 130.42128, 185.50078, - 115.627846, 139.98947, 289.58606, 309.14377, 142.42534, - 209.33948, 173.36143, 225.2312, 143.99767, 200.98541, - 173.53732, 169.86911, 153.01164, 170.13722, 159.87657, - 189.76918, 96.172714, 96.986206, 79.50839, 84.857834, - 55.169514, 86.455696, 31.288324, 70.07587, 75.9201, - 108.843025, 102.15791, 80.40319, 43.760082, 32.99918, - 57.7986, 52.63235, 49.08958, 66.6025, 41.52811, - 39.272114, 109.43552, 72.03807, 42.70097, 53.69152, - 50.425945, 57.688454, 54.434887, 47.13465, 238.52306, - 54.77959, 156.49063, 202.41425, 152.5321, 90.46276, - 150.87604, 132.29721, 127.24975, 161.28734, 148.09119, - 100.586685, 106.832306, 117.242836, 76.98763, 54.746044, - 105.609726, 83.90776, 49.874786, 70.96749, 186.93079, - 196.08215, 139.98947, 189.12393, 59.44609, 183.7602, - 283.77902, 148.18329, 218.80246, 173.45691, 216.49419, - 183.71109, 160.3486, 175.62135, 114.34526, 94.63736, - 82.921555, 76.958176, 62.736973, 106.30415, 46.681694, - 79.09338, 90.09092, 113.268295, 77.62861, 111.54591, - 36.228, 16.603704, 35.05817, 38.289524, 131.90596, - 69.871124, 78.572784, 30.393183, 193.87866, 149.94913, - 169.95064, 64.23063, 183.73297, 141.89912, 144.9913, - 129.70903, 115.74417, 94.09172, 150.89255, 81.08036, - 39.002777, 120.830124, 101.2659, 13.693815, 117.909874, - 88.9999, 55.72721, 38.901844, 31.362652, 182.53668, - 82.48538, 24.942976, 25.499252, 333.41418, 67.99229, - 66.412834, 47.426853, 53.335777, 45.078262, 50.039898, - 41.912533, 50.015617, 19.58408, 223.22888, 104.33461, - 67.07854, 27.214476, 172.05939, 111.326454, 54.743805, - 14.243512, 205.69586, 100.09301, 57.27489, 54.674812, - 156.9442, 189.7904, 139.07417, 129.53613, 39.68467, - 229.95413, 222.50392, 168.9778, 239.53377, 322.79922, - 143.32509, 322.9136, 207.72855, 202.74135, 71.17231, - 83.972084, 66.073074, 50.012398, 51.170338, 53.992184, - 114.8316, 47.372135, 42.360374, 43.548565, 36.18397, - 75.816284, 68.63612, 61.645218, 32.611454, 56.17657, - 38.248703, 73.40891, 51.485855, 43.231396, 35.91626, - 39.926304, 55.054638, 49.661076, 38.238068, 32.872765, - 55.903996, 37.359272, 58.77079, 55.397625, 59.105217, - 56.641926, 34.276466, 39.14483, 96.5624, 66.13174, - 77.471436, 42.189556, 44.44987, 67.75062, 59.052383, - 52.06881, 67.873, 84.64074, 62.187126, 25.467142, - 42.757477, 115.48773, 34.225773, 39.67113, 54.486298, - 139.9709, 62.594227, 63.217285, 45.487816, 52.306408, - 110.78637, 247.39117, 270.04526, 104.15512, 60.283497, - 59.899593, 38.657497, 57.827435, 189.59683, 173.11215, - 139.22232, 104.53753, 153.42346, 160.49753, 179.31993, - 162.1428, 153.30956, 144.66542, 128.31516, 125.63657, - 71.454994, 190.7347, 134.25996, 147.40578, 132.4294, - 115.73384, 41.994507, 45.454346, 72.96538, 51.423233, - 40.22027, 48.144215, 44.726334, 97.745995, 136.06737, - 100.56676, 31.083895, 68.74645, 113.59346, 50.73389, - 44.16764, 27.94992, 34.175705, 38.772865, 47.190094, - 78.76165, 38.411167, 38.135056, 49.543636, 46.128296, - 259.74042, 50.288383, 65.26883, 59.562782, 38.01404, - 51.127945, 49.68924, 58.220406, 55.001827, 58.43538, - 52.92325, 34.94462, 198.41533, 85.925354, 56.599167, - 53.04658, 31.62186, 143.94627, 85.28544, 37.313297, - 35.944954, 35.675747, 160.24567, 80.18254, 72.01921, - 35.75077, 40.201107, 188.46846, 220.64098, 162.69241, - 92.26469, 69.264275, 181.25089, 230.98778, 158.094, - 101.43743, 176.26903, 226.91454, 195.27231, 238.5049, - 137.56863, 184.60065, 182.95068, 197.00922, 177.33443, - 62.11855, 46.366886, 149.38524, 186.21806, 175.46367, - 18.967453, 229.63683, 172.42924, 22.740557, 199.92351, - 172.42924, 23.883936, 58.83334, 60.46213, 28.509531, - 259.10345, 228.78322, 40.426132, 65.14845, 366.53723, - 17.995733, 18.65424, 60.175823, 41.163628, 37.948513, - 29.90758, 16.312477, 21.345627, 25.224194, 24.579498, - 45.972485, 18.78957, 14.154721, 21.557781, 40.9504, - 18.56742, 15.074733, 17.40412, 17.109802, 41.400192, - 16.059507, 18.29525, 18.6214, 14.732312, 13.216421, - 19.208973, 17.148472, 18.381264, 30.273584, 39.882553, - 78.7982, 19.40819, 64.39861, 25.710697, 69.15217, - 124.97755, 12.548386, 13.2581835, 19.690615, 23.995203, - 93.9557, 113.25193, 17.06633, 61.792152, 41.786762, - 73.6299, 18.433601, 18.66278, 55.861813, 19.633232, - 12.417468, 16.543941, 27.540548, 13.823154, 15.848685, - 23.232006, 15.11954, 13.444341, 16.585014, 17.175251, - 22.943953, 17.196583, 16.400946, 34.892387, 29.867853, - 20.113413, 38.45824, 42.308804, 27.744293, 22.366709, - 94.86939, 35.420334, 40.638424, 29.646952, 17.784363, - 20.5215, 14.081334, 43.47021, 23.115707, 19.613548, - 17.593922, 20.60635, 53.75434, 18.210611, 58.74777, - 23.729525, 27.270107, 23.129894, 24.009222, 47.18281, - 50.81296, 55.830753, 216.02821, 255.57335, 27.212584, - 249.0989, 236.52673, 481.1692, 852.6164, 277.27655, - 255.57335, 175.1458, 317.21936], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[438])), - ('vector.wdt.sd', DmapArray(name='vector.wdt.sd', value=np.array([11.42465, 12.556006, 9.140895, 21.705812, 31.332005, - 12.268959, 42.955456, 30.890137, 78.75074, 34.82547, - 45.442585, 22.780684, 33.50894, 18.01766, 27.605047, - 22.382233, 27.4962, 20.838448, 18.487476, 20.558676, - 25.30236, 34.857906, 21.768188, 10.024529, 9.491353, - 15.714167, 14.366316, 9.631293, 13.918718, 22.373377, - 6.9784474, 20.470984, 10.188892, 7.3766146, 6.9207997, - 8.988495, 13.100997, 12.763517, 13.416403, 6.397391, - 7.4879375, 16.972414, 17.291542, 9.047488, 28.073792, - 22.153814, 18.326778, 11.996971, 13.715073, 63.865307, - 7.077375, 22.672428, 52.855537, 20.327255, 14.647324, - 23.72818, 70.30846, 16.63576, 22.35271, 19.436111, - 14.131252, 31.956741, 20.791166, 5.7380543, 12.713614, - 10.735996, 43.51399, 6.411602, 9.383858, 18.58859, - 18.0199, 21.145218, 19.397938, 6.859986, 16.494164, - 23.427778, 13.804414, 30.234215, 12.614137, 27.552721, - 23.280167, 13.562019, 21.402521, 19.432467, 13.997898, - 7.544478, 10.921612, 14.342509, 9.61651, 6.382257, - 11.678095, 5.634917, 8.686102, 8.954946, 7.487764, - 6.1073647, 9.090941, 5.2394247, 4.609298, 22.866352, - 20.896187, 19.504618, 14.795599, 31.221998, 42.521774, - 20.144093, 16.858824, 36.22378, 14.637644, 24.4676, - 14.925868, 74.43984, 36.222195, 18.979279, 19.583454, - 9.402449, 12.015247, 15.794833, 26.889532, 17.73597, - 20.200106, 10.325812, 11.558031, 6.958421, 49.558483, - 16.679785, 10.855565, 6.788432, 63.056908, 11.989775, - 11.605781, 6.8797994, 7.7681575, 7.983323, 10.799645, - 6.795417, 7.611655, 9.221772, 16.74536, 14.602173, - 13.19085, 6.857069, 21.68617, 16.829374, 12.802073, - 10.316431, 20.312609, 22.469551, 12.7206745, 13.892097, - 34.47346, 21.355827, 16.973475, 18.779818, 16.67008, - 33.432777, 16.802307, 16.741842, 39.943954, 45.62179, - 20.040665, 86.59496, 56.29047, 33.62103, 34.48132, - 15.240788, 17.675789, 14.568818, 9.122993, 12.727353, - 25.591473, 11.358604, 8.447349, 10.609619, 15.086162, - 15.991549, 9.556671, 10.4484415, 8.493135, 9.5194435, - 15.093355, 17.251276, 7.016223, 9.838196, 6.410794, - 14.941491, 9.323943, 8.68792, 8.462959, 11.831994, - 10.996251, 4.5227594, 9.821279, 11.854506, 10.591087, - 12.400197, 10.431311, 6.209275, 12.477577, 9.084058, - 9.537394, 10.685894, 16.811586, 9.879548, 7.170527, - 9.403565, 8.578681, 16.220453, 8.740897, 12.589822, - 16.059793, 16.000357, 9.588498, 11.763517, 9.477902, - 25.661146, 17.23887, 9.404726, 11.702509, 8.737996, - 24.02944, 37.157143, 72.6834, 19.109455, 12.351125, - 16.15521, 11.845698, 21.710842, 26.419214, 26.383661, - 27.437832, 16.151617, 18.658386, 30.557596, 28.741825, - 41.569717, 66.467705, 39.024082, 57.93982, 11.670479, - 9.517068, 32.204063, 6.6464615, 10.576744, 8.376612, - 39.521324, 12.119352, 6.1622863, 8.1674595, 12.9516535, - 5.988849, 6.6536303, 8.222826, 8.947143, 6.130597, - 9.496934, 7.659767, 9.398549, 13.971642, 7.485343, - 8.0269785, 4.8261247, 12.335927, 4.3398604, 9.333323, - 15.960945, 10.473977, 8.528557, 10.187137, 4.4476347, - 46.037502, 8.508859, 8.223114, 6.842057, 8.375413, - 7.0133142, 6.1143084, 5.6349583, 6.408948, 8.776886, - 5.104444, 5.9698534, 18.05267, 8.446139, 7.714284, - 4.9719043, 11.095663, 10.342445, 11.657995, 6.01726, - 5.903683, 5.5418444, 15.0480585, 12.50527, 8.689335, - 6.1812916, 6.39757, 20.06465, 17.53195, 17.187569, - 13.160683, 9.450048, 19.70056, 19.158716, 15.828683, - 13.116233, 19.15172, 23.428453, 20.251972, 43.999043, - 31.944466, 26.344418, 40.75693, 40.119186, 43.303284, - 9.745361, 12.810219, 58.643948, 23.859781, 46.710598, - 6.70389, 40.82116, 55.64892, 8.890041, 32.523235, - 31.657759, 30.572113, 16.356348, 13.700204, 20.576849, - 85.004486, 125.42839, 7.893231, 19.361307, 85.937294, - 4.5851545, 5.284096, 14.266039, 7.772196, 8.528283, - 3.5566716, 4.769802, 5.111618, 4.0311036, 3.8346386, - 16.704723, 7.6268487, 4.7928486, 6.958266, 14.024991, - 1.6690118, 1.8786597, 2.759168, 6.0834684, 18.613914, - 1.4959656, 2.0373561, 2.6208787, 34.247437, 2.6581764, - 3.386228, 7.650546, 2.1268268, 6.9659286, 15.99792, - 14.973431, 2.5632782, 11.118323, 4.4559445, 17.061508, - 24.318674, 8.847138, 10.330212, 11.651113, 17.038055, - 21.688875, 34.950146, 1.8918731, 15.002416, 21.275877, - 20.117544, 2.5144467, 4.0691304, 10.117401, 2.2967145, - 1.555838, 2.4540422, 3.8897603, 5.5884423, 5.557636, - 3.5516484, 2.7107844, 7.008997, 3.3557253, 2.4086995, - 6.8542852, 3.4651318, 3.4120963, 6.8816805, 6.331729, - 11.739491, 10.428786, 13.277649, 13.260486, 7.099561, - 28.631254, 10.825013, 8.83494, 5.198479, 3.7071733, - 5.8740635, 3.4765334, 9.357821, 5.8505692, 3.353409, - 6.5119715, 8.108527, 10.627785, 5.49732, 8.1066065, - 6.2070603, 8.836962, 7.755551, 23.902504, 9.300109, - 8.496455, 16.114197, 198.77267, 215.71892, 8.1380625, - 47.230305, 138.69965, 138.8146, 224.39235, 99.33851, - 231.1862, 38.171703, 90.31007], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[438])), - ('N', DmapArray(name='N', value=np.array([0., 1., 1., 1., 2., 2., 2., 2., 2., 3., 3., 3., 3., 3., 3., 3., 4., - 4., 4., 4., 4., 4., 4., 4., 4., 5., 5., 5., 5., 5., 5., 5., 5., 5., - 5., 5., 6., 6., 6., 6., 6., 6., 6., 6., 6., 6., 6., 6., 6., 7., 7., - 7., 7., 7., 7., 7., 7., 7., 7., 7., 7., 7., 7., 7., 8., 8., 8., 8., - 8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8.]), data_type=8, data_type_fmt='d', dimension=1, shape=[81])), - ('N+1', DmapArray(name='N+1', value=np.array([0., 0., 1., -1., 0., 1., -1., 2., -2., 0., 1., -1., 2., - -2., 3., -3., 0., 1., -1., 2., -2., 3., -3., 4., -4., 0., - 1., -1., 2., -2., 3., -3., 4., -4., 5., -5., 0., 1., -1., - 2., -2., 3., -3., 4., -4., 5., -5., 6., -6., 0., 1., -1., - 2., -2., 3., -3., 4., -4., 5., -5., 6., -6., 7., -7., 0., - 1., -1., 2., -2., 3., -3., 4., -4., 5., -5., 6., -6., 7., - -7., 8., -8.]), data_type=8, data_type_fmt='d', dimension=1, shape=[81])), - ('N+2', DmapArray(name='N+2', value=np.array([-2.15645512e+03, -6.47096251e+02, 1.83403769e+04, -1.16115748e+03, - -2.96931731e+02, 2.92859111e+03, -1.33086649e+03, -2.82077800e+01, - -1.15417185e+03, -1.80165263e+03, -1.65939146e+03, 3.87605104e+02, - 2.97881078e+02, 2.57912907e+02, -3.94093836e+01, -1.92630291e+01, - -1.69942044e+02, -5.24549066e+02, -1.25658350e+02, 8.66846815e+01, - -9.13146689e+01, 2.24281367e+01, 1.52349388e+01, 1.15226992e+01, - -6.78482408e+00, 5.40651283e+02, 1.95788835e+02, -1.81521719e+02, - -4.41600011e+01, -1.87833360e+00, 2.47077889e+00, 7.72677297e+00, - -1.31337574e+00, 1.10079831e+00, -1.15094164e+00, 1.10648175e-01, - -1.91133655e+01, 4.01342589e+01, 6.65682900e+01, -5.74979866e+00, - 6.24332052e-01, -1.64105474e+00, -1.41154282e+00, 2.10408448e-01, - 4.02108107e-02, -3.73727507e-02, 4.35350045e-02, 3.42783850e-02, - -4.37246097e-02, -6.31356862e+02, -6.80553046e+01, 4.15502556e+01, - 1.36298336e+01, 2.53156151e+00, -1.32145326e+00, -2.27390729e+00, - -7.22498626e-04, 3.00329520e-03, 1.42268732e-02, -9.11416952e-04, - -2.16089346e-03, -7.90538076e-03, 1.22124802e-03, -1.10224867e-03, - 1.02987805e+02, 1.72150542e+01, 3.48717074e+01, -4.90576643e+00, - -6.69789832e+00, 1.19090294e+00, 1.80182014e-01, 9.42128228e-02, - -6.52813151e-02, -3.31762843e-03, 8.81158291e-03, 2.71354115e-04, - 5.39608370e-03, -4.86252608e-04, -3.76390867e-04, 2.45394602e-04, - 7.15403149e-05]), data_type=8, data_type_fmt='d', dimension=1, shape=[81])), - ('N+3', DmapArray(name='N+3', value=np.array([0.00000000e+00, 1.10416473e+03, 1.11068715e+03, 8.04488910e+02, - 8.07674416e+02, 5.34459057e+02, 5.09548417e+02, 1.62399077e+02, - 1.31264564e+02, 1.43305680e+02, 1.45942487e+02, 4.28533899e+02, - 3.76791902e+02, 9.30706051e+01, 7.56514340e+01, 6.43869664e+01, - 3.77091608e+01, 3.38570541e+02, 3.83232135e+02, 9.40518454e+01, - 5.06156923e+01, 8.02971486e+01, 7.24165975e+01, 1.24886259e+02, - 1.37569876e+02, 2.72742233e+01, 1.76526941e+02, 1.99367665e+02, - 1.68062668e+02, 5.18632688e+01, 5.27378394e+01, 2.81571547e+01, - 4.26024353e+01, 3.41907544e+01, 3.47347094e+01, 2.16200701e+02, - 1.15119689e+02, 1.45344045e+02, 6.70034938e+01, 7.58184641e+01, - 5.11469256e+01, 4.76557918e+01, 3.74349406e+01, 1.45863893e+01, - 3.20218305e+01, 6.98165490e+00, 2.90912515e+01, 2.21632357e+01, - 4.23272735e+01, 1.62454268e+02, 1.25093414e+02, 7.40217610e+01, - 2.50857156e+01, 2.00407790e+01, 8.05552728e+01, 4.40409954e+01, - 3.34613515e+01, 5.02962848e+01, 1.48936151e+01, 3.80430738e+01, - 1.74704962e+01, 4.77571822e+01, 3.15987864e+01, 1.89549569e+01, - 2.91498229e+01, 5.09484664e+01, 5.37031295e+01, 7.14737613e+00, - 6.04056630e+01, 7.91477139e+01, 2.04962159e+01, 3.25271531e+01, - 1.33194794e+01, 3.63118391e+01, 6.46805710e+00, 1.99354607e+01, - 1.12905424e+00, 2.48761443e+00, 3.83326373e+00, 9.03333192e-01, - 1.55822360e+00]), data_type=8, data_type_fmt='d', dimension=1, shape=[81])), - ('model.mlat', DmapArray(name='model.mlat', value=np.array([76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, 76.5, - 76.5, 76.5, 76.5, 76.5, 76.5, 79.2, 73.8, 79.2, 73.8, 79.2, 73.8, - 79.2, 73.8, 79.2, 73.8, 79.2, 73.8, 79.2, 73.8, 79.2, 73.8, 79.2, - 73.8, 79.2, 73.8, 79.2, 73.8, 79.2, 73.8, 79.2, 73.8, 79.2, 73.8, - 81.9, 71.1, 81.9, 71.1, 81.9, 71.1, 81.9, 71.1, 81.9, 71.1, 81.9, - 71.1, 81.9, 71.1, 81.9, 71.1, 81.9, 71.1, 81.9, 71.1, 81.9, 71.1, - 81.9, 71.1, 84.6, 68.4, 84.6, 68.4, 84.6, 68.4, 84.6, 68.4, 84.6, - 68.4, 84.6, 68.4, 84.6, 68.4, 84.6, 68.4, 84.6, 68.4, 84.6, 68.4, - 87.3, 65.7, 87.3, 65.7, 87.3, 65.7, 87.3, 65.7, 87.3, 65.7, 87.3, - 65.7, 87.3, 65.7, 87.3, 65.7, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, - 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, - 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, - 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, - 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, - 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, - 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, - 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 63.5, 64.5, 64.5, 64.5, - 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, - 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, - 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, - 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, - 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, - 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 64.5, 65.5, 65.5, - 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, - 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, - 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, - 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, - 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, - 65.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, - 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, - 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, - 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, - 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 66.5, 67.5, 67.5, 67.5, 67.5, - 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, - 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, - 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, 67.5, - 67.5, 67.5, 67.5, 67.5, 67.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, - 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, - 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, - 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 68.5, 69.5, 69.5, 69.5, 69.5, - 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, - 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, 69.5, - 69.5, 69.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, - 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, 70.5, - 70.5, 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, 71.5, - 71.5, 71.5, 71.5, 71.5, 71.5, 72.5, 72.5, 72.5, 72.5], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[504])), - ('model.mlon', DmapArray(name='model.mlon', value=np.array([83.89422, 106.39422, 128.89421, 151.39421, - 173.89421, -163.60577, -141.10579, -118.60577, - -96.10578, -73.6058, -51.10577, -28.605768, - -6.1057835, 16.394217, 38.894245, 61.394215, - 83.89422, 83.89422, 109.608505, 109.608505, - 135.32278, 135.32278, 161.03708, 161.03708, - -173.24864, -173.24864, -147.53436, -147.53436, - -121.82006, -121.82006, -96.10578, -96.10578, - -70.39149, -70.39149, -44.67721, -44.67721, - -18.96293, -18.96293, 6.7513638, 6.7513638, - 32.465656, 32.465656, 58.17995, 58.17995, - 83.89422, 83.89422, 113.89422, 113.89422, - 143.89421, 143.89421, 173.89421, 173.89421, - -156.10579, -156.10579, -126.10578, -126.10578, - -96.10578, -96.10578, -66.10577, -66.10577, - -36.105785, -36.105785, -6.1057835, -6.1057835, - 23.894217, 23.894217, 53.894215, 53.894215, - 83.89422, 83.89422, 119.89422, 119.89422, - 155.89421, 155.89421, -168.10577, -168.10577, - -132.10579, -132.10579, -96.10578, -96.10578, - -60.10577, -60.10577, -24.105783, -24.105783, - 11.894217, 11.894217, 47.894245, 47.894245, - 83.89422, 83.89422, 128.89421, 128.89421, - 173.89421, 173.89421, -141.10579, -141.10579, - -96.10578, -96.10578, -51.10577, -51.10577, - -6.1057835, -6.1057835, 38.894245, 38.894245, - 173.29181, 175.52783, 177.76385, 179.99988, - 182.2359, 184.47192, 186.70795, 188.94397, - 191.18, 193.41602, 195.65204, 197.88806, - 200.12408, 202.3601, 204.59613, 206.83215, - 209.06818, 211.3042, 213.54022, 215.77625, - 218.01227, 220.24829, 222.48431, 224.72034, - 226.95636, 229.19238, 231.4284, 233.66443, - 235.90045, 238.13647, 240.3725, 242.60852, - 244.84454, 247.08057, 249.31659, 251.55261, - 253.78864, 256.02466, 258.26068, 260.4967, - 262.73273, 264.96875, 267.20477, 269.4408, - 271.67682, 273.91284, 276.14886, 278.3849, - 280.6209, 282.85693, 285.09296, 287.32898, - 289.565, 291.80103, 294.03705, 296.27307, - 298.5091, 300.74512, 302.98114, 305.21716, - 307.4532, 309.6892, 311.92523, 314.16125, - 316.39728, 318.6333, 320.86932, 323.10535, - 325.34137, 327.5774, 329.81342, 332.04944, - 334.28546, 336.52148, 338.7575, 340.99353, - 343.22955, 345.46558, 347.7016, 349.93762, - 182.32266, 184.64525, 186.96783, 189.29042, - 191.613, 193.9356, 196.25818, 198.58076, - 200.90335, 203.22594, 205.54852, 207.87111, - 210.1937, 212.51628, 214.83887, 217.16145, - 219.48404, 221.80663, 224.12921, 226.4518, - 228.77438, 231.09697, 233.41956, 235.74214, - 238.06473, 240.38731, 242.7099, 245.03249, - 247.35507, 249.67766, 252.00024, 254.32283, - 256.64542, 258.968, 261.29056, 263.61313, - 265.9357, 268.25827, 270.58084, 272.9034, - 275.22598, 277.54855, 279.87112, 282.1937, - 284.51627, 286.83884, 289.1614, 291.48398, - 293.80655, 296.12912, 298.4517, 300.77426, - 303.09683, 305.4194, 307.74197, 310.06454, - 312.38712, 314.7097, 317.03226, 319.35483, - 321.6774, 323.99997, 326.32254, 328.6451, - 330.96768, 333.29025, 335.61282, 189.66443, - 192.08054, 194.49664, 196.91275, 199.32886, - 201.74496, 204.16107, 206.57718, 208.99329, - 211.4094, 213.8255, 216.24161, 218.65771, - 221.07382, 223.48993, 225.90604, 228.32214, - 230.73825, 233.15436, 235.57047, 237.98657, - 240.40268, 242.81879, 245.2349, 247.651, - 250.06711, 252.48322, 254.89932, 257.31543, - 259.73154, 262.14764, 264.56375, 266.97986, - 269.39597, 271.81207, 274.22818, 276.6443, - 279.0604, 281.4765, 283.8926, 286.30872, - 288.72482, 291.14093, 293.55704, 295.97314, - 298.38925, 300.80536, 303.22147, 305.63757, - 308.05368, 310.4698, 312.8859, 315.302, - 317.7181, 320.13422, 322.55032, 324.96643, - 327.38254, 196.25, 198.75, 201.25, - 203.75, 206.25, 208.75, 211.25, - 213.75, 216.25, 218.75, 221.25, - 223.75, 226.25, 228.75, 231.25, - 233.75, 236.25, 238.75, 241.25, - 243.75, 246.25, 248.75, 251.25, - 253.75, 256.25, 258.75, 261.25, - 263.75, 266.25, 268.75, 271.25, - 273.75, 276.25, 278.75, 281.25, - 283.75, 286.25, 288.75, 291.25, - 293.75, 296.25, 298.75, 301.25, - 303.75, 306.25, 308.75, 311.25, - 313.75, 316.25, 318.75, 202.17372, - 204.78241, 207.3911, 209.99979, 212.60847, - 215.21716, 217.82585, 220.43454, 223.04323, - 225.65192, 228.2606, 230.8693, 233.47798, - 236.08667, 238.69536, 241.30405, 243.91273, - 246.52142, 249.13011, 251.7388, 254.34749, - 256.95618, 259.56488, 262.17358, 264.7823, - 267.391, 269.9997, 272.6084, 275.2171, - 277.8258, 280.4345, 283.0432, 285.65192, - 288.26062, 290.86932, 293.47803, 296.08673, - 298.69543, 301.30414, 303.91284, 306.52155, - 309.13025, 208.63655, 211.36383, 214.09111, - 216.81839, 219.54567, 222.27295, 225.00023, - 227.72751, 230.45479, 233.18207, 235.90935, - 238.63663, 241.3639, 244.09119, 246.81847, - 249.54575, 252.27303, 255.0003, 257.72757, - 260.45483, 263.1821, 265.90936, 268.63663, - 271.3639, 274.09116, 276.81842, 279.5457, - 282.27295, 285.0002, 287.72748, 290.45474, - 293.182, 295.90927, 298.63654, 301.3638, - 215.71436, 218.5715, 221.42865, 224.2858, - 227.14294, 230.00009, 232.85724, 235.71439, - 238.57153, 241.42868, 244.28583, 247.14297, - 250.00012, 252.85727, 255.71442, 258.57156, - 261.4287, 264.28586, 267.143, 270.00015, - 272.8573, 275.71445, 278.5716, 281.42874, - 284.2859, 287.14304, 290.00018, 292.85733, - 223.5, 226.5, 229.5, 232.5, - 235.5, 238.5, 241.5, 244.5, - 247.5, 250.5, 253.5, 256.5, - 259.5, 262.5, 265.5, 268.5, - 271.5, 274.5, 277.5, 280.5, - 283.5, 228.94753, 232.10542, 235.26332, - 238.42122, 241.57912, 244.73701, 247.89491, - 251.05281, 254.21071, 257.3686, 260.5265, - 263.6844, 266.8423, 270.00018, 273.15808, - 244.99986, 248.33319, 251.66652, 254.99985], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[504])), - ('model.kvect', DmapArray(name='model.kvect', value=np.array([1.75404144e+02, -1.77837051e+02, 1.62810562e+02, 1.04733841e+02, - 7.27445450e+01, 6.92656555e+01, 7.56639252e+01, 2.02416687e+01, - -5.92701263e+01, -6.09102287e+01, -5.73306999e+01, -6.46165314e+01, - -9.17712784e+01, -9.94708633e+01, 1.57488525e+02, 1.63901093e+02, - -1.64050507e+02, 1.68371429e+02, -1.55043121e+02, 1.30346588e+02, - -1.42876694e+02, 1.02890533e+02, -1.17890259e+02, 8.45669632e+01, - 1.15279951e+01, 6.50546341e+01, 2.42252464e+01, 7.51530609e+01, - 7.95016956e+00, 4.98615875e+01, 1.07615441e-02, -7.27322540e+01, - -2.25021782e+01, -6.48418121e+01, -5.37493229e+00, -6.55664062e+01, - 7.69582520e+01, -8.30864944e+01, 1.16511452e+02, -8.18230896e+01, - 1.50873383e+02, -9.66795807e+01, -1.77551788e+02, -1.63902542e+02, - 1.78998886e+02, 1.70734024e+02, -1.56036026e+02, 1.17410217e+02, - -1.24484322e+02, 9.91841812e+01, -9.32210770e+01, 7.56304245e+01, - -6.24290924e+01, 4.57296562e+01, -4.86896896e+01, 8.01161804e+01, - -1.12973280e+01, -6.63451462e+01, 1.32898016e+01, -6.08270111e+01, - 6.04080467e+01, -7.22202377e+01, 9.79666290e+01, -8.72645340e+01, - 1.20755028e+02, -8.09203644e+01, 1.53273346e+02, -1.10627670e+02, - -1.74993042e+02, -1.33187714e+02, -1.39627701e+02, 1.26309280e+02, - -1.07987404e+02, 9.26165237e+01, -5.86551285e+01, 7.07218094e+01, - -4.42817726e+01, 7.82719421e+01, -2.20067558e+01, 1.60289627e+02, - 2.95809898e+01, -6.42279129e+01, 8.03064499e+01, -8.38701782e+01, - 1.13370827e+02, -8.25924301e+01, 1.44490906e+02, -9.13401337e+01, - -1.68106781e+02, -9.52556992e+01, -1.33644348e+02, 1.08930374e+02, - -8.17220306e+01, 8.68349991e+01, -2.56940632e+01, -7.80697479e+01, - 1.46141357e+01, -1.76834961e+02, 5.99075127e+01, -7.94763336e+01, - 1.05062576e+02, -8.49673157e+01, 1.50303497e+02, -8.80893173e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, - 4.50000000e+01, 4.50000000e+01, 4.50000000e+01, 4.50000000e+01], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[504])), - ('model.vel.median', DmapArray(name='model.vel.median', value=np.array([363.41394, 288.7087, 281.09332, 310.83603, 524.1548, - 584.8717, 440.30487, 284.36398, 296.4563, 483.70206, - 574.734, 459.54498, 311.71893, 95.64933, 295.08475, - 355.8065, 410.87955, 291.16415, 391.23502, 308.90524, - 411.4737, 445.10767, 257.4358, 514.98865, 182.90424, - 346.59973, 235.4107, 207.97215, 460.33197, 95.583145, - 355.41394, 161.31169, 380.2697, 345.70868, 296.14713, - 564.72736, 153.02975, 640.72205, 191.45439, 615.0701, - 279.146, 355.86282, 370.92032, 289.62634, 433.03546, - 164.7729, 443.0183, 262.09482, 454.09277, 233.38815, - 532.7921, 165.11351, 626.6855, 101.77235, 601.6236, - 56.37601, 482.68237, 28.4649, 403.2565, 163.69762, - 357.07993, 402.68655, 323.86063, 485.7589, 336.30936, - 582.50336, 441.67633, 377.75195, 396.91525, 113.4474, - 513.2845, 143.49907, 503.39963, 195.61433, 604.80725, - 149.49149, 567.8778, 30.79913, 454.17776, 3.7407653, - 342.21527, 103.29596, 358.21768, 330.94052, 431.58505, - 358.86975, 474.69852, 403.40894, 394.72684, 254.98122, - 530.0553, 86.62006, 550.555, 148.65279, 533.1639, - 25.346647, 445.83524, 2.7387912, 395.957, 62.81452, - 398.8311, 195.07838, 383.3149, 334.44153, 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1., 1., - 1., 1., 1., 1.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[504])), - ('boundary.mlat', DmapArray(name='boundary.mlat', value=np.array([63.11518, 63.01889, 63., 63., 63., 63., - 63., 63., 63., 63., 63., 63., - 63., 63., 63., 63., 63., 63., - 63., 63., 63., 63., 63., 63., - 63., 63., 63., 63., 63., 63., - 63., 63., 63.007534, 63.126823, 63.387814, 63.78257, - 64.2991, 64.92171, 65.631485, 66.40685, 67.22425, 68.05885, - 68.8853, 69.67847, 70.414276, 71.07035, 71.62676, 72.066605, - 72.37652, 72.54708, 72.57641, 72.50917, 72.36119, 72.135, - 71.83447, 71.464745, 71.03215, 70.54409, 70.00891, 69.43577, - 68.83447, 68.21531, 67.588875, 66.96589, 66.35701, 65.77266, - 65.222824, 64.71692, 64.26361, 63.870636, 63.544727, 63.291466, - 63.11518], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[73])), - ('boundary.mlon', DmapArray(name='boundary.mlon', value=np.array([0., 5., 10., 15., 20., 25., 30., 35., 40., 45., 50., - 55., 60., 65., 70., 75., 80., 85., 90., 95., 100., 105., - 110., 115., 120., 125., 130., 135., 140., 145., 150., 155., 160., - 165., 170., 175., 180., 185., 190., 195., 200., 205., 210., 215., - 220., 225., 230., 235., 240., 245., 250., 255., 260., 265., 270., - 275., 280., 285., 290., 295., 300., 305., 310., 315., 320., 325., - 330., 335., 340., 345., 350., 355., 360.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[73]))])] diff --git a/tests/integration/rawacf_data_sets.py b/tests/integration/rawacf_data_sets.py deleted file mode 100644 index a772269..0000000 --- a/tests/integration/rawacf_data_sets.py +++ /dev/null @@ -1,270 +0,0 @@ -# Copyright (C) 2019 SuperDARN -# Author: Marina Schmidt -""" -Test data sets for DmapWrite -""" -import numpy as np - -from collections import OrderedDict - -from pydarnio import DmapScalar, DmapArray - -rawacf_data = [OrderedDict([('radar.revision.major', - DmapScalar(name='radar.revision.major', value=1, - data_type=1, data_type_fmt='c')), - ('radar.revision.minor', DmapScalar(name='radar.revision.minor', value=18, data_type=1, data_type_fmt='c')), - ('origin.code', DmapScalar(name='origin.code', value=0, data_type=1, data_type_fmt='c')), - ('origin.time', DmapScalar(name='origin.time', value='Mon Apr 10 18:01:03 2017', data_type=9, data_type_fmt='s')), - ('origin.command', DmapScalar(name='origin.command', value='twofsound -fast -xcf 1 -p7', data_type=9, data_type_fmt='s')), - ('cp', DmapScalar(name='cp', value=3505, data_type=2, data_type_fmt='h')), - ('stid', DmapScalar(name='stid', value=5, data_type=2, data_type_fmt='h')), - ('time.yr', DmapScalar(name='time.yr', value=2017, data_type=2, data_type_fmt='h')), - ('time.mo', DmapScalar(name='time.mo', value=4, data_type=2, data_type_fmt='h')), - ('time.dy', DmapScalar(name='time.dy', value=10, data_type=2, data_type_fmt='h')), - ('time.hr', DmapScalar(name='time.hr', value=18, data_type=2, data_type_fmt='h')), - ('time.mt', DmapScalar(name='time.mt', value=1, data_type=2, data_type_fmt='h')), - ('time.sc', DmapScalar(name='time.sc', value=0, data_type=2, data_type_fmt='h')), - ('time.us', DmapScalar(name='time.us', value=35565, data_type=3, data_type_fmt='i')), - ('txpow', DmapScalar(name='txpow', value=9000, data_type=2, data_type_fmt='h')), - ('nave', DmapScalar(name='nave', value=32, data_type=2, data_type_fmt='h')), - ('atten', DmapScalar(name='atten', value=0, data_type=2, data_type_fmt='h')), - ('lagfr', DmapScalar(name='lagfr', value=1200, data_type=2, data_type_fmt='h')), - ('smsep', DmapScalar(name='smsep', value=300, data_type=2, data_type_fmt='h')), - ('ercod', DmapScalar(name='ercod', value=0, data_type=2, data_type_fmt='h')), - ('stat.agc', DmapScalar(name='stat.agc', value=0, data_type=2, data_type_fmt='h')), - ('stat.lopwr', DmapScalar(name='stat.lopwr', value=0, data_type=2, data_type_fmt='h')), - ('noise.search', DmapScalar(name='noise.search', value=27.822126388549805, data_type=4, data_type_fmt='f')), - ('noise.mean', DmapScalar(name='noise.mean', value=505125.4375, data_type=4, data_type_fmt='f')), - ('channel', DmapScalar(name='channel', value=2, data_type=2, data_type_fmt='h')), - ('bmnum', DmapScalar(name='bmnum', value=0, data_type=2, data_type_fmt='h')), - ('bmazm', DmapScalar(name='bmazm', value=-1.2000000476837158, data_type=4, data_type_fmt='f')), - ('scan', DmapScalar(name='scan', value=1, data_type=2, data_type_fmt='h')), - ('offset', DmapScalar(name='offset', value=0, data_type=2, data_type_fmt='h')), - ('rxrise', DmapScalar(name='rxrise', value=100, data_type=2, data_type_fmt='h')), - ('intt.sc', DmapScalar(name='intt.sc', value=3, data_type=2, data_type_fmt='h')), - ('intt.us', DmapScalar(name='intt.us', value=500000, data_type=3, data_type_fmt='i')), - ('txpl', DmapScalar(name='txpl', value=300, data_type=2, data_type_fmt='h')), - ('mpinc', DmapScalar(name='mpinc', value=2400, data_type=2, data_type_fmt='h')), - ('mppul', DmapScalar(name='mppul', value=7, data_type=2, data_type_fmt='h')), - ('mplgs', DmapScalar(name='mplgs', value=18, data_type=2, data_type_fmt='h')), - ('nrang', DmapScalar(name='nrang', value=75, data_type=2, data_type_fmt='h')), - ('frang', DmapScalar(name='frang', value=180, data_type=2, data_type_fmt='h')), - ('rsep', DmapScalar(name='rsep', value=45, data_type=2, data_type_fmt='h')), - ('xcf', DmapScalar(name='xcf', value=1, data_type=2, data_type_fmt='h')), - ('tfreq', DmapScalar(name='tfreq', value=13078, data_type=2, data_type_fmt='h')), - ('mxpwr', DmapScalar(name='mxpwr', value=1073741824, data_type=3, data_type_fmt='i')), - ('lvmax', DmapScalar(name='lvmax', value=20000, data_type=3, data_type_fmt='i')), - ('rawacf.revision.major', DmapScalar(name='rawacf.revision.major', value=0, data_type=3, data_type_fmt='i')), - ('rawacf.revision.minor', DmapScalar(name='rawacf.revision.minor', value=0, data_type=3, data_type_fmt='i')), - ('combf', DmapScalar(name='combf', value='$Id: twofsound.c,v 1.04 2016/11/08 20:00:00 KKrieger Exp $', data_type=9, data_type_fmt='s')), - ('thr', DmapScalar(name='thr', value=0.0, data_type=4, data_type_fmt='f')), - ('ptab', DmapArray(name='ptab', value=np.array([0, 9, 12, 20, 22, 26, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[7])), - ('ltab', DmapArray(name='ltab', - value=np.array([0, 0, 26, 27, - 20, 22, 9, 12, - 22, 26, 22, 27, - 20, 26, 20, 27, - 12, 20, 0, 9, - 12, 22, 9, 20, - 0, 12, 9, 22, - 12, 26, 12, 27, - 9, 26, 9, 27, - 27, 27], - dtype=np.int16), - data_type=2, data_type_fmt='h', - dimension=2, shape=[19, 2])), - ('slist', - DmapArray(name='slist', value=np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[75])), - ('pwr0', DmapArray(name='pwr0', - value=np.array([98.4375, 235.3125, 160.5, 59.1875, 43.65625, - 65.40625, 62.03125, 46.25, 72.84375, 60.0625, - 47.40625, 61.0625, 62.5625, 60.46875, 59.53125, - 42.84375, 39.78125, 40.9375, 51.6875, 55.125, - 37.03125, 56.15625, 51.71875, 50.40625, 58.46875, - 59.21875, 61.90625, 61.71875, 53.84375, 51.5625, - 55.4375, 38.8125, 93.09375, 279.8125, 267.59375, - 417.875, 1232.4062, 281.125, 126.3125, 60.65625, - 62.125, 118.5, 351.5625, 778.96875, 126.53125, - 151.46875, 82.21875, 86.625, 61.4375, 69., - 92.71875, 61.15625, 72.0625, 77.84375, 49.84375, - 69.28125, 61.15625, 72.125, 69.125, 66.8125, - 59.625, 71.21875, 62.34375, 57.28125, 54.96875, - 52.65625, 61.84375, 56.34375, 75.875, 97.25, - 80.125, 44.5625, 52.53125, 81.40625, 86.03125], - dtype=np.float32), - data_type=4, data_type_fmt='f', - dimension=1, shape=[75])), - ('acfd', DmapArray(name='acfd', value=np.array([98.4375, 0., 26.59375, -8.5, 28.90625, -3.5625], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[6])), - ('xcfd', DmapArray(name='xcfd', value=np.array([-11., 14.875, 0.84375, 2.375, 72.21875, - 4.21875], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[6]))]), - OrderedDict([('radar.revision.major', DmapScalar(name='radar.revision.major', value=1, data_type=1, data_type_fmt='c')), - ('radar.revision.minor', DmapScalar(name='radar.revision.minor', value=18, data_type=1, data_type_fmt='c')), - ('origin.code', DmapScalar(name='origin.code', value=0, data_type=1, data_type_fmt='c')), - ('origin.time', DmapScalar(name='origin.time', value='Mon Apr 10 18:01:20 2017', data_type=9, data_type_fmt='s')), - ('origin.command', DmapScalar(name='origin.command', value='twofsound -fast -xcf 1 -p7', data_type=9, data_type_fmt='s')), - ('cp', DmapScalar(name='cp', value=3505, data_type=2, data_type_fmt='h')), - ('stid', DmapScalar(name='stid', value=5, data_type=2, data_type_fmt='h')), - ('time.yr', DmapScalar(name='time.yr', value=2017, data_type=2, data_type_fmt='h')), - ('time.mo', DmapScalar(name='time.mo', value=4, data_type=2, data_type_fmt='h')), - ('time.dy', DmapScalar(name='time.dy', value=10, data_type=2, data_type_fmt='h')), - ('time.hr', DmapScalar(name='time.hr', value=18, data_type=2, data_type_fmt='h')), - ('time.mt', DmapScalar(name='time.mt', value=1, data_type=2, data_type_fmt='h')), - ('time.sc', DmapScalar(name='time.sc', value=17, data_type=2, data_type_fmt='h')), - ('time.us', DmapScalar(name='time.us', value=316927, data_type=3, data_type_fmt='i')), - ('txpow', DmapScalar(name='txpow', value=9000, data_type=2, data_type_fmt='h')), - ('nave', DmapScalar(name='nave', value=31, data_type=2, data_type_fmt='h')), - ('atten', DmapScalar(name='atten', value=0, data_type=2, data_type_fmt='h')), - ('lagfr', DmapScalar(name='lagfr', value=1200, data_type=2, data_type_fmt='h')), - ('smsep', DmapScalar(name='smsep', value=300, data_type=2, data_type_fmt='h')), - ('ercod', DmapScalar(name='ercod', value=0, data_type=2, data_type_fmt='h')), - ('stat.agc', DmapScalar(name='stat.agc', value=0, data_type=2, data_type_fmt='h')), - ('stat.lopwr', DmapScalar(name='stat.lopwr', value=0, data_type=2, data_type_fmt='h')), - ('noise.search', DmapScalar(name='noise.search', value=33.84693908691406, data_type=4, data_type_fmt='f')), - ('noise.mean', DmapScalar(name='noise.mean', value=505138.1875, data_type=4, data_type_fmt='f')), - ('channel', DmapScalar(name='channel', value=2, data_type=2, data_type_fmt='h')), - ('bmnum', DmapScalar(name='bmnum', value=5, data_type=2, data_type_fmt='h')), - ('bmazm', DmapScalar(name='bmazm', value=15.0, data_type=4, data_type_fmt='f')), - ('scan', DmapScalar(name='scan', value=0, data_type=2, data_type_fmt='h')), - ('offset', DmapScalar(name='offset', value=0, data_type=2, data_type_fmt='h')), - ('rxrise', DmapScalar(name='rxrise', value=100, data_type=2, data_type_fmt='h')), - ('intt.sc', DmapScalar(name='intt.sc', value=3, data_type=2, data_type_fmt='h')), - ('intt.us', DmapScalar(name='intt.us', value=500000, data_type=3, data_type_fmt='i')), - ('txpl', DmapScalar(name='txpl', value=300, data_type=2, data_type_fmt='h')), - ('mpinc', DmapScalar(name='mpinc', value=2400, data_type=2, data_type_fmt='h')), - ('mppul', DmapScalar(name='mppul', value=7, data_type=2, data_type_fmt='h')), - ('mplgs', DmapScalar(name='mplgs', value=18, data_type=2, data_type_fmt='h')), - ('nrang', DmapScalar(name='nrang', value=75, data_type=2, data_type_fmt='h')), - ('frang', DmapScalar(name='frang', value=180, data_type=2, data_type_fmt='h')), - ('rsep', DmapScalar(name='rsep', value=45, data_type=2, data_type_fmt='h')), - ('xcf', DmapScalar(name='xcf', value=1, data_type=2, data_type_fmt='h')), - ('tfreq', DmapScalar(name='tfreq', value=13274, data_type=2, data_type_fmt='h')), - ('mxpwr', DmapScalar(name='mxpwr', value=1073741824, data_type=3, data_type_fmt='i')), - ('lvmax', DmapScalar(name='lvmax', value=20000, data_type=3, data_type_fmt='i')), - ('rawacf.revision.major', DmapScalar(name='rawacf.revision.major', value=0, data_type=3, data_type_fmt='i')), - ('rawacf.revision.minor', DmapScalar(name='rawacf.revision.minor', value=0, data_type=3, data_type_fmt='i')), - ('combf', DmapScalar(name='combf', value='$Id: twofsound.c,v 1.04 2016/11/08 20:00:00 KKrieger Exp $', data_type=9, data_type_fmt='s')), - ('thr', DmapScalar(name='thr', value=0.0, data_type=4, data_type_fmt='f')), - ('ptab', DmapArray(name='ptab', value=np.array([0, 9, 12, 20, 22, 26, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[7])), - ('ltab', DmapArray(name='ltab', value=np.array([0, 0, 26, 27, 20, 22, 9, 12, 22, 26, 22, 27, 20, 26, 20, 27, 12, - 20, 0, 9, 12, 22, 9, 20, 0, 12, 9, 22, 12, 26, 12, 27, 9, 26, - 9, 27, 27, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=2, shape=[19, 2])), - ('slist', DmapArray(name='slist', value=np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[75])), - ('pwr0', DmapArray(name='pwr0', value=np.array([135.87097, 180.06451, 417.2258, 131.51613, 63.80645, - 96.354836, 75.83871, 79.16129, 67.935486, 68.645164, - 73.03226, 71.3871, 82.741936, 66.645164, 68.32258, - 84.935486, 90.22581, 55.258064, 66.129036, 62.64516, - 80.870964, 75.80645, 93.51613, 85.741936, 41.870968, - 66.645164, 71.22581, 82.22581, 71.03226, 67.22581, - 84.354836, 87.29032, 78.16129, 61.548386, 79.32258, - 92.16129, 109.83871, 125.80645, 104.741936, 104.935486, - 114., 115.48387, 79.129036, 95.58064, 90.70968, - 86.22581, 141.87097, 108.129036, 68.96774, 70.3871, - 115.16129, 76.16129, 68.96774, 99.90323, 69.354836, - 82.935486, 102.645164, 97.48387, 75.935486, 58.419353, - 99.29032, 90.548386, 64.58064, 70.741936, 75.96774, - 70.96774, 73.354836, 102.064514, 86.258064, 149.3871, - 161.90323, 92.58064, 59.64516, 76.70968, 120.29032], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[75])), - ('acfd', DmapArray(name='acfd', value=np.array([135.87096, 0., 18.612904, 6.677419, - 0.6774193, -4.548387], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[6])), - ('xcfd', DmapArray(name='xcfd', value=np.array([36.51613, -12.16129, 16.870968, -29.032257, -41.580643, - -26.80645], dtype=np.float32), data_type=4, - data_type_fmt='f', dimension=1, - shape=[6]))]), - OrderedDict([('radar.revision.major', DmapScalar(name='radar.revision.major', value=1, data_type=1, data_type_fmt='c')), - ('radar.revision.minor', DmapScalar(name='radar.revision.minor', value=18, data_type=1, data_type_fmt='c')), - ('origin.code', DmapScalar(name='origin.code', value=0, data_type=1, data_type_fmt='c')), - ('origin.time', DmapScalar(name='origin.time', value='Mon Apr 10 19:59:44 2017', data_type=9, data_type_fmt='s')), - ('origin.command', DmapScalar(name='origin.command', value='twofsound -fast -xcf 1 -p7', data_type=9, data_type_fmt='s')), - ('cp', DmapScalar(name='cp', value=3505, data_type=2, data_type_fmt='h')), - ('stid', DmapScalar(name='stid', value=5, data_type=2, data_type_fmt='h')), - ('time.yr', DmapScalar(name='time.yr', value=2017, data_type=2, data_type_fmt='h')), - ('time.mo', DmapScalar(name='time.mo', value=4, data_type=2, data_type_fmt='h')), - ('time.dy', DmapScalar(name='time.dy', value=10, data_type=2, data_type_fmt='h')), - ('time.hr', DmapScalar(name='time.hr', value=19, data_type=2, data_type_fmt='h')), - ('time.mt', DmapScalar(name='time.mt', value=59, data_type=2, data_type_fmt='h')), - ('time.sc', DmapScalar(name='time.sc', value=41, data_type=2, data_type_fmt='h')), - ('time.us', DmapScalar(name='time.us', value=453589, data_type=3, data_type_fmt='i')), - ('txpow', DmapScalar(name='txpow', value=9000, data_type=2, data_type_fmt='h')), - ('nave', DmapScalar(name='nave', value=31, data_type=2, data_type_fmt='h')), - ('atten', DmapScalar(name='atten', value=0, data_type=2, data_type_fmt='h')), - ('lagfr', DmapScalar(name='lagfr', value=1200, data_type=2, data_type_fmt='h')), - ('smsep', DmapScalar(name='smsep', value=300, data_type=2, data_type_fmt='h')), - ('ercod', DmapScalar(name='ercod', value=0, data_type=2, data_type_fmt='h')), - ('stat.agc', DmapScalar(name='stat.agc', value=0, data_type=2, data_type_fmt='h')), - ('stat.lopwr', DmapScalar(name='stat.lopwr', value=0, data_type=2, data_type_fmt='h')), - ('noise.search', DmapScalar(name='noise.search', value=39.8087272644043, data_type=4, data_type_fmt='f')), - ('noise.mean', DmapScalar(name='noise.mean', value=505139.1875, data_type=4, data_type_fmt='f')), - ('channel', DmapScalar(name='channel', value=2, data_type=2, data_type_fmt='h')), - ('bmnum', DmapScalar(name='bmnum', value=12, data_type=2, data_type_fmt='h')), - ('bmazm', DmapScalar(name='bmazm', value=37.68000030517578, data_type=4, data_type_fmt='f')), - ('scan', DmapScalar(name='scan', value=0, data_type=2, data_type_fmt='h')), - ('offset', DmapScalar(name='offset', value=0, data_type=2, data_type_fmt='h')), - ('rxrise', DmapScalar(name='rxrise', value=100, data_type=2, data_type_fmt='h')), - ('intt.sc', DmapScalar(name='intt.sc', value=3, data_type=2, data_type_fmt='h')), - ('intt.us', DmapScalar(name='intt.us', value=500000, data_type=3, data_type_fmt='i')), - ('txpl', DmapScalar(name='txpl', value=300, data_type=2, data_type_fmt='h')), - ('mpinc', DmapScalar(name='mpinc', value=2400, data_type=2, data_type_fmt='h')), - ('mppul', DmapScalar(name='mppul', value=7, data_type=2, data_type_fmt='h')), - ('mplgs', DmapScalar(name='mplgs', value=18, data_type=2, data_type_fmt='h')), - ('nrang', DmapScalar(name='nrang', value=75, data_type=2, data_type_fmt='h')), - ('frang', DmapScalar(name='frang', value=180, data_type=2, data_type_fmt='h')), - ('rsep', DmapScalar(name='rsep', value=45, data_type=2, data_type_fmt='h')), - ('xcf', DmapScalar(name='xcf', value=1, data_type=2, data_type_fmt='h')), - ('tfreq', DmapScalar(name='tfreq', value=13051, data_type=2, data_type_fmt='h')), - ('mxpwr', DmapScalar(name='mxpwr', value=1073741824, data_type=3, data_type_fmt='i')), - ('lvmax', DmapScalar(name='lvmax', value=20000, data_type=3, data_type_fmt='i')), - ('rawacf.revision.major', DmapScalar(name='rawacf.revision.major', value=0, data_type=3, data_type_fmt='i')), - ('rawacf.revision.minor', DmapScalar(name='rawacf.revision.minor', value=0, data_type=3, data_type_fmt='i')), - ('combf', DmapScalar(name='combf', value='$Id: twofsound.c,v 1.04 2016/11/08 20:00:00 KKrieger Exp $', data_type=9, data_type_fmt='s')), - ('thr', DmapScalar(name='thr', value=0.0, data_type=4, data_type_fmt='f')), - ('ptab', DmapArray(name='ptab', value=np.array([0, 9, 12, 20, 22, 26, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[7])), - ('ltab', DmapArray(name='ltab', - value=np.array([0, 0, 26, 27, 20, 22, - 9, 12, 22, 26, 22, 27, - 20, 26, 20, 27, 12, 20, - 0, 9, 12, 22, 9, 20, - 0, 12, 9, 22, 12, 26, - 12, 27, 9, 26, 9, 27, - 27, 27], - dtype=np.int16), - data_type=2, data_type_fmt='h', - dimension=2, shape=[19, 2])), - ('slist', DmapArray(name='slist', - value=np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74], dtype=np.int16), - data_type=2, data_type_fmt='h', - dimension=1, shape=[75])), - ('pwr0', DmapArray(name='pwr0', - value=np.array([353.12903, 329.32257, 59.80645, 105.77419, 129.90323, - 83.354836, 174.06451, 62.387096, 95.80645, 109.645164, - 66.935486, 120.32258, 95.935486, 96.51613, 127.451614, - 78.129036, 77.80645, 91.22581, 168., 98.32258, - 167.12903, 78.41936, 133.2258, 108.451614, 140.70967, - 44.580647, 127.3871, 122.77419, 77.451614, 108.48387, - 69.41936, 119.32258, 113.96774, 79.29032, 116.645164, - 153.3871, 94.3871, 146.80646, 139.45161, 127., - 196.19354, 146., 201.3871, 140.48387, 171.51613, - 112.83871, 84.09677, 117.70968, 376.96774, 824.5161, - 625.3226, 342.74194, 330.87097, 224.2258, 133.12903, - 175., 79.48387, 97.645164, 198.48387, 350.96774, - 587.9032, 589.0323, 299.25806, 142., 106.67742, - 94.67742, 69.19355, 112.03226, 107.32258, 135.80646, - 76.741936, 91.451614, 92.80645, 99.96774, 122.935486], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[75])), - ('acfd', DmapArray(name='acfd', value=np.array([353.12903, 0., 243.87096, 23.838709, -60.548386, - 43.419353], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[6])), - ('xcfd', DmapArray(name='xcfd', value=np.array([77.70968, 234.38708, -25.419353, 18.354837, - -78.48387, -201.45161], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[6]))])] diff --git a/tests/integration/rawacf_dict_sets.py b/tests/integration/rawacf_dict_sets.py deleted file mode 100644 index de406c5..0000000 --- a/tests/integration/rawacf_dict_sets.py +++ /dev/null @@ -1,92 +0,0 @@ -""" -Test data sets for DmapWrite -""" -from numpy import array, int8, int16, float32 - - -rawacf_dict_data = [{'radar.revision.major': int8(1), - 'radar.revision.minor': int8(18), - 'origin.code': int8(0), - 'origin.time': 'Mon Apr 18: 01: 03 2017', - 'origin.command': 'twofsound -fast -xcf 1 -p7', - 'cp': int16(3505), - 'stid': int16(5), - 'time.yr': int16(2017), - 'time.mo': int16(4), - 'time.dy': int16(10), - 'time.hr': int16(18), - 'time.mt': int16(1), - 'time.sc': int16(0), - 'time.us': 35565, - 'txpow': int16(9000), - 'nave': int16(32), - 'atten': int16(0), - 'lagfr': int16(1200), - 'smsep': int16(300), - 'ercod': int16(0), - 'stat.agc': int16(0), - 'stat.lopwr': int16(0), - 'noise.search': 27.822126388549805, - 'noise.mean': 505125.4375, - 'channel': int16(2), - 'bmnum': int16(0), - 'bmazm': -1.2000000476837158, - 'scan': int16(1), - 'offset': int16(0), - 'rxrise': int16(100), - 'intt.sc': int16(3), - 'intt.us': 500000, - 'txpl': int16(300), - 'mpinc': int16(2400), - 'mppul': int16(7), - 'mplgs': int16(18), - 'nrang': int16(75), - 'frang': int16(180), - 'rsep': int16(45), - 'xcf': int16(1), - 'tfreq': int16(13078), - 'mxpwr': 1073741824, - 'lvmax': 20000, - 'rawacf.revision.major': 0, - 'rawacf.revision.minor': 0, - 'combf': '$Id: twofsound.c,v 1.0016/11/08 20:00:00' - ' KKrieger Exp $', - 'thr': 0.0, - 'ptab': array([0, 9, 12, 20, 22, 26, 27], dtype=int16), - 'ltab': array([0, 0, 26, 27, 20, 22, 12, 22, 26, - 22, 27, 20, 26, 20, 27, 12, 20, - 0, 9, 12, 22, 9, 20, 0, 12, 9, - 22, 12, 26, 12, 27, 9, 26, 27, 27, 27], - dtype=int16), - 'slist': array([0, 2, 3, 4, 5, 6, 7, 0, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74], dtype=int16), - 'pwr0': array([98.4375, 235.3125, 160.5, 59.1875, - 43.65625, 65.40625, 62.03125, 46.25, - 72.84375, 60.0625, 47.40625, 61.0625, - 62.5625, 60.46875, 59.53125, 42.84375, - 39.78125, 40.9375, 51.6875, 55.125, - 37.03125, 56.15625, 51.71875, 50.40625, - 58.46875, 59.21875, 61.90625, 61.71875, - 53.84375, 51.5625, 55.4375, 38.8125, - 93.09375, 279.8125, 267.59375, 417.875, - 1232.4062, 281.125, 126.3125, 60.65625, - 62.12, 118.5, 351.5625, 778.96875, - 126.53125, 151.46875, 82.21875, 86.625, - 61.4375, 69, 92.71875, 61.15625, - 72.0625, 77.84375, 49.84375, 69.28125, - 61.15625, 72.125, 69.125, 66.8125, - 59.625, 71.21875, 62.34375, 57.28125, - 54.96875, 52.65625, 61.84375, 56.34375, - 75.875, 97.25, 80.125, 44.5625, - 52.53125, 81.40625, 86.03125], - dtype=float32), - 'acfd': array([98.4375, 0, 26.59375, -8.5, - 28.90625, -3.5625], dtype=float32), - 'xcfd': array([-11., 14.875, 0.84375, 2.375, - 72.21875, 4.21875], dtype=float32)}] diff --git a/tests/integration/test_superdarn.py b/tests/integration/test_superdarn.py deleted file mode 100644 index 4931988..0000000 --- a/tests/integration/test_superdarn.py +++ /dev/null @@ -1,923 +0,0 @@ -# Copyright (C) 2019 SuperDARN -# Author: Marina Schmidt -import bz2 -import copy -import logging -import numpy as np -import os -import unittest - -import pydarnio - -import fitacf_data_sets -import grid_data_sets -import iqdat_data_sets -import map_data_sets -import rawacf_data_sets -import rawacf_dict_sets - -# Test files -rawacf_stream = "../testfiles/20170410.1801.00.sas.stream.rawacf.bz2" -rawacf_file = "../testfiles/20170410.1801.00.sas.rawacf" -fitacf_file = "../testfiles/20180220.C0.rkn.fitacf" -fitacf_stream = "../testfiles/20180220.C0.rkn.stream.fitacf.bz2" -map_file = "../testfiles/20170114.map" -map_stream = "../testfiles/20170114.stream.map.bz2" -iqdat_file = "../testfiles/20160316.1945.01.rkn.iqdat" -iqdat_stream = "../testfiles/20160316.1945.01.rkn.stream.iqdat.bz2" -grid_file = "../testfiles/20180220.C0.rkn.grid" -grid_stream = "../testfiles/20180220.C0.rkn.stream.grid.bz2" - -pydarnio_logger = logging.getLogger('pydarnio') - - -class IntegrationSuperdarnio(unittest.TestCase): - def setUp(self): - self.test_file = '' - - - def tearDown(self): - if os.path.isfile(self.test_file): - os.remove(self.test_file) - del self.test_file - - def dmap_compare(self, dmap1: list, dmap2: list): - # Quick simple tests that can be done before looping - # over the list - self.assertEqual(len(dmap1), len(dmap2)) - - # NamedTuple are comparison capabilities - for record1, record2 in zip(dmap1, dmap2): - diff_fields1 = set(record1) - set(record2) - self.assertEqual(len(diff_fields1), 0) - diff_fields2 = set(record2) - set(record1) - self.assertEqual(len(diff_fields2), 0) - for field, val_obj in record1.items(): - if isinstance(val_obj, pydarnio.DmapScalar): - self.assertEqual(record2[field], val_obj) - elif isinstance(val_obj, pydarnio.DmapArray): - self.compare_dmap_array(record2[field], val_obj) - elif isinstance(val_obj, np.ndarray): - if np.array_equal(record2[field], val_obj): - self.assertTrue(np.array_equal(record2[field], - val_obj)) - else: - self.assertTrue(np.allclose(record2[field], val_obj, - equal_nan=True)) - else: - self.assertEqual(val_obj, record2[field]) - - def compare_dmap_array(self, dmaparr1, dmaparr2): - try: - self.assertEqual(dmaparr1.name, dmaparr2.name) - self.assertEqual(dmaparr1.data_type, dmaparr2.data_type) - self.assertEqual(dmaparr1.data_type_fmt, dmaparr2.data_type_fmt) - self.assertEqual(dmaparr1.dimension, dmaparr2.dimension) - value1 = np.reshape(dmaparr1.value, dmaparr1.shape) - value2 = np.reshape(dmaparr2.value, dmaparr2.shape) - except AttributeError: - self.assertEqual(dmaparr1.key, dmaparr2.key) - if np.array_equal(value1, value2): - self.assertTrue(np.array_equal(value1, value2)) - else: - self.assertTrue(np.allclose(value1, value2, equal_nan=True)) - - def test_DmapRead_SDarnWrite_rawacf(self): - """ - Test DmapRead reading an rawacf and SDarnWrite writing - the rawacf file - """ - dmap = pydarnio.DmapRead(rawacf_file) - dmap_data = dmap.read_records() - dmap_write = pydarnio.SDarnWrite(dmap_data) - dmap_write.write_rawacf("test_rawacf.rawacf") - self.assertTrue(os.path.isfile("test_rawacf.rawacf")) - os.remove("test_rawacf.rawacf") - - def test_SDarnWrite_SDarnRead_rawacf(self): - """ - Test SDarnWrite writing a rawacf file and SDarnRead reading the rawacf - file - """ - rawacf_data = copy.deepcopy(rawacf_data_sets.rawacf_data) - rawacf_write = pydarnio.SDarnWrite(rawacf_data, "test_rawacf.rawacf") - rawacf_write.write_rawacf() - - rawacf_read = pydarnio.SDarnRead("test_rawacf.rawacf") - rawacf_read_data = rawacf_read.read_rawacf() - self.dmap_compare(rawacf_read_data, rawacf_data) - os.remove("test_rawacf.rawacf") - - def test_SDarnRead_stream_SDarnWrite_file_rawacf(self): - """ - Test SDarnRead reads from a stream and SDarnWrite writes - to a rawacf file - """ - with bz2.open(rawacf_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.SDarnRead(dmap_stream, True) - stream_data = dmap.read_rawacf() - dmap_stream_data = dmap.get_dmap_records - dmap_write = pydarnio.SDarnWrite(stream_data) - dmap_write.write_rawacf("test_rawacf.rawacf") - dmap_read = pydarnio.SDarnRead("test_rawacf.rawacf") - _ = dmap_read.read_records() - dmap_data = dmap_read.get_dmap_records - self.dmap_compare(dmap_stream_data, dmap_data) - os.remove("test_rawacf.rawacf") - - def test_DmapWrite_missing_SDarnRead_rawacf(self): - """ - Test DmapWrite writes a rawacf file missing the field nave in record 2 - and SDarnRead reads the file - - Behaviour: Raise SuperDARNFieldMissingError - """ - rawacf_missing_field = copy.deepcopy(rawacf_data_sets.rawacf_data) - del rawacf_missing_field[0]['nave'] - dmap_write = pydarnio.DmapWrite(rawacf_missing_field) - dmap_write.write_dmap("test_missing_rawacf.rawacf") - - darn_read = pydarnio.SDarnRead("test_missing_rawacf.rawacf") - try: - darn_read.read_rawacf() - except pydarnio.superdarn_exceptions.SuperDARNFieldMissingError as err: - self.assertEqual(err.fields, {'nave'}) - self.assertEqual(err.record_number, 0) - - os.remove("test_missing_rawacf.rawacf") - - def test_DmapWrite_extra_SDarnRead_rawacf(self): - """ - Test DmapWrite writes a rawacf file with an extra field and SDarnRead - reads the file - - Behaviour: Raised SuperDARNExtraFieldError - """ - rawacf_extra_field = copy.deepcopy(rawacf_data_sets.rawacf_data) - rawacf_extra_field[0].update({'dummy': 'dummy'}) - rawacf_extra_field[0].move_to_end('dummy', last=False) - dmap_write = pydarnio.DmapWrite(rawacf_extra_field, ) - dmap_write.write_dmap("test_extra_rawacf.rawacf") - - darn_read = pydarnio.SDarnRead("test_extra_rawacf.rawacf") - try: - darn_read.read_rawacf() - except pydarnio.superdarn_exceptions.SuperDARNExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - self.assertEqual(err.record_number, 0) - os.remove("test_extra_rawacf.rawacf") - - def test_dict2dmap_SDarnWrite_rawacf(self): - """ - Test dict2dmap to convert a dictionary to dmap then SDarnWrite write - rawacf file - """ - rawacf_dict_data = copy.deepcopy(rawacf_dict_sets.rawacf_dict_data) - dmap_rawacf = pydarnio.dict2dmap(rawacf_dict_data) - darn_read = pydarnio.SDarnWrite(dmap_rawacf) - darn_read.write_rawacf("test_rawacf.rawacf") - dmap_read = pydarnio.DmapRead("test_rawacf.rawacf") - dmap_data = dmap_read.read_records() - dmap_data = dmap_read.get_dmap_records - self.dmap_compare(dmap_data, dmap_rawacf) - os.remove("test_rawacf.rawacf") - - def test_SDarnWrite_incorrect_rawacf_from_dict(self): - """ - Test convert dictionary with incorrect type to dmap and SDarnWrite - write the rawacf file - - Behaviour: Raise SuperDARNDataFormatTypeError - """ - rawacf_dict_data = copy.deepcopy(rawacf_dict_sets.rawacf_dict_data) - rawacf_dict_data[0]['stid'] = np.int8(rawacf_dict_data[0]['stid']) - dmap_rawacf = pydarnio.dict2dmap(rawacf_dict_data) - darn_write = pydarnio.SDarnWrite(dmap_rawacf) - with self.assertRaises(pydarnio.superdarn_exceptions. - SuperDARNDataFormatTypeError): - darn_write.write_rawacf("test_rawacf.rawacf") - - def test_DmapWrite_incorrect_SDarnRead_rawacf_from_dict(self): - """ - Test write an incorrect data type from a dict converting from dict2dmap - with DmapWrite then SDarnRead reads the file - - Behaviour: Raises SuperDARNDataFormatTypeError - """ - rawacf_dict_data = copy.deepcopy(rawacf_dict_sets.rawacf_dict_data) - rawacf_dict_data[0]['stid'] = np.int8(rawacf_dict_data[0]['stid']) - dmap_rawacf = pydarnio.dict2dmap(rawacf_dict_data) - dmap_write = pydarnio.DmapWrite(dmap_rawacf) - dmap_write.write_dmap("test_incorrect_rawacf.rawacf") - - darn_read = pydarnio.SDarnRead("test_incorrect_rawacf.rawacf") - with self.assertRaises(pydarnio.superdarn_exceptions. - SuperDARNDataFormatTypeError): - darn_read.read_rawacf() - - def test_SDarnRead_SDarnWrite_fitacf(self): - """ - Test DmapRead reading an fitacf and SDarnWrite writing - the fitacf file - """ - dmap = pydarnio.SDarnRead(fitacf_file) - dmap_data = dmap.read_fitacf() - dmap_write = pydarnio.SDarnWrite(dmap_data) - dmap_write.write_fitacf("test_fitacf.fitacf") - fitacf_read = pydarnio.SDarnRead("test_fitacf.fitacf") - fitacf_read_data = fitacf_read.read_fitacf() - self.dmap_compare(dmap_data, fitacf_read_data) - os.remove("test_fitacf.fitacf") - - def test_SDarnWrite_SDarnRead_fitacf(self): - """ - Test SDarnWrite writing a fitacf file and SDarnRead reading the fitacf - file - """ - fitacf_data = copy.deepcopy(fitacf_data_sets.fitacf_data) - fitacf_write = pydarnio.SDarnWrite(fitacf_data, "test_fitacf.fitacf") - fitacf_write.write_fitacf() - fitacf_read = pydarnio.SDarnRead("test_fitacf.fitacf") - fitacf_read_data = fitacf_read.read_fitacf() - self.dmap_compare(fitacf_read_data, fitacf_data) - os.remove("test_fitacf.fitacf") - - def test_SDarnRead_stream_SDarnWrite_file_fitacf(self): - """ - Test SDarnRead reads from a stream and SDarnWrite writes - to a fitacf file - """ - with bz2.open(fitacf_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.SDarnRead(dmap_stream, True) - stream_data = dmap.read_fitacf() - dmap_stream_data = dmap.get_dmap_records - dmap_write = pydarnio.SDarnWrite(stream_data) - dmap_write.write_fitacf("test_fitacf.fitacf") - self.assertTrue(os.path.isfile("test_fitacf.fitacf")) - dmap = pydarnio.SDarnRead("test_fitacf.fitacf") - _ = dmap.read_fitacf() - dmap_read_data = dmap.get_dmap_records - self.dmap_compare(dmap_stream_data, dmap_read_data) - - def test_DmapRead_SDarnWrite_SDarnRead_fitacf(self): - """ - Test DmapRead reading a fitacf file then writing it with SDarnWrite - then reading it again with SDarnRead - """ - dmap = pydarnio.DmapRead(fitacf_file) - dmap_data = dmap.read_records() - dmap_write = pydarnio.SDarnWrite(dmap_data) - dmap_write.write_fitacf("test_fitacf.fitacf") - darn_read = pydarnio.SDarnRead("test_fitacf.fitacf") - fitacf_data = darn_read.read_fitacf() - self.dmap_compare(dmap_data, fitacf_data) - os.remove("test_fitacf.fitacf") - - def test_SDarnWrite_file_SDarnRead_fitacf(self): - """ - Test SDarnWrite to write a fitacf file then using - SDarnRead to read the file - """ - fitacf_data = copy.deepcopy(fitacf_data_sets.fitacf_data) - fitacf_write = pydarnio.SDarnWrite(fitacf_data, "test_fitacf.fitacf") - fitacf_write.write_fitacf() - - fitacf_read = pydarnio.SDarnRead("test_fitacf.fitacf") - fitacf_read_data = fitacf_read.read_fitacf() - self.dmap_compare(fitacf_read_data, fitacf_data) - os.remove("test_fitacf.fitacf") - - def test_DmapWrite_SDarnRead_fitacf(self): - """ - Test DmapWrite to write a fitacf file then using SDarnRead - to read the file - """ - fitacf_data = copy.deepcopy(fitacf_data_sets.fitacf_data) - fitacf_write = pydarnio.DmapWrite(fitacf_data, "test_fitacf.fitacf") - fitacf_write.write_dmap() - - fitacf_read = pydarnio.SDarnRead("test_fitacf.fitacf") - fitacf_read_data = fitacf_read.read_fitacf() - self.dmap_compare(fitacf_read_data, fitacf_data) - os.remove("test_fitacf.fitacf") - - def test_SDarnRead_DmapWrite_stream_fitacf(self): - """ - Test SDarnRead to read from a fitacf stream then - DmapWrite to write a fitacf file from the stream - """ - with bz2.open(fitacf_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.SDarnRead(dmap_stream, True) - stream_data = dmap.read_fitacf() - dmap_stream_data = dmap.get_dmap_records - dmap_write = pydarnio.DmapWrite() - dmap_write_stream = dmap_write.write_dmap_stream(stream_data) - dmap_read = pydarnio.SDarnRead(dmap_write_stream, True) - dmap_read_data = dmap_read.read_fitacf() - dmap_read_data = dmap_read.get_dmap_records - - self.dmap_compare(dmap_stream_data, dmap_read_data) - - def test_DmapRead_stream_SDarnWrite_file_fitacf(self): - """ - Test DmapRead to read in a stream then have SDarnWrite the - stream to file - """ - with bz2.open(fitacf_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.DmapRead(dmap_stream, True) - stream_data = dmap.read_records() - dmap_stream_data = dmap.get_dmap_records - dmap_write = pydarnio.SDarnWrite(stream_data) - dmap_write.write_fitacf("test_fitacf.fitacf") - dmap = pydarnio.SDarnRead("test_fitacf.fitacf") - dmap_data = dmap.read_fitacf() - dmap_data = dmap.get_dmap_records - self.dmap_compare(dmap_stream_data, dmap_data) - os.remove("test_fitacf.fitacf") - - def test_DmapWrite_stream_SDarnRead_fitacf(self): - """ - Test DmapWrite to write to a stream and have SDarnRead - the fitacf stream - """ - fitacf_data = copy.deepcopy(fitacf_data_sets.fitacf_data) - fitacf_write = pydarnio.DmapWrite() - fitacf_stream = fitacf_write.write_dmap_stream(fitacf_data) - - fitacf_read = pydarnio.SDarnRead(fitacf_stream, True) - fitacf_read_data = fitacf_read.read_fitacf() - self.dmap_compare(fitacf_read_data, fitacf_data) - - def test_DmapWrite_missing_SDarnRead_fitacf(self): - """ - Test DmapWrite writes a fitacf file missing the field nave in record 2 - and SDarnRead reads the file - - Behaviour: Raise SuperDARNFieldMissingError - """ - fitacf_missing_field = copy.deepcopy(fitacf_data_sets.fitacf_data) - del fitacf_missing_field[0]['nave'] - dmap_write = pydarnio.DmapWrite(fitacf_missing_field) - dmap_write.write_dmap("test_missing_fitacf.fitacf") - - darn_read = pydarnio.SDarnRead("test_missing_fitacf.fitacf") - try: - darn_read.read_fitacf() - except pydarnio.superdarn_exceptions.SuperDARNFieldMissingError as err: - self.assertEqual(err.fields, {'nave'}) - self.assertEqual(err.record_number, 0) - - os.remove("test_missing_fitacf.fitacf") - - def test_DmapWrite_extra_SDarnRead_fitacf(self): - """ - Test DmapWrite writes a fitacf file with an extra field and SDarnRead - reads the file - - Behaviour: Raised SuperDARNExtraFieldError - """ - - fitacf_extra_field = copy.deepcopy(fitacf_data_sets.fitacf_data) - fitacf_extra_field[0].update({'dummy': 'dummy'}) - fitacf_extra_field[0].move_to_end('dummy', last=False) - dmap_write = pydarnio.DmapWrite(fitacf_extra_field, ) - dmap_write.write_dmap("test_extra_fitacf.fitacf") - - darn_read = pydarnio.SDarnRead("test_extra_fitacf.fitacf") - try: - darn_read.read_fitacf() - except pydarnio.superdarn_exceptions.SuperDARNExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - self.assertEqual(err.record_number, 0) - os.remove("test_extra_fitacf.fitacf") - - def test_SDarnRead_SDarnWrite_iqdat(self): - """ - Test DmapRead reading an fitacf and SDarnWrite writing - the fitacf file - """ - dmap = pydarnio.SDarnRead(iqdat_file) - dmap_data = dmap.read_iqdat() - dmap_write = pydarnio.SDarnWrite(dmap_data) - dmap_write.write_iqdat("test_iqdat.iqdat") - iqdat_read = pydarnio.SDarnRead("test_iqdat.iqdat") - iqdat_read_data = iqdat_read.read_iqdat() - self.dmap_compare(dmap_data, iqdat_read_data) - os.remove("test_iqdat.iqdat") - - def test_SDarnWrite_SDarnRead_iqdat(self): - """ - Test SDarnWrite writing a iqdat file and SDarnRead reading the iqdat - file - """ - iqdat_data = copy.deepcopy(iqdat_data_sets.iqdat_data) - iqdat_write = pydarnio.SDarnWrite(iqdat_data, "test_iqdat.iqdat") - iqdat_write.write_iqdat() - iqdat_read = pydarnio.SDarnRead("test_iqdat.iqdat") - iqdat_read_data = iqdat_read.read_iqdat() - self.dmap_compare(iqdat_read_data, iqdat_data) - os.remove("test_iqdat.iqdat") - - def test_SDarnRead_stream_SDarnWrite_file_iqdat(self): - """ - Test SDarnRead reads from a stream and SDarnWrite writes - to a iqdat file - """ - with bz2.open(iqdat_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.SDarnRead(dmap_stream, True) - stream_data = dmap.read_iqdat() - dmap_stream_data = dmap.get_dmap_records - dmap_write = pydarnio.SDarnWrite(stream_data) - dmap_write.write_iqdat("test_iqdat.iqdat") - self.assertTrue(os.path.isfile("test_iqdat.iqdat")) - dmap = pydarnio.SDarnRead("test_iqdat.iqdat") - _ = dmap.read_iqdat() - dmap_read_data = dmap.get_dmap_records - self.dmap_compare(dmap_stream_data, dmap_read_data) - - def test_DmapRead_SDarnWrite_SDarnRead_iqdat(self): - """ - Test SDarnRead reads from a stream and SDarnWrite writes - to a iqdat file - """ - dmap = pydarnio.DmapRead(iqdat_file) - dmap_data = dmap.read_records() - dmap_write = pydarnio.SDarnWrite(dmap_data) - dmap_write.write_iqdat("test_iqdat.iqdat") - darn_read = pydarnio.SDarnRead("test_iqdat.iqdat") - iqdat_data = darn_read.read_iqdat() - self.dmap_compare(dmap_data, iqdat_data) - os.remove("test_iqdat.iqdat") - - def test_SDarnWrite_file_SDarnRead_iqdat(self): - """ - Test SDarnWrite to write a iqdat file then using - SDarnRead to read the file - """ - iqdat_data = copy.deepcopy(iqdat_data_sets.iqdat_data) - iqdat_write = pydarnio.SDarnWrite(iqdat_data, "test_iqdat.iqdat") - iqdat_write.write_iqdat() - - iqdat_read = pydarnio.SDarnRead("test_iqdat.iqdat") - iqdat_read_data = iqdat_read.read_iqdat() - self.dmap_compare(iqdat_read_data, iqdat_data) - os.remove("test_iqdat.iqdat") - - def test_DmapWrite_SDarnRead_iqdat(self): - """ - Test DmapWrite to write a iqdat file then using SDarnRead - to read the file - """ - iqdat_data = copy.deepcopy(iqdat_data_sets.iqdat_data) - iqdat_write = pydarnio.DmapWrite(iqdat_data, "test_iqdat.iqdat") - iqdat_write.write_dmap() - - iqdat_read = pydarnio.SDarnRead("test_iqdat.iqdat") - iqdat_read_data = iqdat_read.read_iqdat() - self.dmap_compare(iqdat_read_data, iqdat_data) - os.remove("test_iqdat.iqdat") - - def test_SDarnRead_DmapWrite_stream_iqdat(self): - """ - Test SDarnRead to read from a iqdat stream then - DmapWrite to write a iqdat file from the stream - """ - with bz2.open(iqdat_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.SDarnRead(dmap_stream, True) - dmap_stream_data = dmap.read_iqdat() - dmap_write = pydarnio.DmapWrite() - dmap_write_stream = dmap_write.write_dmap_stream(dmap_stream_data) - dmap_read = pydarnio.SDarnRead(dmap_write_stream, True) - dmap_read_data = dmap_read.read_iqdat() - self.dmap_compare(dmap_stream_data, dmap_read_data) - - def test_DmapRead_stream_SDarnWrite_file_iqdat(self): - """ - Test DmapRead to read in a stream then have SDarnWrite the - stream to file - """ - with bz2.open(iqdat_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.DmapRead(dmap_stream, True) - dmap_stream_data = dmap.read_records() - dmap_write = pydarnio.SDarnWrite(dmap_stream_data) - dmap_write.write_iqdat("test_iqdat.iqdat") - dmap = pydarnio.SDarnRead("test_iqdat.iqdat") - dmap_data = dmap.read_iqdat() - self.dmap_compare(dmap_stream_data, dmap_data) - os.remove("test_iqdat.iqdat") - - def test_DmapWrite_stream_SDarnRead_iqdat(self): - """ - Test DmapWrite to write to a stream and have SDarnRead - the iqdat stream - """ - iqdat_data = copy.deepcopy(iqdat_data_sets.iqdat_data) - iqdat_write = pydarnio.DmapWrite() - iqdat_stream = iqdat_write.write_dmap_stream(iqdat_data) - - iqdat_read = pydarnio.SDarnRead(iqdat_stream, True) - iqdat_read_data = iqdat_read.read_iqdat() - self.dmap_compare(iqdat_read_data, iqdat_data) - - def test_DmapWrite_missing_SDarnRead_iqdat(self): - """ - Test DmapWrite writes a iqdat file missing the field nave in record 2 - and SDarnRead reads the file - - Behaviour: Raise SuperDARNFieldMissingError - """ - iqdat_missing_field = copy.deepcopy(iqdat_data_sets.iqdat_data) - del iqdat_missing_field[0]['nave'] - dmap_write = pydarnio.DmapWrite(iqdat_missing_field) - dmap_write.write_dmap("test_missing_iqdat.iqdat") - - darn_read = pydarnio.SDarnRead("test_missing_iqdat.iqdat") - try: - darn_read.read_iqdat() - except pydarnio.superdarn_exceptions.SuperDARNFieldMissingError as err: - self.assertEqual(err.fields, {'nave'}) - self.assertEqual(err.record_number, 0) - - os.remove("test_missing_iqdat.iqdat") - - def test_DmapWrite_extra_SDarnRead_iqdat(self): - """ - Test DmapWrite writes a iqdat file with an extra field and SDarnRead - reads the file - - Behaviour: Raised SuperDARNExtraFieldError - """ - iqdat_extra_field = copy.deepcopy(iqdat_data_sets.iqdat_data) - iqdat_extra_field[0].update({'dummy': 'dummy'}) - iqdat_extra_field[0].move_to_end('dummy', last=False) - dmap_write = pydarnio.DmapWrite(iqdat_extra_field, ) - dmap_write.write_dmap("test_extra_iqdat.iqdat") - - darn_read = pydarnio.SDarnRead("test_extra_iqdat.iqdat") - try: - darn_read.read_iqdat() - except pydarnio.superdarn_exceptions.SuperDARNExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - self.assertEqual(err.record_number, 0) - os.remove("test_extra_iqdat.iqdat") - - def test_SDarnRead_SDarnWrite_grid(self): - """ - Test DmapRead reading an grid and SDarnWrite writing - the grid file - """ - dmap = pydarnio.SDarnRead(grid_file) - dmap_data = dmap.read_grid() - dmap_write = pydarnio.SDarnWrite(dmap_data) - dmap_write.write_grid("test_grid.grid") - grid_read = pydarnio.SDarnRead("test_grid.grid") - grid_read_data = grid_read.read_grid() - self.dmap_compare(dmap_data, grid_read_data) - os.remove("test_grid.grid") - - def test_SDarnWrite_SDarnRead_grid(self): - """ - Test SDarnWrite writing a grid file and SDarnRead reading the grid - file - """ - grid_data = copy.deepcopy(grid_data_sets.grid_data) - grid_write = pydarnio.SDarnWrite(grid_data, "test_grid.grid") - grid_write.write_grid() - - grid_read = pydarnio.SDarnRead("test_grid.grid") - grid_read_data = grid_read.read_grid() - self.dmap_compare(grid_read_data, grid_data) - os.remove("test_grid.grid") - - def test_SDarnRead_stream_SDarnWrite_file_grid(self): - """ - Test SDarnRead reads from a stream and SDarnWrite writes - to a grid file - """ - with bz2.open(grid_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.SDarnRead(dmap_stream, True) - dmap_stream_data = dmap.read_grid() - dmap_write = pydarnio.SDarnWrite(dmap_stream_data) - dmap_write.write_grid("test_grid.grid") - self.assertTrue(os.path.isfile("test_grid.grid")) - dmap = pydarnio.SDarnRead("test_grid.grid") - dmap_data = dmap.read_grid() - self.dmap_compare(dmap_stream_data, dmap_data) - - def test_DmapRead_SDarnWrite_SDarnRead_grid(self): - """ - Test DmapRead reading a grid file then writing it with SDarnWrite - then reading it again with SDarnRead - """ - dmap = pydarnio.DmapRead(grid_file) - dmap_data = dmap.read_records() - dmap_write = pydarnio.SDarnWrite(dmap_data) - dmap_write.write_grid("test_grid.grid") - darn_read = pydarnio.SDarnRead("test_grid.grid") - grid_data = darn_read.read_grid() - self.dmap_compare(dmap_data, grid_data) - os.remove("test_grid.grid") - - def test_SDarnWrite_file_SDarnRead_grid(self): - """ - Test SDarnWrite to write a grid file then using - SDarnRead to read the file - """ - grid_data = copy.deepcopy(grid_data_sets.grid_data) - grid_write = pydarnio.SDarnWrite(grid_data, "test_grid.grid") - grid_write.write_grid() - - grid_read = pydarnio.SDarnRead("test_grid.grid") - grid_read_data = grid_read.read_grid() - self.dmap_compare(grid_read_data, grid_data) - os.remove("test_grid.grid") - - def test_DmapWrite_SDarnRead_grid(self): - """ - Test DmapWrite to write a grid file then using SDarnRead - to read the file - """ - grid_data = copy.deepcopy(grid_data_sets.grid_data) - grid_write = pydarnio.DmapWrite(grid_data, "test_grid.grid") - grid_write.write_dmap() - - grid_read = pydarnio.SDarnRead("test_grid.grid") - grid_read_data = grid_read.read_grid() - self.dmap_compare(grid_read_data, grid_data) - os.remove("test_grid.grid") - - def test_SDarnRead_DmapWrite_stream_grid(self): - """ - Test SDarnRead to read from a grid stream then - DmapWrite to write a grid file from the stream - """ - with bz2.open(grid_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.SDarnRead(dmap_stream, True) - dmap_stream_data = dmap.read_grid() - dmap_write = pydarnio.DmapWrite() - dmap_write_stream = dmap_write.write_dmap_stream(dmap_stream_data) - dmap_read = pydarnio.SDarnRead(dmap_write_stream, True) - dmap_read_data = dmap_read.read_grid() - self.dmap_compare(dmap_stream_data, dmap_read_data) - - def test_DmapRead_stream_SDarnWrite_file_grid(self): - """ - Test DmapRead to read in a stream then have SDarnWrite the - stream to file - """ - with bz2.open(grid_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.DmapRead(dmap_stream, True) - dmap_stream_data = dmap.read_records() - dmap_write = pydarnio.SDarnWrite(dmap_stream_data) - dmap_write.write_grid("test_grid.grid") - dmap = pydarnio.SDarnRead("test_grid.grid") - dmap_data = dmap.read_grid() - self.dmap_compare(dmap_stream_data, dmap_data) - os.remove("test_grid.grid") - - def test_DmapWrite_stream_SDarnRead_grid(self): - """ - Test DmapWrite to write to a stream and have SDarnRead - the grid stream - """ - grid_data = copy.deepcopy(grid_data_sets.grid_data) - grid_write = pydarnio.DmapWrite() - grid_stream = grid_write.write_dmap_stream(grid_data) - - grid_read = pydarnio.SDarnRead(grid_stream, True) - grid_read_data = grid_read.read_grid() - self.dmap_compare(grid_read_data, grid_data) - - def test_DmapWrite_missing_SDarnRead_grid(self): - """ - Test DmapWrite writes a grid file missing the field nave in record 2 - and SDarnRead reads the file - - Behaviour: Raise SuperDARNFieldMissingError - """ - grid_missing_field = copy.deepcopy(grid_data_sets.grid_data) - del grid_missing_field[0]['stid'] - dmap_write = pydarnio.DmapWrite(grid_missing_field) - dmap_write.write_dmap("test_missing_grid.grid") - - darn_read = pydarnio.SDarnRead("test_missing_grid.grid") - try: - darn_read.read_grid() - except pydarnio.superdarn_exceptions.SuperDARNFieldMissingError as err: - self.assertEqual(err.fields, {'stid'}) - self.assertEqual(err.record_number, 0) - - os.remove("test_missing_grid.grid") - - def test_DmapWrite_extra_SDarnRead_grid(self): - """ - Test DmapWrite writes a grid file with an extra field and SDarnRead - reads the file - - Behaviour: Raised SuperDARNExtraFieldError - """ - grid_extra_field = copy.deepcopy(grid_data_sets.grid_data) - grid_extra_field[0].update({'dummy': 'dummy'}) - grid_extra_field[0].move_to_end('dummy', last=False) - dmap_write = pydarnio.DmapWrite(grid_extra_field, ) - dmap_write.write_dmap("test_extra_grid.grid") - - darn_read = pydarnio.SDarnRead("test_extra_grid.grid") - try: - darn_read.read_grid() - except pydarnio.superdarn_exceptions.SuperDARNExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - self.assertEqual(err.record_number, 0) - os.remove("test_extra_grid.grid") - - def test_SDarnRead_SDarnWrite_map(self): - """ - Test DmapRead reading an map and SDarnWrite writing - the map file - """ - dmap = pydarnio.SDarnRead(map_file) - dmap_data = dmap.read_map() - dmap_write = pydarnio.SDarnWrite(dmap_data) - dmap_write.write_map("test_map.map") - map_read = pydarnio.SDarnRead("test_map.map") - map_read_data = map_read.read_map() - self.dmap_compare(dmap_data, map_read_data) - os.remove("test_map.map") - - def test_SDarnWrite_SDarnRead_map(self): - """ - Test SDarnWrite writing a map file and SDarnRead reading the map - file - """ - map_data = copy.deepcopy(map_data_sets.map_data) - map_write = pydarnio.SDarnWrite(map_data, "test_map.map") - map_write.write_map() - - map_read = pydarnio.SDarnRead("test_map.map") - map_read_data = map_read.read_map() - self.dmap_compare(map_read_data, map_data) - os.remove("test_map.map") - - def test_SDarnRead_stream_SDarnWrite_file_map(self): - """ - Test SDarnRead reads from a stream and SDarnWrite writes - to a map file - """ - with bz2.open(map_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.SDarnRead(dmap_stream, True) - dmap_stream_data = dmap.read_map() - dmap_write = pydarnio.SDarnWrite(dmap_stream_data) - dmap_write.write_map("test_map.map") - self.assertTrue(os.path.isfile("test_map.map")) - dmap = pydarnio.SDarnRead("test_map.map") - dmap_data = dmap.read_map() - self.dmap_compare(dmap_stream_data, dmap_data) - - def test_DmapRead_SDarnWrite_SDarnRead_map(self): - """ - Test DmapRead reading a map file then writing it with SDarnWrite - then reading it again with SDarnRead - """ - dmap = pydarnio.DmapRead(map_file) - dmap_data = dmap.read_records() - dmap_write = pydarnio.SDarnWrite(dmap_data) - dmap_write.write_map("test_map.map") - darn_read = pydarnio.SDarnRead("test_map.map") - map_data = darn_read.read_map() - self.dmap_compare(dmap_data, map_data) - os.remove("test_map.map") - - def test_SDarnWrite_file_SDarnRead_map(self): - """ - Test SDarnWrite to write a map file then using - SDarnRead to read the file - """ - map_data = copy.deepcopy(map_data_sets.map_data) - map_write = pydarnio.SDarnWrite(map_data, "test_map.map") - map_write.write_map() - - map_read = pydarnio.SDarnRead("test_map.map") - map_read_data = map_read.read_map() - self.dmap_compare(map_read_data, map_data) - os.remove("test_map.map") - - def test_DmapWrite_SDarnRead_map(self): - """ - Test DmapWrite to write a map file then using SDarnRead - to read the file - """ - map_data = copy.deepcopy(map_data_sets.map_data) - map_write = pydarnio.DmapWrite(map_data, "test_map.map") - map_write.write_dmap() - - map_read = pydarnio.SDarnRead("test_map.map") - map_read_data = map_read.read_map() - self.dmap_compare(map_read_data, map_data) - os.remove("test_map.map") - - def test_SDarnRead_DmapWrite_stream_map(self): - """ - Test SDarnRead to read from a map stream then - DmapWrite to write a map file from the stream - """ - with bz2.open(map_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.SDarnRead(dmap_stream, True) - dmap_stream_data = dmap.read_map() - dmap_write = pydarnio.DmapWrite() - dmap_write_stream = dmap_write.write_dmap_stream(dmap_stream_data) - dmap_read = pydarnio.SDarnRead(dmap_write_stream, True) - dmap_read_data = dmap_read.read_map() - self.dmap_compare(dmap_stream_data, dmap_read_data) - - def test_DmapRead_stream_SDarnWrite_file_map(self): - """ - Test DmapRead to read in a stream then have SDarnWrite the - stream to file - """ - with bz2.open(map_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.DmapRead(dmap_stream, True) - dmap_stream_data = dmap.read_records() - dmap_write = pydarnio.SDarnWrite(dmap_stream_data) - dmap_write.write_map("test_map.map") - dmap = pydarnio.SDarnRead("test_map.map") - dmap_data = dmap.read_map() - self.dmap_compare(dmap_stream_data, dmap_data) - os.remove("test_map.map") - - def test_DmapWrite_stream_SDarnRead_map(self): - """ - Test DmapWrite to write to a stream and have SDarnRead - the map stream - """ - map_data = copy.deepcopy(map_data_sets.map_data) - map_write = pydarnio.DmapWrite() - map_stream = map_write.write_dmap_stream(map_data) - - map_read = pydarnio.SDarnRead(map_stream, True) - map_read_data = map_read.read_map() - self.dmap_compare(map_read_data, map_data) - - def test_DmapWrite_missing_SDarnRead_map(self): - """ - Test DmapWrite writes a fitacf file missing the field nave in record 2 - and SDarnRead reads the file - - Behaviour: Raise SuperDARNFieldMissingError - """ - map_missing_field = copy.deepcopy(map_data_sets.map_data) - del map_missing_field[0]['stid'] - dmap_write = pydarnio.DmapWrite(map_missing_field) - dmap_write.write_dmap("test_missing_map.map") - - darn_read = pydarnio.SDarnRead("test_missing_map.map") - try: - darn_read.read_map() - except pydarnio.superdarn_exceptions.SuperDARNFieldMissingError as err: - self.assertEqual(err.fields, {'stid'}) - self.assertEqual(err.record_number, 0) - - os.remove("test_missing_map.map") - - def test_DmapWrite_extra_SDarnRead_map(self): - """ - Test DmapWrite writes a map file with an extra field and SDarnRead - reads the file - - Behaviour: Raised SuperDARNExtraFieldError - """ - map_extra_field = copy.deepcopy(map_data_sets.map_data) - map_extra_field[0].update({'dummy': 'dummy'}) - map_extra_field[0].move_to_end('dummy', last=False) - dmap_write = pydarnio.DmapWrite(map_extra_field, ) - dmap_write.write_dmap("test_extra_map.map") - - darn_read = pydarnio.SDarnRead("test_extra_map.map") - try: - darn_read.read_map() - except pydarnio.superdarn_exceptions.SuperDARNExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - self.assertEqual(err.record_number, 0) - os.remove("test_extra_map.map") - - -if __name__ == '__main__': - """ - Runs the above class in a unittest system. - Roughly takes 467 seconds. - """ - pydarnio_logger.info("Starting DMAP testing") - - unittest.main() diff --git a/tests/unit/borealis_bfiq_data_sets.py b/tests/unit/borealis_bfiq_data_sets.py deleted file mode 100644 index ee67673..0000000 --- a/tests/unit/borealis_bfiq_data_sets.py +++ /dev/null @@ -1,244 +0,0 @@ -""" -Test data sets for Borealis Bfiq. -""" - -import numpy as np - -from collections import OrderedDict - - -borealis_site_bfiq_data = OrderedDict([(str(1558583991060), { - "borealis_git_hash": np.str_('v0.2-61-gc13ab34'), - "experiment_id": np.int64(100000000), - "experiment_name": np.str_('TestScheme9ACFs'), - "experiment_comment": np.str_(''), - "num_slices": np.int64(1), - "slice_comment": np.str_(''), - "station": np.str_('sas'), - "num_sequences": np.int64(29), - "pulse_phase_offset": np.array([0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0]).astype(np.float32), - "range_sep": np.float32(44.96887), - "first_range_rtt": np.float32(1200.8307), - "first_range": np.float32(180.0), - "rx_sample_rate": np.float64(3333.3333333333335), - "scan_start_marker": np.bool_(True), - "int_time": np.float32(3.000395), - "tx_pulse_len": np.uint32(300), - "tau_spacing": np.uint32(2400), - "main_antenna_count": np.uint32(16), - "intf_antenna_count": np.uint32(4), - "freq": np.uint32(10500), - "samples_data_type": np.str_('complex float'), - "num_samps": np.uint32(297), - "num_ranges": np.uint32(75), - "pulses": np.array([0, 9, 12, 20, 22, 26, 27]).astype(np.uint32), - "lags": np.array([[0, 0], - [26, 27], - [20, 22], - [9, 12], - [22, 26], - [22, 27], - [20, 26], - [20, 27], - [12, 20], - [0, 9], - [12, 22], - [9, 20], - [0, 12], - [9, 22], - [12, 26], - [12, 27], - [9, 26], - [9, 27], - [0, 20], - [0, 22], - [0, 26], - [0, 27], - [27, 27]]).astype(np.uint32), - "blanked_samples": np.array([0, 72, 96, 160, - 176, 208, 216]).astype(np.uint32), - "sqn_timestamps": np.array([1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09]), - "beam_nums": np.array([0]).astype(np.uint32), - "beam_azms": np.array([0.0]), - "data_descriptors": np.array(['num_antenna_arrays', 'num_sequences', - 'num_beams', 'num_samps']), - "data_dimensions": np.array([2, 29, 1, 297]).astype(np.uint32), - "antenna_arrays_order": np.array(['main', 'intf']), - "noise_at_freq": np.array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0.]), - "data_normalization_factor": np.float64(9999999.999999996), - "data": np.zeros(17226).astype(np.complex64)}), (str(1558583994062), { - "borealis_git_hash": np.str_('v0.2-61-gc13ab34'), - "experiment_id": np.int64(100000000), - "experiment_name": np.str_('TestScheme9ACFs'), - "experiment_comment": np.str_(''), - "num_slices": np.int64(1), - "slice_comment": np.str_(''), - "station": np.str_('sas'), - "num_sequences": np.int64(29), - "pulse_phase_offset": np.array([0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0]).astype(np.float32), - "range_sep": np.float32(44.96887), - "first_range_rtt": np.float32(1200.8307), - "first_range": np.float32(180.0), - "rx_sample_rate": np.float64(3333.3333333333335), - "scan_start_marker": np.bool_(True), - "int_time": np.float32(3.090798), - "tx_pulse_len": np.uint32(300), - "tau_spacing": np.uint32(2400), - "main_antenna_count": np.uint32(16), - "intf_antenna_count": np.uint32(4), - "freq": np.uint32(10500), - "samples_data_type": np.str_('complex float'), - "num_samps": np.uint32(297), - "num_ranges": np.uint32(75), - "pulses": np.array([0, 9, 12, 20, 22, 26, 27]).astype(np.uint32), - "lags": np.array([[0, 0], - [26, 27], - [20, 22], - [9, 12], - [22, 26], - [22, 27], - [20, 26], - [20, 27], - [12, 20], - [0, 9], - [12, 22], - [9, 20], - [0, 12], - [9, 22], - [12, 26], - [12, 27], - [9, 26], - [9, 27], - [0, 20], - [0, 22], - [0, 26], - [0, 27], - [27, 27]]).astype(np.uint32), - "blanked_samples": np.array([0, 72, 96, 160, - 176, 208, 216]).astype(np.uint32), - "sqn_timestamps": np.array([1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09]), - "beam_nums": np.array([0]).astype(np.uint32), - "beam_azms": np.array([0.0]), - "data_descriptors": np.array(['num_antenna_arrays', 'num_sequences', - 'num_beams', 'num_samps']), - "data_dimensions": np.array([2, 29, 1, 297]).astype(np.uint32), - "antenna_arrays_order": np.array(['main', 'intf']), - "noise_at_freq": np.array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0.]), - "data_normalization_factor": np.float64(9999999.999999996), - "data": np.zeros((17226)).astype(np.complex64) - })]) - -num_records = 1500 -borealis_array_bfiq_data = { - "borealis_git_hash": np.str_('v0.2-61-gc13ab34'), - "experiment_id": np.int64(100000000), - "experiment_name": np.str_('TestScheme9ACFs'), - "experiment_comment": np.str_(''), - "num_slices": np.array([1] * num_records, dtype=np.int64), - "slice_comment": np.str_(''), - "station": np.str_('sas'), - "pulse_phase_offset": np.array([0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0]).astype(np.float32), - "range_sep": np.float32(44.96887), - "first_range_rtt": np.float32(1200.8307), - "first_range": np.float32(180.0), - "rx_sample_rate": np.float64(3333.3333333333335), - "scan_start_marker": np.array([True] * num_records).astype(np.bool_), - "tx_pulse_len": np.uint32(300), - "tau_spacing": np.uint32(2400), - "main_antenna_count": np.uint32(16), - "intf_antenna_count": np.uint32(4), - "freq": np.uint32(10500), - "samples_data_type": np.str_('complex float'), - "num_samps": np.uint32(297), - "num_ranges": np.uint32(75), - "num_beams": np.array([1] * num_records).astype(np.uint32), - "pulses": np.array([0, 9, 12, 20, 22, 26, 27]).astype(np.uint32), - "lags": np.array([[0, 0], - [26, 27], - [20, 22], - [9, 12], - [22, 26], - [22, 27], - [20, 26], - [20, 27], - [12, 20], - [0, 9], - [12, 22], - [9, 20], - [0, 12], - [9, 22], - [12, 26], - [12, 27], - [9, 26], - [9, 27], - [0, 20], - [0, 22], - [0, 26], - [0, 27], - [27, 27]]).astype(np.uint32), - "blanked_samples": np.array([0, 72, 96, 160, - 176, 208, 216]).astype(np.uint32), - "beam_nums": np.array([[0]] * num_records).astype(np.uint32), - "beam_azms": np.array([[0.0]] * num_records), - "data_descriptors": np.array(['num_records', 'num_antenna_arrays', - 'num_sequences', - 'num_beams', 'num_samps']), - "data_normalization_factor": np.float64(9999999.999999996), - "antenna_arrays_order": np.array(['main', 'intf']), - "int_time": np.array([3.000395] * num_records).astype(np.float32), - "num_sequences": np.array([np.int64(29)] * num_records, dtype=np.int64), - "sqn_timestamps": np.array([[1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09]] * num_records), - "noise_at_freq": np.array([[0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0.]] * num_records), - "data": np.zeros((num_records, 2, 29, 1, 297)).astype(np.complex64) - } diff --git a/tests/unit/borealis_rawacf_data_sets.py b/tests/unit/borealis_rawacf_data_sets.py deleted file mode 100644 index 251242c..0000000 --- a/tests/unit/borealis_rawacf_data_sets.py +++ /dev/null @@ -1,234 +0,0 @@ -""" -Test data sets for Borealis Rawacf. -""" -import numpy as np - -from collections import OrderedDict - - -borealis_site_rawacf_data = OrderedDict([(str(1558583991060), { - "borealis_git_hash": np.unicode_('v0.2-61-gc13ab34'), - "experiment_id": np.int64(100000000), - "experiment_name": np.unicode_('TestScheme9ACFs'), - "experiment_comment": np.unicode_(''), - "num_slices": np.int64(1), - "slice_comment": np.unicode_(''), - "station": np.unicode_('sas'), - "num_sequences": np.int64(29), - "range_sep": np.float32(44.96887), - "first_range_rtt": np.float32(1200.8307), - "first_range": np.float32(180.0), - "rx_sample_rate": np.float64(3333.3333333333335), - "scan_start_marker": np.bool_(True), - "int_time": np.float32(3.000395), - "tx_pulse_len": np.uint32(300), - "tau_spacing": np.uint32(2400), - "main_antenna_count": np.uint32(16), - "intf_antenna_count": np.uint32(4), - "freq": np.uint32(10500), - "samples_data_type": np.unicode_('complex float'), - "pulses": np.array([0, 9, 12, 20, 22, 26, 27]).astype(np.uint32), - "lags": np.array([[0, 0], - [26, 27], - [20, 22], - [9, 12], - [22, 26], - [22, 27], - [20, 26], - [20, 27], - [12, 20], - [0, 9], - [12, 22], - [9, 20], - [0, 12], - [9, 22], - [12, 26], - [12, 27], - [9, 26], - [9, 27], - [0, 20], - [0, 22], - [0, 26], - [0, 27], - [27, 27]]).astype(np.uint32), - "blanked_samples": np.array([0, 72, 96, - 160, 176, 208, 216]).astype(np.uint32), - "sqn_timestamps": np.array([1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09]), - "beam_nums": np.array([0]).astype(np.uint32), - "beam_azms": np.array([0.0]), - "correlation_descriptors": np.array(['num_beams', 'num_ranges', - 'num_lags']), - "correlation_dimensions": np.array([1, 75, 23]).astype(np.uint32), - "main_acfs": np.zeros(1725).astype(np.complex64), - "intf_acfs": np.zeros(1725).astype(np.complex64), - "xcfs": np.zeros(1725).astype(np.complex64), - "noise_at_freq": np.array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0.]), - "data_normalization_factor": np.float64(9999999.999999996)}), - (str(1558583994062), { - "borealis_git_hash": np.unicode_('v0.2-61-gc13ab34'), - "experiment_id": np.int64(100000000), - "experiment_name": np.unicode_('TestScheme9ACFs'), - "experiment_comment": np.unicode_(''), - "num_slices": np.int64(1), - "slice_comment": np.unicode_(''), - "station": np.unicode_('sas'), - "num_sequences": np.int64(30), - "range_sep": np.float32(44.96887), - "first_range_rtt": np.float32(1200.8307), - "first_range": np.float32(180.0), - "rx_sample_rate": np.float64(3333.3333333333335), - "scan_start_marker": np.bool_(True), - "int_time": np.float32(3.090798), - "tx_pulse_len": np.uint32(300), - "tau_spacing": np.uint32(2400), - "main_antenna_count": np.uint32(16), - "intf_antenna_count": np.uint32(4), - "freq": np.uint32(10500), - "samples_data_type": np.unicode_('complex float'), - "pulses": np.array([0, 9, 12, 20, 22, 26, 27]).astype(np.uint32), - "lags": np.array([[0, 0], - [26, 27], - [20, 22], - [9, 12], - [22, 26], - [22, 27], - [20, 26], - [20, 27], - [12, 20], - [0, 9], - [12, 22], - [9, 20], - [0, 12], - [9, 22], - [12, 26], - [12, 27], - [9, 26], - [9, 27], - [0, 20], - [0, 22], - [0, 26], - [0, 27], - [27, 27]]).astype(np.uint32), - "blanked_samples": np.array([0, 72, 96, 160, - 176, 208, 216]).astype(np.uint32), - "sqn_timestamps": np.array([1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09]), - "beam_nums": np.array([0]).astype(np.uint32), - "beam_azms": np.array([0.0]), - "correlation_descriptors": np.array(['num_beams', 'num_ranges', - 'num_lags']), - "correlation_dimensions": np.array([1, 75, 23]).astype(np.uint32), - "main_acfs": np.zeros(1725).astype(np.complex64), - "intf_acfs": np.zeros(1725).astype(np.complex64), - "xcfs": np.zeros(1725).astype(np.complex64), - "noise_at_freq": np.array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0.]), - "data_normalization_factor": np.float64(9999999.999999996) - })]) - -num_records = 1500 -borealis_array_rawacf_data = { - "borealis_git_hash": np.unicode_('v0.2-61-gc13ab34'), - "experiment_id": np.int64(100000000), - "experiment_name": np.unicode_('TestScheme9ACFs'), - "experiment_comment": np.unicode_(''), - "num_slices": np.array([1] * num_records).astype(np.int64), - "slice_comment": np.unicode_(''), - "station": np.unicode_('sas'), - "range_sep": np.float32(44.96887), - "first_range_rtt": np.float32(1200.8307), - "first_range": np.float32(180.0), - "rx_sample_rate": np.float64(3333.3333333333335), - "scan_start_marker": np.array([True] * num_records).astype(np.bool_), - "tx_pulse_len": np.uint32(300), - "tau_spacing": np.uint32(2400), - "main_antenna_count": np.uint32(16), - "intf_antenna_count": np.uint32(4), - "freq": np.uint32(10500), - "num_beams": np.array([1] * num_records).astype(np.uint32), - "samples_data_type": np.unicode_('complex float'), - "pulses": np.array([0, 9, 12, 20, 22, 26, 27]).astype(np.uint32), - "data_normalization_factor": np.float64(9999999.999999996), - "lags": np.array([[0, 0], - [26, 27], - [20, 22], - [9, 12], - [22, 26], - [22, 27], - [20, 26], - [20, 27], - [12, 20], - [0, 9], - [12, 22], - [9, 20], - [0, 12], - [9, 22], - [12, 26], - [12, 27], - [9, 26], - [9, 27], - [0, 20], - [0, 22], - [0, 26], - [0, 27], - [27, 27]]).astype(np.uint32), - "blanked_samples": np.array([0, 72, 96, 160, - 176, 208, 216]).astype(np.uint32), - "beam_nums": np.array([[0]] * num_records).astype(np.uint32), - "beam_azms": np.array([[0.0]] * num_records), - "correlation_descriptors": np.array(['num_records', 'num_beams', - 'num_ranges', 'num_lags']), - "int_time": np.array([3.000395] * num_records).astype(np.float32), - "num_sequences": np.array([np.int64(29)] * num_records, dtype=np.int64), - "sqn_timestamps": np.array([[1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09, 1.55858399e+09, - 1.55858399e+09]] * num_records), - "main_acfs": np.zeros((num_records, 1, 75, 23)).astype(np.complex64), - "intf_acfs": np.zeros((num_records, 1, 75, 23)).astype(np.complex64), - "xcfs": np.zeros((num_records, 1, 75, 23)).astype(np.complex64), - "noise_at_freq": np.array([[0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0.]] * num_records) - } diff --git a/tests/unit/dmap_data_sets.py b/tests/unit/dmap_data_sets.py deleted file mode 100644 index 78ec428..0000000 --- a/tests/unit/dmap_data_sets.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (C) 2019 SuperDARN Canada, University of Saskatchewan -# Author: Marina Schmidt - -import numpy as np - -from pydarnio import DmapArray, DmapScalar - -dmap_data = [{'RST.version': DmapScalar('RST.version', '4.1', 9, 's'), - 'stid': DmapScalar('stid', 3, 3, 'i'), - 'FAC.vel': DmapArray('FAC.vel', np.array([2.5, 3.5, 4.0], - dtype=np.float32), 4, - 'f', 1, [3])}, - {'RST.version': DmapScalar('RST.version', '4.1', 9, 's'), - 'stid': DmapScalar('stid', 3, 3, 'i'), - 'FAC.vel': DmapArray('FAC.vel', np.array([1, 0, 1], - dtype=np.int8), - 1, 'c', 1, [3])}, - {'RST.version': DmapScalar('RST.version', '4.1', 9, 's'), - 'stid': DmapScalar('stid', 3, 3, 'i'), - 'FAC.vel': DmapArray('FAC.vel', np.array([5.7, 2.34, -0.2], - dtype=np.float32), - 4, 'f', 1, [3])}] diff --git a/tests/unit/fitacf_data_sets.py b/tests/unit/fitacf_data_sets.py deleted file mode 100644 index b174f4d..0000000 --- a/tests/unit/fitacf_data_sets.py +++ /dev/null @@ -1,485 +0,0 @@ -# Copyright (C) 2019 SuperDARN -# Author: Marina Schmidt - -""" -Test data sets for DmapWrite -""" -import numpy as np - -from collections import OrderedDict - -from pydarnio import DmapScalar, DmapArray - -fitacf_data = [ - OrderedDict([('radar.revision.major', - DmapScalar(name='radar.revision.major', value=1, data_type=1, - data_type_fmt='c')), - ('radar.revision.minor', - DmapScalar(name='radar.revision.minor', value=18, - data_type=1, data_type_fmt='c')), - ('origin.code', DmapScalar(name='origin.code', - value=0, data_type=1, - data_type_fmt='c')), - ('origin.time', DmapScalar(name='origin.time', - value='Thu Feb 22 02:39:03 2018', - data_type=9, data_type_fmt='s')), - ('origin.command', DmapScalar(name='origin.command', - value='/home/dataman/rst/bin/' - 'make_fit -new ' - '20180220.0001.00.rkn.rawacf', - data_type=9, - data_type_fmt='s')), - ('cp', DmapScalar(name='cp', value=3505, data_type=2, - data_type_fmt='h')), - ('stid', DmapScalar(name='stid', value=65, - data_type=2, data_type_fmt='h')), - ('time.yr', DmapScalar(name='time.yr', value=2018, - data_type=2, data_type_fmt='h')), - ('time.mo', DmapScalar(name='time.mo', value=2, data_type=2, - data_type_fmt='h')), - ('time.dy', DmapScalar(name='time.dy', value=20, - data_type=2, data_type_fmt='h')), - ('time.hr', DmapScalar(name='time.hr', value=1, - data_type=2, data_type_fmt='h')), - ('time.mt', DmapScalar(name='time.mt', value=6, data_type=2, - data_type_fmt='h')), - ('time.sc', DmapScalar(name='time.sc', value=28, data_type=2, - data_type_fmt='h')), - ('time.us', DmapScalar(name='time.us', value=19887, - data_type=3, data_type_fmt='i')), - ('txpow', DmapScalar(name='txpow', value=9000, data_type=2, - data_type_fmt='h')), - ('nave', DmapScalar(name='nave', value=29, data_type=2, - data_type_fmt='h')), - ('atten', DmapScalar(name='atten', value=0, data_type=2, - data_type_fmt='h')), - ('lagfr', DmapScalar(name='lagfr', value=1200, - data_type=2, data_type_fmt='h')), - ('smsep', DmapScalar(name='smsep', value=300, data_type=2, - data_type_fmt='h')), - ('ercod', DmapScalar(name='ercod', value=0, data_type=2, - data_type_fmt='h')), - ('stat.agc', DmapScalar(name='stat.agc', value=0, - data_type=2, data_type_fmt='h')), - ('stat.lopwr', DmapScalar(name='stat.lopwr', value=0, - data_type=2, data_type_fmt='h')), - ('noise.search', DmapScalar(name='noise.search', - value=12.906009674072266, data_type=4, data_type_fmt='f')), - ('noise.mean', DmapScalar(name='noise.mean', - value=397571.90625, data_type=4, data_type_fmt='f')), - ('channel', DmapScalar(name='channel', value=1, - data_type=2, data_type_fmt='h')), - ('bmnum', DmapScalar(name='bmnum', value=7, data_type=2, data_type_fmt='h')), - ('bmazm', DmapScalar(name='bmazm', value=4.090000152587891, data_type=4, data_type_fmt='f')), - ('scan', DmapScalar(name='scan', value=0, data_type=2, data_type_fmt='h')), - ('offset', DmapScalar(name='offset', value=0, data_type=2, data_type_fmt='h')), - ('rxrise', DmapScalar(name='rxrise', value=100, data_type=2, data_type_fmt='h')), - ('intt.sc', DmapScalar(name='intt.sc', value=3, data_type=2, data_type_fmt='h')), - ('intt.us', DmapScalar(name='intt.us', value=500000, data_type=3, data_type_fmt='i')), - ('txpl', DmapScalar(name='txpl', value=300, data_type=2, data_type_fmt='h')), - ('mpinc', DmapScalar(name='mpinc', value=2400, data_type=2, data_type_fmt='h')), - ('mppul', DmapScalar(name='mppul', value=7, data_type=2, data_type_fmt='h')), - ('mplgs', DmapScalar(name='mplgs', value=18, data_type=2, data_type_fmt='h')), - ('mplgexs', DmapScalar(name='mplgexs', value=0, data_type=2, data_type_fmt='h')), - ('ifmode', DmapScalar(name='ifmode', value=-1, data_type=2, data_type_fmt='h')), - ('nrang', DmapScalar(name='nrang', value=100, data_type=2, data_type_fmt='h')), - ('frang', DmapScalar(name='frang', value=180, data_type=2, data_type_fmt='h')), - ('rsep', DmapScalar(name='rsep', value=45, data_type=2, data_type_fmt='h')), - ('xcf', DmapScalar(name='xcf', value=1, data_type=2, data_type_fmt='h')), - ('tfreq', DmapScalar(name='tfreq', value=10256, data_type=2, data_type_fmt='h')), - ('mxpwr', DmapScalar(name='mxpwr', value=1073741824, data_type=3, data_type_fmt='i')), - ('lvmax', DmapScalar(name='lvmax', value=20000, data_type=3, data_type_fmt='i')), - ('combf', DmapScalar(name='combf', value='$Id: twofsound.c,v 1.04 2016/11/08 20:00:00 KKrieger Exp $', data_type=9, data_type_fmt='s')), - ('fitacf.revision.major', DmapScalar(name='fitacf.revision.major', value=5, data_type=3, data_type_fmt='i')), - ('fitacf.revision.minor', DmapScalar(name='fitacf.revision.minor', value=0, data_type=3, data_type_fmt='i')), - ('noise.sky', DmapScalar(name='noise.sky', value=16.299999237060547, data_type=4, data_type_fmt='f')), - ('noise.lag0', DmapScalar(name='noise.lag0', value=0.0, data_type=4, data_type_fmt='f')), - ('noise.vel', DmapScalar(name='noise.vel', value=0.0, data_type=4, data_type_fmt='f')), - ('ptab', DmapArray(name='ptab', value=np.array([0, 9, 12, 20, 22, 26, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[7])), - ('ltab', DmapArray(name='ltab', value=np.array([0, 0, 26, 27, 20, 22, 9, 12, 22, 26, 22, 27, 20, 26, 20, 27, 12, - 20, 0, 9, 12, 22, 9, 20, 0, 12, 9, 22, 12, 26, 12, 27, 9, 26, - 9, 27, 27, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=2, shape=[19, 2])), - ('pwr0', DmapArray(name='pwr0', value=np.array([25.482876, 22.258324, -0.7546704, 2.7495077, - 4.2829385, 10.251047, -1.4400175, -0.7546704, - -50., -1.4400175, -6.439859, -9.817387, - -3.2569687, -4.5631275, -2.2541587, -1.8280382, - -3.2569687, 1.9774551, 8.435729, 13.695346, - 12.688249, 10.018611, 3.866029, 5.257997, - 5.780976, 7.207932, 12.105663, 19.4759, - 21.978638, 20.598166, 22.892414, 21.370316, - 18.158546, 16.825161, 18.06804, 15.396302, - 10.903598, 7.156958, 3.2814188, 3.9740682, - 5.489882, 2.7495077, 0.35785663, 2.7495077, - -0.4487027, 0.10528867, -7.8082385, -50., - -50., -3.2569687, -5.4008975, -2.7266836, - -1.0838388, 2.3029215, 1.8050935, 1.8050935, - -2.2541587, -3.861128, -6.439859, -7.8082385, - -1.0838388, -7.8082385, -2.2541587, -7.8082385, - -3.861128, -5.4008975, -1.0838388, -3.861128, - -5.4008975, -13.670896, -7.8082385, -4.5631275, - -3.2569687, 0.8227862, -2.7266836, -1.0838388, - -3.2569687, -0.7546704, -6.439859, -2.2541587, - -1.0838388, -9.817387, -1.4400175, -5.4008975, - -13.670896, -2.7266836, -50., -5.4008975, - -7.8082385, -2.2541587, -3.861128, 0.10528867, - -5.4008975, -0.4487027, -4.5631275, -1.0838388, - -9.817387, -50., -4.5631275, 11.886956], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[100])), - ('slist', DmapArray(name='slist', value=np.array([0, 1, 5, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 40], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[24])), - ('nlag', DmapArray(name='nlag', value=np.array([18, 14, 5, 9, 8, 5, 5, 8, 8, 7, 8, 13, 16, 11, 13, 17, 16, - 10, 11, 18, 9, 6, 6, 6], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[24])), - ('qflg', DmapArray(name='qflg', value=np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1], np.int8), data_type=1, data_type_fmt='c', dimension=1, shape=[24])), - ('gflg', DmapArray(name='gflg', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0], np.int8), data_type=1, data_type_fmt='c', dimension=1, shape=[24])), - ('p_l', DmapArray(name='p_l', value=np.array([25.837471, 21.772894, 10.315242, 8.546406, 13.539429, - 14.268169, 10.585105, 5.629323, 4.9654384, 5.6235294, - 6.705354, 12.144942, 18.312222, 21.94957, 20.888336, - 23.049816, 21.096363, 19.696482, 18.23027, 17.981743, - 15.739749, 11.354882, 7.502067, 6.010397], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('p_l_e', DmapArray(name='p_l_e', value=np.array([0.12540334, 0.30285096, 0.26836973, 0.21962215, 0.44621512, - 0.9992159, 0.50349855, 0.47247618, 0.4993279, 0.4811757, - 0.5614341, 0.06773554, 0.41744527, 0.18671621, 0.22014357, - 0.17500857, 0.20254372, 0.6454112, 0.41737786, 0.12244137, - 0.19204478, 0.32750002, 0.36852616, 0.2476189], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('p_s', DmapArray(name='p_s', value=np.array([25.391392, 21.279507, 9.8984585, 8.239473, 13.376657, - 14.4254675, 10.396272, 5.4328876, 4.624584, 5.412306, - 6.2907987, 11.922243, 17.815878, 21.760286, 20.523682, - 22.566383, 20.563492, 19.193954, 17.767952, 17.596186, - 15.391531, 11.110943, 7.2033787, 5.865661], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('p_s_e', DmapArray(name='p_s_e', value=np.array([0.09658687, 0.30153328, 0.5335675, 0.20160311, 0.37454027, - 0.6018533, 0.32835492, 0.32526138, 0.53839034, 0.43596512, - 0.58928996, 0.06623815, 0.40487084, 0.14407796, 0.10789531, - 0.09396324, 0.17330852, 0.35101762, 0.22534896, 0.10679341, - 0.1470098, 0.23388547, 0.40613198, 0.21845333], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('v', DmapArray(name='v', value=np.array([210.4173, 200.52983, 215.07555, 207.47739, 191.0903, 191.83696, - 209.5849, 251.1472, 260.30737, 249.832, 239.71947, 256.5703, - 359.38943, 383.2561, 413.74936, 487.30872, 531.28046, 535.2693, - 504.72272, 440.33603, 368.79492, 319.20898, 250.16727, 114.16911], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('v_e', DmapArray(name='v_e', value=np.array([3.9786088, 7.012827, -33.193398, -4.463376, - -1.6737736, -6.0411186, -4.7577586, 8.152869, - 11.382911, -6.635872, -6.3119335, 2.0531669, - 2.5595334, -0.89524144, 2.163332, 1.1770849, - 1.885144, 2.986912, 2.7908595, 1.8639158, - -3.4462364, -3.4294195, -6.1686172, -4.4189973], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('w_l', DmapArray(name='w_l', value=np.array([83.878746, 99.753044, 153.06863, 55.7092, 31.258623, - 32.607876, 77.80331, 73.54085, 89.46751, 36.6982, - 95.70889, 37.204212, 76.04568, 28.654127, 84.78225, - 117.6946, 138.9422, 94.33889, 81.74415, 66.54825, - 66.807594, 68.87775, 57.30965, 30.900507], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('w_l_e', DmapArray(name='w_l_e', value=np.array([7.109349, 19.477041, 18.231478, 10.996366, 20.184359, - 71.433754, 30.116459, 29.81509, 30.544685, 25.828869, - 36.886547, 3.3912168, 20.679068, 7.6170983, 12.121777, - 12.003044, 15.073383, 31.873648, 21.10902, 6.5249286, - 9.458526, 16.720922, 17.051199, 10.658608], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('w_s', DmapArray(name='w_s', value=np.array([167.82883, 173.47348, 233.15923, 135.62325, 101.29973, - 184.86955, 184.36272, 186.975, 180.45955, 107.827995, - 179.98326, 109.67403, 141.13757, 91.63864, 177.247, - 221.76321, 244.4691, 184.0788, 166.55692, 145.02649, - 147.4922, 154.32692, 124.689125, 96.998505], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('w_s_e', DmapArray(name='w_s_e', value=np.array([6.9921713, 22.92682, 33.29458, 15.932335, 34.298935, - 73.223854, 24.629501, 27.916792, 44.0334, 49.67091, - 52.318226, 6.459716, 27.34461, 12.055722, 7.242446, - 7.41231, 14.243067, 19.954693, 14.040812, 8.09781, - 9.85989, 14.963779, 26.252836, 17.50076], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('sd_l', DmapArray(name='sd_l', value=np.array([0.07678557, 0.19544871, 0.12019609, 0.08737351, 0.16077198, - 0.25815094, 0.17776884, 0.19282965, 0.23275045, 0.179218, - 0.2708179, 0.03100524, 0.26058298, 0.0716453, 0.11563717, - 0.10870428, 0.12833513, 0.24831082, 0.17849617, 0.07292715, - 0.0802837, 0.12825055, 0.14628929, 0.0864696], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('sd_s', DmapArray(name='sd_s', value=np.array([0.07562572, 0.23361373, 0.25926307, 0.0995465, 0.1628513, - 0.2174241, 0.13478918, 0.16230391, 0.27622813, 0.1907096, - 0.3194423, 0.03898079, 0.29843497, 0.07119729, 0.07097206, - 0.07450401, 0.1361929, 0.1901988, 0.13250129, 0.08141139, - 0.07634614, 0.10642347, 0.18352786, 0.08909834], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('sd_phi', DmapArray(name='sd_phi', value=np.array([0.14121413, 0.19921292, 0.55738163, 0.12504993, 0.04891057, - 0.08948292, 0.0851823, 0.17357136, 0.25275612, 0.15320578, - 0.13208257, 0.06842917, 0.09970863, 0.0336997, 0.06815802, - 0.03461095, 0.04988815, 0.09344769, 0.08783954, 0.06965055, - 0.09880196, 0.07864764, 0.15442486, 0.11673748], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_qflg', DmapArray(name='x_qflg', value=np.array([1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1], np.int8), data_type=1, data_type_fmt='c', dimension=1, shape=[24])), - ('x_gflg', DmapArray(name='x_gflg', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0], np.int8), data_type=1, data_type_fmt='c', dimension=1, shape=[24])), - ('x_p_l', DmapArray(name='x_p_l', value=np.array([27.714064, 22.498621, 14.773344, 8.674485, 14.955762, - 15.4034815, -50., 5.7427235, 2.2186325, 6.577615, - 7.4266825, 11.749854, 17.635168, 21.933393, 19.68564, - 22.835394, 21.13682, 19.438774, 17.741188, 18.237307, - 15.968641, 11.728345, 6.3010383, 5.852917], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_p_l_e', DmapArray(name='x_p_l_e', value=np.array([0.3816435, 0.30511376, 0.24965997, 0.5391254, 0.5861169, - 1.1781335, 0., 0.49218217, 0.8023588, 0.4629429, - 0.72451323, 0.44120732, 0.4393533, 0.16481791, 0.2829396, - 0.17049426, 0.19537082, 0.57809436, 0.3204774, 0.13701357, - 0.11459232, 0.37732843, 0.7576905, 1.1598037], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_p_s', DmapArray(name='x_p_s', value=np.array([27.449762, 22.105358, 14.306933, 8.666591, 14.804492, - 15.497991, -50., 5.655672, 2.4488459, 6.424003, - 7.2596107, 11.468881, 17.28569, 21.696486, 19.30399, - 22.296707, 20.5503, 18.966454, 17.411947, 17.832598, - 15.587591, 11.398707, 6.30129, 6.5174475], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_p_s_e', DmapArray(name='x_p_s_e', value=np.array([0.2303024, 0.29945874, 0.54957503, 0.3789636, 0.38615614, - 0.66818225, 0., 0.38068995, 0.7358919, 0.40694228, - 0.8647962, 0.33124682, 0.4084412, 0.11354841, 0.32705876, - 0.06472139, 0.1707116, 0.31454512, 0.2021999, 0.12369697, - 0.16541561, 0.31807196, 0.6204366, 0.8847257], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_v', DmapArray(name='x_v', value=np.array([281.97443, 223.11514, 221.63034, 197.44917, 188.27458, - 197.8503, 0., 247.33612, 210.60432, 305.89215, - 247.01543, 258.8349, 393.53342, 397.38754, 429.03232, - 501.37967, 551.29156, 536.06995, 514.34, 446.62015, - 366.91202, 322.7745, 242.80046, 106.463936], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_v_e', DmapArray(name='x_v_e', value=np.array([26.394007, 36.618652, 70.31171, 63.333218, 63.895203, - 144.26108, 0., 93.20139, 122.45326, 75.738655, - 229.64532, 56.638374, 65.40975, 55.844543, 70.64021, - 58.674725, 80.664215, 70.150505, 48.79837, 39.537964, - 73.53863, 119.14103, 78.47234, 83.04331], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_w_l', DmapArray(name='x_w_l', value=np.array([57.389225, 57.69733, 126.23592, 30.237602, 47.113304, - 58.984756, 0., 38.26878, -48.92362, 19.931614, - 260.41132, 42.224785, 44.766846, 36.143654, 82.68581, - 126.724434, 156.66393, 87.717186, 56.204193, 71.46811, - 70.74363, 101.99929, 0.3202165, -26.054714], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_w_l_e', DmapArray(name='x_w_l_e', value=np.array([19.230837, 16.294899, 15.168548, 26.129055, 31.24727, - 90.87292, 0., 27.570515, 40.068256, 25.276037, - 97.13555, 23.300837, 21.864376, 7.1030188, 13.769096, - 12.655528, 16.46391, 28.089544, 14.207863, 7.4522157, - 5.6516047, 22.447966, 31.974655, 40.390575], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_w_s', DmapArray(name='x_w_s', value=np.array([145.92664, 116.73225, 199.16847, 121.673805, 142.27568, - 233.33675, 0., 133.75916, -137.55725, 68.61652, - 418.2039, 112.81758, 101.29247, 104.3191, 157.19446, - 227.0272, 260.67654, 176.15086, 133.56267, 151.0875, - 148.78038, 190.15187, 11.559557, -22.508564], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_w_s_e', DmapArray(name='x_w_s_e', value=np.array([16.604748, 25.460632, 33.55762, 33.030075, 32.192673, - 73.7608, 0., 39.169834, 67.15969, 71.89186, - 104.778595, 32.13061, 39.87153, 9.046842, 18.910078, - 5.3034163, 15.238569, 18.197418, 12.990403, 9.309874, - 10.952014, 19.948631, 379.5419, 249.17317], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('phi0', DmapArray(name='phi0', value=np.array([1.399587, 1.9543043, -0.7224908, 2.0916905, 2.0584743, - 2.0382516, 0., 2.0375803, 2.335712, 1.8491666, - 2.056926, 2.4982245, -2.944642, -2.7769294, -2.580205, - -2.5932343, -2.6255465, -2.6566849, -2.5612776, -2.547088, - -2.4405823, -2.566693, -2.4519978, -2.4570632], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('phi0_e', DmapArray(name='phi0_e', value=np.array([0.24121854, 0.31576076, 0.5329399, 0.6017877, 0.5519327, - 0.8613009, 0., 0.7662122, 1.1292348, 0.63882476, - 0.9944896, 0.49388707, 0.6052921, 0.59674376, 0.6684763, - 0.36402082, 0.44081196, 0.6648605, 0.5068969, 0.3347635, - 0.68666506, 0.9222519, 0.85634404, 1.0981326], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('elv', DmapArray(name='elv', value=np.array([35.70254, 38.16125, 24.39799, 38.74954, 38.608, - 38.521618, 0., 38.518745, 39.77631, 37.705807, - 38.601395, 40.447994, 43.784958, 44.426586, 4.395376, - 3.9164848, 2.3389988, 44.882126, 5.0102973, 5.4258823, - 7.875571, 4.8423176, 7.650461, 7.5484366], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('elv_low', DmapArray(name='elv_low', value=np.array([36.789043, 39.50229, 27.634506, 41.24298, 40.90631, 42.068584, - 0., 41.6866, 44.269234, 40.405975, 42.668644, 42.435135, - 9.646016, 11.912934, 14.987502, 11.262804, 11.854093, 14.139045, - 13.439983, 11.490857, 16.53503, 17.530523, 17.956919, 19.9007], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('elv_high', DmapArray(name='elv_high', value=np.array([34.58656, 36.778984, 20.695374, 36.112648, 36.187763, 34.67364, - 0., 35.113194, 34.811623, 34.829647, 34.133892, 38.376377, - 41.403374, 42.10815, 42.60216, 43.7364, 43.314564, 42.314747, - 43.307514, 44.02605, 43.077705, 41.648342, 42.366947, 41.382183], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_sd_l', DmapArray(name='x_sd_l', value=np.array([0.1756741, 0.19235736, 0.10428195, 0.18796304, 0.21322642, - 0.3125638, 0., 0.16106041, 0.20110454, 0.17890598, - 0.32863578, 0.18474424, 0.23959318, 0.06693348, 0.14577192, - 0.10317358, 0.12183417, 0.22132954, 0.12958534, 0.08301932, - 0.04934168, 0.16750264, 0.24611072, 0.21731581], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_sd_s', DmapArray(name='x_sd_s', value=np.array([0.14324568, 0.22587489, 0.25398815, 0.16678365, 0.1868976, - 0.2501515, 0., 0.14932126, 0.21152444, 0.18535602, - 0.40078032, 0.1863737, 0.26176426, 0.06100182, 0.1913554, - 0.0508818, 0.13343154, 0.16805556, 0.10831408, 0.09524555, - 0.08642831, 0.16105707, 0.24610558, 0.2311904], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[24])), - ('x_sd_phi', - DmapArray(name='x_sd_phi', - value=np.array([0.4822196, 0.86454874, 0.9667692, - 0.91119283, 0.8720215, - 0.9923923, 0., 1.0889208, - 1.2291979, 1.0721695, - 2.2484603, 0.89813197, - 1.4335402, 1.0524737, 1.4957206, - 0.9566858, 1.1938425, 1.1054916, - 0.89014846, 0.88092315, - 1.284067, 1.7780174, 1.2080121, - 0.8936057], dtype=np.float32), - data_type=4, data_type_fmt='f', dimension=1, - shape=[24]))]), - OrderedDict([('radar.revision.major', DmapScalar(name='radar.revision.major', value=1, data_type=1, data_type_fmt='c')), - ('radar.revision.minor', DmapScalar(name='radar.revision.minor', value=18, data_type=1, data_type_fmt='c')), - ('origin.code', DmapScalar(name='origin.code', value=0, data_type=1, data_type_fmt='c')), - ('origin.time', DmapScalar(name='origin.time', value='Thu Feb 22 02:39:17 2018', data_type=9, data_type_fmt='s')), - ('origin.command', DmapScalar(name='origin.command', value='/home/dataman/rst/bin/make_fit -new 20180220.0201.00.rkn.rawacf', data_type=9, data_type_fmt='s')), - ('cp', DmapScalar(name='cp', value=3505, data_type=2, data_type_fmt='h')), - ('stid', DmapScalar(name='stid', value=65, data_type=2, data_type_fmt='h')), - ('time.yr', DmapScalar(name='time.yr', value=2018, data_type=2, data_type_fmt='h')), - ('time.mo', DmapScalar(name='time.mo', value=2, data_type=2, data_type_fmt='h')), - ('time.dy', DmapScalar(name='time.dy', value=20, data_type=2, data_type_fmt='h')), - ('time.hr', DmapScalar(name='time.hr', value=2, data_type=2, data_type_fmt='h')), - ('time.mt', DmapScalar(name='time.mt', value=43, data_type=2, data_type_fmt='h')), - ('time.sc', DmapScalar(name='time.sc', value=52, data_type=2, data_type_fmt='h')), - ('time.us', DmapScalar(name='time.us', value=443331, data_type=3, data_type_fmt='i')), - ('txpow', DmapScalar(name='txpow', value=9000, data_type=2, data_type_fmt='h')), - ('nave', DmapScalar(name='nave', value=29, data_type=2, data_type_fmt='h')), - ('atten', DmapScalar(name='atten', value=0, data_type=2, data_type_fmt='h')), - ('lagfr', DmapScalar(name='lagfr', value=1200, data_type=2, data_type_fmt='h')), - ('smsep', DmapScalar(name='smsep', value=300, data_type=2, data_type_fmt='h')), - ('ercod', DmapScalar(name='ercod', value=0, data_type=2, data_type_fmt='h')), - ('stat.agc', DmapScalar(name='stat.agc', value=0, data_type=2, data_type_fmt='h')), - ('stat.lopwr', DmapScalar(name='stat.lopwr', value=0, data_type=2, data_type_fmt='h')), - ('noise.search', DmapScalar(name='noise.search', value=12.143050193786621, data_type=4, data_type_fmt='f')), - ('noise.mean', DmapScalar(name='noise.mean', value=474406.125, data_type=4, data_type_fmt='f')), - ('channel', DmapScalar(name='channel', value=2, data_type=2, data_type_fmt='h')), - ('bmnum', DmapScalar(name='bmnum', value=0, data_type=2, data_type_fmt='h')), - ('bmazm', DmapScalar(name='bmazm', value=-18.59000015258789, data_type=4, data_type_fmt='f')), - ('scan', DmapScalar(name='scan', value=0, data_type=2, data_type_fmt='h')), - ('offset', DmapScalar(name='offset', value=0, data_type=2, data_type_fmt='h')), - ('rxrise', DmapScalar(name='rxrise', value=100, data_type=2, data_type_fmt='h')), - ('intt.sc', DmapScalar(name='intt.sc', value=3, data_type=2, data_type_fmt='h')), - ('intt.us', DmapScalar(name='intt.us', value=500000, data_type=3, data_type_fmt='i')), - ('txpl', DmapScalar(name='txpl', value=300, data_type=2, data_type_fmt='h')), - ('mpinc', DmapScalar(name='mpinc', value=2400, data_type=2, data_type_fmt='h')), - ('mppul', DmapScalar(name='mppul', value=7, data_type=2, data_type_fmt='h')), - ('mplgs', DmapScalar(name='mplgs', value=18, data_type=2, data_type_fmt='h')), - ('mplgexs', DmapScalar(name='mplgexs', value=0, data_type=2, data_type_fmt='h')), - ('ifmode', DmapScalar(name='ifmode', value=-1, data_type=2, data_type_fmt='h')), - ('nrang', DmapScalar(name='nrang', value=100, data_type=2, data_type_fmt='h')), - ('frang', DmapScalar(name='frang', value=180, data_type=2, data_type_fmt='h')), - ('rsep', DmapScalar(name='rsep', value=45, data_type=2, data_type_fmt='h')), - ('xcf', DmapScalar(name='xcf', value=1, data_type=2, data_type_fmt='h')), - ('tfreq', DmapScalar(name='tfreq', value=12423, data_type=2, data_type_fmt='h')), - ('mxpwr', DmapScalar(name='mxpwr', value=1073741824, data_type=3, data_type_fmt='i')), - ('lvmax', DmapScalar(name='lvmax', value=20000, data_type=3, data_type_fmt='i')), - ('combf', DmapScalar(name='combf', value='$Id: twofsound.c,v 1.04 2016/11/08 20:00:00 KKrieger Exp $', data_type=9, data_type_fmt='s')), - ('fitacf.revision.major', DmapScalar(name='fitacf.revision.major', value=5, data_type=3, data_type_fmt='i')), - ('fitacf.revision.minor', DmapScalar(name='fitacf.revision.minor', value=0, data_type=3, data_type_fmt='i')), - ('noise.sky', DmapScalar(name='noise.sky', value=15.399999618530273, data_type=4, data_type_fmt='f')), - ('noise.lag0', DmapScalar(name='noise.lag0', value=0.0, data_type=4, data_type_fmt='f')), - ('noise.vel', DmapScalar(name='noise.vel', value=0.0, data_type=4, data_type_fmt='f')), - ('ptab', DmapArray(name='ptab', value=np.array([0, 9, 12, 20, 22, 26, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[7])), - ('ltab', DmapArray(name='ltab', value=np.array([0, 0, 26, 27, 20, 22, 9, 12, 22, 26, 22, 27, 20, 26, 20, 27, 12, - 20, 0, 9, 12, 22, 9, 20, 0, 12, 9, 22, 12, 26, 12, 27, 9, 26, - 9, 27, 27, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=2, shape=[19, 2])), - ('pwr0', DmapArray(name='pwr0', value=np.array([3.3881855, 1.263465, 8.791779, 14.575084, - 15.58802, 19.181938, 15.222579, 10.763519, - 7.929372, 8.019291, 0.32587367, 0.32587367, - -3.0670712, -3.6797678, 0.32587367, 4.210053, - 2.83771, 0.05603877, -4.3933268, 0.8199222, - 2.034144, 1.4693303, -0.23167865, -6.3121824, - -3.0670712, -14.093695, -4.3933268, -6.3121824, - -7.725474, -5.2476287, -9.834007, -7.725474, - -0.23167865, 4.1017447, 1.8539128, 2.6884532, - 2.83771, 1.8539128, 4.5196576, 0.32587367, - 1.8539128, 2.373609, 3.8766713, 2.83771, - -0.5398181, -3.6797678, -1.6221485, -3.0670712, - -2.5302227, -5.2476287, -14.093695, -6.3121824, - -14.093695, -4.3933268, -9.834007, -2.0524948, - -9.834007, -50., -4.3933268, -14.093695, - -2.0524948, -9.834007, -7.725474, -6.3121824, - -7.725474, -4.3933268, -7.725474, -3.6797678, - -7.725474, -14.093695, -9.834007, -4.3933268, - -50., -3.0670712, -7.725474, -9.834007, - -0.5398181, -4.3933268, -50., -14.093695, - -9.834007, -6.3121824, -50., -5.2476287, - -6.3121824, -9.834007, -1.6221485, -4.3933268, - -2.0524948, -2.5302227, -3.6797678, -4.3933268, - -6.3121824, -14.093695, -5.2476287, -50., - -3.6797678, -3.6797678, -4.3933268, 8.678576], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[100])), - ('slist', DmapArray(name='slist', value=np.array([0, 4, 5, 6, 7, 8, 9, 15, 36, 38, 41, 43], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[12])), - ('nlag', DmapArray(name='nlag', value=np.array([6, 11, 5, 13, 10, 15, 14, 8, 6, 5, 6, 6], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[12])), - ('qflg', DmapArray(name='qflg', value=np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], np.int8), data_type=1, data_type_fmt='c', dimension=1, shape=[12])), - ('gflg', DmapArray(name='gflg', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], np.int8), data_type=1, data_type_fmt='c', dimension=1, shape=[12])), - ('p_l', DmapArray(name='p_l', value=np.array([3.5497692, 15.219805, 19.058012, 14.784413, 10.281843, - 6.939279, 7.670358, 5.8116884, 3.3686848, 4.8680186, - 2.7661672, 4.165058], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('p_l_e', DmapArray(name='p_l_e', value=np.array([0.4204376, 0.3505618, 0.3253947, 0.36781773, 0.5577228, - 0.4022448, 0.25193536, 0.60134286, np.inf, np.inf, - 0.3410064, 0.47262317], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('p_s', DmapArray(name='p_s', value=np.array([3.210243, 14.588972, 18.60333, 14.040471, 9.683641, - 6.422316, 7.34638, 5.332991, 3.1633725, 4.8680186, - 2.541066, 3.9029372], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('p_s_e', DmapArray(name='p_s_e', value=np.array([0.6084755, 0.43360505, 0.6442308, 0.3823753, 0.635267, - 0.4464058, 0.24834335, 0.43611935, np.inf, np.inf, - 0.44715923, 0.26666653], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('v', DmapArray(name='v', value=np.array([-104.39679, -342.97348, -285.34897, -251.2897, -184.85536, - -305.7072, -312.8774, -113.41999, -207.84285, -233.70502, - -256.89438, -245.66766], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('v_e', DmapArray(name='v_e', value=np.array([-9.114674, -8.124575, -31.326744, -9.795714, 16.097227, - 7.834782, -3.636186, 23.887688, -33.519596, -19.189497, - 18.326107, 10.769966], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('w_l', DmapArray(name='w_l', value=np.array([115.201546, 107.62786, 464.26938, 114.610535, 185.66608, - 82.26722, 39.18749, 124.76609, 106.327774, 560.7009, - 75.70222, 95.38054], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('w_l_e', DmapArray(name='w_l_e', value=np.array([26.75211, 18.443213, 64.782196, 20.40742, 46.594242, 19.587702, - 10.786126, 43.510963, np.inf, np.inf, 21.613358, 27.325829], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('w_s', DmapArray(name='w_s', value=np.array([200.20377, 154.28627, 551.15564, 160.30864, 248.93988, 128.84338, - 89.82784, 213.72595, 235.80905, 475.4645, 166.03622, 200.64261], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('w_s_e', DmapArray(name='w_s_e', value=np.array([41.936104, 23.068935, 96.47285, 21.24448, 49.238255, 25.204145, - 18.666155, 30.81735, np.inf, np.inf, 37.603992, 17.433638], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('sd_l', DmapArray(name='sd_l', value=np.array([0.17549379, 0.22083001, 0.18090267, 0.2481737, 0.355894, - 0.2719005, 0.14545113, 0.2891923, np.inf, np.inf, - 0.12042583, 0.17959179], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('sd_s', DmapArray(name='sd_s', value=np.array([0.2729755, 0.31548944, 0.38025123, 0.31500262, 0.45055687, - 0.34171918, 0.17246605, 0.25702748, np.inf, np.inf, - 0.17277695, 0.1193686], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('sd_phi', DmapArray(name='sd_phi', value=np.array([0.18365021, 0.25823486, 0.1979715, 0.33172324, 0.34346697, - 0.31707346, 0.14914487, 0.49632668, 0.58580476, 0.2802783, - 0.38193268, 0.21990536], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_qflg', DmapArray(name='x_qflg', value=np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], np.int8), data_type=1, data_type_fmt='c', dimension=1, shape=[12])), - ('x_gflg', DmapArray(name='x_gflg', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], np.int8), data_type=1, data_type_fmt='c', dimension=1, shape=[12])), - ('x_p_l', DmapArray(name='x_p_l', value=np.array([0.89324456, 16.801666, 18.62557, 14.448944, 9.817669, - 6.69979, 6.4301286, 6.5051303, 2.654736, 3.9768033, - -0.6938298, 3.1957011], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_p_l_e', DmapArray(name='x_p_l_e', value=np.array([1.05346, 0.373323, 0.42180446, 0.6168531, 0.40609515, - 0.5390204, 0.43419337, 1.3868219, 0.95508665, 0.30156177, - 0.30076468, 0.8342631], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_p_s', DmapArray(name='x_p_s', value=np.array([0.967382, 16.105404, 18.05176, 14.224932, 9.380045, - 6.254807, 6.426912, 6.212974, 2.5523796, 3.631779, - -0.75107485, 3.1319592], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_p_s_e', DmapArray(name='x_p_s_e', value=np.array([0.8583297, 0.4714994, 0.5957066, 0.57107013, 0.62998855, - 0.5534169, 0.33480978, 0.977634, 0.63024247, 0.5643229, - 0.30037746, 0.5892786], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_v', DmapArray(name='x_v', value=np.array([-119.49145, -328.7751, -298.08453, -211.84265, -348.66498, - -433.93707, -303.01135, -120.90141, -244.6152, -355.99246, - -313.2477, -246.9257], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_v_e', DmapArray(name='x_v_e', value=np.array([55.02978, 71.10144, 137.32585, 166.15111, 560.4914, - 77.48594, 26.329714, 77.8307, 119.75101, 144.00725, - 101.63227, 43.31267], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_w_l', DmapArray(name='x_w_l', value=np.array([-2.9401755, 145.45688, 230.3764, 84.676094, 451.35312, - 75.04602, -1.385049, 85.661934, 62.407505, 131.11426, - 11.158009, 42.414925], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_w_l_e', DmapArray(name='x_w_l_e', value=np.array([44.685745, 23.483494, 36.533936, 52.30831, 88.28202, 25.552269, - 14.792147, 86.05524, 49.034096, 23.320967, 13.812058, 40.330265], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_w_s', DmapArray(name='x_w_s', value=np.array([17.663244, 181.19942, 274.58835, 220.84924, 631.99927, - 130.5851, -22.957256, 181.46843, 171.9126, 213.20656, - 61.037247, 139.12025], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_w_s_e', DmapArray(name='x_w_s_e', value=np.array([411.7451, 25.797867, 40.459, 80.37043, 120.65318, - 32.736336, 74.18374, 64.1738, 42.973003, 43.801407, - 51.02822, 45.003693], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('phi0', DmapArray(name='phi0', value=np.array([1.0006866, 2.4803083, 2.5298276, 2.3434021, 2.4804325, 2.5325048, - 2.169191, 2.236938, 1.9520159, 1.4018124, 2.1937125, 1.0845904], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('phi0_e', DmapArray(name='phi0_e', value=np.array([0.5965372, 0.53425974, 0.73015106, 0.90231866, 1.1873266, - 0.75273883, 0.35550907, 0.5863736, 1.0741612, 0.8912153, - 1.0134457, 0.41260323], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('elv', DmapArray(name='elv', value=np.array([36.92941, 15.8056345, 16.163155, 14.772609, 15.8065405, - 16.18226, 13.343854, 13.91679, 11.314536, 1.2040502, - 13.554012, 37.19182], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('elv_low', DmapArray(name='elv_low', value=np.array([6.809374, 19.3193, 20.736443, 20.656742, 22.900055, 20.876936, - 16.126497, 18.139124, 19.388645, 14.37398, 20.439638, 4.834197], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('elv_high', DmapArray(name='elv_high', value=np.array([35.00545, 11.25364, 9.640776, 3.2362866, 37.835796, - 9.40011, 9.806536, 7.6573696, 36.541744, 35.356617, - 37.48873, 35.88235], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_sd_l', DmapArray(name='x_sd_l', value=np.array([0.28318468, 0.26670623, 0.29874006, 0.24475327, 0.1948397, - 0.3278357, 0.1807695, 0.4866734, 0.29503337, 0.12113429, - 0.0754123, 0.24887906], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_sd_s', DmapArray(name='x_sd_s', value=np.array([0.28335696, 0.38254797, 0.45298725, 0.25643772, 0.32724318, - 0.3764938, 0.18062629, 0.42809662, 0.24934997, 0.24624465, - 0.07997479, 0.22335777], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12])), - ('x_sd_phi', DmapArray(name='x_sd_phi', value=np.array([0.78556406, 1.7383693, 2.2458427, 1.554859, 2.4740252, - 1.9882897, 0.68696094, 1.1805041, 1.4410603, 1.7740515, - 1.4178867, 0.5345671], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[12]))])] diff --git a/tests/unit/grid_data_sets.py b/tests/unit/grid_data_sets.py deleted file mode 100644 index 011f29f..0000000 --- a/tests/unit/grid_data_sets.py +++ /dev/null @@ -1,263 +0,0 @@ -# Copyright (C) 2019 SuperDARN -# Author: Marina Schmidt - -""" -Test data sets for DmapWrite -""" -import numpy as np - -from collections import OrderedDict - -from pydarnio import DmapScalar, DmapArray - -grid_data = \ - [OrderedDict([('start.year', - DmapScalar(name='start.year', value=2018, data_type=2, data_type_fmt='h')), - ('start.month', DmapScalar(name='start.month', value=2, data_type=2, data_type_fmt='h')), - ('start.day', DmapScalar(name='start.day', value=20, data_type=2, data_type_fmt='h')), - ('start.hour', DmapScalar(name='start.hour', value=0, data_type=2, data_type_fmt='h')), - ('start.minute', DmapScalar(name='start.minute', value=6, data_type=2, data_type_fmt='h')), - ('start.second', DmapScalar(name='start.second', value=0.0040569305419921875, data_type=8, data_type_fmt='d')), - ('end.year', DmapScalar(name='end.year', value=2018, data_type=2, data_type_fmt='h')), - ('end.month', DmapScalar(name='end.month', value=2, data_type=2, data_type_fmt='h')), - ('end.day', DmapScalar(name='end.day', value=20, data_type=2, data_type_fmt='h')), - ('end.hour', DmapScalar(name='end.hour', value=0, data_type=2, data_type_fmt='h')), - ('end.minute', DmapScalar(name='end.minute', value=8, data_type=2, data_type_fmt='h')), - ('end.second', DmapScalar(name='end.second', value=0.0040569305419921875, data_type=8, data_type_fmt='d')), - ('stid', DmapArray(name='stid', value=np.array([65], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('channel', DmapArray(name='channel', value=np.array([0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('nvec', DmapArray(name='nvec', value=np.array([45], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('freq', DmapArray(name='freq', value=np.array([11348.719], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('major.revision', DmapArray(name='major.revision', value=np.array([2], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('minor.revision', DmapArray(name='minor.revision', value=np.array([0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('program.id', DmapArray(name='program.id', value=np.array([3505], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('noise.mean', DmapArray(name='noise.mean', value=np.array([10.59375], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('noise.sd', DmapArray(name='noise.sd', value=np.array([1.5636357], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('gsct', DmapArray(name='gsct', value=np.array([1], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('v.min', DmapArray(name='v.min', value=np.array([35.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('v.max', DmapArray(name='v.max', value=np.array([2500.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('p.min', DmapArray(name='p.min', value=np.array([3.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('p.max', DmapArray(name='p.max', value=np.array([60.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('w.min', DmapArray(name='w.min', value=np.array([10.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('w.max', DmapArray(name='w.max', value=np.array([1000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('ve.min', DmapArray(name='ve.min', value=np.array([0.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('ve.max', DmapArray(name='ve.max', value=np.array([200.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('vector.mlat', DmapArray(name='vector.mlat', value=np.array([72.5, 73.5, 74.5, 79.5, 79.5, 80.5, 73.5, 74.5, 80.5, 72.5, 79.5, - 80.5, 82.5, 82.5, 83.5, 81.5, 84.5, 82.5, 80.5, 81.5, 79.5, 81.5, - 73.5, 80.5, 83.5, 79.5, 80.5, 81.5, 82.5, 83.5, 79.5, 81.5, 72.5, - 80.5, 78.5, 79.5, 80.5, 79.5, 80.5, 73.5, 74.5, 78.5, 79.5, 78.5, - 79.5], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[45])), - ('vector.mlon', DmapArray(name='vector.mlon', value=np.array([335., 333.52942, 331.875, 319.0909, 313.63635, - 308.1356, 337.05884, 335.625, 314.23727, 338.33334, - 324.54544, 320.339, 310.21277, 317.87234, 311.7073, - 329.43396, 313.7143, 333.1915, 338.64407, 336.2264, - 340.9091, 343.01886, 340.58823, 344.74576, 346.82925, - 346.36365, 350.84744, 349.8113, 356.17023, 355.60974, - 351.81818, 356.60376, 341.66666, 356.94916, 352.5, - 357.27274, 3.0508475, 2.7272727, 9.152542, 344.11765, - 346.875, 2.5, 8.181818, 7.5, 13.636364], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[45])), - ('vector.kvect', DmapArray(name='vector.kvect', value=np.array([150.48602, 150.38976, 149.73271, -44.11724, -48.90261, - -52.720737, 168.25351, 159.23058, -44.17332, 174.83675, - 149.24484, 145.81033, 133.7058, 143.56154, 139.32442, - 166.77945, 143.30453, 175.14447, 179.95691, 175.5118, - -172.71599, -172.94543, -163.22404, -167.09595, -164.52101, - -161.34946, -155.4211, -159.47032, -153.30176, -153.61163, - -149.5504, -146.24246, -149.24686, -143.59334, -142.18036, - -138.36761, -132.77902, -129.27661, -123.71623, -143.01823, - -140.66672, -125.94862, -121.524704, -120.69907, -114.96321], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[45])), - ('vector.stid', DmapArray(name='vector.stid', value=np.array([65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[45])), - ('vector.channel', DmapArray(name='vector.channel', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[45])), - ('vector.index', DmapArray(name='vector.index', value=np.array([72100, 73094, 74088, 79058, 79057, 80050, 73095, 74089, 80051, - 72101, 79059, 80052, 82040, 82041, 83035, 81048, 84030, 82043, - 80055, 81049, 79062, 81050, 73096, 80056, 83039, 79063, 80057, - 81051, 82046, 83040, 79064, 81052, 72102, 80058, 78070, 79065, - 80000, 79000, 80001, 73097, 74092, 78000, 79001, 78001, 79002], - dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[45])), - ('vector.vel.median', DmapArray(name='vector.vel.median', value=np.array([211.40865, 287.75946, 230.77419, 187.97984, 257.93872, - 260.47934, 178.85757, 232.12292, 237.11732, 157.37292, - 122.41863, 100.79391, 46.440826, 54.64365, 61.027603, - 90.12276, 114.797516, 106.21644, 172.39407, 132.68246, - 205.91148, 207.2965, 116.40394, 219.84409, 223.87404, - 234.68289, 242.02846, 253.77455, 248.37881, 231.41563, - 215.56255, 250.5544, 103.61616, 230.06058, 220.61739, - 232.87077, 236.41026, 244.11392, 243.74884, 66.45725, - 60.761314, 239.27852, 245.77727, 253.88075, 260.77255], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[45])), - ('vector.vel.sd', DmapArray(name='vector.vel.sd', value=np.array([31.622776, 35.35534, 35.35534, 63.331505, 40.82483, - 50., 17.149858, 25.897175, 57.988403, 21.821789, - 53.313816, 130.36421, 57.735027, 50., 50., - 50., 70.71068, 50., 28.867514, 50., - 44.72136, 40.82483, 18.898224, 44.72136, 44.72136, - 40.82483, 35.35534, 70.71068, 57.735027, 70.71068, - 50., 50., 30.151134, 28.867514, 57.735027, - 35.35534, 35.35534, 31.622776, 50., 40.82483, - 50., 44.72136, 40.82483, 50., 44.72136], - dtype=np.float32), data_type=4, data_type_fmt='f', - dimension=1, shape=[45]))]), - OrderedDict([('start.year', DmapScalar(name='start.year', value=2018, data_type=2, data_type_fmt='h')), - ('start.month', DmapScalar(name='start.month', value=2, data_type=2, data_type_fmt='h')), - ('start.day', DmapScalar(name='start.day', value=20, data_type=2, data_type_fmt='h')), - ('start.hour', DmapScalar(name='start.hour', value=13, data_type=2, data_type_fmt='h')), - ('start.minute', DmapScalar(name='start.minute', value=23, data_type=2, data_type_fmt='h')), - ('start.second', DmapScalar(name='start.second', value=0.011981964111328125, data_type=8, data_type_fmt='d')), - ('end.year', DmapScalar(name='end.year', value=2018, data_type=2, data_type_fmt='h')), - ('end.month', DmapScalar(name='end.month', value=2, data_type=2, data_type_fmt='h')), - ('end.day', DmapScalar(name='end.day', value=20, data_type=2, data_type_fmt='h')), - ('end.hour', DmapScalar(name='end.hour', value=13, data_type=2, data_type_fmt='h')), - ('end.minute', DmapScalar(name='end.minute', value=25, data_type=2, data_type_fmt='h')), - ('end.second', DmapScalar(name='end.second', value=0.011981964111328125, data_type=8, data_type_fmt='d')), - ('stid', DmapArray(name='stid', value=np.array([65], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('channel', DmapArray(name='channel', value=np.array([0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('nvec', DmapArray(name='nvec', value=np.array([32], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('freq', DmapArray(name='freq', value=np.array([11355.719], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('major.revision', DmapArray(name='major.revision', value=np.array([2], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('minor.revision', DmapArray(name='minor.revision', value=np.array([0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('program.id', DmapArray(name='program.id', value=np.array([3505], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('noise.mean', DmapArray(name='noise.mean', value=np.array([14.8125], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('noise.sd', DmapArray(name='noise.sd', value=np.array([5.087161], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('gsct', DmapArray(name='gsct', value=np.array([1], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('v.min', DmapArray(name='v.min', value=np.array([35.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('v.max', DmapArray(name='v.max', value=np.array([2500.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('p.min', DmapArray(name='p.min', value=np.array([3.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('p.max', DmapArray(name='p.max', value=np.array([60.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('w.min', DmapArray(name='w.min', value=np.array([10.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('w.max', DmapArray(name='w.max', value=np.array([1000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('ve.min', DmapArray(name='ve.min', value=np.array([0.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('ve.max', DmapArray(name='ve.max', value=np.array([200.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('vector.mlat', DmapArray(name='vector.mlat', value=np.array([75.5, 76.5, 77.5, 79.5, 74.5, 75.5, 76.5, 77.5, 83.5, 84.5, 84.5, - 85.5, 76.5, 77.5, 86.5, 86.5, 75.5, 74.5, 76.5, 75.5, 74.5, 78.5, - 75.5, 77.5, 76.5, 78.5, 77.5, 73.5, 74.5, 75.5, 76.5, 77.5], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[32])), - ('vector.mlon', DmapArray(name='vector.mlon', value=np.array([330., 327.85715, 325.3846, 313.63635, 335.625, 334., - 332.14285, 330., 267.80487, 272.57144, 262.2857, 263.57144, - 336.42856, 334.6154, 270., 253.63637, 338., 339.375, - 340.7143, 342., 343.125, 347.5, 346., 348.46155, - 349.2857, 352.5, 353.07693, 344.11765, 346.875, 350., - 353.57144, 357.69232], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[32])), - ('vector.kvect', DmapArray(name='vector.kvect', value=np.array([148.69537, 141.54613, 142.8571, 131.84319, 170.03053, - 160.40012, 157.37341, 89.2536, -93.46017, -87.30513, - -92.89313, -85.86758, 8.765994, -11.932242, -77.360016, - -86.02396, 141.57924, 17.019497, 6.932431, 17.441008, - 25.992363, 27.482807, 32.788364, 31.261826, 36.400013, - 37.104523, 41.330643, 37.179756, 38.110252, 41.75692, - 45.872223, 49.977745], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[32])), - ('vector.stid', DmapArray(name='vector.stid', value=np.array([65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[32])), - ('vector.channel', DmapArray(name='vector.channel', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[32])), - ('vector.index', DmapArray(name='vector.index', value=np.array([75082, 76076, 77070, 79057, 74089, 75083, 76077, 77071, 83030, - 84026, 84025, 85020, 76078, 77072, 86016, 86015, 75084, 74090, - 76079, 75085, 74091, 78069, 75086, 77075, 76081, 78070, 77076, - 73097, 74092, 75087, 76082, 77077], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[32])), - ('vector.vel.median', DmapArray(name='vector.vel.median', value=np.array([86.22557, 55.99529, 77.1204, 138.94217, 53.439465, - 83.13799, 65.69839, 8.872497, 140.93784, 136.43436, - 125.74353, 107.80217, 10.187439, 137.04274, 118.45908, - 98.89083, 5.5379543, 81.491165, 50.020416, 95.97311, - 182.38617, 154.7921, 158.80106, 146.97353, 85.35316, - 205.68631, 121.89034, 218.41821, 200.13217, 186.16425, - 74.23934, 202.2707], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[32])), - ('vector.vel.sd', DmapArray(name='vector.vel.sd', value=np.array([31.622776, 45.96998, 57.735027, 70.71068, 22.96239, 25.858837, - 33.51713, 53.530884, 70.71068, 70.71068, 50., 40.82483, - 23.570227, 31.957285, 57.735027, 70.71068, 22.566723, 27.893995, - 23.570227, 26.726124, 22.094053, 74.42324, 22.941574, 37.93341, - 27.748476, 49.585766, 31.773098, 58.097965, 31.622776, 35.35534, - 31.622776, 34.513107], dtype=np.float32), data_type=4, - data_type_fmt='f', dimension=1, - shape=[32]))]), - OrderedDict([('start.year', DmapScalar(name='start.year', value=2018, data_type=2, data_type_fmt='h')), - ('start.month', DmapScalar(name='start.month', value=2, data_type=2, data_type_fmt='h')), - ('start.day', DmapScalar(name='start.day', value=20, data_type=2, data_type_fmt='h')), - ('start.hour', DmapScalar(name='start.hour', value=23, data_type=2, data_type_fmt='h')), - ('start.minute', DmapScalar(name='start.minute', value=50, data_type=2, data_type_fmt='h')), - ('start.second', DmapScalar(name='start.second', value=0.025077104568481445, data_type=8, data_type_fmt='d')), - ('end.year', DmapScalar(name='end.year', value=2018, data_type=2, data_type_fmt='h')), - ('end.month', DmapScalar(name='end.month', value=2, data_type=2, data_type_fmt='h')), - ('end.day', DmapScalar(name='end.day', value=20, data_type=2, data_type_fmt='h')), - ('end.hour', DmapScalar(name='end.hour', value=23, data_type=2, data_type_fmt='h')), - ('end.minute', DmapScalar(name='end.minute', value=52, data_type=2, data_type_fmt='h')), - ('end.second', DmapScalar(name='end.second', value=0.025077104568481445, data_type=8, data_type_fmt='d')), - ('stid', DmapArray(name='stid', value=np.array([65], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('channel', DmapArray(name='channel', value=np.array([0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('nvec', DmapArray(name='nvec', value=np.array([48], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('freq', DmapArray(name='freq', value=np.array([11333.656], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('major.revision', DmapArray(name='major.revision', value=np.array([2], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('minor.revision', DmapArray(name='minor.revision', value=np.array([0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('program.id', DmapArray(name='program.id', value=np.array([3505], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('noise.mean', DmapArray(name='noise.mean', value=np.array([12.53125], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('noise.sd', DmapArray(name='noise.sd', value=np.array([1.5820909], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('gsct', DmapArray(name='gsct', value=np.array([1], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[1])), - ('v.min', DmapArray(name='v.min', value=np.array([35.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('v.max', DmapArray(name='v.max', value=np.array([2500.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('p.min', DmapArray(name='p.min', value=np.array([3.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('p.max', DmapArray(name='p.max', value=np.array([60.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('w.min', DmapArray(name='w.min', value=np.array([10.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('w.max', DmapArray(name='w.max', value=np.array([1000.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('ve.min', DmapArray(name='ve.min', value=np.array([0.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('ve.max', DmapArray(name='ve.max', value=np.array([200.], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[1])), - ('vector.mlat', DmapArray(name='vector.mlat', value=np.array([79.5, 79.5, 80.5, 79.5, 80.5, 81.5, 80.5, 81.5, 82.5, 80.5, 81.5, - 82.5, 82.5, 83.5, 84.5, 80.5, 81.5, 83.5, 84.5, 81.5, 82.5, 84.5, - 82.5, 83.5, 84.5, 80.5, 81.5, 82.5, 83.5, 84.5, 81.5, 82.5, 83.5, - 80.5, 81.5, 82.5, 83.5, 80.5, 81.5, 82.5, 80.5, 81.5, 81.5, 79.5, - 80.5, 80.5, 79.5, 79.5], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[48])), - ('vector.mlon', DmapArray(name='vector.mlon', value=np.array([319.0909, 313.63635, 314.23727, 324.54544, 320.339, - 315.84906, 326.44067, 322.6415, 317.87234, 332.54236, - 329.43396, 325.53192, 333.1915, 329.26828, 324., - 338.64407, 336.2264, 338.04877, 334.2857, 343.01886, - 340.85107, 344.57144, 348.51065, 346.82925, 354.85715, - 350.84744, 349.8113, 356.17023, 355.60974, 5.142857, - 356.60376, 3.8297873, 4.390244, 356.94916, 3.3962264, - 11.489362, 13.170732, 3.0508475, 10.18868, 19.148935, - 9.152542, 16.981133, 23.773584, 8.181818, 15.254237, - 21.355932, 13.636364, 19.09091], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[48])), - ('vector.kvect', DmapArray(name='vector.kvect', value=np.array([1.3776143e+02, 1.3067482e+02, 1.3548923e+02, 1.5051083e+02, - 1.4419740e+02, 1.4045711e+02, 1.5574120e+02, 1.5187080e+02, - 1.4506064e+02, 1.6567052e+02, 1.6373940e+02, 1.5515234e+02, - -5.0249748e+00, -1.6617077e+01, -1.8794113e+01, 1.7961696e+02, - 1.7558623e+02, -8.2697503e-02, -6.7042108e+00, 9.9063320e+00, - 4.3262248e+00, 6.0504212e+00, 1.6758739e+01, 1.5605538e+01, - 2.2159294e+01, 2.5681110e+01, 2.0525904e+01, 2.8494555e+01, - 2.7147511e+01, 3.3622570e+01, 3.1760328e+01, 4.1792263e+01, - 3.9918575e+01, 3.5687832e+01, 4.3404911e+01, 5.2630638e+01, - 5.2512428e+01, 4.8060982e+01, 5.4476559e+01, 6.0645481e+01, - 5.5574818e+01, 6.2865593e+01, 7.1008202e+01, 5.8256989e+01, - 6.3870285e+01, 7.1036896e+01, 6.4951691e+01, 7.0386543e+01], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[48])), - ('vector.stid', DmapArray(name='vector.stid', value=np.array([65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65], - dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[48])), - ('vector.channel', DmapArray(name='vector.channel', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[48])), - ('vector.index', DmapArray(name='vector.index', value=np.array([79058, 79057, 80051, 79059, 80052, 81046, 80053, 81047, 82041, - 80054, 81048, 82042, 82043, 83037, 84031, 80055, 81049, 83038, - 84032, 81050, 82044, 84033, 82045, 83039, 84034, 80057, 81051, - 82046, 83040, 84000, 81052, 82000, 83000, 80058, 81000, 82001, - 83001, 80000, 81001, 82002, 80001, 81002, 81003, 79001, 80002, - 80003, 79002, 79003], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[48])), - ('vector.vel.median', DmapArray(name='vector.vel.median', value=np.array([168.87584, 378.16104, 390.48422, 264.72037, 340.24277, - 261.96246, 166.4799, 175.58917, 170.59193, 100.241035, - 117.02003, 113.83192, 110.63128, 124.69313, 85.883835, - 59.58456, 29.183453, 149.87598, 87.57454, 106.41398, - 144.1112, 100.86157, 209.35103, 177.68849, 153.74188, - 261.6218, 219.8409, 224.89569, 188.59256, 165.06386, - 293.19037, 210.94766, 194.56616, 271.47748, 303.23712, - 199.45433, 204.04663, 253.03906, 293.68582, 228.18443, - 280.49426, 255.60298, 223.19438, 196.14743, 268.67493, - 253.27917, 202.5746, 262.70676], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[48])), - ('vector.vel.sd', DmapArray(name='vector.vel.sd', value=np.array([65.60137, 56.20039, 39.431385, 52.887394, 69.346954, 43.638535, - 52.373154, 39.7046, 39.206783, 44.322094, 31.622776, 39.10426, - 42.038414, 50., 44.72136, 35.902393, 50.005493, 28.867514, - 40.82483, 32.031635, 40.82483, 40.82483, 40.82483, 40.82483, - 35.35534, 48.513336, 41.15344, 35.35534, 40.82483, 44.72136, - 35.531113, 35.35534, 35.35534, 36.263626, 35.35534, 40.82483, - 40.82483, 40.907024, 35.35534, 40.82483, 40.82483, 40.82483, - 40.82483, 40.82483, 50., 35.35534, 44.72136, 57.735027], - dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[48]))])] diff --git a/tests/unit/iqdat_data_sets.py b/tests/unit/iqdat_data_sets.py deleted file mode 100644 index 1648d55..0000000 --- a/tests/unit/iqdat_data_sets.py +++ /dev/null @@ -1,248 +0,0 @@ -# Copyright (C) 2019 SuperDARN -# Author: Marina Schmidt - -""" -Test data sets for DmapWrite -""" -import numpy as np - -from collections import OrderedDict - -from pydarnio import DmapScalar, DmapArray -iqdat_data = [OrderedDict([ - ('radar.revision.major', DmapScalar(name='radar.revision.major', - value=1, data_type=1, - data_type_fmt='c')), - ('radar.revision.minor', DmapScalar(name='radar.revision.minor', value=17, data_type=1, data_type_fmt='c')), - ('origin.code', DmapScalar(name='origin.code', value=0, data_type=1, data_type_fmt='c')), - ('origin.time', DmapScalar(name='origin.time', value='Wed Mar 16 19:45:04 2016', data_type=9, data_type_fmt='s')), - ('origin.command', DmapScalar(name='origin.command', value='', data_type=9, data_type_fmt='s')), - ('cp', DmapScalar(name='cp', value=-3560, data_type=2, data_type_fmt='h')), - ('stid', DmapScalar(name='stid', value=65, data_type=2, data_type_fmt='h')), - ('time.yr', DmapScalar(name='time.yr', value=2016, data_type=2, data_type_fmt='h')), - ('time.mo', DmapScalar(name='time.mo', value=3, data_type=2, data_type_fmt='h')), - ('time.dy', DmapScalar(name='time.dy', value=16, data_type=2, data_type_fmt='h')), - ('time.hr', DmapScalar(name='time.hr', value=19, data_type=2, data_type_fmt='h')), - ('time.mt', DmapScalar(name='time.mt', value=45, data_type=2, data_type_fmt='h')), - ('time.sc', DmapScalar(name='time.sc', value=1, data_type=2, data_type_fmt='h')), - ('time.us', DmapScalar(name='time.us', value=277995, data_type=3, data_type_fmt='i')), - ('txpow', DmapScalar(name='txpow', value=9000, data_type=2, data_type_fmt='h')), - ('nave', DmapScalar(name='nave', value=16, data_type=2, data_type_fmt='h')), - ('atten', DmapScalar(name='atten', value=0, data_type=2, data_type_fmt='h')), - ('lagfr', DmapScalar(name='lagfr', value=600, data_type=2, data_type_fmt='h')), - ('smsep', DmapScalar(name='smsep', value=100, data_type=2, data_type_fmt='h')), - ('ercod', DmapScalar(name='ercod', value=0, data_type=2, data_type_fmt='h')), - ('stat.agc', DmapScalar(name='stat.agc', value=0, data_type=2, data_type_fmt='h')), - ('stat.lopwr', DmapScalar(name='stat.lopwr', value=0, data_type=2, data_type_fmt='h')), - ('noise.search', DmapScalar(name='noise.search', value=1478.2957763671875, data_type=4, data_type_fmt='f')), - ('noise.mean', DmapScalar(name='noise.mean', value=456224.625, data_type=4, data_type_fmt='f')), - ('channel', DmapScalar(name='channel', value=0, data_type=2, data_type_fmt='h')), - ('bmnum', DmapScalar(name='bmnum', value=7, data_type=2, data_type_fmt='h')), - ('bmazm', DmapScalar(name='bmazm', value=4.090000152587891, data_type=4, data_type_fmt='f')), - ('scan', DmapScalar(name='scan', value=1, data_type=2, data_type_fmt='h')), - ('offset', DmapScalar(name='offset', value=0, data_type=2, data_type_fmt='h')), - ('rxrise', DmapScalar(name='rxrise', value=100, data_type=2, data_type_fmt='h')), - ('intt.sc', DmapScalar(name='intt.sc', value=2, data_type=2, data_type_fmt='h')), - ('intt.us', DmapScalar(name='intt.us', value=900000, data_type=3, data_type_fmt='i')), - ('txpl', DmapScalar(name='txpl', value=100, data_type=2, data_type_fmt='h')), - ('mpinc', DmapScalar(name='mpinc', value=2400, data_type=2, data_type_fmt='h')), - ('mppul', DmapScalar(name='mppul', value=7, data_type=2, data_type_fmt='h')), - ('mplgs', DmapScalar(name='mplgs', value=18, data_type=2, data_type_fmt='h')), - ('nrang', DmapScalar(name='nrang', value=75, data_type=2, data_type_fmt='h')), - ('frang', DmapScalar(name='frang', value=90, data_type=2, data_type_fmt='h')), - ('rsep', DmapScalar(name='rsep', value=15, data_type=2, data_type_fmt='h')), - ('xcf', DmapScalar(name='xcf', value=1, data_type=2, data_type_fmt='h')), - ('tfreq', DmapScalar(name='tfreq', value=12275, data_type=2, data_type_fmt='h')), - ('mxpwr', DmapScalar(name='mxpwr', value=1073741824, data_type=3, data_type_fmt='i')), - ('lvmax', DmapScalar(name='lvmax', value=20000, data_type=3, data_type_fmt='i')), - ('iqdata.revision.major', DmapScalar(name='iqdata.revision.major', value=0, data_type=3, data_type_fmt='i')), - ('iqdata.revision.minor', DmapScalar(name='iqdata.revision.minor', value=0, data_type=3, data_type_fmt='i')), - ('combf', DmapScalar(name='combf', value='$Id: multifonebm.c,v 1.0 2016/01/19 18:00:00 KKrieger Exp $', data_type=9, data_type_fmt='s')), - ('seqnum', DmapScalar(name='seqnum', value=16, data_type=3, data_type_fmt='i')), - ('chnnum', DmapScalar(name='chnnum', value=2, data_type=3, data_type_fmt='i')), - ('smpnum', DmapScalar(name='smpnum', value=729, data_type=3, data_type_fmt='i')), - ('skpnum', DmapScalar(name='skpnum', value=7, data_type=3, data_type_fmt='i')), - ('ptab', DmapArray(name='ptab', value=np.array([0, 9, 12, 20, 22, 26, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[7])), - ('ltab', DmapArray(name='ltab', value=np.array([0, 0, 26, 27, 20, 22, 9, 12, 22, 26, 22, 27, 20, 26, 20, 27, 12, - 20, 0, 9, 12, 22, 9, 20, 0, 12, 9, 22, 12, 26, 12, 27, 9, 26, - 9, 27, 27, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=2, shape=[19, 2])), - ('tsc', DmapArray(name='tsc', value=np.array([1458157502, 1458157502, 1458157502, 1458157502, 1458157502, - 1458157503, 1458157503, 1458157503, 1458157503, 1458157503, - 1458157503, 1458157503, 1458157503, 1458157503, 1458157504, - 1458157504], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[16])), - ('tus', DmapArray(name='tus', value=np.array([562719, 769514, 872911, 979638, 1079705, 183702, 287083, - 390468, 496666, 597247, 703386, 804577, 907966, 1014047, - 114749, 220806], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[16])), - ('tatten', DmapArray(name='tatten', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[16])), - ('tnoise', DmapArray(name='tnoise', value=np.array([1478.2958, 1478.2958, 1478.2958, 1478.2958, 1478.2958, 1478.2958, - 1478.2958, 1478.2958, 1478.2958, 1478.2958, 1478.2958, 1478.2958, - 1478.2958, 1478.2958, 1478.2958, 1478.2958], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[16])), - ('toff', DmapArray(name='toff', value=np.array([0, 2916, 5832, 8748, 11664, 14580, 17496, 20412, 23328, - 26244, 29160, 32076, 34992, 37908, 40824, 43740], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[16])), - ('tsze', DmapArray(name='tsze', value=np.array([2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, - 2916, 2916, 2916, 2916, 2916], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[16])), - ('data', DmapArray(name='data', - value=np.array([-5, -11, 1, -25, -11, 54], - dtype=np.int16), data_type=2, - data_type_fmt='h', dimension=1, shape=[6]))]), - OrderedDict([('radar.revision.major', DmapScalar(name='radar.revision.major', value=1, data_type=1, data_type_fmt='c')), - ('radar.revision.minor', DmapScalar(name='radar.revision.minor', value=17, data_type=1, data_type_fmt='c')), - ('origin.code', DmapScalar(name='origin.code', value=0, data_type=1, data_type_fmt='c')), - ('origin.time', DmapScalar(name='origin.time', value='Wed Mar 16 19:48:02 2016', data_type=9, data_type_fmt='s')), - ('origin.command', DmapScalar(name='origin.command', value='', data_type=9, data_type_fmt='s')), - ('cp', DmapScalar(name='cp', value=-3560, data_type=2, data_type_fmt='h')), - ('stid', DmapScalar(name='stid', value=65, data_type=2, data_type_fmt='h')), - ('time.yr', DmapScalar(name='time.yr', value=2016, data_type=2, data_type_fmt='h')), - ('time.mo', DmapScalar(name='time.mo', value=3, data_type=2, data_type_fmt='h')), - ('time.dy', DmapScalar(name='time.dy', value=16, data_type=2, data_type_fmt='h')), - ('time.hr', DmapScalar(name='time.hr', value=19, data_type=2, data_type_fmt='h')), - ('time.mt', DmapScalar(name='time.mt', value=48, data_type=2, data_type_fmt='h')), - ('time.sc', DmapScalar(name='time.sc', value=0, data_type=2, data_type_fmt='h')), - ('time.us', DmapScalar(name='time.us', value=22004, data_type=3, data_type_fmt='i')), - ('txpow', DmapScalar(name='txpow', value=9000, data_type=2, data_type_fmt='h')), - ('nave', DmapScalar(name='nave', value=26, data_type=2, data_type_fmt='h')), - ('atten', DmapScalar(name='atten', value=0, data_type=2, data_type_fmt='h')), - ('lagfr', DmapScalar(name='lagfr', value=600, data_type=2, data_type_fmt='h')), - ('smsep', DmapScalar(name='smsep', value=100, data_type=2, data_type_fmt='h')), - ('ercod', DmapScalar(name='ercod', value=0, data_type=2, data_type_fmt='h')), - ('stat.agc', DmapScalar(name='stat.agc', value=0, data_type=2, data_type_fmt='h')), - ('stat.lopwr', DmapScalar(name='stat.lopwr', value=0, data_type=2, data_type_fmt='h')), - ('noise.search', DmapScalar(name='noise.search', value=2762.113037109375, data_type=4, data_type_fmt='f')), - ('noise.mean', DmapScalar(name='noise.mean', value=456916.71875, data_type=4, data_type_fmt='f')), - ('channel', DmapScalar(name='channel', value=0, data_type=2, data_type_fmt='h')), - ('bmnum', DmapScalar(name='bmnum', value=7, data_type=2, data_type_fmt='h')), - ('bmazm', DmapScalar(name='bmazm', value=4.090000152587891, data_type=4, data_type_fmt='f')), - ('scan', DmapScalar(name='scan', value=1, data_type=2, data_type_fmt='h')), - ('offset', DmapScalar(name='offset', value=0, data_type=2, data_type_fmt='h')), - ('rxrise', DmapScalar(name='rxrise', value=100, data_type=2, data_type_fmt='h')), - ('intt.sc', DmapScalar(name='intt.sc', value=2, data_type=2, data_type_fmt='h')), - ('intt.us', DmapScalar(name='intt.us', value=900000, data_type=3, data_type_fmt='i')), - ('txpl', DmapScalar(name='txpl', value=100, data_type=2, data_type_fmt='h')), - ('mpinc', DmapScalar(name='mpinc', value=2400, data_type=2, data_type_fmt='h')), - ('mppul', DmapScalar(name='mppul', value=7, data_type=2, data_type_fmt='h')), - ('mplgs', DmapScalar(name='mplgs', value=18, data_type=2, data_type_fmt='h')), - ('nrang', DmapScalar(name='nrang', value=75, data_type=2, data_type_fmt='h')), - ('frang', DmapScalar(name='frang', value=90, data_type=2, data_type_fmt='h')), - ('rsep', DmapScalar(name='rsep', value=15, data_type=2, data_type_fmt='h')), - ('xcf', DmapScalar(name='xcf', value=1, data_type=2, data_type_fmt='h')), - ('tfreq', DmapScalar(name='tfreq', value=12088, data_type=2, data_type_fmt='h')), - ('mxpwr', DmapScalar(name='mxpwr', value=1073741824, data_type=3, data_type_fmt='i')), - ('lvmax', DmapScalar(name='lvmax', value=20000, data_type=3, data_type_fmt='i')), - ('iqdata.revision.major', DmapScalar(name='iqdata.revision.major', value=0, data_type=3, data_type_fmt='i')), - ('iqdata.revision.minor', DmapScalar(name='iqdata.revision.minor', value=0, data_type=3, data_type_fmt='i')), - ('combf', DmapScalar(name='combf', value='$Id: multifonebm.c,v 1.0 2016/01/19 18:00:00 KKrieger Exp $', data_type=9, data_type_fmt='s')), - ('seqnum', DmapScalar(name='seqnum', value=26, data_type=3, data_type_fmt='i')), - ('chnnum', DmapScalar(name='chnnum', value=2, data_type=3, data_type_fmt='i')), - ('smpnum', DmapScalar(name='smpnum', value=729, data_type=3, data_type_fmt='i')), - ('skpnum', DmapScalar(name='skpnum', value=7, data_type=3, data_type_fmt='i')), - ('ptab', DmapArray(name='ptab', value=np.array([0, 9, 12, 20, 22, 26, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[7])), - ('ltab', DmapArray(name='ltab', value=np.array([0, 0, 26, 27, 20, 22, 9, 12, 22, 26, 22, 27, 20, 26, 20, 27, 12, - 20, 0, 9, 12, 22, 9, 20, 0, 12, 9, 22, 12, 26, 12, 27, 9, 26, - 9, 27, 27, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=2, shape=[19, 2])), - ('tsc', DmapArray(name='tsc', value=np.array([1458157680, 1458157680, 1458157680, 1458157680, 1458157680, - 1458157680, 1458157680, 1458157681, 1458157681, 1458157681, - 1458157681, 1458157681, 1458157681, 1458157681, 1458157681, - 1458157681, 1458157681, 1458157682, 1458157682, 1458157682, - 1458157682, 1458157682, 1458157682, 1458157682, 1458157682, - 1458157682], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[26])), - ('tus', DmapArray(name='tus', value=np.array([318710, 530499, 634147, 737627, 837570, 940892, 1047153, - 151597, 255467, 356013, 459377, 565472, 669910, 773803, - 874486, 977862, 1083894, 188324, 292222, 392966, 496872, - 602347, 706770, 810670, 911448, 1015352], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[26])), - ('tatten', DmapArray(name='tatten', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[26])), - ('tnoise', DmapArray(name='tnoise', value=np.array([2762.113, 2762.113, 2762.113, 2762.113, 2762.113, 2762.113, - 2762.113, 2762.113, 2762.113, 2762.113, 2762.113, 2762.113, - 2762.113, 2762.113, 2762.113, 2762.113, 2762.113, 2762.113, - 2762.113, 2762.113, 2762.113, 2762.113, 2762.113, 2762.113, - 2762.113, 2762.113], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[26])), - ('toff', DmapArray(name='toff', value=np.array([0, 2916, 5832, 8748, 11664, 14580, 17496, 20412, 23328, - 26244, 29160, 32076, 34992, 37908, 40824, 43740, 46656, 49572, - 52488, 55404, 58320, 61236, 64152, 67068, 69984, 72900], - dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[26])), - ('tsze', DmapArray(name='tsze', value=np.array([2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, - 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, - 2916, 2916, 2916, 2916], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[26])), - ('data', DmapArray(name='data', value=np.array([-85, 1, 149, -5, -10, -7], - dtype=np.int16), - data_type=2, data_type_fmt='h', dimension=1, - shape=[6]))]), - OrderedDict([('radar.revision.major', DmapScalar(name='radar.revision.major', value=1, data_type=1, data_type_fmt='c')), - ('radar.revision.minor', DmapScalar(name='radar.revision.minor', value=17, data_type=1, data_type_fmt='c')), - ('origin.code', DmapScalar(name='origin.code', value=0, data_type=1, data_type_fmt='c')), - ('origin.time', DmapScalar(name='origin.time', value='Wed Mar 16 19:49:56 2016', data_type=9, data_type_fmt='s')), - ('origin.command', DmapScalar(name='origin.command', value='', data_type=9, data_type_fmt='s')), - ('cp', DmapScalar(name='cp', value=-3560, data_type=2, data_type_fmt='h')), - ('stid', DmapScalar(name='stid', value=65, data_type=2, data_type_fmt='h')), - ('time.yr', DmapScalar(name='time.yr', value=2016, data_type=2, data_type_fmt='h')), - ('time.mo', DmapScalar(name='time.mo', value=3, data_type=2, data_type_fmt='h')), - ('time.dy', DmapScalar(name='time.dy', value=16, data_type=2, data_type_fmt='h')), - ('time.hr', DmapScalar(name='time.hr', value=19, data_type=2, data_type_fmt='h')), - ('time.mt', DmapScalar(name='time.mt', value=49, data_type=2, data_type_fmt='h')), - ('time.sc', DmapScalar(name='time.sc', value=53, data_type=2, data_type_fmt='h')), - ('time.us', DmapScalar(name='time.us', value=231589, data_type=3, data_type_fmt='i')), - ('txpow', DmapScalar(name='txpow', value=9000, data_type=2, data_type_fmt='h')), - ('nave', DmapScalar(name='nave', value=26, data_type=2, data_type_fmt='h')), - ('atten', DmapScalar(name='atten', value=0, data_type=2, data_type_fmt='h')), - ('lagfr', DmapScalar(name='lagfr', value=600, data_type=2, data_type_fmt='h')), - ('smsep', DmapScalar(name='smsep', value=100, data_type=2, data_type_fmt='h')), - ('ercod', DmapScalar(name='ercod', value=0, data_type=2, data_type_fmt='h')), - ('stat.agc', DmapScalar(name='stat.agc', value=0, data_type=2, data_type_fmt='h')), - ('stat.lopwr', DmapScalar(name='stat.lopwr', value=0, data_type=2, data_type_fmt='h')), - ('noise.search', DmapScalar(name='noise.search', value=994.9771118164062, data_type=4, data_type_fmt='f')), - ('noise.mean', DmapScalar(name='noise.mean', value=456085.6875, data_type=4, data_type_fmt='f')), - ('channel', DmapScalar(name='channel', value=0, data_type=2, data_type_fmt='h')), - ('bmnum', DmapScalar(name='bmnum', value=7, data_type=2, data_type_fmt='h')), - ('bmazm', DmapScalar(name='bmazm', value=4.090000152587891, data_type=4, data_type_fmt='f')), - ('scan', DmapScalar(name='scan', value=0, data_type=2, data_type_fmt='h')), - ('offset', DmapScalar(name='offset', value=0, data_type=2, data_type_fmt='h')), - ('rxrise', DmapScalar(name='rxrise', value=100, data_type=2, data_type_fmt='h')), - ('intt.sc', DmapScalar(name='intt.sc', value=2, data_type=2, data_type_fmt='h')), - ('intt.us', DmapScalar(name='intt.us', value=900000, data_type=3, data_type_fmt='i')), - ('txpl', DmapScalar(name='txpl', value=100, data_type=2, data_type_fmt='h')), - ('mpinc', DmapScalar(name='mpinc', value=2400, data_type=2, data_type_fmt='h')), - ('mppul', DmapScalar(name='mppul', value=7, data_type=2, data_type_fmt='h')), - ('mplgs', DmapScalar(name='mplgs', value=18, data_type=2, data_type_fmt='h')), - ('nrang', DmapScalar(name='nrang', value=75, data_type=2, data_type_fmt='h')), - ('frang', DmapScalar(name='frang', value=90, data_type=2, data_type_fmt='h')), - ('rsep', DmapScalar(name='rsep', value=15, data_type=2, data_type_fmt='h')), - ('xcf', DmapScalar(name='xcf', value=1, data_type=2, data_type_fmt='h')), - ('tfreq', DmapScalar(name='tfreq', value=12088, data_type=2, data_type_fmt='h')), - ('mxpwr', DmapScalar(name='mxpwr', value=1073741824, data_type=3, data_type_fmt='i')), - ('lvmax', DmapScalar(name='lvmax', value=20000, data_type=3, data_type_fmt='i')), - ('iqdata.revision.major', DmapScalar(name='iqdata.revision.major', value=0, data_type=3, data_type_fmt='i')), - ('iqdata.revision.minor', DmapScalar(name='iqdata.revision.minor', value=0, data_type=3, data_type_fmt='i')), - ('combf', DmapScalar(name='combf', value='$Id: multifonebm.c,v 1.0 2016/01/19 18:00:00 KKrieger Exp $', data_type=9, data_type_fmt='s')), - ('seqnum', DmapScalar(name='seqnum', value=26, data_type=3, data_type_fmt='i')), - ('chnnum', DmapScalar(name='chnnum', value=2, data_type=3, data_type_fmt='i')), - ('smpnum', DmapScalar(name='smpnum', value=729, data_type=3, data_type_fmt='i')), - ('skpnum', DmapScalar(name='skpnum', value=7, data_type=3, data_type_fmt='i')), - ('ptab', DmapArray(name='ptab', value=np.array([0, 9, 12, 20, 22, 26, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[7])), - ('ltab', DmapArray(name='ltab', value=np.array([0, 0, 26, 27, 20, 22, 9, 12, 22, 26, 22, 27, 20, 26, 20, 27, 12, - 20, 0, 9, 12, 22, 9, 20, 0, 12, 9, 22, 12, 26, 12, 27, 9, 26, - 9, 27, 27, 27], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=2, shape=[19, 2])), - ('tsc', DmapArray(name='tsc', value=np.array([1458157793, 1458157793, 1458157793, 1458157793, 1458157793, - 1458157794, 1458157794, 1458157794, 1458157794, 1458157794, - 1458157794, 1458157794, 1458157794, 1458157794, 1458157794, - 1458157795, 1458157795, 1458157795, 1458157795, 1458157795, - 1458157795, 1458157795, 1458157795, 1458157795, 1458157796, - 1458157796], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[26])), - ('tus', DmapArray(name='tus', value=np.array([531291, 736088, 841483, 947545, 1052024, 155871, 255655, - 360183, 466363, 570260, 674157, 774239, 878703, 984771, - 1088673, 189378, 292761, 398790, 503222, 607125, 707880, - 811265, 917263, 1021688, 125590, 226375], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[26])), - ('tatten', DmapArray(name='tatten', value=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[26])), - ('tnoise', DmapArray(name='tnoise', value=np.array([994.9771, 994.9771, 994.9771, 994.9771, 994.9771, 994.9771, - 994.9771, 994.9771, 994.9771, 994.9771, 994.9771, 994.9771, - 994.9771, 994.9771, 994.9771, 994.9771, 994.9771, 994.9771, - 994.9771, 994.9771, 994.9771, 994.9771, 994.9771, 994.9771, - 994.9771, 994.9771], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[26])), - ('toff', DmapArray(name='toff', value=np.array([0, 2916, 5832, 8748, 11664, 14580, 17496, 20412, 23328, - 26244, 29160, 32076, 34992, 37908, 40824, 43740, 46656, 49572, - 52488, 55404, 58320, 61236, 64152, 67068, 69984, 72900], - dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[26])), - ('tsze', DmapArray(name='tsze', value=np.array([2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, - 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, - 2916, 2916, 2916, 2916], dtype=np.int32), data_type=3, data_type_fmt='i', dimension=1, shape=[26])), - ('data', DmapArray(name='data', value=np.array([-15, -22, -2, 3, 9, 8], dtype=np.int16), data_type=2, data_type_fmt='h', dimension=1, shape=[6]))])] diff --git a/tests/unit/test_borealis.py b/tests/unit/test_borealis.py deleted file mode 100644 index 45dc4a5..0000000 --- a/tests/unit/test_borealis.py +++ /dev/null @@ -1,915 +0,0 @@ -# Copyright 2019 SuperDARN Canada, University of Saskatchewan -# Author: Marci Detwiller -""" -This test suite is to test the implementation for the following classes: - BorealisRead - BorealisWrite - BorealisConvert -Support for the following Borealis file types: - rawrf - antennas_iq - bfiq - rawacf -And supports conversion of the following Borealis -> SDARN DMap types: - bfiq -> iqdat - rawacf -> rawacf -""" -import collections -import copy -import logging -import numpy as np -import os -import pytest -import random -import tables -import unittest - -import pydarnio - -from collections import OrderedDict - -from borealis_rawacf_data_sets import (borealis_array_rawacf_data, - borealis_site_rawacf_data) -from borealis_bfiq_data_sets import (borealis_array_bfiq_data, - borealis_site_bfiq_data) - -pydarnio_logger = logging.getLogger('pydarnio') - -# Site Test files v0.6 -borealis_site_bfiq_file_v06 = "" -borealis_site_rawacf_file_v06 = "" -borealis_site_antennas_iq_file_v06 = "" -borealis_site_rawrf_file_v06 = "" - -# Array Test files v0.6 -borealis_array_bfiq_file_v06 = "" -borealis_array_rawacf_file_v06 = "" -borealis_array_antennas_iq_file_v06 = "" - -# Site Test files v0.5 -borealis_site_bfiq_file_v05 = \ - "/home/marci/data/borealis-v05/20200303.2143.00.sas.0.bfiq.hdf5.site" -borealis_site_rawacf_file_v05 = \ - "/home/marci/data/borealis-v05/20200303.2143.00.sas.0.rawacf.hdf5.site" -borealis_site_antennas_iq_file_v05 = \ - "/home/marci/data/borealis-v05/20200303.2143.00.sas.0.antennas_iq.hdf5."\ - "site" -borealis_site_rawrf_file_v05 = "" - -# Array Test files v0.5 -borealis_array_bfiq_file_v05 = \ - "/home/marci/data/borealis-v05/20200303.2143.00.sas.0.bfiq.hdf5" -borealis_array_rawacf_file_v05 = \ - "/home/marci/data/borealis-v05/20200303.2143.00.sas.0.rawacf.hdf5" -borealis_array_antennas_iq_file_v05 = \ - "/home/marci/data/borealis-v05/20200303.2143.00.sas.0.antennas_iq.hdf5" - -# Site Test files v0.4 -borealis_site_bfiq_file_v04 = \ - "/home/marci/data/borealis-v04/20200311.1734.00.sas.0.bfiq.hdf5.site" -borealis_site_rawacf_file_v04 = \ - "/home/marci/data/borealis-v04/20200311.1734.00.sas.0.rawacf.hdf5.site" -borealis_site_antennas_iq_file_v04 = \ - "/home/marci/data/borealis-v04/20200311.1734.00.sas.0.antennas_iq.hdf5."\ - "site" -borealis_site_rawrf_file_v04 = "" - -# Array Test files v0.4 -borealis_array_bfiq_file_v04 = \ - "/home/marci/data/borealis-v04/20200311.1734.00.sas.0.bfiq.hdf5" -borealis_array_rawacf_file_v04 = \ - "/home/marci/data/borealis-v04/20200311.1734.00.sas.0.rawacf.hdf5" -borealis_array_antennas_iq_file_v04 = \ - "/home/marci/data/borealis-v04/20200311.1734.00.sas.0.antennas_iq.hdf5" - -# Problem files TODO -borealis_site_extra_field_file = "" -borealis_site_missing_field_file = "" -borealis_site_incorrect_data_format_file = "" - -borealis_array_extra_field_file = "" -borealis_array_missing_field_file = "" -borealis_array_incorrect_data_format_file = "" -borealis_array_num_records_error_file = "" -borealis_empty_file = "../test_files/empty.rawacf" - - -@pytest.mark.skip -class TestBorealisRead_v04(unittest.TestCase): - """ - Testing class for BorealisSiteRead - """ - - def setUp(self): - self.rawacf_site_file_path = borealis_site_rawacf_file_v04 - self.bfiq_site_file_path = borealis_site_bfiq_file_v04 - self.antennas_site_file_path = borealis_site_antennas_iq_file_v04 - self.rawrf_site_file_path = borealis_site_rawrf_file_v04 - self.nonexistent_dir_path = './dog/somefile.rawacf' - self.nonexistent_file_path = '../test_files/somefile.rawacf' - self.empty_file_path = borealis_empty_file - self.rawacf_array_file_path = borealis_array_rawacf_file_v04 - self.bfiq_array_file_path = borealis_array_bfiq_file_v04 - self.antennas_array_file_path = borealis_array_antennas_iq_file_v04 - - def test_read_site_bfiq(self): - """ - Test reading records from bfiq. - - Checks: - - returns correct data structures, both records and arrays - (restructuring happens internally) - - returns expected values - """ - dm = pydarnio.BorealisRead(self.bfiq_site_file_path, 'bfiq', 'site') - records = dm.records - first_record = records[dm.record_names[0]] - self.assertIsInstance(records, collections.OrderedDict) - self.assertIsInstance(first_record, dict) - self.assertIsInstance(first_record['num_slices'], np.int64) - - arrays = dm.arrays - self.assertIsInstance(arrays, dict) - self.assertIsInstance(arrays['num_slices'], np.ndarray) - self.assertIsInstance(arrays['num_slices'][0], np.int64) - del dm, records, arrays - - def test_read_site_rawacf(self): - """ - Test reading records from rawacf. - - Checks: - - returns correct data structures, both records and arrays - (restructuring happens internally) - - returns expected values - """ - dm = pydarnio.BorealisRead(self.rawacf_site_file_path, 'rawacf', - 'site') - records = dm.records - first_record = records[dm.record_names[0]] - self.assertIsInstance(records, collections.OrderedDict) - self.assertIsInstance(first_record, dict) - self.assertIsInstance(first_record['num_slices'], np.int64) - - arrays = dm.arrays - self.assertIsInstance(arrays, dict) - self.assertIsInstance(arrays['num_slices'], np.ndarray) - self.assertIsInstance(arrays['num_slices'][0], np.int64) - del dm, records, arrays - - def test_read_site_antennas_iq(self): - """ - Test reading records from antennas_iq. - - Checks: - - returns correct data structures, both records and arrays - (restructuring happens internally) - - returns expected values - """ - dm = pydarnio.BorealisRead(self.antennas_site_file_path, - 'antennas_iq', 'site') - records = dm.records - first_record = records[dm.record_names[0]] - self.assertIsInstance(records, collections.OrderedDict) - self.assertIsInstance(first_record, dict) - self.assertIsInstance(first_record['num_slices'], np.int64) - - arrays = dm.arrays - self.assertIsInstance(arrays, dict) - self.assertIsInstance(arrays['num_slices'], np.ndarray) - self.assertIsInstance(arrays['num_slices'][0], np.int64) - del dm, records, arrays - - # TODO add rawrf file for test - # def test_read_site_rawrf(self): - # """ - # Test reading records from antennas_iq. - - # Checks: - # - returns correct data structures - # - returns expected values - # """ - # dm = pydarnio.BorealisSiteRead(self.rawrf_site_file_path, 'rawrf', - # 'site') - # records = dm.records - # first_record = records[dm.record_names[0]] - # self.assertIsInstance(records, collections.OrderedDict) - # self.assertIsInstance(first_record, dict) - # self.assertIsInstance(first_record['num_slices'], np.int64) - - def test_read_array_bfiq(self): - """ - Test reading records from bfiq. - - Checks: - - returns correct data structures, both records and arrays - (restructuring happens internally) - - returns expected values - """ - dm = pydarnio.BorealisRead(self.bfiq_array_file_path, 'bfiq', 'array') - arrays = dm.arrays - self.assertIsInstance(arrays, dict) - self.assertIsInstance(arrays['num_slices'], np.ndarray) - self.assertIsInstance(arrays['num_slices'][0], np.int64) - - records = dm.records - first_record = records[dm.record_names[0]] - self.assertIsInstance(records, collections.OrderedDict) - self.assertIsInstance(first_record, dict) - self.assertIsInstance(first_record['num_slices'], np.int64) - del dm, records, arrays - - def test_read_array_rawacf(self): - """ - Test reading records from rawacf. - - Checks: - - returns correct data structures, both records and arrays - (restructuring happens internally) - - returns expected values - """ - dm = pydarnio.BorealisRead(self.rawacf_array_file_path, 'rawacf', - 'array') - arrays = dm.arrays - self.assertIsInstance(arrays, dict) - self.assertIsInstance(arrays['num_slices'], np.ndarray) - self.assertIsInstance(arrays['num_slices'][0], np.int64) - - records = dm.records - first_record = records[dm.record_names[0]] - self.assertIsInstance(records, collections.OrderedDict) - self.assertIsInstance(first_record, dict) - self.assertIsInstance(first_record['num_slices'], np.int64) - del dm, records, arrays - - def test_read_array_antennas_iq(self): - """ - Test reading records from bfiq. - - Checks: - - returns correct data structures, both records and arrays - (restructuring happens internally) - - returns expected values - """ - dm = pydarnio.BorealisRead(self.antennas_array_file_path, - 'antennas_iq', 'array') - arrays = dm.arrays - self.assertIsInstance(arrays, dict) - self.assertIsInstance(arrays['num_slices'], np.ndarray) - self.assertIsInstance(arrays['num_slices'][0], np.int64) - - records = dm.records - first_record = records[dm.record_names[0]] - self.assertIsInstance(records, collections.OrderedDict) - self.assertIsInstance(first_record, dict) - self.assertIsInstance(first_record['num_slices'], np.int64) - del dm, records, arrays - - def test_return_reader(self): - """ - Test the internal BorealisRead return_reader function which should - be able to determine which structure of file to use - if none is provided. - """ - site_reader = pydarnio.BorealisRead(self.bfiq_site_file_path, 'bfiq') - record_data = site_reader.records - random_key = random.choice(list(record_data.keys())) - self.assertIsInstance(record_data[random_key]['num_slices'], np.int64) - - array_reader = pydarnio.BorealisRead(self.bfiq_array_file_path, 'bfiq') - array_data = array_reader.arrays - self.assertIsInstance(array_data['num_slices'], np.ndarray) - - # READ FAILURE TESTS - - def test_incorrect_path(self): - """ - Testing BorealisSiteRead and BorealisArrayRead constructor with - a non-existent folder. - - Expected behaviour: raise OSError - """ - self.assertRaises(OSError, pydarnio.BorealisRead, - self.nonexistent_dir_path, 'rawacf', 'site') - self.assertRaises(OSError, pydarnio.BorealisRead, - self.nonexistent_dir_path, 'rawacf', 'array') - - def test_incorrect_file(self): - """ - Tests if BorealisSiteRead and BorealisArrayRead constructor with - a non-existent file - - Expected behaviour: raises OSError - """ - self.assertRaises(OSError, pydarnio.BorealisRead, - self.nonexistent_file_path, 'rawacf', 'site') - self.assertRaises(OSError, pydarnio.BorealisRead, - self.nonexistent_file_path, 'rawacf', 'array') - - def test_empty_file(self): - """ - Tests if BorealisSiteRead and BorealisArrayRead constructor with - an empty file - - Expected behaviour: raise OSError, unable to open - (file signature not found) - or raises HDF5ExtError (not an HDF5 file) - """ - self.assertRaises(OSError, - pydarnio.BorealisRead, self.empty_file_path, - 'rawacf', 'site') - HDF5ExtError = tables.exceptions.HDF5ExtError - self.assertRaises((OSError, HDF5ExtError), - pydarnio.BorealisRead, self.empty_file_path, - 'rawacf', 'array') - - def test_wrong_borealis_filetype(self): - """ - Provide the wrong filetype. - """ - wrong_filetype_exceptions = \ - (pydarnio.borealis_exceptions.BorealisExtraFieldError, - pydarnio.borealis_exceptions.BorealisFieldMissingError, - pydarnio.borealis_exceptions.BorealisDataFormatTypeError) - self.assertRaises(wrong_filetype_exceptions, pydarnio.BorealisRead, - self.bfiq_site_file_path, 'antennas_iq', 'site') - - def test_wrong_borealis_file_structure(self): - """ - Provide the wrong file structure. - """ - wrong_file_structure_exceptions = \ - (pydarnio.borealis_exceptions.BorealisStructureError) - self.assertRaises(wrong_file_structure_exceptions, - pydarnio.BorealisRead, - self.bfiq_site_file_path, 'bfiq', 'array') - self.assertRaises(wrong_file_structure_exceptions, - pydarnio.BorealisRead, - self.bfiq_array_file_path, 'bfiq', 'site') - - -@pytest.mark.skip -class TestBorealisRead_v05(TestBorealisRead_v04): - """ - Testing class for BorealisSiteRead - """ - - def setUp(self): - self.rawacf_site_file_path = borealis_site_rawacf_file_v05 - self.bfiq_site_file_path = borealis_site_bfiq_file_v05 - self.antennas_site_file_path = borealis_site_antennas_iq_file_v05 - self.rawrf_site_file_path = borealis_site_rawrf_file_v05 - self.nonexistent_dir_path = './dog/somefile.rawacf' - self.nonexistent_file_path = '../test_files/somefile.rawacf' - self.empty_file_path = borealis_empty_file - self.rawacf_array_file_path = borealis_array_rawacf_file_v05 - self.bfiq_array_file_path = borealis_array_bfiq_file_v05 - self.antennas_array_file_path = borealis_array_antennas_iq_file_v05 - - -@pytest.mark.skip -class TestBorealisRead_v06(TestBorealisRead_v05): - """ - Testing class for BorealisSiteRead - """ - - def setUp(self): - self.rawacf_site_file_path = borealis_site_rawacf_file_v06 - self.bfiq_site_file_path = borealis_site_bfiq_file_v06 - self.antennas_site_file_path = borealis_site_antennas_iq_file_v06 - self.rawrf_site_file_path = borealis_site_rawrf_file_v06 - self.nonexistent_dir_path = './dog/somefile.rawacf' - self.nonexistent_file_path = '../test_files/somefile.rawacf' - self.empty_file_path = borealis_empty_file - self.rawacf_array_file_path = borealis_array_rawacf_file_v06 - self.bfiq_array_file_path = borealis_array_bfiq_file_v06 - self.antennas_array_file_path = borealis_array_antennas_iq_file_v06 - - -@pytest.mark.skip -class TestBorealisWrite(unittest.TestCase): - """ - Tests BorealisWrite class - """ - - def setUp(self): - self.rawacf_site_data = copy.deepcopy( - borealis_site_rawacf_data) - self.rawacf_site_missing_field = copy.deepcopy( - borealis_site_rawacf_data) - self.rawacf_site_extra_field = copy.deepcopy( - borealis_site_rawacf_data) - self.rawacf_site_incorrect_fmt = copy.deepcopy( - borealis_site_rawacf_data) - self.bfiq_site_data = copy.deepcopy( - borealis_site_bfiq_data) - self.bfiq_site_missing_field = copy.deepcopy( - borealis_site_bfiq_data) - self.bfiq_site_extra_field = copy.deepcopy( - borealis_site_bfiq_data) - self.bfiq_site_incorrect_fmt = copy.deepcopy( - borealis_site_bfiq_data) - - self.rawacf_array_data = copy.deepcopy( - borealis_array_rawacf_data) - self.rawacf_array_missing_field = copy.deepcopy( - borealis_array_rawacf_data) - self.rawacf_array_extra_field = copy.deepcopy( - borealis_array_rawacf_data) - self.rawacf_array_incorrect_fmt = copy.deepcopy( - borealis_array_rawacf_data) - self.bfiq_array_data = copy.deepcopy( - borealis_array_bfiq_data) - self.bfiq_array_missing_field = copy.deepcopy( - borealis_array_bfiq_data) - self.bfiq_array_extra_field = copy.deepcopy( - borealis_array_bfiq_data) - self.bfiq_array_incorrect_fmt = copy.deepcopy( - borealis_array_bfiq_data) - - # Read/write tests to check input vs output - def check_dictionaries_are_same(self, dict1, dict2): - - self.assertEqual(sorted(list(dict1.keys())), - sorted(list(dict2.keys()))) - for key1, value1 in dict1.items(): - if isinstance(value1, dict) or isinstance(value1, OrderedDict): - self.check_dictionaries_are_same(value1, dict2[key1]) - elif isinstance(value1, np.ndarray): - self.assertTrue((value1 == dict2[key1]).all()) - else: - self.assertEqual(value1, dict2[key1]) - - return True - - def test_writing_site_rawacf(self): - """ - Tests write_rawacf method - writes a rawacf file - - Expected behaviour - ------------------ - Rawacf file is produced - """ - test_file = "./test_rawacf.rawacf.hdf5" - pydarnio.BorealisWrite(test_file, self.rawacf_site_data, - 'rawacf', 'site') - # only testing the file is created since it should only be created - # at the last step after all checks have passed - # Testing the integrity of the insides of the file will be part of - # integration testing since we need BorealisSiteRead for that. - self.assertTrue(os.path.isfile(test_file)) - reader = pydarnio.BorealisRead(test_file, 'rawacf', 'site') - records = reader.records - dictionaries_are_same =\ - self.check_dictionaries_are_same(records, self.rawacf_site_data) - self.assertTrue(dictionaries_are_same) - os.remove(test_file) - - def test_missing_field_site_rawacf(self): - """ - Tests write_rawacf method - writes a rawacf structure file for the - given data - - Expected behaviour - ------------------ - Raises BorealisFieldMissingError - because the rawacf data is - missing field num_sequences - """ - - keys = sorted(list(self.rawacf_site_missing_field.keys())) - del self.rawacf_site_missing_field[keys[0]]['num_sequences'] - - try: - pydarnio.BorealisWrite("test_rawacf.rawacf.hdf5", - self.rawacf_site_missing_field, - 'rawacf', 'site') - except pydarnio.borealis_exceptions.BorealisFieldMissingError as err: - self.assertEqual(err.fields, {'num_sequences'}) - self.assertEqual(err.record_name, keys[0]) - - def test_extra_field_site_rawacf(self): - """ - Tests write_rawacf method - writes a rawacf structure file for the - given data - - Expected behaviour - ------------------ - Raises BorealisExtraFieldError because the rawacf data - has an extra field dummy - """ - keys = sorted(list(self.rawacf_site_extra_field.keys())) - self.rawacf_site_extra_field[keys[0]]['dummy'] = 'dummy' - try: - pydarnio.BorealisWrite("test_rawacf.rawacf.hdf5", - self.rawacf_site_extra_field, - 'rawacf', 'site') - except pydarnio.borealis_exceptions.BorealisExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - self.assertEqual(err.record_name, keys[0]) - - def test_incorrect_data_format_site_rawacf(self): - """ - Tests write_rawacf method - writes a rawacf structure file for the - given data - - Expected Behaviour - ------------------- - Raises BorealisDataFormatTypeError because the rawacf data has the - wrong type for the scan_start_marker field - """ - keys = sorted(list(self.rawacf_site_incorrect_fmt.keys())) - self.rawacf_site_incorrect_fmt[keys[0]]['scan_start_marker'] = 1 - - try: - pydarnio.BorealisWrite("test_rawacf.rawacf.hdf5", - self.rawacf_site_incorrect_fmt, - 'rawacf', 'site') - except pydarnio.borealis_exceptions.BorealisDataFormatTypeError as err: - self.assertEqual( - err.incorrect_types['scan_start_marker'], - "") - self.assertEqual(err.record_name, keys[0]) - - def test_writing_site_bfiq(self): - """ - Tests write_bfiq method - writes a bfiq file - - Expected behaviour - ------------------ - bfiq file is produced - """ - test_file = "./test_bfiq.bfiq.hdf5" - pydarnio.BorealisWrite(test_file, self.bfiq_site_data, 'bfiq', 'site') - # only testing the file is created since it should only be created - # at the last step after all checks have passed - # Testing the integrity of the insides of the file will be part of - # integration testing since we need BorealisSiteRead for that. - self.assertTrue(os.path.isfile(test_file)) - reader = pydarnio.BorealisRead(test_file, 'bfiq', 'site') - records = reader.records - dictionaries_are_same = \ - self.check_dictionaries_are_same(records, self.bfiq_site_data) - self.assertTrue(dictionaries_are_same) - os.remove(test_file) - - def test_missing_field_site_bfiq(self): - """ - Tests write_bfiq method - writes a bfiq structure file for the - given data - - Expected behaviour - ------------------ - Raises BorealisFieldMissingError - because the bfiq data is - missing field antenna_arrays_order - """ - keys = sorted(list(self.bfiq_site_missing_field.keys())) - del self.bfiq_site_missing_field[keys[0]]['antenna_arrays_order'] - - try: - _ = pydarnio.BorealisWrite("test_bfiq.bfiq.hdf5", - self.bfiq_site_missing_field, - 'bfiq', 'site') - except pydarnio.borealis_exceptions.BorealisFieldMissingError as err: - self.assertEqual(err.fields, {'antenna_arrays_order'}) - self.assertEqual(err.record_name, keys[0]) - - def test_extra_field_site_bfiq(self): - """ - Tests write_bfiq method - writes a bfiq structure file for the - given data - - Expected behaviour - ------------------ - Raises BorealisExtraFieldError because the bfiq data - has an extra field dummy - """ - keys = sorted(list(self.bfiq_site_extra_field.keys())) - self.bfiq_site_extra_field[keys[0]]['dummy'] = 'dummy' - - try: - _ = pydarnio.BorealisWrite("test_bfiq.bfiq.hdf5", - self.bfiq_site_extra_field, - 'bfiq', 'site') - except pydarnio.borealis_exceptions.BorealisExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - self.assertEqual(err.record_name, keys[0]) - - def test_incorrect_data_format_site_bfiq(self): - """ - Tests write_bfiq method - writes a bfiq structure file for the - given data - - Expected Behaviour - ------------------- - Raises BorealisDataFormatTypeError because the bfiq data has the - wrong type for the first_range_rtt field - """ - keys = sorted(list(self.bfiq_site_incorrect_fmt.keys())) - self.bfiq_site_incorrect_fmt[keys[0]]['first_range_rtt'] = 5 - - try: - _ = pydarnio.BorealisWrite("test_bfiq.bfiq.hdf5", - self.bfiq_site_incorrect_fmt, - 'bfiq', 'site') - except pydarnio.borealis_exceptions.BorealisDataFormatTypeError as err: - self.assertEqual( - err.incorrect_types['first_range_rtt'], - "") - self.assertEqual(err.record_name, keys[0]) - - def test_writing_array_rawacf(self): - """ - Tests write_rawacf method - writes a rawacf file - - Expected behaviour - ------------------ - Rawacf file is produced - """ - test_file = "test_rawacf.rawacf.hdf5" - _ = pydarnio.BorealisWrite(test_file, - self.rawacf_array_data, 'rawacf', - 'array') - self.assertTrue(os.path.isfile(test_file)) - reader = pydarnio.BorealisRead(test_file, 'rawacf', 'array') - data = reader.arrays - dictionaries_are_same =\ - self.check_dictionaries_are_same(data, self.rawacf_array_data) - self.assertTrue(dictionaries_are_same) - os.remove(test_file) - - def test_missing_field_array_rawacf(self): - """ - Tests write_rawacf method - writes a rawacf structure file for the - given data - - Expected behaviour - ------------------ - Raises BorealisFieldMissingError - because the rawacf data is - missing field num_sequences - """ - - del self.rawacf_array_missing_field['num_sequences'] - - try: - _ = pydarnio.BorealisWrite("test_rawacf.rawacf.hdf5", - self.rawacf_array_missing_field, - 'rawacf', 'array') - except pydarnio.borealis_exceptions.BorealisFieldMissingError as err: - self.assertEqual(err.fields, {'num_sequences'}) - - def test_extra_field_array_rawacf(self): - """ - Tests write_rawacf method - writes a rawacf structure file for the - given data - - Expected behaviour - ------------------ - Raises BorealisExtraFieldError because the rawacf data - has an extra field dummy - """ - self.rawacf_array_extra_field['dummy'] = 'dummy' - try: - _ = pydarnio.BorealisWrite("test_rawacf.rawacf.hdf5", - self.rawacf_array_extra_field, - 'rawacf', 'array') - except pydarnio.borealis_exceptions.BorealisExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - - def test_incorrect_data_format_array_rawacf(self): - """ - Tests write_rawacf method - writes a rawacf structure file for the - given data - - Expected Behaviour - ------------------- - Raises BorealisDataFormatTypeError because the rawacf data has the - wrong type for the scan_start_marker field - """ - num_records =\ - self.rawacf_array_incorrect_fmt['scan_start_marker'].shape[0] - self.rawacf_array_incorrect_fmt['scan_start_marker'] = \ - np.array([1] * num_records) - - try: - _ = pydarnio.BorealisWrite("test_rawacf.rawacf.hdf5", - self.rawacf_array_incorrect_fmt, - 'rawacf', 'array') - except pydarnio.borealis_exceptions.BorealisDataFormatTypeError as err: - self.assertEqual(err.incorrect_types['scan_start_marker'], - "np.ndarray of ") - - def test_writing_array_bfiq(self): - """ - Tests write_bfiq method - writes a bfiq file - - Expected behaviour - ------------------ - bfiq file is produced - """ - test_file = "test_bfiq.bfiq.hdf5" - _ = pydarnio.BorealisWrite(test_file, self.bfiq_array_data, - 'bfiq', 'array') - self.assertTrue(os.path.isfile(test_file)) - reader = pydarnio.BorealisRead(test_file, 'bfiq', 'array') - data = reader.arrays - dictionaries_are_same = \ - self.check_dictionaries_are_same(data, - self.bfiq_array_data) - self.assertTrue(dictionaries_are_same) - os.remove(test_file) - - def test_missing_field_array_bfiq(self): - """ - Tests write_bfiq method - writes a bfiq structure file for the - given data - - Expected behaviour - ------------------ - Raises BorealisFieldMissingError - because the bfiq data is - missing field antenna_arrays_order - """ - del self.bfiq_array_missing_field['antenna_arrays_order'] - - try: - _ = pydarnio.BorealisWrite("test_bfiq.bfiq.hdf5", - self.bfiq_array_missing_field, - 'bfiq', 'array') - except pydarnio.borealis_exceptions.BorealisFieldMissingError as err: - self.assertEqual(err.fields, {'antenna_arrays_order'}) - - def test_extra_field_array_bfiq(self): - """ - Tests write_bfiq method - writes a bfiq structure file for the - given data - - Expected behaviour - ------------------ - Raises BorealisExtraFieldError because the bfiq data - has an extra field dummy - """ - self.bfiq_array_extra_field['dummy'] = 'dummy' - - try: - _ = pydarnio.BorealisWrite("test_bfiq.bfiq.hdf5", - self.bfiq_array_extra_field, - 'bfiq', 'array') - except pydarnio.borealis_exceptions.BorealisExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - - def test_incorrect_data_format_array_bfiq(self): - """ - Tests write_bfiq method - writes a bfiq structure file for the - given data - - Expected Behaviour - ------------------- - Raises BorealisDataFormatTypeError because the bfiq data has the - wrong type for the first_range_rtt field - """ - self.bfiq_array_incorrect_fmt['first_range_rtt'] = 5 - - try: - _ = pydarnio.BorealisWrite("test_bfiq.bfiq.hdf5", - self.bfiq_array_incorrect_fmt, - 'bfiq', 'array') - except pydarnio.borealis_exceptions.BorealisDataFormatTypeError as err: - self.assertEqual( - err.incorrect_types['first_range_rtt'], - "") - - # # WRITE FAILURE TESTS - - def test_wrong_borealis_filetype(self): - """ - Provide the wrong filetype. - """ - wrong_filetype_exceptions = \ - (pydarnio.borealis_exceptions.BorealisExtraFieldError, - pydarnio.borealis_exceptions.BorealisFieldMissingError, - pydarnio.borealis_exceptions.BorealisDataFormatTypeError) - self.assertRaises(wrong_filetype_exceptions, pydarnio.BorealisWrite, - 'test_write_borealis_file.bfiq.hdf5', - self.bfiq_site_data, 'antennas_iq', 'site') - - def test_wrong_borealis_file_structure(self): - """ - Provide the wrong file structure. - """ - self.assertRaises(pydarnio.borealis_exceptions.BorealisStructureError, - pydarnio.BorealisWrite, - 'test_write_borealis_file.bfiq.hdf5', - self.bfiq_site_data, 'rawacf', 'array') - self.assertRaises(pydarnio.borealis_exceptions.BorealisStructureError, - pydarnio.BorealisWrite, - 'test_write_borealis_file.bfiq.hdf5', - self.bfiq_array_data, 'rawacf', 'site') - - -@pytest.mark.skip -class TestBorealisConvert(unittest.TestCase): - """ - Tests BorealisConvert class - """ - - def setUp(self): - self.rawacf_array_data = copy.deepcopy(borealis_array_rawacf_data) - self.bfiq_array_data = copy.deepcopy(borealis_array_bfiq_data) - - # write some v0.4 data - self.bfiq_test_file = "test_bfiq.bfiq.hdf5" - _ = pydarnio.BorealisWrite(self.bfiq_test_file, - self.bfiq_array_data, 'bfiq', 'array') - self.rawacf_test_file = "test_rawacf.rawacf.hdf5" - _ = pydarnio.BorealisWrite(self.rawacf_test_file, - self.rawacf_array_data, - 'rawacf', 'array') - - # get v0.5 data from file - self.bfiqv05_test_file = borealis_site_bfiq_file_v05 - self.rawacfv05_test_file = borealis_site_rawacf_file_v05 - - # Get v0.6 data from file - self.bfiqv06_test_file = borealis_site_bfiq_file_v06 - self.rawacfv06_test_file = borealis_site_rawacf_file_v06 - - def test_borealis_convert_to_rawacfv04(self): - """ - Tests BorealisConvert to rawacf - - Expected behaviour - ------------------ - write a SDARN DMap rawacf - """ - _ = pydarnio.BorealisConvert(self.rawacf_test_file, "rawacf", - "test_rawacf.rawacf.dmap", - borealis_slice_id=0, - borealis_file_structure='array') - self.assertTrue(os.path.isfile("test_rawacf.rawacf.dmap")) - os.remove("test_rawacf.rawacf.dmap") - - def test_borealis_convert_to_iqdatv04(self): - """ - Tests BorealisConvert to iqdat - - Expected behaviour - ------------------ - write a SDARN DMap iqdat - """ - - _ = pydarnio.BorealisConvert(self.bfiq_test_file, "bfiq", - "test_bfiq.bfiq.dmap", - borealis_slice_id=0, - borealis_file_structure='array') - self.assertTrue(os.path.isfile("test_bfiq.bfiq.dmap")) - os.remove("test_bfiq.bfiq.dmap") - - def test_borealis_convert_to_rawacfv05(self): - _ = pydarnio.BorealisConvert(self.rawacfv05_test_file, "rawacf", - "test_rawacf.rawacf.dmap", - borealis_file_structure='site') - self.assertTrue(os.path.isfile("test_rawacf.rawacf.dmap")) - os.remove("test_rawacf.rawacf.dmap") - - def test_borealis_convert_to_iqdatv05(self): - """ - Tests BorealisConvert to iqdat - - Expected behaviour - ------------------ - write a SDARN DMap iqdat - """ - _ = pydarnio.BorealisConvert(self.bfiqv05_test_file, "bfiq", - "test_bfiq.bfiq.dmap", - borealis_file_structure='site') - self.assertTrue(os.path.isfile("test_bfiq.bfiq.dmap")) - os.remove("test_bfiq.bfiq.dmap") - - def test_borealis_convert_to_rawacfv06(self): - _ = pydarnio.BorealisConvert(self.rawacfv06_test_file, "rawacf", - "test_rawacf.rawacf.dmap", - borealis_file_structure='site') - self.assertTrue(os.path.isfile("test_rawacf.rawacf.dmap")) - os.remove("test_rawacf.rawacf.dmap") - - def test_borealis_convert_to_iqdatv06(self): - """ - Tests BorealisConvert to iqdat - - Expected behaviour - ------------------ - write a SDARN DMap iqdat - """ - _ = pydarnio.BorealisConvert(self.bfiqv06_test_file, "bfiq", - "test_bfiq.bfiq.dmap", - borealis_file_structure='site') - self.assertTrue(os.path.isfile("test_bfiq.bfiq.dmap")) - os.remove("test_bfiq.bfiq.dmap") - - -if __name__ == '__main__': - """ - Runs the above class in a unittest system. - """ - pydarnio_logger.info("Starting Borealis unit testing on v0.5 files") - - unittest.main() diff --git a/tests/unit/test_conversions.py b/tests/unit/test_conversions.py deleted file mode 100644 index a0a511c..0000000 --- a/tests/unit/test_conversions.py +++ /dev/null @@ -1,190 +0,0 @@ -# Copyright (C) 2019 SuperDARN Canada, University of Saskatchewan -# Author: Marina Schmidt - - -import numpy as np -import unittest - -from collections import OrderedDict - -import pydarnio - - -class Test_Conversions(unittest.TestCase): - """ - Class to test the conversion functions - """ - def setUp(self): - """ - Creates the testing data - - Attributes - ---------- - dmap_list : List[dict] - List of dictionaries containing fields and values - dmap_records : List[dict] - List of ordered dictionaries containing dmap data structure - DmapScalar and DmapArray - """ - self.dmap_list = [{'stid': 1, 'channel': 0, - 'ptab': np.array([0, 9, 12, - 20, 22, - 26, 27], dtype=np.int64)}, - {'bmnum': np.int16(15), 'combf': "$Id: twofsound", - 'pwr0': np.array([58.081821, 52.241421, 32.936508, - 35.562561, 35.344330, 31.501854, - 25.313326, 13.731517, 3.482957, - -5.032664, -9.496454, 3.254651], - dtype=np.float32)}, - {'radar.revision.major': np.int8(1), - 'radar.revision.minor': np.int8(18), - 'float test': float(3.5), - 'float2 test': 3.65, - 'channel': 'a', - 'double test': np.array([[2.305015, 2.0251], - [16548548, 78687686]], - dtype=np.float64)}, - {'time.us': 508473, - 'negative int': -42, - 'long int': np.int64(215610516132151613), - 'unsigned char': np.uint8(3), - 'unsigned short': np.uint16(45), - 'unsigned int': np.uint32(100), - 'unsigned long': np.uint64(1250000000000), - 'list test': [np.int64(1), np.int64(2), - np.int64(34), np.int64(45)]}] - self.dmap_records = \ - [OrderedDict([('stid', pydarnio.DmapScalar('stid', 1, 3, 'i')), - ('channel', pydarnio.DmapScalar('channel', 0, 3, 'i')), - ('ptab', pydarnio.DmapArray('ptab', - np.array([0, 9, 12, 20, 22, - 26, 27], - dtype=np.int64), - 10, 'q', 1, [7]))]), - OrderedDict([('bmnum', pydarnio.DmapScalar('bmnum', 15, 2, 'h')), - ('combf', pydarnio.DmapScalar('combf', - "$Id: twofsound", 9, - 's')), - ('pwr0', pydarnio.DmapArray('pwr0', - np.array([58.081821, - 52.241421, - 32.936508, - 35.562561, - 35.344330, - 31.501854, - 25.313326, - 13.731517, - 3.482957, - -5.032664, - -9.496454, - 3.254651], - dtype=np.float32), - 4, 'f', 1, [12]))]), - OrderedDict([('radar.revision.major', - pydarnio.DmapScalar('radar.revision.major', - np.int8(1), 1, 'c')), - ('radar.revision.minor', - pydarnio.DmapScalar('radar.revision.minor', - np.int8(18), 1, 'c')), - ('float test', - pydarnio.DmapScalar('float test', - float(3.5), 4, 'f')), - ('float2 test', - pydarnio.DmapScalar('float2 test', 3.65, 4, 'f')), - ('channel', pydarnio.DmapScalar('channel', 'a', 9, - 's')), - ('double test', - pydarnio.DmapArray('double test', - np.array([[2.305015, 2.0251], - [16548548, 78687686]], - dtype=np.float64), 8, - 'd', 2, [2, 2]))]), - OrderedDict([('time.us', pydarnio.DmapScalar('time.us', 508473, - 3, 'i')), - ('negative int', - pydarnio.DmapScalar('negative int', -42, 3, 'i')), - ('long int', - pydarnio.DmapScalar('long int', - np.int64(215610516132151613), - 10, 'q')), - ('unsigned char', pydarnio.DmapScalar('unsigned char', - np.uint8(3), - 16, 'B')), - ('unsigned short', - pydarnio.DmapScalar('unsigned short', np.uint16(45), - 17, 'H')), - ('unsigned int', - pydarnio.DmapScalar('unsigned int', np.uint32(100), - 18, 'I')), - ('unsigned long', - pydarnio.DmapScalar('unsigned long', - np.uint64(1250000000000), - 19, 'Q')), - ('list test', - pydarnio.DmapArray('list test', - np.array([1, 2, 34, 45], - dtype=np.int64), - 10, 'q', 1, [4]))])] - - def dmap_compare(self, dmap1: list, dmap2: list): - """ - compares dmap data structure records to ensure they are equivalent - """ - # Quick simple tests that can be done before looping - # over the list - self.assertEqual(len(dmap1), len(dmap2)) - - # NamedTuple are comparison capabilities - for record1, record2 in zip(dmap1, dmap2): - diff_fields1 = set(record1) - set(record2) - self.assertEqual(len(diff_fields1), 0) - diff_fields2 = set(record2) - set(record1) - self.assertEqual(len(diff_fields2), 0) - for field, val_obj in record1.items(): - if isinstance(val_obj, pydarnio.DmapScalar): - self.assertEqual(record2[field], val_obj) - else: - self.compare_dmap_array(record2[field], val_obj) - - def compare_dmap_array(self, dmaparr1, dmaparr2): - """ - Compares DmapArrays because np.arrays need to call a numpy comparison - method to compare the elements - """ - self.assertEqual(dmaparr1.name, dmaparr2.name) - self.assertEqual(dmaparr1.data_type, dmaparr2.data_type) - self.assertEqual(dmaparr1.data_type_fmt, dmaparr2.data_type_fmt) - self.assertEqual(dmaparr1.dimension, dmaparr2.dimension) - self.assertTrue(np.array_equal(dmaparr1.value, dmaparr2.value)) - - def test_dict2dmap(self): - """ - From utils package, testing dict2dmap function - """ - dmap_records_test = pydarnio.dict2dmap(self.dmap_list) - self.dmap_compare(dmap_records_test, self.dmap_records) - - def test_dmap2dict(self): - """ - From utils package, testing dmap2dict function - """ - # need to break up the list of dictionaries to properly - # compare each field value - dmap_list_test = pydarnio.dmap2dict(self.dmap_records) - for j in range(len(dmap_list_test)): - for key, value in dmap_list_test[j].items(): - if isinstance(value, np.ndarray): - self.assertTrue(np.array_equal(value, - self.dmap_list[j][key])) - else: - self.assertEqual(value, self.dmap_list[j][key]) - - -if __name__ == '__main__': - - """ - Runs the above class in a unittest system. - Roughly takes 467 seconds. - """ - - unittest.main() diff --git a/tests/unit/test_dmap.py b/tests/unit/test_dmap.py deleted file mode 100644 index 0a1c794..0000000 --- a/tests/unit/test_dmap.py +++ /dev/null @@ -1,298 +0,0 @@ -# Copyright (C) 2019 SuperDARN Canada, University of Saskatchewan -# Author: Marina Schmidt - -import bz2 -import collections -import copy -import logging -import numpy as np -import os -import pytest -import unittest - -import pydarnio - -import dmap_data_sets - -pydarnio_logger = logging.getLogger('pydarnio') - -# Test files -rawacf_stream = "../testfiles/20170410.1801.00.sas.stream.rawacf.bz2" -rawacf_file = "../testfiles/20170410.1801.00.sas.rawacf" -fitacf_file = "../testfiles/20180220.C0.rkn.fitacf" -map_file = "../testfiles/20170114.map" -iqdat_file = "../testfiles/20160316.1945.01.rkn.iqdat" -grid_file = "../testfiles/20180220.C0.rkn.grid" -# Black listed files -corrupt_file1 = "../testfiles/20070117.1001.00.han.rawacf" -corrupt_file2 = "../testfiles/20090320.1601.00.pgr.rawacf" - - -@pytest.mark.skip -class TestDmapRead(unittest.TestCase): - """ - Testing class for DmapRead class - """ - def setUp(self): - pass - - """ - Testing DmapRead's constructor - """ - def test_incorrect_path(self): - """ - Testing DmapRead's constructor with an non-existant folder. - - Expected behaviour: raise FileNotFoundError - """ - self.assertRaises(FileNotFoundError, pydarnio.DmapRead, - './dog/somefile.rawacf') - - def test_incorrect_file(self): - """ - Tests if DmapRead's constructor with an non-existant file - - Expected bahaviour: raises FileNotFoundError - """ - self.assertRaises(FileNotFoundError, pydarnio.DmapRead, - '../testfiles/somefile.rawacf') - - def test_empty_file(self): - """ - Tests if DmapRead's constructor with an empty file - - Expected behaviour: raise EmptyFileError - """ - self.assertRaises(pydarnio.dmap_exceptions.EmptyFileError, - pydarnio.DmapRead, '../testfiles/empty.rawacf') - - def test_open_dmap_file(self): - """ - Tests DmapRead's constructor on opening a rawacf. - It should be able to open the file, read it and convert to bytearray. - - Checks: - - bytearray instance is created from reading in the file - - bytearray is not empty - """ - file_path = fitacf_file - dm = pydarnio.DmapRead(file_path) - self.assertIsInstance(dm.dmap_bytearr, bytearray) - self.assertGreater(dm.dmap_end_bytes, 0) - - def test_integrity_check_dmap_file(self): - """ - Tests DmapRead test_initial_data_integrity - It should be able to read through the bytearray quickly - ensureing no curruption has occured in the file. - - Behaviours: raising no exceptions - """ - file_path = rawacf_file - dm = pydarnio.DmapRead(file_path) - dm.test_initial_data_integrity() - - def test_read_dmap_file(self): - """ - Tests DmapRead test read_dmap. - - Behaviour: raising no exceptions - """ - file_path = fitacf_file - dm = pydarnio.DmapRead(file_path) - dmap_records = dm.read_records() - dmap_records = dm.get_dmap_records - self.assertIsInstance(dmap_records, collections.deque) - self.assertIsInstance(dmap_records[0], collections.OrderedDict) - self.assertIsInstance(dmap_records[4]['bmnum'], pydarnio.DmapScalar) - self.assertIsInstance(dmap_records[1]['ptab'], pydarnio.DmapArray) - self.assertIsInstance(dmap_records[7]['channel'].value, int) - self.assertIsInstance(dmap_records[2]['ltab'].value, np.ndarray) - self.assertEqual(dmap_records[0]['ptab'].dimension, 1) - self.assertEqual(dmap_records[50]['gflg'].value[1], 0) - - # TODO: Again dependent on the file used :/ - def test_integrity_check_corrupt_file1(self): - """ - Test test_initial_data_integrity on a corrupt file - - Expected bahaviour: raises pydmap expection - """ - dmap = pydarnio.DmapRead(corrupt_file1) - with self.assertRaises(pydarnio.dmap_exceptions.MismatchByteError): - dmap.test_initial_data_integrity() - - def test_read_corrupt_file1(self): - """ - Test read_records on a corrupt file - - Expected bahaviour: raises pydmap expection - """ - dmap = pydarnio.DmapRead(corrupt_file1) - with self.assertRaises(pydarnio.dmap_exceptions.DmapDataTypeError): - dmap.read_records() - - def test_integrity_check_corrupt_file2(self): - """ - Test test_initial_data_integrity on a corrupt file - - Expected bahaviour: raises pydmap expection - """ - dmap = pydarnio.DmapRead(corrupt_file2) - with self.assertRaises(pydarnio.dmap_exceptions.NegativeByteError): - dmap.test_initial_data_integrity() - - def test_read_currupt_file2(self): - """ - Test read_records on a corrupt file - - Expected bahaviour: raises pydmap expection - """ - dmap = pydarnio.DmapRead(corrupt_file2) - with self.assertRaises(pydarnio.dmap_exceptions.NegativeByteError): - dmap.read_records() - - def test_dmap_read_stream(self): - """ - Test read_records on dmap data stream. - The dmap data stream is formed from compressed - bzip2 file that returns a bytes object. - - Checks: - - returns correct data structures - - returns excpected values - """ - # bz2 opens the compressed file into a data - # stream of bytes without actually uncompressing the file - with bz2.open(rawacf_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.DmapRead(dmap_stream, True) - dmap_data = dmap.read_records() - dmap_data = dmap.get_dmap_records - self.assertIsInstance(dmap_data, collections.deque) - self.assertIsInstance(dmap_data[0], collections.OrderedDict) - self.assertIsInstance(dmap_data[4]['channel'], pydarnio.DmapScalar) - self.assertIsInstance(dmap_data[1]['ptab'], pydarnio.DmapArray) - self.assertIsInstance(dmap_data[7]['channel'].value, int) - self.assertIsInstance(dmap_data[2]['xcfd'].value, np.ndarray) - self.assertEqual(dmap_data[0]['xcfd'].dimension, 3) - - def test_dmap_read_corrupt_stream(self): - """ - Test read_records on a corrupt stream. Read in compressed - file which returns a byte object, then insert some random - bytes to produce a corrupt stream. - - Expected bahaviour: raises pydmap expection - """ - with bz2.open(rawacf_stream) as fp: - dmap_stream = fp.read() - - # need to convert to byte array for mutability - # since bytes are immutable. - corrupt_stream = bytearray(dmap_stream[0:36]) - corrupt_stream[36:40] = bytearray(str(os.urandom(4)).encode('utf-8')) - corrupt_stream[40:] = dmap_stream[37:] - dmap = pydarnio.DmapRead(corrupt_stream, True) - with self.assertRaises(pydarnio.dmap_exceptions.DmapDataError): - dmap.read_records() - - -@pytest.mark.skip -class TestDmapWrite(unittest.TestCase): - """ Testing DmapWrite class""" - def setUp(self): - pass - - def test_incorrect_filename_input_using_write_methods(self): - """ - Testing if a filename is not given to DmapWrite - - Expected behaviour - ------------------ - Raises FilenameRequiredError - no filename was given to write and - constructor - """ - rawacf_data = copy.deepcopy(dmap_data_sets.dmap_data) - dmap_data = pydarnio.DmapWrite(rawacf_data) - with self.assertRaises(pydarnio.dmap_exceptions.FilenameRequiredError): - dmap_data.write_dmap() - - def test_empty_data_check(self): - """ - Testing if no data is given to DmapWrite - - Expected behaviour - ------------------ - Raise DmapDataError - no data is given to write - """ - with self.assertRaises(pydarnio.dmap_exceptions.DmapDataError): - dmap_write = pydarnio.DmapWrite(filename="test.test") - dmap_write.write_dmap() - - def test_writing_dmap(self): - """ - Testing write_dmap method - - Expected behaviour - ------------------ - File is produced - """ - dmap_data = copy.deepcopy(dmap_data_sets.dmap_data) - dmap = pydarnio.DmapWrite(dmap_data) - - # Integration testing will test the integrity of the - # writing procedure. - dmap.write_dmap("test_dmap.dmap") - self.assertTrue(os.path.isfile("test_dmap.dmap")) - - os.remove("test_dmap.dmap") - - def test_scalar(self): - """ - Test DmapWrite writing a character scalar type. - - Behaviour: Raised DmapCharError - Dmap cannot write characters as they are treated as strings and not - int8 - RST standard for char types. - """ - scalar = pydarnio.DmapScalar('channel', 'c', 1, 'c') - dmap_write = pydarnio.DmapWrite([{'channel': scalar}]) - with self.assertRaises(pydarnio.dmap_exceptions.DmapCharError): - dmap_write.dmap_scalar_to_bytes(scalar) - - def test_String_array(self): - """ - Test DmapWrite writing string arrays - - Behaviour: Raised DmapDataError - DmapWrite doesn't support writing string arrays because DmapRead does - not support string arrays. - """ - array = pydarnio.DmapArray('xcf', np.array(['dog', 'cat', 'mouse']), - 9, 's', 1, [3]) - dmap_write = pydarnio.DmapWrite([{'xcf': array}]) - with self.assertRaises(pydarnio.dmap_exceptions.DmapDataError): - dmap_write.dmap_array_to_bytes(array) - - def test_character_array(self): - """ - Test DmapWrite writing character arrays. - - Behaviour: Raised DmapCharError - """ - array = pydarnio.DmapArray('channel', np.array(['d', 'c', 'm']), - 1, 'c', 1, [3]) - dmap_write = pydarnio.DmapWrite([{'channel': array}]) - with self.assertRaises(pydarnio.dmap_exceptions.DmapCharError): - dmap_write.dmap_array_to_bytes(array) - - -if __name__ == '__main__': - """ - Runs the above class in a unittest system. - Roughly takes 467 seconds. - """ - pydarnio_logger.info("Starting DMAP testing") - - unittest.main() diff --git a/tests/unit/test_superdarn.py b/tests/unit/test_superdarn.py deleted file mode 100644 index 858812b..0000000 --- a/tests/unit/test_superdarn.py +++ /dev/null @@ -1,1023 +0,0 @@ -# Copyright (C) 2019 SuperDARN Canada, University of Saskatchewan -# Author: Marina Schmidt -""" -This test suite is to test the implementation for the following classes: - SDarnRead - DarnUtilities - SDarnWrite -Support for the following SuperDARN file types: - iqdat - rawacf - fitacf - grid - map -""" - -import bz2 -import copy -import collections -import logging -import numpy as np -import os -import pytest -import unittest - -import pydarnio - -import map_data_sets -import grid_data_sets -import fitacf_data_sets -import iqdat_data_sets -import rawacf_data_sets - -pydarnio_logger = logging.getLogger('pydarnio') - -# Test files -rawacf_stream = "../testfiles/20170410.1801.00.sas.stream.rawacf.bz2" -rawacf_file = "../testfiles/20170410.1801.00.sas.rawacf" -fitacf_file = "../testfiles/20160331.2201.00.mcm.a.fitacf" -map_file = "../testfiles/20170114.map" -iqdat_file = "../testfiles/20160316.1945.01.rkn.iqdat" -grid_file = "../testfiles/20180220.C0.rkn.grid" -# Black listed files -corrupt_file1 = "../testfiles/20070117.1001.00.han.rawacf" -corrupt_file2 = "../testfiles/20090320.1601.00.pgr.rawacf" - - -@pytest.mark.skip -class TestSDarnRead(unittest.TestCase): - """ - Testing class for SDarnRead class - """ - def setUp(self): - pass - - """ - Testing SDarnRead constructor - """ - def test_incorrect_path(self): - """ - Testing SDarnRead constructor with an nonexistent folder. - - Expected behaviour: raise FileNotFoundError - """ - self.assertRaises(FileNotFoundError, pydarnio.SDarnRead, - './dog/somefile.rawacf') - - def test_incorrect_file(self): - """ - Tests if SDarnRead constructor with an non-existent file - - Expected behaviour: raises FileNotFoundError - """ - self.assertRaises(FileNotFoundError, pydarnio.SDarnRead, - '../testfiles/somefile.rawacf') - - def test_empty_file(self): - """ - Tests if SDarnRead constructor with an empty file - - Expected behaviour: raise EmptyFileError - """ - self.assertRaises(pydarnio.dmap_exceptions.EmptyFileError, - pydarnio.SDarnRead, '../testfiles/empty.rawacf') - - def test_open_rawacf(self): - """ - Tests SDarnRead constructor on opening a rawacf. - It should be able to open the file, read it and convert to bytearray. - - Checks: - - bytearray instance is created from reading in the file - - bytearray is not empty - """ - file_path = rawacf_file - dm = pydarnio.SDarnRead(file_path) - self.assertIsInstance(dm.dmap_bytearr, bytearray) - self.assertGreater(dm.dmap_end_bytes, 0) - - def test_open_fitacf(self): - """ - Tests SDarnRead constructor on opening a fitacf. - It should be able to open the file, read it and convert to bytearray. - - Checks: - - bytearray instance is created from reading in the file - - bytearray is not empty - """ - file_path = fitacf_file - dm = pydarnio.SDarnRead(file_path) - self.assertIsInstance(dm.dmap_bytearr, bytearray) - self.assertGreater(dm.dmap_end_bytes, 0) - - def test_open_map(self): - """ - Tests SDarnRead constructor on opening a map. - It should be able to open the file, read it and convert to bytearray. - - Checks: - - bytearray instance is created from reading in the file - - bytearray is not empty - """ - file_path = map_file - dm = pydarnio.SDarnRead(file_path) - self.assertIsInstance(dm.dmap_bytearr, bytearray) - self.assertGreater(dm.dmap_end_bytes, 0) - - def test_open_grid(self): - """ - Tests SDarnRead constructor on opening a grid. - It should be able to open the file, read it and convert to bytearray. - - Checks: - - bytearray instance is created from reading in the file - - bytearray is not empty - """ - file_path = grid_file - dm = pydarnio.SDarnRead(file_path) - self.assertIsInstance(dm.dmap_bytearr, bytearray) - self.assertGreater(dm.dmap_end_bytes, 0) - - def test_open_iqdat(self): - """ - Tests SDarnRead constructor on opening a iqdat. - It should be able to open the file, read it and convert to bytearray. - - Checks: - - bytearray instance is created from reading in the file - - bytearray is not empty - """ - file_path = iqdat_file - dm = pydarnio.SDarnRead(file_path) - self.assertIsInstance(dm.dmap_bytearr, bytearray) - self.assertGreater(dm.dmap_end_bytes, 0) - - # TODO: potential issue if files change and the values are not the same :/ - def test_read_iqdat(self): - """ - Test reading records from iqdat. - - Checks: - - returns correct data structures - - returns expected values - """ - file_path = iqdat_file - dm = pydarnio.SDarnRead(file_path) - _ = dm.read_iqdat() - dm_records = dm.get_dmap_records - self.assertIsInstance(dm_records, collections.deque) - self.assertIsInstance(dm_records[0], collections.OrderedDict) - self.assertIsInstance(dm_records[0]['rxrise'], pydarnio.DmapScalar) - self.assertIsInstance(dm_records[3]['tsc'], pydarnio.DmapArray) - self.assertIsInstance(dm_records[5]['mppul'].value, int) - self.assertIsInstance(dm_records[6]['tnoise'].value, np.ndarray) - self.assertEqual(dm_records[7]['channel'].value, 0) - self.assertEqual(dm_records[10]['data'].dimension, 1) - - def test_read_rawacf(self): - """ - Test reading records from rawacf. - - Checks: - - returns correct data structures - - returns expected values - """ - file_path = rawacf_file - dm = pydarnio.SDarnRead(file_path) - dm_records = dm.read_rawacf() - dm_records = dm.get_dmap_records - self.assertIsInstance(dm_records, collections.deque) - self.assertIsInstance(dm_records[0], collections.OrderedDict) - self.assertIsInstance(dm_records[4]['channel'], pydarnio.DmapScalar) - self.assertIsInstance(dm_records[1]['ptab'], pydarnio.DmapArray) - self.assertIsInstance(dm_records[7]['channel'].value, int) - self.assertIsInstance(dm_records[2]['xcfd'].value, np.ndarray) - self.assertEqual(dm_records[0]['xcfd'].dimension, 3) - - def test_read_fitacf(self): - """ - Test reading records from fitacf. - - Checks: - - returns correct data structures - - returns expected values - """ - file_path = fitacf_file - dm = pydarnio.SDarnRead(file_path) - dm_records = dm.read_fitacf() - dm_records = dm.get_dmap_records - self.assertIsInstance(dm_records, collections.deque) - self.assertIsInstance(dm_records[0], collections.OrderedDict) - self.assertIsInstance(dm_records[4]['bmnum'], pydarnio.DmapScalar) - self.assertIsInstance(dm_records[1]['ptab'], pydarnio.DmapArray) - self.assertIsInstance(dm_records[7]['channel'].value, int) - self.assertIsInstance(dm_records[2]['ltab'].value, np.ndarray) - self.assertEqual(dm_records[0]['ptab'].dimension, 1) - - def test_read_grid(self): - """ - Test reading records from grid file. - - Checks: - - returns correct data structures - - returns expected values - """ - file_path = grid_file - dm = pydarnio.SDarnRead(file_path) - _ = dm.read_grid() - dm_records = dm.get_dmap_records - self.assertIsInstance(dm_records, collections.deque) - self.assertIsInstance(dm_records[0], collections.OrderedDict) - self.assertIsInstance(dm_records[4]['start.year'], pydarnio.DmapScalar) - self.assertIsInstance(dm_records[1]['v.max'], pydarnio.DmapArray) - self.assertIsInstance(dm_records[7]['end.day'].value, int) - self.assertIsInstance(dm_records[2]['stid'].value, np.ndarray) - self.assertEqual(dm_records[0]['nvec'].dimension, 1) - - def test_read_map(self): - """ - Test reading records from map file. - - Checks: - - returns correct data structures - - returns expected values - """ - file_path = map_file - dm = pydarnio.SDarnRead(file_path) - _ = dm.read_map() - dm_records = dm.get_dmap_records - self.assertIsInstance(dm_records, collections.deque) - self.assertIsInstance(dm_records[0], collections.OrderedDict) - self.assertIsInstance(dm_records[2]['IMF.flag'], - pydarnio.io.datastructures.DmapScalar) - self.assertIsInstance(dm_records[3]['stid'], pydarnio.DmapArray) - self.assertIsInstance(dm_records[8]['IMF.flag'].value, int) - self.assertIsInstance(dm_records[10]['stid'].value, np.ndarray) - self.assertEqual(dm_records[3]['stid'].dimension, 1) - # this will be file dependent... future working test project. - self.assertEqual(dm_records[0]['stid'].shape[0], 14) - - def test_read_corrupt_file1(self): - """ - Test read_records on a corrupt file - - Expected behaviour: raises pydmap exception - """ - dmap = pydarnio.SDarnRead(corrupt_file1) - with self.assertRaises(pydarnio.dmap_exceptions.DmapDataTypeError): - dmap.read_rawacf() - - def test_read_currupt_file2(self): - """ - Test read_records on a corrupt file - - Expected behaviour: raises pydmap exception - """ - dmap = pydarnio.SDarnRead(corrupt_file2) - with self.assertRaises(pydarnio.dmap_exceptions.NegativeByteError): - dmap.read_rawacf() - - def test_dmap_read_stream(self): - """ - Test read_records on dmap data stream. - The dmap data stream is formed from compressed - bzip2 file that returns a bytes object. - - Checks: - - returns correct data structures - - returns expected values - """ - # bz2 opens the compressed file into a data - # stream of bytes without actually uncompressing the file - with bz2.open(rawacf_stream) as fp: - dmap_stream = fp.read() - dmap = pydarnio.SDarnRead(dmap_stream, True) - dmap_data = dmap.read_rawacf() - dmap_data = dmap.get_dmap_records - self.assertIsInstance(dmap_data, collections.deque) - self.assertIsInstance(dmap_data[0], collections.OrderedDict) - self.assertIsInstance(dmap_data[4]['channel'], pydarnio.DmapScalar) - self.assertIsInstance(dmap_data[1]['ptab'], pydarnio.DmapArray) - self.assertIsInstance(dmap_data[7]['channel'].value, int) - self.assertIsInstance(dmap_data[2]['xcfd'].value, np.ndarray) - self.assertEqual(dmap_data[0]['xcfd'].dimension, 3) - - def test_dmap_read_corrupt_stream(self): - """ - Test read_records on a corrupt stream. Read in compressed - file which returns a byte object, then insert some random - bytes to produce a corrupt stream. - - Expected behaviour: raises pydmap exception - """ - with bz2.open(rawacf_stream) as fp: - dmap_stream = fp.read() - - # need to convert to byte array for mutability - # since bytes are immutable. - corrupt_stream = bytearray(dmap_stream[0:36]) - corrupt_stream[36:40] = bytearray(str(os.urandom(4)).encode('utf-8')) - corrupt_stream[40:] = dmap_stream[37:] - dmap = pydarnio.SDarnRead(corrupt_stream, True) - with self.assertRaises(pydarnio.dmap_exceptions.DmapDataError): - dmap.read_rawacf() - - -@pytest.mark.skip -class TestDarnUtilities(unittest.TestCase): - """ - Testing DarnUtilities class. - - Note - ---- - All methods in this class are static so there is no constructor testing - """ - def SetUp(self): - pass - - def test_dict_key_diff(self): - """ - Testing dict_key_diff - returns the difference in keys between two sets - dictionaries - - Expected behaviour - ------------------ - Returns the set difference between two dictionaries - """ - a = {'a': 4, 'c': 5, 'd': 4} - b = {'1': 'a', 'c': 'd', 'd': 4, 'z': 'dog'} - solution_a_b = {'a'} - solution_b_a = {'1', 'z'} - diff_set = pydarnio.SDarnUtilities.dict_key_diff(a, b) - self.assertEqual(diff_set, solution_a_b) - diff_set = pydarnio.SDarnUtilities.dict_key_diff(b, a) - self.assertEqual(diff_set, solution_b_a) - - def test_dict_list2set(self): - """ - Tests the dict_list2set method - this method converts lists of - dictionaries to concatenated full sets - - Expected behaviour - ------------------ - Returns only a single set the comprises of the dictionary keys - given in the list - """ - dict1 = {'a': 1, 'b': 2, 'c': 3} - dict2 = {'rst': '4.1', 'stid': 3, 'vel': [2.3, 4.5]} - dict3 = {'fitacf': 'f', 'rawacf': 's', 'map': 'm'} - - complete_set = {'a', 'b', 'c', - 'rst', 'stid', 'vel', - 'fitacf', 'rawacf', 'map'} - dict_set = pydarnio.SDarnUtilities.dict_list2set([dict1, dict2, dict3]) - self.assertEqual(dict_set, complete_set) - - def test_extra_field_check_pass(self): - """ - Test the extra_field_check method - this method checks if there are - differences in the key sets of dictionaries that when passed a record - and field names it will indicate if there is an extra field in the - record key set - - Expected behaviour - ------------------ - Nothing - if there are no differences in the key set then - nothing returns - """ - dict1 = {'a': 1, 'b': 2, 'c': 3} - dict2 = {'rst': '4.1', 'stid': 3, 'vel': [2.3, 4.5]} - dict3 = {'fitacf': 'f', 'rawacf': 's', 'map': 'm'} - test_dict = {'a': 3, 'b': 3, 'c': 3, 'rst': 1, 'vel': 'd'} - pydarnio.SDarnUtilities.extra_field_check([dict1, dict2, dict3], - test_dict, 1) - - def test_extra_field_check_fail(self): - """ - Test the extra_field_check method - this method checks if there are - differences in the key sets of dictionaries that when passed a record - and field names it will indicate if there is an extra field in the - record key set - - Expected behaviour - ----------------- - Raises SuperDARNExtraFieldError because there are differences between - the two dictionary sets - """ - dict1 = {'a': 1, 'b': 2, 'c': 3} - dict2 = {'rst': '4.1', 'stid': 3, 'vel': [2.3, 4.5]} - dict3 = {'fitacf': 'f', 'rawacf': 's', 'map': 'm'} - - test_dict = {'a': 3, 'b': 3, 'c': 2, 'd': 3, 'rst': 1, 'vel': 'd'} - try: - pydarnio.SDarnUtilities.extra_field_check([dict1, dict2, dict3], - test_dict, 1) - except pydarnio.superdarn_exceptions.SuperDARNExtraFieldError as err: - self.assertEqual(err.fields, {'d'}) - - def test_missing_field_check_pass_mixed_dict(self): - """ - Testing missing_field_check - Reverse idea of the extra_field_check, - should find missing fields in a record when compared to a key set of - SuperDARN field names - - Expected behaviour - ------------------ - Nothing - if there is not differences then nothing happens - """ - dict1 = {'a': 1, 'b': 2, 'c': 3} - dict2 = {'rst': '4.1', 'stid': 3, 'vel': [2.3, 4.5]} - dict3 = {'fitacf': 'f', 'rawacf': 's', 'map': 'm'} - test_dict = {} - test_dict.update(dict1) - test_dict.update(dict3) - pydarnio.SDarnUtilities.missing_field_check([dict1, dict2, - dict3], - test_dict, 1) - - def test_missing_field_check_pass_mixed_subset(self): - """ - Testing missing_field_check - Reverse idea of the extra_field_check, - should find missing fields in a record when compared to a key set of - SuperDARN field names - - Expected behaviour - ------------------ - Nothing - the missing_field_check should be able to handle subsets of - of complete sets. Meaning it will not raise an error if it contains - the full subsets of the dictionary keys but the full overall set. - This is needed for Fitacf, Gird and Map files as they do not write - all the fields in if data is bad or users do not use certain - commands/options when processing the data. - """ - dict1 = {'a': 1, 'b': 2, 'c': 3} - dict2 = {'rst': '4.1', 'stid': 3, 'vel': [2.3, 4.5]} - dict3 = {'fitacf': 'f', 'rawacf': 's', 'map': 'm'} - - test_dict = {'a': 3, 'b': 3, 'c': 2, 'd': 2, - 'stid': 's', 'rst': 1, 'vel': 'd'} - - pydarnio.SDarnUtilities.missing_field_check([dict1, dict2, dict3], - test_dict, 1) - test_dict = {} - test_dict.update(dict1) - test_dict.update(dict3) - pydarnio.SDarnUtilities.missing_field_check([dict1, dict2, dict3], - test_dict, 1) - - def test_missing_field_check_fail2(self): - """ - Testing missing_field_check - Reverse idea of the extra_field_check, - should find missing fields in a record when compared to a key set of - SuperDARN field names - - Expected behaviour - ------------------ - Raise SuperDARNFieldMissingError - raised when there is a difference - between dictionary key sets - """ - - dict1 = {'a': 1, 'b': 2, 'c': 3} - dict2 = {'rst': '4.1', 'stid': 3, 'vel': [2.3, 4.5]} - dict3 = {'fitacf': 'f', 'rawacf': 's', 'map': 'm'} - - test_dict = {'a': 3, 'b': 3, 'd': 2, - 'stid': 's', 'vel': 'd', - 'fitacf': 3, 'map': 4} - - try: - pydarnio.SDarnUtilities.missing_field_check([dict1, dict2, dict3], - test_dict, 1) - except pydarnio.superdarn_exceptions.SuperDARNFieldMissingError as err: - self.assertEqual(err.fields, {'c', 'rst', 'rawacf'}) - - def test_missing_field_check_fail(self): - """ - Testing missing_field_check - Reverse idea of the extra_field_check, - should find missing fields in a record when compared to a key set of - SuperDARN field names - - Expected behaviour - ------------------ - Raise SuperDARNFieldMissingError - raised when there is a difference - between dictionary key sets - """ - - dict1 = {'a': 1, 'b': 2, 'c': 3} - dict2 = {'rst': '4.1', 'stid': 3, 'vel': [2.3, 4.5]} - dict3 = {'fitacf': 'f', 'rawacf': 's', 'map': 'm'} - - test_dict = {'a': 3, 'b': 3, 'd': 2, - 'stid': 's', 'rst': 1, 'vel': 'd', - 'fitacf': 3, 'map': 4} - - try: - pydarnio.SDarnUtilities.missing_field_check([dict1, dict2, dict3], - test_dict, 1) - except pydarnio.superdarn_exceptions.SuperDARNFieldMissingError as err: - self.assertEqual(err.fields, {'c', 'rawacf'}) - - def test_incorrect_types_check_pass(self): - """ - Test incorrect_types_check - this method checks if the field data - format type is not correct to specified SuperDARN field type. - - Note - ---- - This method only works on pydarnio DMAP record data structure - - Expected Behaviour - ------------------ - Nothing - should not return or raise anything if the fields - are the correct data format type - """ - dict1 = {'a': 's', 'b': 'i', 'c': 'f'} - dict3 = {'fitacf': 'f', 'rawacf': 's', 'map': 'm'} - - test_dict = {'a': pydarnio.DmapScalar('a', 1, 1, 's'), - 'b': pydarnio.DmapScalar('a', 1, 1, 'i'), - 'c': pydarnio.DmapArray('a', np.array([2.4, 2.4]), 1, - 'f', 1, [3]), - 'fitacf': pydarnio.DmapScalar('a', 1, 1, 'f'), - 'rawacf': pydarnio.DmapScalar('a', 1, 1, 's'), - 'map': pydarnio.DmapScalar('a', 1, 1, 'm')} - - pydarnio.SDarnUtilities.incorrect_types_check([dict1, dict3], - test_dict, 1) - - def test_incorrect_types_check_fail(self): - """ - Test incorrect_types_check - this method checks if the field data - format type is not correct to specified SuperDARN field type. - - Note - ---- - This method only works on pydarnio DMAP record data structure - - Expected Behaviour - ------------------ - Raises SuperDARNDataFormatTypeError - because the field format types - should not be the same. - """ - - dict1 = {'a': 's', 'b': 'i', 'c': 'f'} - dict3 = {'fitacf': 'f', 'rawacf': 's', 'map': 'm'} - - test_dict = {'a': pydarnio.DmapScalar('a', 1, 1, 's'), - 'b': pydarnio.DmapScalar('a', 1, 1, 'i'), - 'c': pydarnio.DmapArray('a', np.array([2.4, 2.4]), - 1, 'f', 1, [3]), - 'fitacf': pydarnio.DmapScalar('a', 1, 1, 's'), - 'rawacf': pydarnio.DmapScalar('a', 1, 1, 's'), - 'map': pydarnio.DmapScalar('a', 1, 1, 'm')} - try: - pydarnio.SDarnUtilities.incorrect_types_check([dict1, dict3], - test_dict, 1) - except pydarnio.superdarn_exceptions.SuperDARNDataFormatTypeError as err: - self.assertEqual(err.incorrect_params, {'fitacf': 'f'}) - - -@pytest.mark.skip -class TestSDarnWrite(unittest.TestCase): - """ - Tests SDarnWrite class - """ - def setUp(self): - pass - - def test_darn_write_constructor(self): - """ - Tests SDarnWrite constructor - - Expected behaviour - ------------------ - Contains file name of the data if given to it. - """ - rawacf_data = copy.deepcopy(rawacf_data_sets.rawacf_data) - darn = pydarnio.SDarnWrite(rawacf_data, "rawacf_test.rawacf") - self.assertEqual(darn.filename, "rawacf_test.rawacf") - - def test_empty_record(self): - """ - Tests if an empty record is given. This will later be changed for - real-time implementation. - - Expected behaviour - ------------------ - Raise DmapDataError if no data is provided to the constructor - """ - with self.assertRaises(pydarnio.dmap_exceptions.DmapDataError): - pydarnio.SDarnWrite([], 'dummy_file.acf') - - def test_incorrect_filename_input_using_write_methods(self): - """ - Tests if a file name is not provided to any of the write methods - - Expected behaviour - ------------------ - All should raise a FilenameRequiredError - if no file name is given - what do we write to. - """ - rawacf_data = copy.deepcopy(rawacf_data_sets.rawacf_data) - dmap_data = pydarnio.SDarnWrite(rawacf_data) - with self.assertRaises(pydarnio.dmap_exceptions.FilenameRequiredError): - dmap_data.write_rawacf() - dmap_data.write_fitacf() - dmap_data.write_iqdat() - dmap_data.write_grid() - dmap_data.write_map() - dmap_data.write_dmap() - - def test_SDarnWrite_missing_field_rawacf(self): - """ - Tests write_rawacf method - writes a rawacf structure file for the - given data - - Expected behaviour - ------------------ - Raises SuperDARNFieldMissingError - because the rawacf data is - missing field nave - """ - rawacf_missing_field = copy.deepcopy(rawacf_data_sets.rawacf_data) - del rawacf_missing_field[2]['nave'] - - dmap = pydarnio.SDarnWrite(rawacf_missing_field) - - try: - dmap.write_rawacf("test_rawacf.rawacf") - except pydarnio.superdarn_exceptions.SuperDARNFieldMissingError as err: - self.assertEqual(err.fields, {'nave'}) - self.assertEqual(err.record_number, 2) - - def test_extra_field_rawacf(self): - """ - Tests write_rawacf method - writes a rawacf structure file for the - given data - - Expected behaviour - ------------------ - Raises SuperDARNExtraFieldError because the rawacf data - has an extra field dummy - """ - rawacf_extra_field = copy.deepcopy(rawacf_data_sets.rawacf_data) - rawacf_extra_field[1]['dummy'] = pydarnio.DmapScalar('dummy', 'nothing', - chr(1), 's') - dmap = pydarnio.SDarnWrite(rawacf_extra_field) - - try: - dmap.write_rawacf("test_rawacf.rawacf") - except pydarnio.superdarn_exceptions.SuperDARNExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - self.assertEqual(err.record_number, 1) - - def test_incorrect_data_format_rawacf(self): - """ - Tests write_rawacf method - writes a rawacf structure file for the - given data - - Expected Behaviour - ------------------- - Raises SuperDARNDataFormatTypeError because the rawacf data has the - wrong type for the scan field - """ - rawacf_incorrect_fmt = copy.deepcopy(rawacf_data_sets.rawacf_data) - rawacf_incorrect_fmt[2]['scan'] = \ - rawacf_incorrect_fmt[2]['scan']._replace(data_type_fmt='c') - dmap = pydarnio.SDarnWrite(rawacf_incorrect_fmt) - - try: - dmap.write_rawacf("test_rawacf.rawacf") - except pydarnio.superdarn_exceptions.SuperDARNDataFormatTypeError as err: - self.assertEqual(err.incorrect_params['scan'], 'h') - self.assertEqual(err.record_number, 2) - - def test_writing_rawacf(self): - """ - Tests write_rawacf method - writes a rawacf file - - Expected behaviour - ------------------ - Rawacf file is produced - """ - rawacf_data = copy.deepcopy(rawacf_data_sets.rawacf_data) - - dmap = pydarnio.SDarnWrite(rawacf_data) - - dmap.write_rawacf("test_rawacf.rawacf") - # only testing the file is created since it should only be created - # at the last step after all checks have passed - # Testing the integrity of the insides of the file will be part of - # integration testing since we need SDarnRead for that. - self.assertTrue(os.path.isfile("test_rawacf.rawacf")) - os.remove("test_rawacf.rawacf") - - def test_writing_fitacf(self): - """ - Tests write_fitacf method - writes a fitacf file - - Expected behaviour - ------------------ - fitacf file is produced - """ - fitacf_data = copy.deepcopy(fitacf_data_sets.fitacf_data) - dmap = pydarnio.SDarnWrite(fitacf_data) - - dmap.write_fitacf("test_fitacf.fitacf") - self.assertTrue(os.path.isfile("test_fitacf.fitacf")) - os.remove("test_fitacf.fitacf") - - def test_missing_fitacf_field(self): - """ - Tests write_fitacf method - writes a fitacf structure file for the - given data - - Expected behaviour - ------------------ - Raises SuperDARNFieldMissingError - because the fitacf data is - missing field stid - """ - fitacf_missing_field = copy.deepcopy(fitacf_data_sets.fitacf_data) - del fitacf_missing_field[0]['stid'] - dmap = pydarnio.SDarnWrite(fitacf_missing_field) - - try: - dmap.write_fitacf("test_fitacf.fitacf") - except pydarnio.superdarn_exceptions.SuperDARNFieldMissingError as err: - self.assertEqual(err.fields, {'stid'}) - self.assertEqual(err.record_number, 0) - - def test_extra_fitacf_field(self): - """ - Tests write_fitacf method - writes a fitacf structure file for the - given data - - Expected behaviour - ------------------ - Raises SuperDARNExtraFieldError because the fitacf data - has an extra field dummy - """ - fitacf_extra_field = copy.deepcopy(fitacf_data_sets.fitacf_data) - fitacf_extra_field[1]['dummy'] = pydarnio.DmapArray('dummy', - np.array([1, 2]), - chr(1), 'c', 1, [2]) - dmap = pydarnio.SDarnWrite(fitacf_extra_field) - - try: - dmap.write_fitacf("test_fitacf.fitacf") - except pydarnio.superdarn_exceptions.SuperDARNExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - self.assertEqual(err.record_number, 1) - - def test_incorrect_fitacf_data_type(self): - """ - Tests write_fitacf method - writes a fitacf structure file for the - given data - - Expected Behaviour - ------------------- - Raises SuperDARNDataFormatTypeError because the fitacf data has the - wrong type for the ltab field - """ - - fitacf_incorrect_fmt = copy.deepcopy(fitacf_data_sets.fitacf_data) - fitacf_incorrect_fmt[1]['ltab'] = \ - fitacf_incorrect_fmt[1]['ltab']._replace(data_type_fmt='s') - dmap = pydarnio.SDarnWrite(fitacf_incorrect_fmt) - - try: - dmap.write_fitacf("test_fitacf.fitacf") - except pydarnio.superdarn_exceptions.SuperDARNDataFormatTypeError as err: - self.assertEqual(err.incorrect_params['ltab'], 'h') - self.assertEqual(err.record_number, 1) - - def test_writing_iqdat(self): - """ - Tests write_iqdat method - writes a iqdat file - - Expected behaviour - ------------------ - iqdat file is produced - """ - iqdat_data = copy.deepcopy(iqdat_data_sets.iqdat_data) - dmap = pydarnio.SDarnWrite(iqdat_data) - - dmap.write_iqdat("test_iqdat.iqdat") - self.assertTrue(os.path.isfile("test_iqdat.iqdat")) - os.remove("test_iqdat.iqdat") - - def test_missing_iqdat_field(self): - """ - Tests write_iqdat method - writes a iqdat structure file for the - given data - - Expected behaviour - ------------------ - Raises SuperDARNFieldMissingError - because the iqdat data is - missing field chnnum - """ - - iqdat_missing_field = copy.deepcopy(iqdat_data_sets.iqdat_data) - del iqdat_missing_field[1]['chnnum'] - dmap = pydarnio.SDarnWrite(iqdat_missing_field) - - try: - dmap.write_iqdat("test_iqdat.iqdat") - except pydarnio.superdarn_exceptions.SuperDARNFieldMissingError as err: - self.assertEqual(err.fields, {'chnnum'}) - self.assertEqual(err.record_number, 1) - - def test_extra_iqdat_field(self): - """ - Tests write_iqdat method - writes a iqdat structure file for the - given data - - Expected behaviour - ------------------ - Raises SuperDARNExtraFieldError because the iqdat data - has an extra field dummy - """ - iqdat_extra_field = copy.deepcopy(iqdat_data_sets.iqdat_data) - iqdat_extra_field[2]['dummy'] = \ - pydarnio.DmapArray('dummy', np.array([1, 2]), chr(1), 'c', 1, [2]) - dmap = pydarnio.SDarnWrite(iqdat_extra_field) - - try: - dmap.write_iqdat("test_iqdat.iqdat") - except pydarnio.superdarn_exceptions.SuperDARNExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - self.assertEqual(err.record_number, 2) - - def test_incorrect_iqdat_data_type(self): - """ - Tests write_iqdat method - writes a iqdat structure file for the - given data - - Expected Behaviour - ------------------- - Raises SuperDARNDataFormatTypeError because the iqdat data has the - wrong type for the lagfr field - """ - iqdat_incorrect_fmt = copy.deepcopy(iqdat_data_sets.iqdat_data) - iqdat_incorrect_fmt[2]['lagfr'] = \ - iqdat_incorrect_fmt[2]['lagfr']._replace(data_type_fmt='d') - dmap = pydarnio.SDarnWrite(iqdat_incorrect_fmt) - - try: - dmap.write_iqdat("test_iqdat.iqdat") - except pydarnio.superdarn_exceptions.SuperDARNDataFormatTypeError as err: - self.assertEqual(err.incorrect_params['lagfr'], 'h') - self.assertEqual(err.record_number, 2) - - def test_writing_map(self): - """ - Tests write_map method - writes a map file - - Expected behaviour - ------------------ - map file is produced - """ - map_data = copy.deepcopy(map_data_sets.map_data) - dmap = pydarnio.SDarnWrite(map_data) - - dmap.write_map("test_map.map") - self.assertTrue(os.path.isfile("test_map.map")) - os.remove("test_map.map") - - def test_missing_map_field(self): - """ - Tests write_map method - writes a map structure file for the - given data - - Expected behaviour - ------------------ - Raises SuperDARNFieldMissingError - because the map data is - missing field stid - """ - map_missing_field = copy.deepcopy(map_data_sets.map_data) - del map_missing_field[0]['IMF.Kp'] - dmap = pydarnio.SDarnWrite(map_missing_field) - - try: - dmap.write_map("test_map.map") - except pydarnio.superdarn_exceptions.SuperDARNFieldMissingError as err: - self.assertEqual(err.fields, {'IMF.Kp'}) - self.assertEqual(err.record_number, 0) - - def test_extra_map_field(self): - """ - Tests write_map method - writes a map structure file for the - given data - - Expected behaviour - ------------------ - Raises SuperDARNExtraFieldError because the map data - has an extra field dummy - """ - map_extra_field = copy.deepcopy(map_data_sets.map_data) - map_extra_field[1]['dummy'] = \ - pydarnio.DmapArray('dummy', np.array([1, 2]), chr(1), 'c', 1, [2]) - dmap = pydarnio.SDarnWrite(map_extra_field) - - try: - dmap.write_map("test_map.map") - except pydarnio.superdarn_exceptions.SuperDARNExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - self.assertEqual(err.record_number, 1) - - def test_incorrect_map_data_type(self): - """ - Tests write_map method - writes a map structure file for the - given data - - Expected Behaviour - ------------------- - Raises SuperDARNDataFormatTypeError because the map data has the - wrong type for the IMF.Bx field - """ - map_incorrect_fmt = copy.deepcopy(map_data_sets.map_data) - map_incorrect_fmt[2]['IMF.Bx'] = \ - map_incorrect_fmt[2]['IMF.Bx']._replace(data_type_fmt='i') - dmap = pydarnio.SDarnWrite(map_incorrect_fmt) - - try: - dmap.write_map("test_map.map") - except pydarnio.superdarn_exceptions.SuperDARNDataFormatTypeError as err: - self.assertEqual(err.incorrect_params.keys(), {'IMF.Bx'}) - self.assertEqual(err.record_number, 2) - - def test_writing_grid(self): - """ - Tests write_grid method - writes a grid file - - Expected behaviour - ------------------ - grid file is produced - """ - grid_data = copy.deepcopy(grid_data_sets.grid_data) - dmap = pydarnio.SDarnWrite(grid_data) - - dmap.write_grid("test_grid.grid") - self.assertTrue(os.path.isfile("test_grid.grid")) - os.remove("test_grid.grid") - - def test_missing_grid_field(self): - """ - Tests write_grid method - writes a grid structure file for the - given data - - Expected behaviour - ------------------ - Raises SuperDARNFieldMissingError - because the grid data is - missing field stid - """ - grid_missing_field = copy.deepcopy(grid_data_sets.grid_data) - del grid_missing_field[1]['start.year'] - dmap = pydarnio.SDarnWrite(grid_missing_field) - - try: - dmap.write_grid("test_grid.grid") - except pydarnio.superdarn_exceptions.SuperDARNFieldMissingError as err: - self.assertEqual(err.fields, {'start.year'}) - self.assertEqual(err.record_number, 1) - - def test_extra_grid_field(self): - """ - Tests write_grid method - writes a grid structure file for the - given data - - Expected behaviour - ------------------ - Raises SuperDARNExtraFieldError because the grid data - has an extra field dummy - """ - grid_extra_field = copy.deepcopy(grid_data_sets.grid_data) - grid_extra_field[0]['dummy'] = \ - pydarnio.DmapArray('dummy', np.array([1, 2]), chr(1), 'c', 1, [2]) - dmap = pydarnio.SDarnWrite(grid_extra_field) - - try: - dmap.write_grid("test_grid.grid") - except pydarnio.superdarn_exceptions.SuperDARNExtraFieldError as err: - self.assertEqual(err.fields, {'dummy'}) - self.assertEqual(err.record_number, 0) - - def test_incorrect_grid_data_type(self): - """ - Tests write_grid method - writes a grid structure file for the - given data - - Expected Behaviour - ------------------- - Raises SuperDARNDataFormatTypeError because the grid data has the - wrong type for the v.min field - """ - grid_incorrect_fmt = copy.deepcopy(grid_data_sets.grid_data) - grid_incorrect_fmt[2]['v.min'] = \ - grid_incorrect_fmt[2]['v.min']._replace(data_type_fmt='d') - dmap = pydarnio.SDarnWrite(grid_incorrect_fmt) - - try: - dmap.write_grid("test_grid.grid") - except pydarnio.superdarn_exceptions.SuperDARNDataFormatTypeError as err: - self.assertEqual(err.incorrect_params.keys(), {'v.min'}) - self.assertEqual(err.record_number, 2)