diff --git a/AUTHORS.rst b/AUTHORS.rst
index 23124c7c1e..93b262096a 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -55,6 +55,7 @@ ISIS3 Contributors
- Steven Lambright
- Stuart Sides
- Summer Stapleton
+- Timothy Giroux
- Tracie Sucharski
- Travis Addair
- Tyler Wilson
diff --git a/CHANGELOG.md b/CHANGELOG.md
index de2fc6f5b4..23547b6db1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -30,6 +30,19 @@ update the Unreleased link so that it compares against the latest release tag.
## [Unreleased]
+### Changed
+
+ - Isis2raw will now output straight to a 32bit file (no stretch) when stretch is set to None and bittype is set to 32bit. [#3878](https://github.com/USGS-Astrogeology/ISIS3/issues/3878)
+
+### Fixed
+
+ - Equalizer now reports the correct equation and values used to perform the adjustment. [#3987](https://github.com/USGS-Astrogeology/ISIS3/issues/3987)
+ - mro/hideal2pds app now writes the correct SAMPLE_BIT_MASK values to the output label. [#3978](https://github.com/USGS-Astrogeology/ISIS3/issues/3978)
+
+ ### Added
+
+ - A Gui Helper gear was added to hist to fill in the minimum and maximum parameters with what would have been automatically calculated. [#3880](https://github.com/USGS-Astrogeology/ISIS3/issues/3880)
+
## [4.2.0] - 2020-07-27
### Added
diff --git a/isis/src/base/apps/equalizer/equalizer.xml b/isis/src/base/apps/equalizer/equalizer.xml
index d2dee5aefd..d91bb0076f 100644
--- a/isis/src/base/apps/equalizer/equalizer.xml
+++ b/isis/src/base/apps/equalizer/equalizer.xml
@@ -246,6 +246,10 @@
Changed pvl.DIFF of input for app tests nonOverlapRecalculate and nonOverlapRetryBoth to
ignore file names. Allows test to pass when not using default data area. Fixes #4738.
+
+ Reported formula and variables now match the formula selected by the ADJUST
+ argument. Fixes #3987.
+
diff --git a/isis/src/base/apps/hist/hist.xml b/isis/src/base/apps/hist/hist.xml
index 17c580d68d..cd1937f56c 100644
--- a/isis/src/base/apps/hist/hist.xml
+++ b/isis/src/base/apps/hist/hist.xml
@@ -88,6 +88,9 @@
Re-added the ability to set number of bins without setting min/max values after the last update.
Follow-on to #3881.
+
+ Added GUI helper for filling in computed min/max. Fixed #3880.
+
@@ -138,6 +141,17 @@
Minimum DN value in histogram. If not entered it will automatically be computed.
+
+
+ helperButtonCalcMinMax
+ Fill in the auto calculated MINIMUM and MAXIMUM for the input cube
+
+ This button will calculate what the default MINIMUM and MAXIMUM values would be
+ and fills the respective GUI fields with them.
+
+ $ISISROOT/appdata/images/icons/exec.png
+
+
- MAXIMUM
diff --git a/isis/src/base/apps/hist/main.cpp b/isis/src/base/apps/hist/main.cpp
index f9a3821ab7..3b9b6ee69a 100644
--- a/isis/src/base/apps/hist/main.cpp
+++ b/isis/src/base/apps/hist/main.cpp
@@ -1,3 +1,4 @@
+#define GUIHELPERS
#include "Isis.h"
#include
@@ -18,6 +19,15 @@
using namespace std;
using namespace Isis;
+void helperButtonCalcMinMax();
+
+map GuiHelpers() {
+ map helper;
+ helper ["helperButtonCalcMinMax"] = (void *) helperButtonCalcMinMax;
+ return helper;
+}
+
+
void IsisMain() {
Process p;
Cube *icube = p.SetInputCube("FROM");
@@ -29,7 +39,7 @@ void IsisMain() {
}
Histogram *hist;
- if (ui.WasEntered("MINIMUM") && ui.WasEntered("MAXIMUM")){
+ if (ui.WasEntered("MINIMUM") && ui.WasEntered("MAXIMUM")) {
int nbins = 0;
if (ui.WasEntered("NBINS")){
@@ -71,7 +81,7 @@ void IsisMain() {
p.Progress()->CheckStatus();
LineManager line(*icube);
- for(int i = 1; i <= icube->lineCount(); i++) {
+ for (int i = 1; i <= icube->lineCount(); i++) {
line.SetLine(i);
icube->read(line);
hist->AddData(line.DoubleBuffer(), line.size());
@@ -236,3 +246,41 @@ void IsisMain() {
delete hist;
p.EndProcess();
}
+
+
+// Helper function to fill in the auto calculated min/max.
+void helperButtonCalcMinMax() {
+
+ UserInterface &ui = Application::GetUserInterface();
+
+ // Setup a cube for gathering stats from the user requested band
+ QString file = ui.GetFileName("FROM");
+
+ Cube inCube;
+ CubeAttributeInput attrib = ui.GetInputAttribute("FROM");
+ if (attrib.bands().size() != 0) {
+ vector bands = attrib.bands();
+ inCube.setVirtualBands(bands);
+ }
+
+ inCube.open(file, "r");
+
+ LineManager line(inCube);
+ Statistics cubeStats;
+
+ for (int i = 1; i <= inCube.lineCount(); i++) {
+ line.SetLine(i);
+ inCube.read(line);
+ cubeStats.AddData(line.DoubleBuffer(), line.size());
+ }
+
+ inCube.close();
+
+ // Write ranges to the GUI
+ ui.Clear("MINIMUM");
+ ui.PutDouble("MINIMUM", cubeStats.Minimum());
+ ui.Clear("MAXIMUM");
+ ui.PutDouble("MAXIMUM", cubeStats.Maximum());
+
+}
+
diff --git a/isis/src/base/apps/isis2raw/isis2raw.xml b/isis/src/base/apps/isis2raw/isis2raw.xml
index 0447771915..ab8d54a9f4 100644
--- a/isis/src/base/apps/isis2raw/isis2raw.xml
+++ b/isis/src/base/apps/isis2raw/isis2raw.xml
@@ -11,12 +11,12 @@
The raw image may be output into an 8-bit, 16-bit unsigned, 16-bit signed
or 32-bit raw image. This raw image can be in BSQ, BIL, or BIP format, and
can include or exclude Null, LRS, LIS, HIS, and/or HRS specific DN values.
- If no special pixel parameters are selected, then Low Saturation values and
+ If no special pixel parameters are selected, then Low Saturation values and
Null values are set to black and High Saturation values are set to white.
- To ensure acceptable contrast in the output file, the user may select from
+ To ensure acceptable contrast in the output file, the user may select from
three stretch options are given 1) no stretch 2) linear, and 3) manual.
- A custom maximum and minimum DN value can be specified for all output
- bittypes. For example, if a range of 0 to 1023 is selected in a 16-bit
+ A custom maximum and minimum DN value can be specified for all output
+ bittypes. For example, if a range of 0 to 1023 is selected in a 16-bit
unsigned raw image, the DNs are stretched to an effective 10-bit format.
@@ -57,7 +57,7 @@
Fixed problem where the valid data range overlapped the null value.
- Created options to ouput BIL and BIP formats, making BSQ the default, as
+ Created options to ouput BIL and BIP formats, making BSQ the default, as
well as added preserve special pixel (NULL) option.
@@ -72,6 +72,11 @@
output image. OMIN and OMAX are now calculated based on the stretch if 32-bit
is chosen and the OMIN and OMAX fields are left blank. Fixes #2194.
+
+ Updated application logic to not generate a histogram if stretch is None
+ and the output bit type is 32-bit. Also removes duplicate calls to checkRange
+ and setRangeAndPixels. Closes #3878 (github).
+
@@ -173,15 +178,15 @@
The minimum output DN value including special pixels.
- If a value is provided, the value will be the minimum DN used (including special
- pixels). If left blank and the BITTYPE is not 32BIT, the minimum DN value
- will default to the smallest value possible for the provided
+ If a value is provided, the value will be the minimum DN used (including special
+ pixels). If left blank and the BITTYPE is not 32BIT, the minimum DN value
+ will default to the smallest value possible for the provided
BITTYPE. If the BITTYPE is 32BIT and OMIN is left blank, the value
- of OMIN will depend on the STRETCH type chosen. If LINEAR is
- chosen, the value for OMIN will be the DN value at the value
- entered for MINPERCENT on the data. If MANUAL is chosen, the OMIN
- will equal to the value of MINIMUM. If NONE is chosen, the value
- will default to the smallest value possible for 32 bit data.
+ of OMIN will depend on the STRETCH type chosen. If LINEAR is
+ chosen, the value for OMIN will be the DN value at the value
+ entered for MINPERCENT on the data. If MANUAL is chosen, the OMIN
+ will equal to the value of MINIMUM. If NONE is chosen, the value
+ will default to the smallest value possible for 32 bit data.
Refer to Documentation
@@ -193,14 +198,14 @@
The maximum output DN value including special pixels.
- If a value is provided, the value will be the maximum DN used (including special
- pixels). If left blank and the BITTYPE is not 32BIT, the maximum DN value
- will default to the largest value possible for the provided
+ If a value is provided, the value will be the maximum DN used (including special
+ pixels). If left blank and the BITTYPE is not 32BIT, the maximum DN value
+ will default to the largest value possible for the provided
BITTYPE. If the BITTYPE is 32BIT and OMAX is left blank, the value
- of OMAX will depend on the STRETCH type chosen. If LINEAR is
- chosen, the value for OMAX will be the DN value at the value
- entered for MAXPERCENT on the data. If MANUAL is chosen, the OMIN
- will equal to the value of MAXIMUM. If NONE is chosen, the value
+ of OMAX will depend on the STRETCH type chosen. If LINEAR is
+ chosen, the value for OMAX will be the DN value at the value
+ entered for MAXPERCENT on the data. If MANUAL is chosen, the OMIN
+ will equal to the value of MAXIMUM. If NONE is chosen, the value
will default to the largest value possible for 32 bit data.
@@ -212,7 +217,7 @@
- true
Dedicates the minimum DN value for null pixels.
- If set to true, the minimum value of the raw output data will be
+ If set to true, the minimum value of the raw output data will be
reserved for null pixels. The actual value used for null pixels will
be denoted in the print.prt file and displayed onscreen.
@@ -403,7 +408,7 @@
Storage order of output file.
- Sets the storage order of the raw ouput file to BSQ, BIL, or
+ Sets the storage order of the raw ouput file to BSQ, BIL, or
BIP.
diff --git a/isis/src/base/apps/isis2raw/main.cpp b/isis/src/base/apps/isis2raw/main.cpp
index 0af54a711a..74cbed6491 100644
--- a/isis/src/base/apps/isis2raw/main.cpp
+++ b/isis/src/base/apps/isis2raw/main.cpp
@@ -37,39 +37,42 @@ void IsisMain() {
// if(ui.GetString("BITTYPE") != "32BIT")
p.SetInputRange();
}
- if(ui.GetString("STRETCH") == "MANUAL")
+ if(ui.GetString("STRETCH") == "MANUAL") {
p.SetInputRange(ui.GetDouble("MINIMUM"), ui.GetDouble("MAXIMUM"));
+ }
// Determine bit size, output range, and calculate number of bytes to write
// for each line.
double min = -DBL_MAX;
double max = DBL_MAX;
+ Pixtype pixType = NONE;
if(ui.GetString("BITTYPE") == "8BIT") {
p.SetOutputType(Isis::UnsignedByte);
min = 0.0;
max = 255.0;
- checkRange(ui, min, max);
- setRangeAndPixels(ui, p, min, max, BOTH);
+ pixType = BOTH;
}
else if(ui.GetString("BITTYPE") == "S16BIT") {
p.SetOutputType(Isis::SignedWord);
min = -32768.0;
max = 32767.0;
- checkRange(ui, min, max);
- setRangeAndPixels(ui, p, min, max, NEG);
+ pixType = NEG;
}
else if(ui.GetString("BITTYPE") == "U16BIT") {
p.SetOutputType(Isis::UnsignedWord);
min = 0.0;
max = 65535.0;
- checkRange(ui, min, max);
- setRangeAndPixels(ui, p, min, max, BOTH);
+ pixType = BOTH;
}
else if(ui.GetString("BITTYPE") == "32BIT") {
p.SetOutputType(Isis::Real);
+ pixType = NONE;
+ }
+
+ if (ui.GetString("STRETCH") != "NONE" || ui.GetString("BITTYPE") != "32BIT") {
checkRange(ui, min, max);
- setRangeAndPixels(ui, p, min, max, NONE);
}
+ setRangeAndPixels(ui, p, min, max, pixType);
// Set the output endianness
if(ui.GetString("ENDIAN") == "MSB")
@@ -117,7 +120,7 @@ void IsisMain() {
// Validates provided range
void checkRange(UserInterface &ui, double &min, double &max) {
Isis::Histogram *hist = p_cube->histogram(0);
-
+
if(ui.WasEntered("OMIN")) {
if(ui.GetDouble("OMIN") < min) {
QString message = "OMIN [" + toString(min) + "] is too small for the provided BITTYPE [";
@@ -136,7 +139,7 @@ void checkRange(UserInterface &ui, double &min, double &max) {
min = ui.GetDouble("MINIMUM");
}
}
-
+
if(ui.WasEntered("OMAX")) {
if(ui.GetDouble("OMAX") > max) {
QString message = "OMAX [" + toString(max) + "] is too large for the provided BITTYPE [";
diff --git a/isis/src/base/apps/stats/stats.xml b/isis/src/base/apps/stats/stats.xml
index 78e656c111..986cb66230 100644
--- a/isis/src/base/apps/stats/stats.xml
+++ b/isis/src/base/apps/stats/stats.xml
@@ -11,6 +11,57 @@
processed. The stats program generates statistics that will help you find new insights
in your data to make more accurate predictions and achieve better outcomes.
+ Histogram Computation
+
+ Stats uses a histogram to compute the mode and median DN values for a given cube.
+ The minimum, maximum, and number of bins depends on the pixel type of the cube. Here are the minimum, maximum,
+ and number of bins associated with supported pixel types:
+
+
+ Pixel Type |
+ Minimum |
+ Maximum |
+ Number of Bins |
+
+
+ Unsigned Byte |
+ 0 * cube multiplier + base |
+ 255 * cube multiplier + base |
+ 256 |
+
+
+ Unsigned Word |
+ 0 * cube multiplier + base |
+ 65535 * cube multiplier + base |
+ 65536 |
+
+
+ Signed Word |
+ -32768.0 * cube multiplier + base |
+ 32767.0 * cube multiplier + base |
+ 65536 |
+
+
+ Unsigned Integer |
+ Minimum DN value in the cube |
+ Maximum DN value in the cube |
+ 65536 |
+
+
+ Signed Integer |
+ Minimum DN value in the cube |
+ Maximum DN value in the cube |
+ 65536 |
+
+
+ Real |
+ Minimum DN value in the cube |
+ Maximum DN value in the cube |
+ 65536 |
+
+
+ The cube multiplier and base can be found in the header of the cube.
+
@@ -28,23 +79,23 @@
-Average Total pixels
+ Average Total pixels
-Standard deviation Valid pixels
+ Standard deviation Valid pixels
-Variance Over valid maximum pixels
+ Variance Over valid maximum pixels
-Median Under valid minimum pixels
+ Median Under valid minimum pixels
-Mode Null pixels
+ Mode Null pixels
-Skew Low representation saturation (LRS) pixels
+ Skew Low representation saturation (LRS) pixels
-Minimum High representation saturation (HRS) pixels
+ Minimum High representation saturation (HRS) pixels
-Maximum Low instrument saturation (LIS) pixels
+ Maximum Low instrument saturation (LIS) pixels
-Sum High instrument saturation (HIS) pixels
+ Sum High instrument saturation (HIS) pixels
diff --git a/isis/src/base/objs/Equalization/Equalization.cpp b/isis/src/base/objs/Equalization/Equalization.cpp
index 3f7b98501c..d1bad329ff 100644
--- a/isis/src/base/objs/Equalization/Equalization.cpp
+++ b/isis/src/base/objs/Equalization/Equalization.cpp
@@ -105,7 +105,7 @@ namespace Isis {
/**
- * @brief Calculates the image and overlap statistics, and then determines corrective factors if
+ * @brief Calculates the image and overlap statistics, and then determines corrective factors if
* possible
*
* This method calculates image statistics on a band-by-band basis and calculates overlap
@@ -155,7 +155,7 @@ namespace Isis {
if (!m_badFiles.isEmpty()) {
// Make sure we set the results for the already calculated overlap statistics
setResults();
-
+
QString msg;
// Let user know where to find list of non-overlapping files so they can make corrections.
msg = "There are input images that do not overlap with enough valid pixels. ";
@@ -199,7 +199,7 @@ namespace Isis {
/**
* @brief Calculates the image statistics on a band-by-band basis
*
- * This method calculates statistics by band for the input images. Each set of
+ * This method calculates statistics by band for the input images. Each set of
* band statistics is used to initialize the OverlapNormalizations that will
* be used to determine gains and offsets for equalization.
*/
@@ -239,7 +239,7 @@ namespace Isis {
/**
* @brief Calculates the overlap statistics for each pair of input images
- *
+ *
* This method calculates any overlap statistics that have not been previously
* calculated for the input images.
*/
@@ -252,7 +252,7 @@ namespace Isis {
// Find overlapping areas and add them to the set of known overlaps for
// each band shared amongst cubes
for (int i = 0; i < m_imageList.size(); i++) {
- Cube cube1;
+ Cube cube1;
cube1.open(m_imageList[i].toString());
for (int j = (i + 1); j < m_imageList.size(); j++) {
@@ -347,23 +347,52 @@ namespace Isis {
// Add normalization statistics
for (int img = 0; img < m_imageList.size(); img++) {
// Format and name information
+ // It is important that the variable names are listed in the same
+ // order as they are added to the PvlKeyword in the for loop.
PvlGroup norm("Normalization");
- norm.addComment("Formula: newDN = (oldDN - AVERAGE) * GAIN + AVERAGE + OFFSET");
- norm.addComment("BandN = (GAIN, OFFSET, AVERAGE)");
+ switch(m_sType) {
+ case OverlapNormalization::Both:
+ norm.addComment("Formula: newDN = (oldDN - AVERAGE) * GAIN + AVERAGE + OFFSET");
+ norm.addComment("BandN = (GAIN, OFFSET, AVERAGE)");
+ break;
+ case OverlapNormalization::Gains:
+ norm.addComment("Formula: newDN = oldDN * GAIN + AVERAGE * GAIN");
+ norm.addComment("BandN = (GAIN, AVERAGE)");
+ break;
+ case OverlapNormalization::Offsets:
+ norm.addComment("Formula: newDN = OFFSET + AVERAGE");
+ norm.addComment("BandN = (OFFSET, AVERAGE)");
+ break;
+ case OverlapNormalization::GainsWithoutNormalization:
+ norm.addComment("Formula: newDN = oldDN * GAIN");
+ norm.addComment("BandN = (GAIN)");
+ break;
+ }
norm += PvlKeyword("FileName", m_imageList[img].original());
if (m_normsSolved) {
// Band by band statistics
for (int band = 1; band <= m_maxBand; band++) {
- QString mult = toString(m_adjustments[img]->getGain(band - 1));
- QString base = toString(m_adjustments[img]->getOffset(band - 1));
- QString avg = toString(m_adjustments[img]->getAverage(band - 1));
QString bandNum = toString(band);
QString bandStr = "Band" + bandNum;
PvlKeyword bandStats(bandStr);
- bandStats += mult;
- bandStats += base;
- bandStats += avg;
+ // GAIN
+ if (m_sType == OverlapNormalization::Both ||
+ m_sType == OverlapNormalization::Gains ||
+ m_sType == OverlapNormalization::GainsWithoutNormalization) {
+ bandStats += toString(m_adjustments[img]->getGain(band - 1));
+ }
+ // OFFSET
+ if (m_sType == OverlapNormalization::Both ||
+ m_sType == OverlapNormalization::Offsets) {
+ bandStats += toString(m_adjustments[img]->getOffset(band - 1));
+ }
+ // AVERAGE
+ if (m_sType == OverlapNormalization::Both ||
+ m_sType == OverlapNormalization::Gains ||
+ m_sType == OverlapNormalization::Offsets) {
+ bandStats += toString(m_adjustments[img]->getAverage(band - 1));
+ }
norm += bandStats;
}
}
@@ -401,8 +430,8 @@ namespace Isis {
/**
* @brief Imports statistics for applying correction
*
- * This method obtains corrective factors from an input statistics pvl file so that
- * input images can be equalized. These corrective factors are obtained from Normalization
+ * This method obtains corrective factors from an input statistics pvl file so that
+ * input images can be equalized. These corrective factors are obtained from Normalization
* groups within the EqualizationInformation object in the input pvl.
*
* @see Equalization::applyCorrection()
@@ -699,7 +728,7 @@ namespace Isis {
for (unsigned int adj = 0; adj < m_adjustments.size(); adj++) {
delete m_adjustments[adj];
}
- m_adjustments.clear();
+ m_adjustments.clear();
}
@@ -778,7 +807,7 @@ namespace Isis {
const PvlGroup &eqGen = eqInfo.findGroup("General");
m_samplingPercent = eqGen["SamplingPercent"];
m_mincnt = eqGen["MinCount"];
- m_wtopt = (eqGen["Weighted"][0] == "true") ? true : false;
+ m_wtopt = (eqGen["Weighted"][0] == "true") ? true : false;
m_sType = static_cast((int)eqGen["SolutionType"]);
m_lsqMethod = static_cast(eqGen["SolveMethod"][0].toInt());
@@ -799,10 +828,10 @@ namespace Isis {
m_alreadyCalculated[x] = true;
m_alreadyCalculated[y] = true;
- // Determine which calculated overlaps have valid overlaps
+ // Determine which calculated overlaps have valid overlaps
// (i.e. valid pixels > mincount)
if (oStat["Valid"][0] == "true") {
- m_doesOverlapList[x] = true;
+ m_doesOverlapList[x] = true;
m_doesOverlapList[y] = true;
}
}
@@ -821,7 +850,7 @@ namespace Isis {
for (int o = 0; o < (int) m_overlapStats.size(); o++) {
OverlapStatistics *oStat = m_overlapStats[o];
- // Calculate the indices - we want to ensure that no matter how the input list of images
+ // Calculate the indices - we want to ensure that no matter how the input list of images
// changes (e.g. the order is changed), we always add overlaps that same way.
// This means ensuring that each overlap has the X overlap statistics associated with
// the X index and the Y overlap statistics associated with the Y index.
diff --git a/isis/src/mro/apps/hidtmgen/MroHiriseIdealPds.pft b/isis/src/mro/apps/hideal2pds/MroHiriseIdealPds.pft
similarity index 100%
rename from isis/src/mro/apps/hidtmgen/MroHiriseIdealPds.pft
rename to isis/src/mro/apps/hideal2pds/MroHiriseIdealPds.pft
diff --git a/isis/src/mro/apps/hidtmgen/MroHiriseIdealPds.typ b/isis/src/mro/apps/hideal2pds/MroHiriseIdealPds_16bit.typ
similarity index 100%
rename from isis/src/mro/apps/hidtmgen/MroHiriseIdealPds.typ
rename to isis/src/mro/apps/hideal2pds/MroHiriseIdealPds_16bit.typ
diff --git a/isis/src/mro/apps/hideal2pds/hiriseIdealPds.typ b/isis/src/mro/apps/hideal2pds/MroHiriseIdealPds_8bit.typ
similarity index 96%
rename from isis/src/mro/apps/hideal2pds/hiriseIdealPds.typ
rename to isis/src/mro/apps/hideal2pds/MroHiriseIdealPds_8bit.typ
index 9dff8d1e5c..f76ce2452f 100644
--- a/isis/src/mro/apps/hideal2pds/hiriseIdealPds.typ
+++ b/isis/src/mro/apps/hideal2pds/MroHiriseIdealPds_8bit.typ
@@ -25,7 +25,7 @@ INSTRUMENT_HOST_NAME = String
TARGET_NAME = String
MISSION_PHASE_NAME = String
ORBIT_NUMBER = Integer
-SOURCE_PRODUCT_ID = String
+#SOURCE_PRODUCT_ID = String
RATIONALE_DESC = String
SOFTWARE_NAME = String
SAMPLE_DETECTORS = Integer
@@ -33,7 +33,7 @@ LINE_DETECTORS = Integer
INSTRUMENT_TYPE = Enum
EPHEMERIS_TIME = Real
FOCAL_PLANE_X_DEPENDENCY = Integer
-EXPOSURE_DURATION = (Real, 4)
+EXPOSURE_DURATION = (Real, 6)
IMAGE_JITTER_CORRECTED = Integer
SHAPE_MODEL = String
A_AXIS_RADIUS = (Real, 2)
@@ -68,7 +68,7 @@ BANDS = Integer
OFFSET = Real
SCALING_FACTOR = Real
SAMPLE_BITS = Integer
-SAMPLE_BIT_MASK = ("Binary",16)
+SAMPLE_BIT_MASK = ("Binary",8)
SAMPLE_TYPE = Enum
FILTER_NAME = String
CENTER_FILTER_WAVELENGTH = Real
diff --git a/isis/src/mro/apps/hideal2pds/hideal2pds.xml b/isis/src/mro/apps/hideal2pds/hideal2pds.xml
index d128f56e97..6a624d3642 100644
--- a/isis/src/mro/apps/hideal2pds/hideal2pds.xml
+++ b/isis/src/mro/apps/hideal2pds/hideal2pds.xml
@@ -59,6 +59,9 @@
Added an option to control the output bits. min = 8, max =16, default = 10. Fixes #5527.
+
+ Output label now has the correct SAMPLE_BIT_MASK value according to bits input. Fixes #3978.
+
diff --git a/isis/src/mro/apps/hideal2pds/hiriseIdealPds.pft b/isis/src/mro/apps/hideal2pds/hiriseIdealPds.pft
deleted file mode 100644
index 0ba52cc7ba..0000000000
--- a/isis/src/mro/apps/hideal2pds/hiriseIdealPds.pft
+++ /dev/null
@@ -1,173 +0,0 @@
-PDS_VERSION_ID
-RECORD_TYPE
-RECORD_BYTES
-FILE_RECORDS
-LABEL_RECORDS
-^IMAGE
-^INSTRUMENT_POINTING_TABLE
-^INSTRUMENT_POSITION_TABLE
-^BODY_ROTATION_TABLE
-^SUN_POSITION_TABLE
-NOT_APPLICABLE_CONSTANT
-DATA_SET_ID
-DATA_SET_NAME
-PRODUCER_INSTITUTION_NAME
-PRODUCER_ID
-PRODUCER_FULL_NAME
-OBSERVATION_ID
-PRODUCT_ID
-PRODUCT_VERSION_ID
-SPACECRAFT_NAME
-INSTRUMENT_ID
-INSTRUMENT_NAME
-INSTRUMENT_HOST_ID
-INSTRUMENT_HOST_NAME
-TARGET_NAME
-MISSION_PHASE_NAME
-ORBIT_NUMBER
-SOURCE_PRODUCT_ID
-RATIONALE_DESC
-SOFTWARE_NAME
-SAMPLE_DETECTORS
-LINE_DETECTORS
-INSTRUMENT_TYPE
-FOCAL_LENGTH
-PIXEL_PITCH
-EPHEMERIS_TIME
-FOCAL_PLANE_X_DEPENDENCY
-TRANS_X
-TRANS_Y
-EXPOSURE_DURATION
-MATCHED_CUBE
-IMAGE_JITTER_CORRECTED
-SHAPE_MODEL
-A_AXIS_RADIUS
-B_AXIS_RADIUS
-C_AXIS_RADIUS
-BODY_FRAME_CODE
-IDEAL_FOCAL_LENGTH
-IDEAL_PIXEL_PITCH
-IDEAL_TRANSX
-IDEAL_TRANSY
-IDEAL_TRANSL
-IDEAL_TRANSS
-
-/* All xxx_COUNT values are for the MRO spacecraft clock (SCLK) */
-/* in seconds:subseconds form. A subsecond tick = 15.2588 microseconds. */
-/* All xxx_TIME values are referenced to UTC. */
-GROUP = TIME_PARAMETERS
-/* Time when the observation first started */
- MRO:OBSERVATION_START_TIME
- MRO:OBSERVATION_START_COUNT
- /* Time of the first image line */
- START_TIME
- SPACECRAFT_CLOCK_START_COUNT
- /* Time of the last image line */
- STOP_TIME
- SPACECRAFT_CLOCK_STOP_COUNT
- /* Time when this RDR product was created */
- PRODUCT_CREATION_TIME
-END_GROUP = TIME_PARAMETERS
-
-OBJECT = IMAGE
- DESCRIPTION
- LINES
- LINE_SAMPLES
- SOURCE_LINE_SAMPLES
- SOURCE_LINES
- FIRST_LINE_SAMPLE
- FIRST_LINE
- BANDS
- OFFSET
- SCALING_FACTOR
- SAMPLE_BITS
- SAMPLE_BIT_MASK
- SAMPLE_TYPE
- FILTER_NAME
- CENTER_FILTER_WAVELENGTH
- BAND_WIDTH
- BAND_STORAGE_TYPE
- CORE_NULL
- CORE_LOW_REPR_SATURATION
- CORE_LOW_INSTR_SATURATION
- CORE_HIGH_REPR_SATURATION
- CORE_HIGH_INSTR_SATURATION
- VALID_MINIMUM
- INTERCHANGE_FORMAT
-END_OBJECT = IMAGE
-
-OBJECT = INSTRUMENT_POINTING_TABLE
- INTERCHANGE_FORMAT
- ROWS
- COLUMNS
- ROW_BYTES
- ROW_SUFFIX_BYTES
- TIME_DEPENDENT_FRAMES
- CONSTANT_FRAMES
- CONSTANT_ROTATION
- CK_TABLE_START_TIME
- CK_TABLE_END_TIME
- CK_TABLE_ORIGINAL_SIZE
- OBJECT = COLUMN
- COLUMN_NUMBER
- NAME
- DATA_TYPE
- START_BYTE
- BYTES
- END_OBJECT = COLUMN
-END_OBJECT = INSTRUMENT_POINTING_TABLE
-
-OBJECT = INSTRUMENT_POSITION_TABLE
- ROWS
- COLUMNS
- ROW_BYTES
- ROW_SUFFIX_BYTES
- CACHE_TYPE
- SPK_TABLE_START_TIME
- SPK_TABLE_END_TIME
- SPK_TABLE_ORIGINAL_SIZE
- OBJECT = COLUMN
- COLUMN_NUMBER
- NAME
- DATA_TYPE
- START_BYTE
- BYTES
- END_OBJECT = COLUMN
-END_OBJECT = INSTRUMENT_POSITION_TABLE
-
-OBJECT = BODY_ROTATION_TABLE
- ROWS
- COLUMNS
- ROW_BYTES
- ROW_SUFFIX_BYTES
- TIME_DEPENDENT_FRAMES
- CK_TABLE_START_TIME
- CK_TABLE_END_TIME
- CK_TABLE_ORIGINAL_SIZE
- SOLAR_LONGITUDE
- OBJECT = COLUMN
- COLUMN_NUMBER
- NAME
- DATA_TYPE
- START_BYTE
- BYTES
- END_OBJECT = COLUMN
-END_OBJECT = BODY_ROTATION_TABLE
-
-OBJECT = SUN_POSITION_TABLE
- ROWS
- COLUMNS
- ROW_BYTES
- ROW_SUFFIX_BYTES
- CACHE_TYPE
- SPK_TABLE_START_TIME
- SPK_TABLE_END_TIME
- SPK_TABLE_ORIGINAL_SIZE
- OBJECT = COLUMN
- COLUMN_NUMBER
- NAME
- DATA_TYPE
- START_BYTE
- BYTES
- END_OBJECT = COLUMN
-END_OBJECT = SUN_POSITION_TABLE
diff --git a/isis/src/mro/apps/hideal2pds/main.cpp b/isis/src/mro/apps/hideal2pds/main.cpp
index 2515daaf97..f39f9d79d1 100644
--- a/isis/src/mro/apps/hideal2pds/main.cpp
+++ b/isis/src/mro/apps/hideal2pds/main.cpp
@@ -184,11 +184,11 @@ void IsisMain() {
updatePdsLabelTimeParametersGroup(pdsLabel);
updatePdsLabelImageObject(isisCubeLab, pdsLabel);
- if (nbits != 8 && nbits != 16) {
- PvlObject &image = pdsLabel.findObject("IMAGE");
- image.addKeyword(PvlKeyword("SAMPLE_BIT_MASK",
- toString((int)pow(2.0, (double)nbits) - 1)), Pvl::Replace);
- }
+
+ // change SAMPLE_BIT_MASK value according to BITS input
+ PvlObject &image = pdsLabel.findObject("IMAGE");
+ image.addKeyword(PvlKeyword("SAMPLE_BIT_MASK", toString((int)pow(2.0, (double)nbits) - 1)),
+ Pvl::Replace);
Camera *cam = inputCube->camera();
updatePdsLabelRootObject(isisCubeLab, pdsLabel, ui, cam);
@@ -293,7 +293,12 @@ void IsisMain() {
// Read in the proper keyword types (Real, Enum, String, Integer, etc) for
// each PvlKeyword so that the PDS labels have proper format
PvlFormat *formatter = pdsLabel.format();
- formatter->add("$ISISROOT/appdata/translations/MroHiriseIdealPds.typ");
+
+ if( nbits != 8 ) {
+ formatter->add("$ISISROOT/appdata/translations/MroHiriseIdealPds_16bit.typ");
+ } else {
+ formatter->add("$ISISROOT/appdata/translations/MroHiriseIdealPds_8bit.typ");
+ }
// Format ordering of keywords/objects/groups/comments in the PDS labels
pdsLabel.setFormatTemplate("$ISISROOT/appdata/translations/MroHiriseIdealPds.pft");