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

Conversation

tgiroux
Copy link
Contributor

@tgiroux tgiroux commented Apr 15, 2021

Description

Change SAMPLE_BITS to 8 in the PDS image label if the user entered BITS=8.

From the app documentation for the BITS parameter:

The output data type will be automaticity choosen using this value. A value of 8 will create unsigned byte output files. Values from 9 to 16 will create unsigned word output files. Unused bits in the unsigned word output file will be set to zero.

The way I understand this is that there are 16 "sample bits" for BITS=[9, 16] and 8 for BITS=8. I seem to remember talking to @scsides about this back when I made the issue.

Before merging:
I think this should be verified by someone more familiar with this app / hirise / pds images.
Would this require a changeLog entry? IIRC small output differences like this can be time-consuming for products / missions to validate.

Related Issue

#4006

Motivation and Context

Closes an issue for ISIS support milestone. Fixes unintended output for hideal2pds.

How Has This Been Tested?

Output from makefile tests verifies that these changes work as intended

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation change (update to the documentation; no code change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read and agree to abide by the Code of Conduct
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have added myself to the .zenodo.json document.
  • I have added any user impacting changes to the CHANGELOG.md document.

Licensing

This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

  • I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

@acpaquette acpaquette requested a review from scsides April 16, 2021 19:03
@@ -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?

@tgiroux tgiroux closed this May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants