mimimaki / NOAA_decoder

NOAA15/18/19 satellite decoder Python script
MIT License
1 stars 0 forks source link

Error trying to decode recorded signal from NOAA 19 satellite #1

Open henriquesebastiao opened 3 weeks ago

henriquesebastiao commented 3 weeks ago

I'm trying to create an Android app to decode these signals in a more portable way, but I'm using Python in the project. I was looking for projects that performed decoding with Python, and for me, only yours worked. However, after implementing and trying to decode a signal I received, I ended up getting the following error:

Traceback (most recent call last):
  File "/home/hick/.temp/NOAA_decoder/src/NOAA_decoder.py", line 60, in <module>
    brightness = int(data_am[pixel]//32 - 32)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: only length-1 arrays can be converted to Python scalars

Could you tell me what is causing the problem?

When I try to decode the audio file in the media folder, it works normally. Thank you very much for this.

mimimaki commented 3 weeks ago

Hi, nice to hear that my project has been useful. The error you have received seems to be that data_am[pixel] is not a scalar, then int() fails as it does not accept arrays. Are you running this script as it is or have you made modifications? I suggest setting a breakpoint with pdb.set_trace() after defining data_am and checking that the format is correct.

I have only ran the code with two different .wav files that I have recorded myself and so there might be bugs. Nevertheless this project was made for educational purposes. If you figure this out, I'd like to hear more about what the issue was and how you fixed it.

henriquesebastiao commented 3 weeks ago

I'm running it as is, I just adapted how the audio is passed to the script to implement with the graphical interface. I have no experience with Numpy, but I'll look into whether there's a solution. If I find one, I'll get back to you. Thanks a lot!