SpHr_Normalize [ /R=[r] /C=[c] /DR=[d] ] srcWaveName


Normalize values in srcWaveName


Parameters

srcWaveName  Specification for source and destination wave. This wave is always overwritten with normalized values. One and only one of the following flags must be used.


Flags

/R [ = r ]

    Values are scaled within individual rows of srcWaveName 

    /R=0: Same as no /R flag. (Default).

    /R=1: Same as /R flag alone. Values are normalized to a maximum of 1.

       srcWaveName /= maximum value in each srcWaveName row

    /R=2: Values are normalized so that minima in each row = 0 and maxima in each row = 1.


/C [ = c ]

    Values are scaled so that all values within individual columns of srcWaveName

    /C=0: Same as no /C flag. (Default).

    /C=1: Same as /C flag alone. Values are normalized to a maximum of 1.

       srcWaveName /= maximum value in each srcWaveName column

    /C=2: Values are normalized so that minima in each column = 0 and maxima in each column = 1.


/DR = { min, max }    

    All values in srcWaveName are scaled so that values between min and max range from 0 to 1. Values below min may thus become negative and values above max may exceed 1.


Example

Function SpHr_Normalize_Example()

    Make/O Values = {{2,3,4,5,6},{3,4,5,6,7},{4,5,6,7,8},{5,6,7,8,9}}

    // normalize all values re: min & max values

    Duplicate/O Values, NormMinToMax

    variable minVal = 3    // 3 = 0

    variable maxVal = 7    // 7 = 1

    SpHr_Normalize/DR={minVal,maxVal} NormMinToMax

    // normalize within Columns

    Duplicate/O Values, Columns_reMax

    SpHr_Normalize/C=1 Columns_reMax    // maxima = 1

    Duplicate/O Values, Columns_0to1

    SpHr_Normalize/C=2 Columns_0to1    // minima=0, maxima=1

    // normalize within Rows

    Duplicate/O Values, Rows_reMax

    SpHr_Normalize/R=1 Rows_reMax    // maxima = 1

    Duplicate/O Values, Rows_0to1

    SpHr_Normalize/R=2 Rows_0to1    // minima=0, maxima=1

    // Display Values

    Display/K=1/W=(20,60,20+214,60+187) as "Values"

    AppendImage Values

    ModifyImage Values ctab= {0,10,SeaLandAndFire,0}

    ColorScale/C/N=text0/F=0/B=1/H={15,0,5}/A=RC/X=0.00/Y=0.00/E width=6,height=80,frame=0.00,image=Values

    // Display values re: min & max values

    Display/K=1/W=(20,280,20+214,280+187) as "min=3, max=7"

    AppendImage NormMinToMax

    ModifyImage NormMinToMax ctab= {0,1,SeaLandAndFire,0}

    ColorScale/C/N=text0/F=0/B=1/H={15,0,5}/A=RC/X=0.00/Y=0.00/E width=6,height=80,frame=0.00,image=NormMinToMax

    // Display normalized within Columns

    Display/K=1/W=(240,60,240+214,60+187) as "Columns re:Max"

    AppendImage Columns_reMax

    ModifyImage Columns_reMax ctab= {0,1,SeaLandAndFire,0}

    ColorScale/C/N=text0/F=0/B=1/H={15,0,5}/A=RC/X=0.00/Y=0.00/E width=6,height=80,frame=0.00,image=Columns_reMax

    Display/K=1/W=(240,280,240+214,280+187) as "Columns min=0, max=1"

    AppendImage Columns_0to1

    ModifyImage Columns_0to1 ctab= {0,1,SeaLandAndFire,0}

    ColorScale/C/N=text0/F=0/B=1/H={15,0,5}/A=RC/X=0.00/Y=0.00/E width=6,height=80,frame=0.00,image=Columns_0to1

    // Display normalized within rows

    Display/K=1/W=(460,60,460+214,60+187) as "Rows re:Max"

    AppendImage Rows_reMax

    ModifyImage Rows_reMax ctab= {0,1,SeaLandAndFire,0}

    ColorScale/C/N=text0/F=0/B=1/H={15,0,5}/A=RC/X=0.00/Y=0.00/E width=6,height=80,frame=0.00,image=Rows_reMax

    Display/K=1/W=(460,280,460+214,280+187) as "Rows min=0, max=1"

    AppendImage Rows_0to1

    ModifyImage Rows_0to1 ctab= {0,1,SeaLandAndFire,0}

    ColorScale/C/N=text0/F=0/B=1/H={15,0,5}/A=RC/X=0.00/Y=0.00/E width=6,height=80,frame=0.00,image=Rows_0to1

End

Contact: Brian