bbrzycki / setigen

Python library for generating and injecting artificial narrow-band signals into radio frequency data
https://setigen.readthedocs.io
MIT License
25 stars 11 forks source link

Error when trying to directly save extremely large frames #12

Open bbrzycki opened 4 years ago

bbrzycki commented 4 years ago

Example code:

frame = stg.Frame(fchans=2**24,
                  tchans=32,
                  df=1.3969838619232178*u.Hz,
                  dt=1.4316557653333333*u.s,
                  fch1=6095.214842353016*u.MHz)
frame.save_fil('test.fil')

This gives something like:

Traceback (most recent call last):
  File "/home/bryanb/setigen/setigen/frame.py", line 807, in save_fil
    self.waterfall.write_to_fil(filename)
  File "/home/bryanb/blimpy/blimpy/waterfall.py", line 317, in write_to_fil
    write_to_fil(self, filename_out)
  File "/home/bryanb/blimpy/blimpy/io/fil_writer.py", line 21, in write_to_fil
    __write_to_fil_heavy(wf, filename_out)
  File "/home/bryanb/blimpy/blimpy/io/fil_writer.py", line 50, in __write_to_fil_heavy
    bob = wf.container.read_blob(blob_dim, n_blob=ii)
  File "/home/bryanb/blimpy/blimpy/io/fil_reader.py", line 223, in read_blob
    blob = dd.reshape((int(dd.shape[0]/blob_dim[self.freq_axis]),blob_dim[self.beam_axis],blob_dim[self.freq_axis]))
ValueError: cannot reshape array of size 32768 into shape (0,1,24576000)

This might be some sort of interaction with blimpy Waterfall metadata.

texadactyl commented 4 years ago

I got it to work with fchans=2^23 but experienced the same problem as you at fchans=2^24. My opinion is that this is not a setigen issue but a io/fil_reader.py issue or limitation.