UCBerkeleySETI / blimpy

Breakthrough Listen I/O Methods for Python
https://blimpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
46 stars 41 forks source link

bl_scrunch never really worked correctly! )-: #276

Closed texadactyl closed 1 year ago

texadactyl commented 1 year ago

bl_scrunch dutifully writes out the data array adjusted as one expects BUT it fails to update the header field nchans with the result of scrunching. E.g. The Voyager 1 Filterbank file has 1048576 fine frequency columns. After scrunching with -f 4, it has 262144 fine frequency columns. However, note the errant nchans value although the shape is correct:

--- File Info ---
DIMENSION_LABELS :   ['time' 'feed_id' 'frequency']
        az_start :                              0.0
       data_type :                                1
            fch1 :            8421.386717353016 MHz
            foff :      -1.1175870895385742e-05 MHz
           ibeam :                                1
      machine_id :                               20
          nbeams :                                1
           nbits :                               32
          nchans :                          1048576
            nifs :                                1
     rawdatafile : guppi_57650_67573_Voyager1_0002.0000.raw
     source_name :                         Voyager1
         src_dej :                       12:10:58.8
         src_raj :                     17:10:03.984
    telescope_id :                                6
           tsamp :                     18.253611008
   tstart (ISOT) :          2016-09-19T18:46:13.000
    tstart (MJD) :                57650.78209490741
        za_start :                              0.0

Num ints in file :                               16
      File shape :                  (16, 1, 262144)
--- Selection Info ---
Data selection shape :                  (16, 1, 262144)
Minimum freq (MHz) :                8418.457041028887
Maximum freq (MHz) :                8421.386717353016

Note also that bl_scrunch -h lies about its purpose:

Command line utility for converting HDF5 (.h5) to Sigproc filterbank (.fil)
format >>h52fil <FULL_PATH_TO_FIL_FILE> [options]

@#$%^!!!