From a92a0c49c2faebdc0fbaaf4817d4bff5e04bb717 Mon Sep 17 00:00:00 2001 From: Kaitlyn Lee Date: Wed, 19 Dec 2018 11:09:33 -0700 Subject: [PATCH] Added pixel type attribute to the output image of program shadow. Fixes #5187 (#659) * Removed bolding of some text to decrease distraction. * Fixed some typos. * Reworded documentation. --- isis/src/base/apps/shadow/shadow.xml | 131 ++++++++++++++------------- 1 file changed, 67 insertions(+), 64 deletions(-) diff --git a/isis/src/base/apps/shadow/shadow.xml b/isis/src/base/apps/shadow/shadow.xml index b18e54baaa..f6f14fc0da 100644 --- a/isis/src/base/apps/shadow/shadow.xml +++ b/isis/src/base/apps/shadow/shadow.xml @@ -2,26 +2,28 @@ - High accuracy hillshade with shadow casting + Create a high accuracy hillshade with shadow casting - This program will create a shaded-relief cube from a DEM and match cube.

+ This program, shadow, will create a shaded-relief cube from a digital + elevation model (DEM) and a MATCH cube.

- This program operates much like 'shade' but instead of an azimuth/elevation input, we use the - sun's position at the center of the given cube or at a given time and, by default, factor in - shadows cast by features.

+ We use the sun's position at the center of the input cube or a user-defined + observation time. By default, we factor in shadows cast by features. + This program operates much like the ISIS3 'shade' program which instead requires azimuth/elevation as input.

- Using the sun's position allows much higher precision shading and enables the possibility of - computing shadowed areas. The algorithm description below is provided to help understand the + However, with the shadow application, using the sun's position allows much + higher precision shading and enables the possibility of computing shadowed areas. + The algorithm description below is provided to help understand the optimization settings.

User-Requirements
The user must supply an elevation model (DEM) and either an observation time or a cube - with raw camera geometry (see spiceinit).

+ with raw camera geometry (see 'spiceinit').

Understanding the Algorithm
- The shade program's algorithm is called 'hillshade' in this algorithm description. + The 'shade' program's algorithm is called 'hillshade' in this algorithm description.
  1. @@ -30,35 +32,32 @@
  2. - For every pixel in the input elevation model
    + For every pixel in the input elevation model, compute the hillshade value for the pixel, and
    1. - Compute the hillshade value for the pixel, and -
    2. -
    3. - if the hillshade result is positive (facing towards the sun) then estimate if the pixel is + if the hillshade result is positive (facing towards the sun), then estimate if the pixel is in shadow;
    4. - if the hillshade value is positive and the pixel is in shadow then the result is an LRS; + if the hillshade value is positive and the pixel is in shadow, then the result is an LRS;
    5. - if the hillshade value is positive and the pixel is not in shadow then the result is the + if the hillshade value is positive and the pixel is not in shadow, then the result is the hillshade result and
    6. - if the hillshade value is negative the result is an LRS + if the hillshade value is negative, the result is low resolution saturation (LRS).
