NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links


median*


This function computes the median of a data set


Location in HEALPix directory tree: src/f90/mod/statistics.f90


FORMAT

var=median*( data [, badval, even] )


ARGUMENTS

name & dimensionality kind in/out description
       
var SP/ DP OUT median of the data set, defined as the middle number (or the average of the 2 middle numbers) once the valid data points are sorted in monotonous order
data(:) SP/ DP IN data set
badval (OPTIONAL) SP/ DP IN sentinel value given to bad data points. Data points with this value will be ignored during calculation of the median. If not set, all points will be considered. Do not set to 0!.
even (OPTIONAL) LGT IN if set to .true. and the number of valid data points is even, will output the average of the 2 middle points (which doubles the calculation time). If the number of points is odd, the single middle point is output and this keyword is ignored.


EXAMPLE:

use statistics, only: median
...
med = median(map, even=.true.)

Outputs in med the median of map


MODULES & ROUTINES

This section lists the modules and routines used by median*.

m_indmed
module of the Orderpack 2.0 package, written by: Michel Olagnon, http://www.fortran-2000.com/rank/
indmed
routine to output rank of median


RELATED ROUTINES

This section lists the routines related to median*


compute_statistics
routine min, max, absolute deviation, and first four order moments of a data set

Eric Hivon 2010-06-18
Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650