Map

Map(min, max, scale)

Converts value between 0 and 1 on various scales.

Base class for Map objects.

Parameters:

    min : int or float
        Lowest value of the range.
    max : int or float
        Highest value of the range.
    scale : string {'lin', 'log'}
        Method used to scale the input value on the specified range.

Methods:

    get(x) : Returns scaled value for `x` between 0 and 1.
    set(x) : Returns the normalized value (0 -> 1) for `x` in the real range. 
    setMin(x) : Replaces the 'min' attribute. 
    setMax(x) : Replaces the 'max' attribute. 
    setScale(x) : Replaces the 'scale' attribute.

Attributes:

    min : Lowest value of the range.
    max : Highest value of the range.
    scale : Method used to scale the input value.

Examples:

    >>> m = Map(20., 20000., 'log')
    >>> print m.get(.5)
    632.455532034
    >>> print m.set(12000)
    0.926050416795

Methods details:

    Map.get(x):

        Takes `x` between 0 and 1 and returns scaled value.

    Map.set(x):

        Takes `x` in the real range and returns value unscaled 
        (between 0 and 1).

    Map.setMin(x):

        Replace the `min` attribute.
        
        Parameters:

        x : float
            New `min` attribute.

    Map.setMax(x):

        Replace the `max` attribute.
        
        Parameters:

        x : float
            New `max` attribute.

    Map.setScale(x):

        Replace the `scale` attribute.
        
        Parameters:

        x : string
            New `scale` attribute.



Subsections