Syntax: ramp(pic1 = VAL, pic2 = VAL [, stop = INT] [, ignore = VAL])
'pic1' - may be any 2-d array - float, int, short, etc.
'pic2' - may be any 2-d array - float, int, short, etc.
'stop' - maximum number of pixels away from edge to search. Default is 100000.
'ignore' - the non-data pixel values. Default is 0.
ramp() creates a map of the overlapping section of both images. Pixels that have image data in one picture but are ignore values in the other are left out of the ramp calculation. Each pixel of the map is filled in with it's integer distance (in pixels) away from the edge of the image. Pixels on the edge of the image (next to an ignore value) are given a value of 1. The next farthest away are given a value of 2, etc. When the distance maps are completed, the ramp is the ratio of pic2:(sum of both distance maps).
When specified, the 'stop' value will halt the stop the counting of the distance map. For example, a 'stop =' 5' command will count up to 5 pixels away from the edge of the data and then fill in the rest of the overlapping pixels in the distance map with the distance value of 5. This makes for a very steep, narrow ramp. Generally, in most THEMIS images, a 'stop' value of 100 is sufficient for a smooth looking ramp and is indistinguishable from allowing the distance count to continue until finished. Designating a smaller distance count also speeds up ramp calculation linearly.
In the case of total overlap of the images in the array (i.e. there are no ignore values), the ramp will be calculated to give a 0 - 50% blend of pic2. This allows the user to put a new image on top of a region that has already been filled with data.
- Multiply ramp*pic2 and (1-ramp)*pic1 to achieve the proper blending of the images.
- The ramp is only found for OVERLAPPING regions.
- Non-overlapping regions from pic1 and pic2 need to be added to make a full blend. The source code of blend demonstrates how this is done.
- You can speed up ramp calculation by setting 'stop'. 100 works well.