LANL-Seismoacoustics / pisces

Pisces: A practical seismological database library in Python.
http://lanl-seismoacoustics.github.io/pisces/
Other
17 stars 10 forks source link

Error with reading in s3-formatted waveform data #46

Closed jsakamo closed 1 year ago

jsakamo commented 2 years ago

We are trying to read in older data from the IMS that is in s3 (3-byte interger) format. Pisces tries to read the data but produces the error in read_waveform: data, flag = read_s3(DATAFILE, BYTEOFFSET, NUM) ValueError: too many values to unpack (expected 2)

jkmacc-LANL commented 2 years ago

Hi @jsakamo ! Thanks for finding this bug. It looks like the return signature of the underlying s3 reader changed when it was made into pure Python, but this wasn't updated everywhere in the code base. I'm sorry for that. If I make a quick update in master here, are you able to re-install pisces using the updated branch?

jkmacc-LANL commented 2 years ago

Alternately, you can edit your this line to remove the flag parameter in your own installation, while this bug fix makes its way to a release on PyPI.

Edit: Yes, the line would look like this:

data = read_s3(DATAFILE, BYTEOFFSET, NUM)
jsakamo commented 2 years ago

The alternate method, i.e., removing the flag parameter, worked successfully -- readwaveform.py is smoothly reading s3 data! Thank you!

jkmacc-LANL commented 2 years ago

Thanks for the update, @jsakamo ! I'll still initiate the PR, and leave this open until it's done.

jsakamo commented 1 year ago

Would you be able to make this fix in your latest version, i.e., removing the 'flag' parameter? I'm using pisces as a dependency in my software package, so having the fix avoids the user having to manually do it. Thank you!