SpHr_Extrema [ flags ] srcWaveName


Calculates minimum and maximum values in srcWaveName.


Parameters

srcWaveName  Specification for single or double precision source matrix.


srcWaveName(startX, endX)  startX and endX specify an x range in the source wave.


srcWaveName[startP, endP]  startP and endP specify a point-range in the source wave.


Flags

/Min = [ min ]

    Numeric variable V_Min is set to the minimum valued in srcWaveName, analogous to V_Min = WaveMin(srcWaveName). If the /I flag is also present, the wave index corresponding to V_Min is set as V_MinInd.

    min= 1, same as /Min flag alone.

    min = 0, same as no flag.


/Max = [ max ]

    Numeric variable V_Max is set to the maximum valued in srcWaveName, analogous to V_Max = WaveMax(srcWaveName). If the /I flag is also present, the wave index corresponding to V_Max is set as V_MaxInd.


/MinM = [ minM ]

    Numeric variable V_MinMag is set to the minimum magnitude in srcWaveName, analogous to V_MinMag = WaveMin(ABS(srcWaveName)). If the /I flag is also present, the wave index corresponding to V_MinMag is set as V_MinMagInd.


/MaxM = [ maxM ]

    Numeric variable V_MaxMag is set to the maximum magnitude of srcWaveName analogous to V_MaxMag = WaveMax(ABS(srcWaveName)). If the /I flag is also present, the wave index corresponding to V_MaxMag is set as V_MaxMagInd.


/I = [ i ]

    Wave indices corresponding to numeric variables are written to:

    V_MinInd with the /Min flag.

    V_MaxInd with the /Max flag.

    V_MinMagInd with the /MaxM flag.

    V_MaxMagInd with the /MaxM flag.

    i = 1, same as /I flag alone.

    i = 0, same as no flag.


/PMin = { priorMin [, priorMinIndex ] }

    When used together with the /Min flag, V_Min is set the lesser of V_Min and priorMin. If the /I flag is present, V_MinInd is set to the index corresponding to V_Min or priorMinIndex if priorMin is less than V_Min. When used together with the /MinMag flag, V_MinMag is set the lesser of V_MinMag and priorMin. If the /I flag is present, V_MinMagInd is set to the index corresponding to V_MinMag or priorMinIndex if priorMin is less than V_MinMag.


/PMax = { priorMax [, priorMaxIndex ] }

    When used together with the /Max flag, V_Max is set the greater of V_Max and priorMax. If the /I flag is present, V_MaxInd is set to the index corresponding to V_Max or priorMaxIndex if priorMax is greater than V_Max. When used together with the /MaxMag flag, V_MaxMag is set the greater of V_MaxMag and priorMax. If the /I flag is present, V_MaxMagInd is set to the index corresponding to V_MaxMag or priorMaxIndex if priorMax is greater than V_MaxMag.


/Col = [ col ]

    Specifies the column for which numeric variables are calculated along rows.


/Layr = [ layer ]

    Specifies the layer in which col is specified and numeric variables are calculated along rows.


/Chnk = [ chunk

    Specifies the chunk in which col and layer are specified and for which numeric variables are calculated along rows.


/iNaN = [ inan ]

    When this flag is present, the operation uses an algorithm that explicitly excludes NaNs, although the much faster default algorithm nearly always also excludes NaNs. This flag is provided in case the default algorithms fail (probably due to NaNs near the ends of short waves).

    inan = 1, same as /iNaN flag alone

    inan = 0, same as /iNaN no flag


Example    

Function SpHr_Extrema_Example()

    Make/O/N=(100) noise

    noise = gnoise(1)

    SpHr_Extrema /MaxM /I noise

    Printf "maximum magnitude= %g\r", V_MaxMag

    Printf "index at maximum magnitude= %g\r", V_MaxMagInd

End

Contact: Brian