- The algorithm to estimate if a pixel is in shadow + The algorithm to estimate if a pixel is in shadow:
  1. - Optimization: If SHADOW, and this elevation model pixel is known to be shadowed, + Optimization: If SHADOW, and this elevation model pixel is known to be shadowed, consider this pixel to be shadowed and stop (no pixels are initially known to be - shadowed). + shadowed).
  2. Compute the pixel's body-fixed coordinate (XYZ) position. @@ -68,7 +67,7 @@ the sun.
  3. - Subtract the sun's position from the elevation model pixel's position, giving you a vector + Subtract the sun's position from the elevation model pixel's position, providing a vector to the center (or edge) of the sun.
  4. @@ -84,10 +83,10 @@
  5. Update estimate of how far along the 3D ray is equivalent to the full resolution of the elevation model.
    - Optimization: Multiply the step by PRECISION.
    - Optimization : If SKIPOVERSHADOW, while the next linearly-extrapolated elevation + Optimization: Multiply the step by PRECISION.
    + Optimization : If SKIPOVERSHADOW, while the next linearly-extrapolated elevation model position is known to be in shadow, increase the next step size by the - estimate up to MAXSKIPOVERSHADOWSTEPS times
    . + estimate up to MAXSKIPOVERSHADOWSTEPS times.
  6. Check for a solution
    • @@ -98,9 +97,9 @@
    • If the ray's elevation is higher than the highest point on the elevation model, the originating pixel is in light.
      - Optimization: If LIGHTCURTAIN, and the ray's elevation is higher than a previous ray + Optimization: If LIGHTCURTAIN, and the ray's elevation is higher than a previous ray that intersected this pixel in the elevation model, consider the - originating pixel in light. + originating pixel in light.
  7. @@ -109,18 +108,18 @@
  8. If LIGHTCURTAIN, and the pixel was determined to be in light, record the elevations of the ray where it projected onto the elevation model.
    - Optimization: If LOWERLIGHTCURTAIN, lower the elevations along the ray by + Optimization: If LOWERLIGHTCURTAIN, lower the elevations along the ray by subtracting the minimum difference between the ray and the elevation model while - the ray was being walked..
    - Optimization: If CACHEINTERPOLATEDVALUES, linearly interpolate the points where the - ray would have intersected the elevation model to one pixel accuracy. + the ray was being walked.
    + Optimization: If CACHEINTERPOLATEDVALUES, linearly interpolate the points where the + ray would have intersected the elevation model to one pixel accuracy.
  9. If SHADOWMAP, and the pixel was determined to be in shadow, record all points where the ray projected onto the elevation model to be known shadowed points, excluding the actual intersection point.
    - Optimization: If CACHEINTERPOLATEDVALUES, linearly interpolate the points where the - ray would have intersected the elevation model to one pixel accuracy. + Optimization: If CACHEINTERPOLATEDVALUES, linearly interpolate the points where the + ray would have intersected the elevation model to one pixel accuracy.
  10. @@ -137,8 +136,8 @@ cache, and 16 bytes for the shadow cache, but the caches are hash-based causing a large amount of potential overhead. The caches are not limited to their specified sizes, only reduced to them periodically, and larger cache sizes result in this program consuming more memory. - Although the larger the cache, the longer takes to lookup a single value (which happens often), - in general larger caches mean less CPU time for the cost of memory. + The larger the cache, the longer it takes to lookup a single value (which happens often). + In general, larger caches mean less CPU time for the cost of memory. @@ -152,6 +151,10 @@ Added NaifStatus::CheckErrors() to see if any NAIF errors were signaled. References #2248. + + Added the PixelType attribute to the output cube and set it to real. + Documentation updated by editor. Fixes #5187. + @@ -170,6 +173,7 @@ cube + real output Shaded and shadowed DEM @@ -267,8 +271,8 @@ This is the estimated radius of the sun in solar radii. Since the unit "solar radius" is not our best guess of the sun's radius, the default is slightly different than 1. - A larger number has the end effect of lessening shadows, a smaller number increases - shadows. The sun's radius is only used for shadow computations, hillshade always uses the + A larger number has the end effect of lessening shadows; a smaller number increases + shadows. The sun's radius is only used for shadow computations. Hillshade always uses the sun's center. 0.0 @@ -291,8 +295,8 @@ This should be the time of the observer to use for the sun's position. The entered time - will be adjusted for light-time between the sun and the observer. The format should be: - "YYYY-MM-DDTHH:MM:SS.SSS" - for example: "2012-01-01T14:25:15.36" + will be adjusted for light-time between the sun and the observer. The format should be + "YYYY-MM-DDTHH:MM:SS.SSS"; for example, "2012-01-01T14:25:15.36" @@ -306,7 +310,7 @@ This is a list of quick settings for the other parameters in the Optimizations group. This also includes the ability to disable the shadow computations entirely. These options are - provided for those who don't need a lot of customization or don't want to calculate + provided for those who do not need a lot of customization or do not want to calculate shadow positions. @@ -417,10 +421,10 @@ When a ray is determined to be in shadow, every DEM pixel between the original position and - the point at which the DEM intersected the ray will be marked as in shadow. We then don't - have to do any significant work when processing a pixel we previously determined was in + the point at which the DEM intersected the ray will be marked as in shadow. We then perform no + significant work when processing a pixel that we previously determined was in shadow. This also helps avoid unnecessary ray-DEM intersection checks (because surfaces - aren't shadowed by surfaces already in shadow). + are not shadowed by surfaces already in shadow). BASESHADOWCACHESIZE @@ -436,8 +440,8 @@ The shadow cache is allowed to grow to an unlimited size while the shadowing algorithm is - processing. However, periodically the caches are shrunk - this is the approximate number - of elements to shrink the shadow cache to. The shrinking is optimized in a way that + processing. This is the approximate number of elements to shrink the + shadow cache to, as periodically the caches are shrunk. The shrinking is optimized in a way that is mostly respected, but not guaranteed. 0 @@ -480,8 +484,8 @@ The light curtain cache is allowed to grow to an unlimited size while the shadowing - algorithm is processing. However, periodically the caches are shrunk - this is the - approximate number of elements to shrink the light caches to. The shrinking is optimized + algorithm is processing. This is the approximate number of elements to + shrink the light caches to, as periodically the caches are shrunk. The shrinking is optimized in a way that this is mostly respected, but not guaranteed. 0 @@ -515,7 +519,7 @@ This is a means to lessen the number of ray-DEM intersection checks by guessing the - next ray-DEM intersection location and checking if it's in shadow. If it is, the ray + next ray-DEM intersection location and checking if it is in shadow. If it is, the ray is stepped farther before the next intersection test (up to MAXSKIPOVERSHADOWSTEPS farther). @@ -530,7 +534,7 @@ Distance to consider SKIPOVERSHADOW valid - Since the ray won't make a perfectly straight line across the DEM (DEMs are + Since the ray will not make a perfectly straight line across the DEM (DEMs are projected onto a flat surface) a linear guess as to the next intersection point degrades in accuracy (depending on a number of factors, such as ray elevation, projection type, and DEM accuracy). This controls how far the algorithm can guess the next intersection point @@ -547,7 +551,7 @@ This example will cover running this program in balanced mode. - The input file "localdem.cub" was produced with the commands: + The input file "localdem.cub" was produced with the following commands:
               spiceinit from=ab102401.cub
               fx from=ab102401.cub to=ab102401.radii.cub equation="radius(f1)"
    @@ -565,10 +569,10 @@
           
             
               
    -            Example's parameters in the graphical interface
    +            Example of parameters in the graphical interface
                 
    -              Run this program given a high resolution DEM 'localdem.cub' and the lighting
    -              characteristics from 'ab102401.cub' to create 'shadowed.cub'
    +              Run this program using the high resolution DEM 'localdem.cub' and the lighting
    +              characteristics from 'ab102401.cub' to create the 'shadowed.cub'
                 
                 
    @@ -579,8 +583,8 @@
             
               FROM DEM to do shaded relief and shadow calculations on
               
    -            This is the elevation model for which we're computing a shaded relief and shadow
    -            positions for. This is the FROM cube.
    +            This is the elevation model for which the shaded relief and shadow
    +            positions are to be computed. This is the FROM cube.
               
               
    @@ -588,7 +592,7 @@
             
               MATCH image for computing the sun position
               
    -            This is the image we're gathering the sun position from. In other words, we're trying
    +            We gather the sun position from this image. In other words, we are trying
                 to make the DEM look like this image.
               
               Output shaded relief with shadows
               
                 This is the result of the shadow program. This is the TO cube.
    -
                 The shadows are not as big as the shadows we see in the projected MATCH image because
    -            we're computing the fully shadowed areas in this program. Areas of the image that are
    -            getting less light, but aren't fully shadowed, look like they are in shadow but still
    -            have detail in them. To extend the shadow computations to encompass the visible
    +            we have computed the fully shadowed areas in this program. Areas of the image that are
    +            getting less light, but not fully shadowed, still appear in the shadow, but
    +            show more detail in them. To extend the shadow computations to encompass the visible
                 shadow completely you can turn off SUNEDGE.
               
               
                 Example's parameters in the graphical interface
                 
    -              Run this program given a the DEM 'dem.cub' and the lighting
    -              characteristics from midnight March 1st, 2012 to create 'shadowed_dem.cub'
    +              Run this program given the DEM 'dem.cub' and the lighting
    +              characteristics from midnight March 1st, 2012 to create 'shadowed_dem.cub'.
                 
                 
    @@ -661,8 +664,8 @@
             
               FROM DEM to do shaded relief and shadow calculations on
               
    -            This is the elevation model for which we're computing a shaded relief and shadow
    -            positions for. This is the FROM cube.
    +            This is the elevation model for which the shaded relief and shadow
    +            positions are to be computed. This is the FROM cube.
               
               
    @@ -674,7 +677,7 @@
               
                 This is the result of the shadow program. This is the TO cube.
     
    -            This is what a mosaic of the entire moon would look like, approximately, if all of the
    +            This is what a mosaic of the entire moon would look like, approximately, if all
                 images were taken at one time.