Adds elevation on points every min_interval_length and add missing
        elevation between
483382
def _add_interval_elevations(self, gpx, min_interval_length=100):
        
        for track in gpx.tracks:
            for segment in track.segments:
                last_interval_changed = 0
                previous_point = None
                length = 0
                for no, point in enumerate(segment.points):
                    if previous_point:
                        length += point.distance_2d(previous_point)

                    if no == 0 or no == len(segment.points) - 1 or length > last_interval_changed:
                        last_interval_changed += min_interval_length
                        point.elevation = self.get_elevation(point.latitude, point.longitude)
                    else:
                        point.elevation = None
                    previous_point = point
        gpx.add_missing_elevations()
214794
private void updateBounds()
    {
        if (npoints >= MIN_POINTS)
        {
            double boundsMinX = Double.MAX_VALUE;
            double boundsMinY = Double.MAX_VALUE;
            double boundsMaxX = -Double.MAX_VALUE;
            double boundsMaxY = -Double.MAX_VALUE;

            for (int i = 0; i < npoints; i++)
            {
                final double x = xpoints[i];
                boundsMinX = Math.min(boundsMinX, x);
                boundsMaxX = Math.max(boundsMaxX, x);

                final double y = ypoints[i];
                boundsMinY = Math.min(boundsMinY, y);
                boundsMaxY = Math.max(boundsMaxY, y);
            }

            bounds.set(boundsMinX, boundsMinY, boundsMaxX - boundsMinX, boundsMaxY - boundsMinY);
        }
    }
244116
def remove_points_from_interval(self, start, end):
        
        for s, e, v in self.iterperiods(start, end):
            try:
                del self._d[s]
            except KeyError:
                pass
836073
private void setNoValueBorder( WritableRaster pitWR, int width, int height, WritableRaster hillshadeWR ) {
        for( int y = 2; y < height - 2; y++ ) {
            for( int x = 2; x < width - 2; x++ ) {
                if (pitWR.getSampleDouble(x, y, 0) == -9999.0) {
                    hillshadeWR.setSample(x, y, 0, doubleNoValue);
                }
            }
        }

        // maybe NaN instead of 0
        for( int y = 0; y < height; y++ ) {
            hillshadeWR.setSample(0, y, 0, 0);
            hillshadeWR.setSample(1, y, 0, 0);
            hillshadeWR.setSample(width - 2, y, 0, 0);
            hillshadeWR.setSample(width - 1, y, 0, 0);
        }

        for( int x = 2; x < width - 2; x++ ) {
            hillshadeWR.setSample(x, 0, 0, 0);
            hillshadeWR.setSample(x, 1, 0, 0);
            hillshadeWR.setSample(x, height - 2, 0, 0);
            hillshadeWR.setSample(x, height - 1, 0, 0);
        }
    }
552596
def addPoint( self, x, y ):
        
        self._points.append((x, y))
        self._dirty = True
1286029
public void addPoint( float x , float y , float z ) {
		norm.grow().set(x/z, y/z);
	}
398467
public static void addUniform(InterleavedS32 input, Random rand , int min , int max) {
		int range = max-min;

		int[] data = input.data;
		int length = input.width*input.numBands;

		for (int y = 0; y < input.height; y++) {
			int index = input.getStartIndex() + y * input.getStride();

				int indexEnd = index+length;
				while( index < indexEnd ) {
				int value = (data[index] ) + rand.nextInt(range)+min;
				data[index++] =  value;
			}
		}
	}
178483
def add(self, interval: Interval) -> None:
        
        if interval is None:
            return
        if not isinstance(interval, Interval):
            raise TypeError(
                "Attempt to insert non-Interval into IntervalList")
        self.intervals.append(interval)
        self._tidy()
451568
private void addMissingZeros()
    {
        //go back and add 0s for the onces we missed
        for (int i = 0; i < points.size(); i++)
            while(points.get(i).alpha.size() < this.points.get(0).vecs.size())
                points.get(i).alpha.add(0.0);
    }
254120
protected void addToOverlaps(Intervalable interval, List<Intervalable> overlaps, List<Intervalable> newOverlaps)
    {
        for (Intervalable currentInterval : newOverlaps)
        {
            if (!currentInterval.equals(interval))
            {
                overlaps.add(currentInterval);
            }
        }
    }
504725
private List<Float> interpolateBetween(float min, float max, int steps) {

        float delta = (max - min) / (steps + 1);
        List<Float> result = new ArrayList<Float>();
        float num = min;

        for (int i = 0; i < steps; i++) {
            num += delta;
            result.add(new Float(num));
        }
        return result;
    }
1332111
def _process_interval(self, mod, interval):
        '''
        
        '''
        log.trace('Processing interval %s for beacon mod %s', interval, mod)
        loop_interval = self.opts['loop_interval']
        if mod in self.interval_map:
            log.trace('Processing interval in map')
            counter = self.interval_map[mod]
            log.trace('Interval counter: %s', counter)
            if counter * loop_interval >= interval:
                self.interval_map[mod] = 1
                return True
            else:
                self.interval_map[mod] += 1
        else:
            log.trace('Interval process inserting mod: %s', mod)
            self.interval_map[mod] = 1
        return False
1109433
def draw_simple_elevation(world, sea_level, target):
    
    e = world.layers['elevation'].data
    c = numpy.empty(e.shape, dtype=numpy.float)

    has_ocean = not (sea_level is None or world.layers['ocean'].data is None or not world.layers['ocean'].data.any())  # or 'not any ocean'
    mask_land = numpy.ma.array(e, mask=world.layers['ocean'].data if has_ocean else False)  # only land

    min_elev_land = mask_land.min()
    max_elev_land = mask_land.max()
    elev_delta_land = (max_elev_land - min_elev_land) / 11.0

    if has_ocean:
        land = numpy.logical_not(world.layers['ocean'].data)
        mask_ocean = numpy.ma.array(e, mask=land)  # only ocean
        min_elev_sea = mask_ocean.min()
        max_elev_sea = mask_ocean.max()
        elev_delta_sea = max_elev_sea - min_elev_sea

        c[world.layers['ocean'].data] = ((e[world.layers['ocean'].data] - min_elev_sea) / elev_delta_sea)
        c[land] = ((e[land] - min_elev_land) / elev_delta_land) + 1
    else:
        c = ((e - min_elev_land) / elev_delta_land) + 1

    for y in range(world.height):
        for x in range(world.width):
            r, g, b = elevation_color(c[y, x], sea_level)
            target.set_pixel(x, y, (int(r * 255), int(g * 255),
                                    int(b * 255), 255))
37470
def addPointScalars(self, scalars, name):
        
        poly = self.polydata(False)
        if len(scalars) != poly.GetNumberOfPoints():
            colors.printc('~times pointScalars Error: Number of scalars != nr. of points',
                          len(scalars), poly.GetNumberOfPoints(), c=1)
            exit()
        arr = numpy_to_vtk(np.ascontiguousarray(scalars), deep=True)
        arr.SetName(name)
        poly.GetPointData().AddArray(arr)
        poly.GetPointData().SetActiveScalars(name)
        self.mapper.SetScalarRange(np.min(scalars), np.max(scalars))
        self.mapper.ScalarVisibilityOn()
        return self
777010
def findOverlap(x_mins, y_mins, min_distance):
    
    n = len(x_mins)
    idex = []
    for i in range(n):
        if i == 0:
            pass
        else:
            for j in range(0, i):
                if (abs(x_mins[i] - x_mins[j]) < min_distance and abs(y_mins[i] - y_mins[j]) < min_distance):
                    idex.append(i)
                    break
    x_mins = np.delete(x_mins, idex, axis=0)
    y_mins = np.delete(y_mins, idex, axis=0)
    return x_mins, y_mins
634385
def __view_to_intervals(self, data_and_metadata: DataAndMetadata.DataAndMetadata, intervals: typing.List[typing.Tuple[float, float]]) -> None:
        """"""
        left = None
        right = None
        for interval in intervals:
            left = min(left, interval[0]) if left is not None else interval[0]
            right = max(right, interval[1]) if right is not None else interval[1]
        left = left if left is not None else 0.0
        right = right if right is not None else 1.0
        left_channel = int(max(0.0, left) * data_and_metadata.data_shape[-1])
        right_channel = int(min(1.0, right) * data_and_metadata.data_shape[-1])
        data_min = numpy.amin(data_and_metadata.data[..., left_channel:right_channel])
        data_max = numpy.amax(data_and_metadata.data[..., left_channel:right_channel])
        if data_min > 0 and data_max > 0:
            y_min = 0.0
            y_max = data_max * 1.2
        elif data_min < 0 and data_max < 0:
            y_min = data_min * 1.2
            y_max = 0.0
        else:
            y_min = data_min * 1.2
            y_max = data_max * 1.2
        extra = (right - left) * 0.5
        display_left_channel = int(max(0.0, left - extra) * data_and_metadata.data_shape[-1])
        display_right_channel = int(min(1.0, right + extra) * data_and_metadata.data_shape[-1])
        # command = self.delegate.create_change_display_command()
        self.delegate.update_display_properties({"left_channel": display_left_channel, "right_channel": display_right_channel, "y_min": y_min, "y_max": y_max})
1362463
function () {
			var series = this,
				yAxis = series.yAxis,
				plotHigh;

			colProto.translate.apply(series);

			// Set plotLow and plotHigh
			each(series.points, function (point) {
				var shapeArgs = point.shapeArgs,
					minPointLength = series.options.minPointLength,
					heightDifference,
					height,
					y;

				point.tooltipPos = null; // don't inherit from column
				point.plotHigh = plotHigh = yAxis.translate(point.high, 0, 1, 0, 1);
				point.plotLow = point.plotY;

				// adjust shape
				y = plotHigh;
				height = point.plotY - plotHigh;

				if (height < minPointLength) {
					heightDifference = (minPointLength - height);
					height += heightDifference;
					y -= heightDifference / 2;
				}
				shapeArgs.height = height;
				shapeArgs.y = y;
			});
		}