From 8574937ba2e351820597b6c100bb48af1822de3b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 19 Jul 2012 10:20:53 -0400 Subject: [PATCH] Store wave, bin_info, and wave_info separately in WaveRecord. This makes more sense than storing them as a tuple. Also, use wave_record.wave_info['bname'] as the name for storing the wave in the filesystem view returned by packed.load. --- igor/packed.py | 14 +- igor/record/wave.py | 3 +- test/test.py | 776 ++++++++++++++++++++++---------------------- 3 files changed, 400 insertions(+), 393 deletions(-) diff --git a/igor/packed.py b/igor/packed.py index 10bf214..f6c8adf 100644 --- a/igor/packed.py +++ b/igor/packed.py @@ -117,13 +117,17 @@ def load(filename, strict=True, ignore_unknown=True): dir_stack.pop() elif isinstance(record, (_VariablesRecord, _WaveRecord)): if isinstance(record, _VariablesRecord): - filename = ':variables' # start with an invalid character - else: # to avoid collisions with folder - filename = ':waves' # names + # start with an invalid character to avoid collisions + # with folder names + filename = ':variables' + else: + filename = ''.join(c for c in record.wave_info['bname'] + ).split('\x00', 1)[0] if filename in cwd: - cwd[filename].append(record) + raise ValueError('collision on name {} in {}'.format( + filename, ':'.join(d for d,cwd in dir_stack))) else: - cwd[filename] = [record] + cwd[filename] = record return (records, filesystem) diff --git a/igor/record/wave.py b/igor/record/wave.py index 53d3af1..93de8a3 100644 --- a/igor/record/wave.py +++ b/igor/record/wave.py @@ -9,7 +9,8 @@ from . import Record class WaveRecord (Record): def __init__(self, *args, **kwargs): super(WaveRecord, self).__init__(*args, **kwargs) - self.wave = _loadibw(_BytesIO(bytes(self.data)), strict=False) + self.wave,self.bin_info,self.wave_info = _loadibw( + _BytesIO(bytes(self.data)), strict=False) def __str__(self): return str(self.wave) diff --git a/test/test.py b/test/test.py index cda1355..c2911f7 100644 --- a/test/test.py +++ b/test/test.py @@ -666,7 +666,7 @@ record 30: record 31: '\x95 Polar Graphs Demo, v3.01\n\n' record 32: -(array([ 0.30000001, 0.5448544 , 0.77480197, 0.97584349, 1.13573945, +array([ 0.30000001, 0.5448544 , 0.77480197, 0.97584349, 1.13573945, 1.24475539, 1.2962544 , 1.28710103, 1.21785283, 1.09272552, 0.91933674, 0.7082426 , 0.47229454, 0.22585714, -0.01606643, -0.23874778, -0.42862982, -0.57415301, -0.6664573 , -0.69992352, @@ -691,46 +691,46 @@ record 32: 1.17415261, 1.0286293 , 0.83874667, 0.61606491, 0.37414294, 0.12770344, -0.1082412 , -0.31933719, -0.49272597, -0.61785328, -0.6871013 , -0.69625437, -0.64475471, -0.53574032, -0.37584305, - -0.17479956, 0.05514668, 0.30000135], dtype=float32), - {'checksum': -25004, - 'note': '', - 'noteSize': 0, - 'pictSize': 0, - 'version': 2, - 'wfmSize': 638}, - {'aModified': 0, - 'bname': array(['r', 'a', 'd', 'i', 'u', 's', 'D', 'a', 't', 'a', '', '', '', '', + -0.17479956, 0.05514668, 0.30000135], dtype=float32) +{'checksum': -25004, + 'note': '', + 'noteSize': 0, + 'pictSize': 0, + 'version': 2, + 'wfmSize': 638} +{'aModified': 0, + 'bname': array(['r', 'a', 'd', 'i', 'u', 's', 'D', 'a', 't', 'a', '', '', '', '', '', '', '', '', '', ''], dtype='|S1'), - 'botFullScale': 0.0, - 'creationDate': 0, - 'dataUnits': array(['', '', '', ''], - dtype='|S1'), - 'depID': 0, - 'fileName': 0, - 'formula': 0, - 'fsValid': 0, - 'hsA': 0.04908738521234052, - 'hsB': 0.0, - 'kindBits': '\x00', - 'modDate': 2845545774, - 'next': 0, - 'npnts': 128, - 'srcFldr': 0, - 'swModified': 0, - 'topFullScale': 0.0, - 'type': 2, - 'useBits': '\x00', - 'wData': array([ 0.30000001, 0.5448544 , 0.77480197, 0.97584349]), - 'wModified': 0, - 'wUnused': array(['', ''], - dtype='|S1'), - 'waveNoteH': 0, - 'whVersion': 0, - 'xUnits': array(['', '', '', ''], - dtype='|S1')}) + 'botFullScale': 0.0, + 'creationDate': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, + 'formula': 0, + 'fsValid': 0, + 'hsA': 0.04908738521234052, + 'hsB': 0.0, + 'kindBits': '\x00', + 'modDate': 2845545774, + 'next': 0, + 'npnts': 128, + 'srcFldr': 0, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': array([ 0.30000001, 0.5448544 , 0.77480197, 0.97584349]), + 'wModified': 0, + 'wUnused': array(['', ''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, + 'xUnits': array(['', '', '', ''], + dtype='|S1')} record 33: -(array([ 0. , 0.0494739 , 0.0989478 , 0.1484217 , 0.1978956 , +array([ 0. , 0.0494739 , 0.0989478 , 0.1484217 , 0.1978956 , 0.24736951, 0.29684341, 0.34631732, 0.3957912 , 0.44526511, 0.49473903, 0.54421294, 0.59368682, 0.6431607 , 0.69263464, 0.74210852, 0.79158241, 0.84105635, 0.89053023, 0.94000411, @@ -755,46 +755,46 @@ record 33: 5.44212914, 5.4916029 , 5.54107714, 5.5905509 , 5.64002466, 5.6894989 , 5.73897219, 5.78844643, 5.83792019, 5.88739443, 5.93686819, 5.98634195, 6.03581619, 6.08528948, 6.13476372, - 6.18423796, 6.23371172, 6.28318548], dtype=float32), - {'checksum': 28621, - 'note': '', - 'noteSize': 0, - 'pictSize': 0, - 'version': 2, - 'wfmSize': 638}, - {'aModified': 0, - 'bname': array(['a', 'n', 'g', 'l', 'e', 'D', 'a', 't', 'a', '', '', '', '', '', '', + 6.18423796, 6.23371172, 6.28318548], dtype=float32) +{'checksum': 28621, + 'note': '', + 'noteSize': 0, + 'pictSize': 0, + 'version': 2, + 'wfmSize': 638} +{'aModified': 0, + 'bname': array(['a', 'n', 'g', 'l', 'e', 'D', 'a', 't', 'a', '', '', '', '', '', '', '', '', '', '', ''], dtype='|S1'), - 'botFullScale': 0.0, - 'creationDate': 0, - 'dataUnits': array(['', '', '', ''], - dtype='|S1'), - 'depID': 0, - 'fileName': 0, - 'formula': 0, - 'fsValid': 0, - 'hsA': 0.04908738521234052, - 'hsB': 0.0, - 'kindBits': '\x00', - 'modDate': 2845470039, - 'next': 0, - 'npnts': 128, - 'srcFldr': 0, - 'swModified': 0, - 'topFullScale': 0.0, - 'type': 2, - 'useBits': '\x00', - 'wData': array([ 0. , 0.0494739, 0.0989478, 0.1484217]), - 'wModified': 0, - 'wUnused': array(['', ''], - dtype='|S1'), - 'waveNoteH': 0, - 'whVersion': 0, - 'xUnits': array(['', '', '', ''], - dtype='|S1')}) + 'botFullScale': 0.0, + 'creationDate': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, + 'formula': 0, + 'fsValid': 0, + 'hsA': 0.04908738521234052, + 'hsB': 0.0, + 'kindBits': '\x00', + 'modDate': 2845470039, + 'next': 0, + 'npnts': 128, + 'srcFldr': 0, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': array([ 0. , 0.0494739, 0.0989478, 0.1484217]), + 'wModified': 0, + 'wUnused': array(['', ''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, + 'xUnits': array(['', '', '', ''], + dtype='|S1')} record 34: -(array([ 1.83690956e-17, 2.69450769e-02, 7.65399113e-02, +array([ 1.83690956e-17, 2.69450769e-02, 7.65399113e-02, 1.44305170e-01, 2.23293692e-01, 3.04783821e-01, 3.79158467e-01, 4.36888516e-01, 4.69528973e-01, 4.70633775e-01, 4.36502904e-01, 3.66688997e-01, @@ -836,70 +836,70 @@ record 34: 1.51621893e-01, 2.12215677e-01, 2.38205954e-01, 2.33226836e-01, 2.03656554e-01, 1.57870770e-01, 1.05330117e-01, 5.55786416e-02, 1.72677450e-02, - -2.72719120e-03, 5.24539061e-08], dtype=float32), - {'checksum': 23021, - 'dataEUnits': '', - 'dataEUnitsSize': 0, - 'dimEUnits': ['', '', '', ''], - 'dimEUnitsSize': array([0, 0, 0, 0]), - 'dimLabels': [[], [], [], []], - 'dimLabelsSize': array([0, 0, 0, 0]), - 'formula': 'PolarRadiusFunction(radiusData,1,0) * cos(PolarAngleFunction(angleData,3,1,2))\x00', - 'formulaSize': 80, - 'note': '', - 'noteSize': 0, - 'optionsSize1': 0, - 'optionsSize2': 0, - 'sIndicesSize': 0, - 'version': 5, - 'wfmSize': 832}, - {'aModified': 0, - 'bname': array(['W', '_', 'p', 'l', 'r', 'X', '5', '', '', '', '', '', '', '', '', + -2.72719120e-03, 5.24539061e-08], dtype=float32) +{'checksum': 23021, + 'dataEUnits': '', + 'dataEUnitsSize': 0, + 'dimEUnits': ['', '', '', ''], + 'dimEUnitsSize': array([0, 0, 0, 0]), + 'dimLabels': [[], [], [], []], + 'dimLabelsSize': array([0, 0, 0, 0]), + 'formula': 'PolarRadiusFunction(radiusData,1,0) * cos(PolarAngleFunction(angleData,3,1,2))\x00', + 'formulaSize': 80, + 'note': '', + 'noteSize': 0, + 'optionsSize1': 0, + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'version': 5, + 'wfmSize': 832} +{'aModified': 0, + 'bname': array(['W', '_', 'p', 'l', 'r', 'X', '5', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], dtype='|S1'), - 'botFullScale': 0.0, - 'creationDate': 0, - 'dFolder': 7848580, - 'dLock': 0, - 'dataEUnits': 0, - 'dataUnits': array(['', '', '', ''], - dtype='|S1'), - 'depID': 24, - 'dimEUnits': array([0, 0, 0, 0]), - 'dimLabels': array([0, 0, 0, 0]), - 'dimUnits': array([['', '', '', ''], + 'botFullScale': 0.0, + 'creationDate': 0, + 'dFolder': 7848580, + 'dLock': 0, + 'dataEUnits': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 24, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), + 'dimUnits': array([['', '', '', ''], ['', '', '', ''], ['', '', '', ''], ['', '', '', '']], dtype='|S1'), - 'fileName': 0, - 'formula': 8054500, - 'fsValid': 0, - 'kindBits': '\x00', - 'modDate': 2985072242, - 'nDim': array([128, 0, 0, 0]), - 'next': 8054516, - 'npnts': 128, - 'sIndices': 0, - 'sfA': array([ 0.04908739, 1. , 1. , 1. ]), - 'sfB': array([ 0., 0., 0., 0.]), - 'srcFldr': 0, - 'swModified': 0, - 'topFullScale': 0.0, - 'type': 2, - 'useBits': '\x00', - 'wData': 1.8369095638207904e-17, - 'wModified': 0, - 'waveNoteH': 0, - 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), - 'whVersion': 1, - 'whpad1': array(['', '', '', '', '', ''], - dtype='|S1'), - 'whpad2': 0, - 'whpad3': 0, - 'whpad4': 0}) + 'fileName': 0, + 'formula': 8054500, + 'fsValid': 0, + 'kindBits': '\x00', + 'modDate': 2985072242, + 'nDim': array([128, 0, 0, 0]), + 'next': 8054516, + 'npnts': 128, + 'sIndices': 0, + 'sfA': array([ 0.04908739, 1. , 1. , 1. ]), + 'sfB': array([ 0., 0., 0., 0.]), + 'srcFldr': 0, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': 1.8369095638207904e-17, + 'wModified': 0, + 'waveNoteH': 0, + 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), + 'whVersion': 1, + 'whpad1': array(['', '', '', '', '', ''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, + 'whpad4': 0} record 35: -(array([ 0.30000001, 0.54418772, 0.77101213, 0.96511477, 1.1135726 , +array([ 0.30000001, 0.54418772, 0.77101213, 0.96511477, 1.1135726 , 1.20686483, 1.23956215, 1.21068466, 1.12370288, 0.98618096, 0.80910152, 0.60592639, 0.39147732, 0.18073183, -0.01236418, -0.17596789, -0.30120692, -0.38277394, -0.41920158, -0.41280419, @@ -924,70 +924,70 @@ record 35: 0.78277934, 0.72283876, 0.6181944 , 0.47410288, 0.29939076, 0.10585135, -0.09260413, -0.28104633, -0.44468346, -0.57008827, -0.64630753, -0.66580337, -0.62512833, -0.52528399, -0.37171093, - -0.17394456, 0.0550792 , 0.30000135], dtype=float32), - {'checksum': -9146, - 'dataEUnits': '', - 'dataEUnitsSize': 0, - 'dimEUnits': ['', '', '', ''], - 'dimEUnitsSize': array([0, 0, 0, 0]), - 'dimLabels': [[], [], [], []], - 'dimLabelsSize': array([0, 0, 0, 0]), - 'formula': 'PolarRadiusFunction(radiusData,1,0) * sin(PolarAngleFunction(angleData,3,1,2))\x00', - 'formulaSize': 80, - 'note': 'shadowX=W_plrX5,appendRadius=radiusData,appendAngleData=angleData,angleDataUnits=2', - 'noteSize': 82, - 'optionsSize1': 0, - 'optionsSize2': 0, - 'sIndicesSize': 0, - 'version': 5, - 'wfmSize': 832}, - {'aModified': 0, - 'bname': array(['W', '_', 'p', 'l', 'r', 'Y', '5', '', '', '', '', '', '', '', '', + -0.17394456, 0.0550792 , 0.30000135], dtype=float32) +{'checksum': -9146, + 'dataEUnits': '', + 'dataEUnitsSize': 0, + 'dimEUnits': ['', '', '', ''], + 'dimEUnitsSize': array([0, 0, 0, 0]), + 'dimLabels': [[], [], [], []], + 'dimLabelsSize': array([0, 0, 0, 0]), + 'formula': 'PolarRadiusFunction(radiusData,1,0) * sin(PolarAngleFunction(angleData,3,1,2))\x00', + 'formulaSize': 80, + 'note': 'shadowX=W_plrX5,appendRadius=radiusData,appendAngleData=angleData,angleDataUnits=2', + 'noteSize': 82, + 'optionsSize1': 0, + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'version': 5, + 'wfmSize': 832} +{'aModified': 0, + 'bname': array(['W', '_', 'p', 'l', 'r', 'Y', '5', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], dtype='|S1'), - 'botFullScale': 0.0, - 'creationDate': 0, - 'dFolder': 7848580, - 'dLock': 0, - 'dataEUnits': 0, - 'dataUnits': array(['', '', '', ''], - dtype='|S1'), - 'depID': 26, - 'dimEUnits': array([0, 0, 0, 0]), - 'dimLabels': array([0, 0, 0, 0]), - 'dimUnits': array([['', '', '', ''], + 'botFullScale': 0.0, + 'creationDate': 0, + 'dFolder': 7848580, + 'dLock': 0, + 'dataEUnits': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 26, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), + 'dimUnits': array([['', '', '', ''], ['', '', '', ''], ['', '', '', ''], ['', '', '', '']], dtype='|S1'), - 'fileName': 0, - 'formula': 8054532, - 'fsValid': 0, - 'kindBits': '\x00', - 'modDate': 2985072242, - 'nDim': array([128, 0, 0, 0]), - 'next': 8084972, - 'npnts': 128, - 'sIndices': 0, - 'sfA': array([ 0.04908739, 1. , 1. , 1. ]), - 'sfB': array([ 0., 0., 0., 0.]), - 'srcFldr': 0, - 'swModified': 0, - 'topFullScale': 0.0, - 'type': 2, - 'useBits': '\x00', - 'wData': 0.30000001192092896, - 'wModified': 0, - 'waveNoteH': 7996608, - 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), - 'whVersion': 1, - 'whpad1': array(['', '', '', '', '', ''], - dtype='|S1'), - 'whpad2': 0, - 'whpad3': 0, - 'whpad4': 0}) + 'fileName': 0, + 'formula': 8054532, + 'fsValid': 0, + 'kindBits': '\x00', + 'modDate': 2985072242, + 'nDim': array([128, 0, 0, 0]), + 'next': 8084972, + 'npnts': 128, + 'sIndices': 0, + 'sfA': array([ 0.04908739, 1. , 1. , 1. ]), + 'sfB': array([ 0., 0., 0., 0.]), + 'srcFldr': 0, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': 0.30000001192092896, + 'wModified': 0, + 'waveNoteH': 7996608, + 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), + 'whVersion': 1, + 'whpad1': array(['', '', '', '', '', ''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, + 'whpad4': 0} record 36: -(array([ 0.2617994 , 0.27842158, 0.29504377, 0.31166595, 0.32828814, +array([ 0.2617994 , 0.27842158, 0.29504377, 0.31166595, 0.32828814, 0.34491032, 0.36153251, 0.3781547 , 0.39477688, 0.41139907, 0.42802125, 0.44464344, 0.46126559, 0.47788778, 0.49450997, 0.51113212, 0.52775431, 0.54437649, 0.56099868, 0.57762086, @@ -999,46 +999,46 @@ record 36: 1.00979757, 1.02641988, 1.04304194, 1.05966425, 1.07628632, 1.09290862, 1.10953069, 1.12615299, 1.14277506, 1.15939736, 1.17601943, 1.19264174, 1.2092638 , 1.22588611, 1.24250817, - 1.25913048, 1.27575254, 1.29237485, 1.30899692], dtype=float32), - {'checksum': 14307, - 'note': '', - 'noteSize': 0, - 'pictSize': 0, - 'version': 2, - 'wfmSize': 382}, - {'aModified': 0, - 'bname': array(['a', 'n', 'g', 'l', 'e', 'Q', '1', '', '', '', '', '', '', '', '', + 1.25913048, 1.27575254, 1.29237485, 1.30899692], dtype=float32) +{'checksum': 14307, + 'note': '', + 'noteSize': 0, + 'pictSize': 0, + 'version': 2, + 'wfmSize': 382} +{'aModified': 0, + 'bname': array(['a', 'n', 'g', 'l', 'e', 'Q', '1', '', '', '', '', '', '', '', '', '', '', '', '', ''], dtype='|S1'), - 'botFullScale': 0.0, - 'creationDate': 0, - 'dataUnits': array(['', '', '', ''], - dtype='|S1'), - 'depID': 0, - 'fileName': 0, - 'formula': 0, - 'fsValid': 0, - 'hsA': 1.0, - 'hsB': 0.0, - 'kindBits': '\x00', - 'modDate': 2845473705, - 'next': 0, - 'npnts': 64, - 'srcFldr': 0, - 'swModified': 0, - 'topFullScale': 0.0, - 'type': 2, - 'useBits': '\x00', - 'wData': array([ 0.2617994 , 0.27842158, 0.29504377, 0.31166595]), - 'wModified': 0, - 'wUnused': array(['', ''], - dtype='|S1'), - 'waveNoteH': 0, - 'whVersion': 0, - 'xUnits': array(['', '', '', ''], - dtype='|S1')}) + 'botFullScale': 0.0, + 'creationDate': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, + 'formula': 0, + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, + 'kindBits': '\x00', + 'modDate': 2845473705, + 'next': 0, + 'npnts': 64, + 'srcFldr': 0, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': array([ 0.2617994 , 0.27842158, 0.29504377, 0.31166595]), + 'wModified': 0, + 'wUnused': array(['', ''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, + 'xUnits': array(['', '', '', ''], + dtype='|S1')} record 37: -(array([ -8.34064484, -7.66960144, -6.62294245, -6.82878971, +array([ -8.34064484, -7.66960144, -6.62294245, -6.82878971, -8.6383152 , -11.20019722, -13.83398628, -15.95139503, -16.18096733, -13.58062267, -9.26843071, -5.34649038, -3.01010084, -2.30953455, -2.73682952, -3.72112942, @@ -1053,46 +1053,46 @@ record 37: -4.54975414, -4.52917624, -3.99160147, -3.1971693 , -2.93472862, -3.47230864, -4.7322526 , -6.80173016, -9.08601665, -10.00928402, -8.87677383, -6.88120317, - -5.61007977, -5.6351161 , -6.41880989, -6.8738699 ], dtype=float32), - {'checksum': -12080, - 'note': '', - 'noteSize': 0, - 'pictSize': 0, - 'version': 2, - 'wfmSize': 382}, - {'aModified': 0, - 'bname': array(['r', 'a', 'd', 'i', 'u', 's', 'Q', '1', '', '', '', '', '', '', '', + -5.61007977, -5.6351161 , -6.41880989, -6.8738699 ], dtype=float32) +{'checksum': -12080, + 'note': '', + 'noteSize': 0, + 'pictSize': 0, + 'version': 2, + 'wfmSize': 382} +{'aModified': 0, + 'bname': array(['r', 'a', 'd', 'i', 'u', 's', 'Q', '1', '', '', '', '', '', '', '', '', '', '', '', ''], dtype='|S1'), - 'botFullScale': 0.0, - 'creationDate': 0, - 'dataUnits': array(['', '', '', ''], - dtype='|S1'), - 'depID': 0, - 'fileName': 0, - 'formula': 0, - 'fsValid': 0, - 'hsA': 1.0, - 'hsB': 0.0, - 'kindBits': '\x00', - 'modDate': 2845473634, - 'next': 0, - 'npnts': 64, - 'srcFldr': 0, - 'swModified': 0, - 'topFullScale': 0.0, - 'type': 2, - 'useBits': '\x00', - 'wData': array([-8.34064484, -7.66960144, -6.62294245, -6.82878971]), - 'wModified': 0, - 'wUnused': array(['', ''], - dtype='|S1'), - 'waveNoteH': 0, - 'whVersion': 0, - 'xUnits': array(['', '', '', ''], - dtype='|S1')}) + 'botFullScale': 0.0, + 'creationDate': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 0, + 'fileName': 0, + 'formula': 0, + 'fsValid': 0, + 'hsA': 1.0, + 'hsB': 0.0, + 'kindBits': '\x00', + 'modDate': 2845473634, + 'next': 0, + 'npnts': 64, + 'srcFldr': 0, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': array([-8.34064484, -7.66960144, -6.62294245, -6.82878971]), + 'wModified': 0, + 'wUnused': array(['', ''], + dtype='|S1'), + 'waveNoteH': 0, + 'whVersion': 0, + 'xUnits': array(['', '', '', ''], + dtype='|S1')} record 38: -(array([ 30.58058929, 31.08536911, 31.93481636, 31.57315445, +array([ 30.58058929, 31.08536911, 31.93481636, 31.57315445, 29.68683434, 27.10366058, 24.47453499, 22.3495121 , 21.98692894, 24.21500397, 27.95923996, 31.28394508, 33.12408066, 33.46794128, 32.79909515, 31.64211464, @@ -1107,70 +1107,70 @@ record 38: 17.34101677, 16.83446693, 16.56042671, 16.38027191, 15.94310474, 15.16159916, 14.10328865, 12.76812935, 11.41363049, 10.60795975, 10.52314186, 10.67826462, - 10.5454855 , 9.99268055, 9.22939587, 8.5736742 ], dtype=float32), - {'checksum': -5745, - 'dataEUnits': '', - 'dataEUnitsSize': 0, - 'dimEUnits': ['', '', '', ''], - 'dimEUnitsSize': array([0, 0, 0, 0]), - 'dimLabels': [[], [], [], []], - 'dimLabelsSize': array([0, 0, 0, 0]), - 'formula': 'PolarRadiusFunction(radiusQ1,1,-40) * cos(PolarAngleFunction(angleQ1,2,2,2))\x00', - 'formulaSize': 78, - 'note': '', - 'noteSize': 0, - 'optionsSize1': 0, - 'optionsSize2': 0, - 'sIndicesSize': 0, - 'version': 5, - 'wfmSize': 576}, - {'aModified': 0, - 'bname': array(['W', '_', 'p', 'l', 'r', 'X', '6', '', '', '', '', '', '', '', '', + 10.5454855 , 9.99268055, 9.22939587, 8.5736742 ], dtype=float32) +{'checksum': -5745, + 'dataEUnits': '', + 'dataEUnitsSize': 0, + 'dimEUnits': ['', '', '', ''], + 'dimEUnitsSize': array([0, 0, 0, 0]), + 'dimLabels': [[], [], [], []], + 'dimLabelsSize': array([0, 0, 0, 0]), + 'formula': 'PolarRadiusFunction(radiusQ1,1,-40) * cos(PolarAngleFunction(angleQ1,2,2,2))\x00', + 'formulaSize': 78, + 'note': '', + 'noteSize': 0, + 'optionsSize1': 0, + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'version': 5, + 'wfmSize': 576} +{'aModified': 0, + 'bname': array(['W', '_', 'p', 'l', 'r', 'X', '6', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], dtype='|S1'), - 'botFullScale': 0.0, - 'creationDate': 0, - 'dFolder': 7848580, - 'dLock': 0, - 'dataEUnits': 0, - 'dataUnits': array(['', '', '', ''], - dtype='|S1'), - 'depID': 30, - 'dimEUnits': array([0, 0, 0, 0]), - 'dimLabels': array([0, 0, 0, 0]), - 'dimUnits': array([['', '', '', ''], + 'botFullScale': 0.0, + 'creationDate': 0, + 'dFolder': 7848580, + 'dLock': 0, + 'dataEUnits': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 30, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), + 'dimUnits': array([['', '', '', ''], ['', '', '', ''], ['', '', '', ''], ['', '', '', '']], dtype='|S1'), - 'fileName': 0, - 'formula': 8052116, - 'fsValid': 0, - 'kindBits': '\x00', - 'modDate': 2985072242, - 'nDim': array([64, 0, 0, 0]), - 'next': 8324392, - 'npnts': 64, - 'sIndices': 0, - 'sfA': array([ 1., 1., 1., 1.]), - 'sfB': array([ 0., 0., 0., 0.]), - 'srcFldr': 0, - 'swModified': 0, - 'topFullScale': 0.0, - 'type': 2, - 'useBits': '\x00', - 'wData': 30.580589294433594, - 'wModified': 0, - 'waveNoteH': 0, - 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), - 'whVersion': 1, - 'whpad1': array(['', '', '', '', '', ''], - dtype='|S1'), - 'whpad2': 0, - 'whpad3': 0, - 'whpad4': 0}) + 'fileName': 0, + 'formula': 8052116, + 'fsValid': 0, + 'kindBits': '\x00', + 'modDate': 2985072242, + 'nDim': array([64, 0, 0, 0]), + 'next': 8324392, + 'npnts': 64, + 'sIndices': 0, + 'sfA': array([ 1., 1., 1., 1.]), + 'sfB': array([ 0., 0., 0., 0.]), + 'srcFldr': 0, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': 30.580589294433594, + 'wModified': 0, + 'waveNoteH': 0, + 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), + 'whVersion': 1, + 'whpad1': array(['', '', '', '', '', ''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, + 'whpad4': 0} record 39: -(array([ 8.19404411, 8.88563347, 9.70543861, 10.17177773, +array([ 8.19404411, 8.88563347, 9.70543861, 10.17177773, 10.11173058, 9.73756695, 9.25513077, 8.8788929 , 9.16085339, 10.56489944, 12.75579453, 14.90572262, 16.46352959, 17.33401871, 17.68511391, 17.74635315, @@ -1185,68 +1185,68 @@ record 39: 30.91939545, 31.22146797, 31.97431755, 32.95656204, 33.4611969 , 33.23248672, 32.3250885 , 30.64473915, 28.72983551, 28.05199242, 29.29024887, 31.3501091 , - 32.7331543 , 32.87995529, 32.28799438, 31.99738503], dtype=float32), - {'checksum': -16604, - 'dataEUnits': '', - 'dataEUnitsSize': 0, - 'dimEUnits': ['', '', '', ''], - 'dimEUnitsSize': array([0, 0, 0, 0]), - 'dimLabels': [[], [], [], []], - 'dimLabelsSize': array([0, 0, 0, 0]), - 'formula': 'PolarRadiusFunction(radiusQ1,1,-40) * sin(PolarAngleFunction(angleQ1,2,2,2))\x00', - 'formulaSize': 78, - 'note': 'shadowX=W_plrX6,appendRadius=radiusQ1,appendAngleData=angleQ1,angleDataUnits=2', - 'noteSize': 78, - 'optionsSize1': 0, - 'optionsSize2': 0, - 'sIndicesSize': 0, - 'version': 5, - 'wfmSize': 576}, - {'aModified': 0, - 'bname': array(['W', '_', 'p', 'l', 'r', 'Y', '6', '', '', '', '', '', '', '', '', + 32.7331543 , 32.87995529, 32.28799438, 31.99738503], dtype=float32) +{'checksum': -16604, + 'dataEUnits': '', + 'dataEUnitsSize': 0, + 'dimEUnits': ['', '', '', ''], + 'dimEUnitsSize': array([0, 0, 0, 0]), + 'dimLabels': [[], [], [], []], + 'dimLabelsSize': array([0, 0, 0, 0]), + 'formula': 'PolarRadiusFunction(radiusQ1,1,-40) * sin(PolarAngleFunction(angleQ1,2,2,2))\x00', + 'formulaSize': 78, + 'note': 'shadowX=W_plrX6,appendRadius=radiusQ1,appendAngleData=angleQ1,angleDataUnits=2', + 'noteSize': 78, + 'optionsSize1': 0, + 'optionsSize2': 0, + 'sIndicesSize': 0, + 'version': 5, + 'wfmSize': 576} +{'aModified': 0, + 'bname': array(['W', '_', 'p', 'l', 'r', 'Y', '6', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], dtype='|S1'), - 'botFullScale': 0.0, - 'creationDate': 0, - 'dFolder': 7848580, - 'dLock': 0, - 'dataEUnits': 0, - 'dataUnits': array(['', '', '', ''], - dtype='|S1'), - 'depID': 32, - 'dimEUnits': array([0, 0, 0, 0]), - 'dimLabels': array([0, 0, 0, 0]), - 'dimUnits': array([['', '', '', ''], + 'botFullScale': 0.0, + 'creationDate': 0, + 'dFolder': 7848580, + 'dLock': 0, + 'dataEUnits': 0, + 'dataUnits': array(['', '', '', ''], + dtype='|S1'), + 'depID': 32, + 'dimEUnits': array([0, 0, 0, 0]), + 'dimLabels': array([0, 0, 0, 0]), + 'dimUnits': array([['', '', '', ''], ['', '', '', ''], ['', '', '', ''], ['', '', '', '']], dtype='|S1'), - 'fileName': 0, - 'formula': 7995612, - 'fsValid': 0, - 'kindBits': '\x00', - 'modDate': 2985072242, - 'nDim': array([64, 0, 0, 0]), - 'next': 0, - 'npnts': 64, - 'sIndices': 0, - 'sfA': array([ 1., 1., 1., 1.]), - 'sfB': array([ 0., 0., 0., 0.]), - 'srcFldr': 0, - 'swModified': 0, - 'topFullScale': 0.0, - 'type': 2, - 'useBits': '\x00', - 'wData': 8.19404411315918, - 'wModified': 0, - 'waveNoteH': 7998208, - 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), - 'whVersion': 1, - 'whpad1': array(['', '', '', '', '', ''], - dtype='|S1'), - 'whpad2': 0, - 'whpad3': 0, - 'whpad4': 0}) + 'fileName': 0, + 'formula': 7995612, + 'fsValid': 0, + 'kindBits': '\x00', + 'modDate': 2985072242, + 'nDim': array([64, 0, 0, 0]), + 'next': 0, + 'npnts': 64, + 'sIndices': 0, + 'sfA': array([ 1., 1., 1., 1.]), + 'sfB': array([ 0., 0., 0., 0.]), + 'srcFldr': 0, + 'swModified': 0, + 'topFullScale': 0.0, + 'type': 2, + 'useBits': '\x00', + 'wData': 8.19404411315918, + 'wModified': 0, + 'waveNoteH': 7998208, + 'whUnused': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), + 'whVersion': 1, + 'whpad1': array(['', '', '', '', '', ''], + dtype='|S1'), + 'whpad2': 0, + 'whpad3': 0, + 'whpad4': 0} record 40: 'Packages' record 41: @@ -1328,17 +1328,17 @@ record 50: '#include version >= 3.0\n' filesystem: -{'root': {':variables': [], - ':waves': [, - , - , - , - , - , - , - ], - 'Packages': {'PolarGraphs': {':variables': []}, - 'WMDataBase': {':variables': []}}}} +{'root': {':variables': , + 'Packages': {'PolarGraphs': {':variables': }, + 'WMDataBase': {':variables': }}, + 'W_plrX5': , + 'W_plrX6': , + 'W_plrY5': , + 'W_plrY6': , + 'angleData': , + 'angleQ1': , + 'radiusData': , + 'radiusQ1': }} """ import os.path @@ -1378,6 +1378,8 @@ def dumppxp(filename, strict=True): pprint(record.variables) elif isinstance(record, WaveRecord): pprint(record.wave) + pprint(record.bin_info) + pprint(record.wave_info) else: pprint(record) print('\nfilesystem:') -- 2.26.2