NAME

HiBeautify

SUMMARY

HiBeautify creates special color products ("pretty pictures"); namely, a synthetic RGB product and an enhanced IRB product that are cosmetically improved over the raw color or normalized raw color. These special products are extras associated with an eventual COLOR (IRB) RDR. They will be placed in the RDR Extras directory for the observation. This directory will be created if needed.

It will typically be configured to use the HiColorNorm cubes as input and be invoked after the HiColorNorm pipeline.

SYNOPSIS

HiBeautify [-Verbose] [-Help] [-Catalog <name>] [-Frost | -NoFrost] [-Configuration <filename>] [-Id <Conductor ID>] [-Product_Version <Number>] PVL source file

OPTIONS

-Catalog <name>

The name of the database catalog to use.

-Configuration <filename>

The Configuration file used to control some aspects of the cosmetic enhancement and JP2/JPG creation.

-Id <Conductor ID>

Provides the Conductor ID, to use in temporary files. If unset, the process ID of the script will be used.

-Product_Version <Number>

To force the Extras to be created with a particular RDR version number, provide it with the -Product_Version option.

If not specified, the Product_Version utility will be used to obtain the next version number for the extras (defaulting to 1).

-Frost

Use the frost/ice color stretch and disable the auto-detection of frost/ice.

-NoFrost

Do not use the frost/ice color stretch and disable the autodetection of frost/ice.

-Verbose

Show more messages and echo ISIS commands before they are run.

-Help

Prints the command usage help.

DESCRIPTION

HiBeautify uses the left & right HiColorNorm cubes (slithered, normalized, three-band IRB cubes). It creates a mosaic of these which is saved as the _IRB cub. This is used as the input source for subsequent steps.

HiBeautify consists of the following steps.

Setup, initialize variables, lookup configuration parameters, create Archiver instance

Decompress the HiColorNorm cubes if necessary

Create an IRB mosaic from the HiColorNorm halves.

If a half is missing, we create a mosaic with the proper width and place the half in it at the proper location.

Determine if Frost/ICE may be present using FrostStats module.

Tag if Frost/Ice was detected

Subtract the unaltered RED band from the high pass filtered BG for synthetic blue.

Determine the min and max DN values of each band (RED, IR, BG, B) we're working with.

Create an RGB cube using the RED from the IRB mosaic, the BG from the IRB mosaic and the synthetic B that we just made.

NOTE: cubeit is broken in 3.4.0, a workaround is added here

Create the RGB.NOMAP and COLOR.NOMAP (IRB) Extras (JP2, browse and thumb). Archive them into the proper versioned directories.

Clean up as configured

Create PVL for Extras product mapping into HiCat

Use PVL_to_DB to update (or insert) the Extras info into HiCat. Note, PVL_to_DB does not have a catalog option.

Function Definitions

Create_JPEGs

Explode the stacked cube into separate band cubes.

Reduce each by the configured scale factor (adding the bin ratio if BG or IR).

Obtain the min and max DN from the reduced band cube.

Create the JP2 by converting the color mosaic with Isis2jp2, passing the min and max DN from each reduced band cube.

Create JPG browse & thumb by converting the color mosaic with Isis2jpeg using the configured stretch options.

Exit Status

Zero on success, see HiColor.pm for definitions of the other exit codes.

Author

Guy McArthur, UA/HiROC

Copyright

Copyright (C) 2007-2020 Arizona Board of Regents on behalf of the Lunar and Planetary Laboratory at the University of Arizona.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Version

1.95 2023/10/10 22:20:07