Skip to content

Ask for help to run the code successfully #2

@HarDLy-nnu

Description

@HarDLy-nnu

My goal is to process NEON's waveform data with pywaves and perform further analysis. I created a main.py to call base.py according to the guidance in readme. The base.py has not been modified. The code of main.py is as follows:

import base as pw
pulsewave = pw.openPLS(r"D:\...\NEON_D01_HARV_DP1_L001-1_2019081112_1.pls")
wave = pulsewave.get_waves(0)
wave.plot()

But then I received the following error:

Traceback (most recent call last):
  File "D:\...\pypwaves\main.py", line 4, in <module>
    pulsewave = pw.openPLS(r"D:\...\NEON_D01_HARV_DP1_L001-1_2019081112_1.pls")
  File "D:\...\pypwaves\base.py", line 211, in openPLS
    return PulseWaves(filename)
  File "D:\...\pypwaves\base.py", line 20, in __init__
    self.file_sig = "".join(struct.unpack("c"*16, pulsebinary.read(16))).strip("\x00")
TypeError: sequence item 0: expected str instance, bytes found

The pywaves has been tested with NEON's waveform lidar data, so I think it's my problem, but I have limited knowledge of python and can't solve this problem independently, I would be very grateful if anyone can help me with this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions