Skip to content

Possible rcolgem off-by-one error #35

@rmcclosk

Description

@rmcclosk

This function at line 1239 gets the index of the sub-interval that h + hoffset lies in, when the interval [maxtime, mintime] is chopped up into FGY_RESOLUTION pieces.

fgyParms$get.index <- function(h) min(1 + fgyParms$FGY_RESOLUTION * (h + hoffset) / ( maxtime - mintime ), fgyParms$FGY_RESOLUTION )

But below (line 1311), we define the time axis as a sequence of length FGY_RESOLUTION to be (I think) the interval boundaries.

haxis <- seq(0, maxHeight, length.out=fgyParms$FGY_RESOLUTION)

This means that we have FGY_RESOLUTION interval boundaries, which means FGY_RESOLUTION - 1 intervals. This does not agree with the get.index function, which assumes there are FGY_RESOLUTION intervals.

The error introduced here is obviously negligible, so keeping the original behaviour for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions