Skip to content

Problem with C-Interface Compression

I'm having some problems compressing FrVects with LALFrame when using the FrameC backend. I am getting "Unknown compression mode" errors.

I think I've tracked this down to a problem in line 147 of FrChanInternal.hh in the routine CompressionScheme:

  inline ::FrameCPP::FrVect::compression_scheme_type FrChannel::
  CompressionScheme( fr_vect_compression_schemes_t Scheme )
  {
    ::FrameCPP::FrVect::compression_scheme_type retval;

    switch( Scheme & FR_VECT_COMPRESS_LITTLEENDIAN )
    {
    case FR_VECT_COMPRESS_RAW:
      retval = ::FrameCPP::FrVect::RAW;
      break;
    case FR_VECT_COMPRESS_GZIP:
      retval = ::FrameCPP::FrVect::GZIP;
      break;
    case FR_VECT_COMPRESS_DIFF_GZIP:
      retval = ::FrameCPP::FrVect::DIFF_GZIP;
      break;
    case FR_VECT_COMPRESS_ZERO_SUPPRESS_WORD_2:
      retval = ::FrameCPP::FrVect::ZERO_SUPPRESS_WORD_2;
      break;
    case FR_VECT_COMPRESS_ZERO_SUPPRESS_WORD_4:
      retval = ::FrameCPP::FrVect::ZERO_SUPPRESS_WORD_4;
      break;
    case FR_VECT_COMPRESS_ZERO_SUPPRESS_WORD_8:
      retval = ::FrameCPP::FrVect::ZERO_SUPPRESS_WORD_8;
      break;
    default:
      throw std::runtime_error( "Unknown compression mode" );
      break;
    }
    return retval;
  }

I think the line

    switch( Scheme & FR_VECT_COMPRESS_LITTLEENDIAN )

should be

    switch( Scheme & ~FR_VECT_COMPRESS_LITTLEENDIAN )
Edited by Ed Maros