Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

ISIS Documentation

lineeq

This program will normalize a cube based on line averages.

This program will normalize a cube based on line averages.

This is useful for linescan camera images where the signal drifts over time. It can also be used for correcting for photometric changes when part of the image was taken during the day and the other part was taken at night.

The boxcar size should be somewhere between 0% and 200%, where 200% will give you the same image back and 0% will remove all albedo and clean up all noise. The reason for the boxcar size being 200% is because the boxcar folds at the border, meaning at line zero it's only incorporating 50% of the lines and at the center it's incorporating all of them. The 200% boxcar makes every pixel incorporates a boxcar of all of the data, causing only negligable change in the equation.

The normalization is achieved by collecting all of the line averages for any given band. A lowpass filter is then run on these averages. Finally, the lines are normalized with their smoothed average. The CSV output option will output a CSV file (readable by most spreadsheet programs such as Excel) with the line averages before and after smoothing. Using this data, graphing the line averages will reveal and identify problem data.

Categories


History

Steven Lambright2007-07-26 Original version
Steven Lambright2007-08-06 Added options and expanded examples
Steven Lambright2007-12-10 Fixed bug where batchlists failed after a few runs
Steven Lambright2007-12-11 Fixed problem with gaps in the images causing the program to fail
Steven Lambright2008-05-13 Removed references to CubeInfo
Debbie A. Cook2011-11-18 Made the output pixel match the input pixel when the input was a special pixel

Parameters

Files

Specify the cube to be normalized.
Type cube
File Mode input

Specify the output (normalized) cube.
Type cube
File Mode output

Specify the CSV file to output the line averages to.
Type filename
File Mode output
Internal Default No Output
Filter *.csv

Settings

When overriding the default boxcar size, you can enter the new value as a percentage of the image height or as an absolute size.
Type string
Default NONE
Option List:
Option Brief Description
NONEThe boxcar size will be computed automaticallyThe boxcar size will be 10% (rounded up if even).

Exclusions

  • BOXSIZE
ABSOLUTEEnter the boxcar size in linesThe boxcar size will be exactly what you enter. No computations will be done.

Inclusions

  • BOXSIZE
PERCENTAGEEnter the boxcar size in percentagesThis is the percent of the height of the image the boxcar size will be.

Inclusions

  • BOXSIZE

This will override the default boxcar size when smoothing the line averages. The larger this size is, the less the image is affected. The smaller the boxcar, the larger the effect. If entering an absolute line size, it must be odd (any even number will automatically be rounded up).
Type integer

Output a CSV formatted file of the line averages and the smoothed averages.
Type boolean
Default false
Inclusions
  • CSV

Example 1

Normalizing a cube

This shows how to normalize a cube using this program. The input is valid data with introduced noise.

Command Line

This is the command line to run this program, with a small boxcar, on input.cub.
lineeq from=input.cub to=output.cub boxtype=absolute boxsize=1

GUI Screenshot

Running this program

Running this program on input.cub

Running this program

Parameter Name: TO

This screen shot shows how to run this program using a small boxcar on input.cub.

Input Images

Noise

Noise

Noise

Parameter Name: FROM

This shows the noise that was introduced into the input image. It's values change line by line. This was introduced to input.cub by using fx and adding to the valid data.

Original

Original Data

Original

Parameter Name: FROM

This is the original image, before anything was done to it.

Before

Input Data

Before

Parameter Name: FROM

This is the original image with the noise added in.

Output Image

After

Output Image

After

Parameter Name: TO

This shows the image after this program was run. Notice the image data is restored, but all albedo was lost.

Example 2

Identifying a problem cube

This program does not properly handle all cubes. When the line averages spike, this program smoothes them, but bad data could cause these spikes and this program will try to correct bad data incorrectly inthe areas with the spikes.

Command Line

This is the command line to run this program, with a small boxcar, on I07762023RDR_CN.norm.cub and output a CSV file.
lineeq from=I07762023RDR_CN.cub to=I07762023RDR_CN.norm.cub csv=I07762023RDR_CN.norm.csv boxtype=percentage boxsize=2 averages=yes

GUI Screenshot

Running this program

Running this program on I07762023RDR_CN.cub with CSV output

Running this program

Parameter Name: TO

This screen shot shows how to run this program on I07762023RDR_CN.cub and output the line averages as CSV.

Input Images

Overall Graph

CSV Graph

Overall Graph

Parameter Name: CSV

This shows the graph of the averages from the CSV file. Notice there is a large spike on the far left hand side of the data. This should be investigated further.

Zoomed In Graph

CSV Graph (a closer look)

Zoomed In Graph

Parameter Name: CSV

This shows the graph of the averages from the CSV file zoomed into the left side. Notice the smoothed average (pink) is significantly off from the averages (blue). This tells us that the data in this region did not normalize properly.

Input

The cube

Input

Parameter Name: FROM

This shows the first 1000 lines of the image before this program was run. Notice the bright area in this data corrosponds to the spike on the CSV graph.

Output Image

Output

Output Image

Output

Parameter Name: TO

This shows the first 1000 lines of the image after this program was run. Notice the resulting effects of this incorrect normalization. A smaller boxcar would balance this area, except for the lines with the bad data, but would also destroy any valid albedo.

Example 3

Deciding on a boxcar size

This shows how the boxcar size affects the output of this program.

Command Line

This is the command line to run this program in this example, where ?? becomes a relative boxcar size.
lineeq from=input.cub to=output.cub boxtype=percentage boxsize=??

GUI Screenshot

Running this program at 5% boxcar

Running this program on input.cub with a 5% boxcar size

Running this program at 5% boxcar

Parameter Name: BOXSIZE

This screen shot shows how to run this program using a 5% boxcar on input.cub.

Running this program at 20% boxcar

Running this program on input.cub with a 20% boxcar size

Running this program at 20% boxcar

Parameter Name: BOXSIZE

This screen shot shows how to run this program using a 20% boxcar on input.cub.

Running this program at 50% boxcar

Running this program on input.cub with a 50% boxcar size

Running this program at 50% boxcar

Parameter Name: BOXSIZE

This screen shot shows how to run this program using a 50% boxcar on input.cub.

Input Image

Noise

Input Data

Noise

Parameter Name: FROM

This is the original image. Notice it's very bright at the top and very dark at the bottom.

Output Images

Very Small Boxcar

Output Image

Very Small Boxcar

Parameter Name: TO

This shows the image after this program was run with a very small boxcar. Notice the loss of albedo.

Small Boxcar

Output Image

Small Boxcar

Parameter Name: TO

This shows the image after this program was run with a small boxcar. Notice less of the data was properly normalized and there's more albedo.

Larger Boxcar

Output Image

Larger Boxcar

Parameter Name: TO

This shows the image after this program was run with a larger boxcar. The albedo change from the last example to this one is minimal, but much more data was lost.