Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rawspec_initialize needs better Nbps diagnosis and comment cleanup. #61

Closed
texadactyl opened this issue May 19, 2022 · 0 comments
Closed
Assignees
Labels
bug Something isn't working documentation

Comments

@texadactyl
Copy link
Contributor

// Validate Nbps. Zero silently defaults to 8 for backwards compatibility
  // with pre-Nbps versions.  Any other value except 8, or 16 is treated as 8
  // and a warning is issued to stderr.
  if(ctx->Nbps == 0) {
    ctx->Nbps = 8;
  } else if(ctx->Nbps != 8 && ctx->Nbps != 16) {
    NbpsIsExpanded = ctx->Nbps == 4;
    ctx->Nbps = 8;
  }

Nbps = raw hdr NBITS. According to according to the raw file document https://github.com/UCBerkeleySETI/breakthrough/blob/master/doc/RAW-File-Format.md, 3 values are valid:

  • "8": 1 sample occupying 2 bytes: 8-bit real, 8-bit imaginary
  • "4" 1 sample occupying 1 byte: 4-bit real, 4-bit imaginary
  • "2" 2 samples occupying 1 byte:
    -- sample1: 2-bit real, 2-bit imaginary
    -- sample2: 2-bit real, 2-bit imaginary

But, the above GPU code doesn't seem to match.

  • 16, handled in gpu code, is not in the documentation. This is the case of 1 sample consisting of a 16-bit real and a 16-bit imaginary. Add to documentation.
  • 2 is missing from gpu code. Update documentation to say "not currently supported".
  • 0 is handled in GPU code (replaced with "8") but not mentioned in the document. Update documentation to mention backwards compatibility with pre-Nbps versions of raw header.
  • Erroneous values (not 4, 8, or 16) should be diagnosed in gpu code and result in a return with 1 (error) to caller.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation
Projects
None yet
Development

No branches or pull requests

1 participant