Esempio n. 1
0
 def test_rawparsing(self):
     ifg = Dataset.parse_raw("test_rawparsing.trt",
                             skiprows=8,
                             meta_len=5,
                             decimal=",",
                             sep=";")
     assert issubclass(ifg.meta.__class__, collections.abc.Mapping)
     with self.assertRaises(OSError):
         Dataset.parse_raw(546)
Esempio n. 2
0
def test_raw_str():
    string = [
        'Dataset', '----------', 'Parameters', '----------',
        'Datapoints: 2633', 'Predicted domain: wavelength',
        'Range: from 360.500 to 1200.250 nm', 'Normalized: False',
        'Delay value: Not given', 'SPP position(s): Not given',
        '----------------------------', 'Metadata extracted from file',
        '----------------------------', "{", '    "Average": "1 scans",',
        '    "Data measured with spectrometer name": "1107006U1",',
        '    "Integration time": "2,00 ms",',
        '    "Nr of pixels used for smoothing": "0",',
        '    "comment": "m_ifg 8,740",', '    "unparsed": [', '        [',
        '            "Timestamp [10 microsec ticks]256373440"', '        ]',
        '    ]', '}'
    ]

    ifg = Dataset.parse_raw("test_rawparsing.trt",
                            skiprows=8,
                            meta_len=5,
                            decimal=",",
                            sep=";")
    with setting("precision", 3):
        actual = ifg.__str__().split("\n")
    assert actual == string