Identifier chk_multix Purpose check if an array of x values (xscale) contains multiple points at the same value. If so, compute mean of the corresponding y values (yarr) and sigma values (sarr) at the mean of the duplicate points in xarr and modify xarr, yarr and sarr accordingly. This is intended as a pre-binning operation to simplify interpolation and rebinning of a spectrum. Synopsis status = chk_multix(xarr, yarr, sarr , epsilon, /mean) Arguments Name I/O Type Description ----------------------------------------------------- xarr I/O Fltarr x-scale (e.g. wavelength array that is to be resampled) yarr I/O Fltarr y-scale (e.g. flux array that is to be resampled) sarr I/O Fltarr sigma array for yarr epsilon I Float acceptable minimum seperation between wavelength (micron) points in the output array. mean I -- If this option is set, arithmatic mean values are computed instead of weighted mean. This option must be used if the sigma array has any zero values. Returns Modifies xarr, yarr, sarr, and status (1 for fatal, 0 otherwise) Description - Check if xscale contains multiple points at the "same" value ("same" means value +- epsilon). If so, compute mean of these multiple x values and the mean values of the corresponding yarr and sarr points. Replace the multiple points in xarr, yarr and sarr with their mean values (weighted by (1./sigma)^2 or not depending on /mean option). Comment Example stat = chk_multix(wave, flux, stdev, .0001) Dependencies CALLS: kwd_notset, sap_error CALLED FROM: glue, sap_rebin Category ISAP Filename chk_multix.pro Author Iffat R. Khan (irk@ipac.caltech.edu) Version 0.3 History 0.1 27.07.95 definition of requirements - first draft E. Sturm 0.1 01.09.95 revision of requirements - J. Mazz (mazz@ipac.caltech.edu) 0.1 01.09.95 Version 0.1 --> irk@ipac 0.2 01-11-95 Revised parameters --> irk@ipac checking/Error messages 1.0 24-05-96 changed usage to FUNCTION from PRO --> irk@ipac to incorporate error status flag ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Copyright (C) 1995, California Institute of Technology. ; U.S. Government Sponsorship under NASA Contract NAS7-918 ; is acknowledged. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;