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

hideal2pds SAMPLE_BITS = 8 for ubyte output #4404

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions isis/src/mro/apps/hideal2pds/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ void IsisMain() {
image.addKeyword(PvlKeyword("SAMPLE_BIT_MASK", toString((int)pow(2.0, (double)nbits) - 1)),
Pvl::Replace);

// SAMPLE_BITS defaults to 16 but should be 8 when BITS=8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the mask without changing the bit type of the output doesn't make sense to me. See #4006. These two keywords have to be in sync with each other. See line 131 in this file. It appears to be setting unsignedword for an 8bit output request. I wonder if the mask would work correctly without the fix below if line 131 was set to unsignedbyte????

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good eye. Changing that output type to unsignedbyte produces correct mask and samples_bits values in the output pvl for BITS=8.

Line 197 is still needed for BITS values 9-15, because the mask always defaults to the full 16 bits. ( #3978 )

Also, I was under the impression that (output pvl) SAMPLE_BITS should be 16 for (user-entered) BITS=[9, 16] and 8 for BITS=8. Is that correct?

if( nbits == 8 ) {
image.addKeyword(PvlKeyword("SAMPLE_BITS", toString(nbits)), Pvl::Replace);
}

Camera *cam = inputCube->camera();
updatePdsLabelRootObject(isisCubeLab, pdsLabel, ui, cam);

Expand Down