Identifier sm_median Purpose Smooth SPD or AAR using a median filter Synopsis out = sm_median(in, width [,band] [,det] [,/sample] [,/velo] [,/sep][,stat=stat) Arguments Name I/O Type: Description: --------------------------------------------------------------------- in I AAR/SPD spectrum to be smoothed width I float width of median filter used for smoothing, default is in wavelength [um]. band I int scalar/ Option to select one band (scalar) or several array (array). Example: band=2, band=[1,4]. If absent all bands are selected (default). Illegal option for LAAR. det I int scalar/ Option to select one detector (scalar) or array several (array). Example: det=6, det=[3,21,30]. If absent all detectors are selected (default). /sample I switch if set, the width is interpreted in terms of samples /velo I switch if set, the width is interpreted in terms of velocity [km/s] /sep I switch if set smoothing is done separately for each detector stat I/O int error status, 0 if ok, 1 if fatal Returns Smoothed AAR/SPD Description Smooth fluxes in a SPD or AAR by convolution with a median filter. At edges, signal and error are set to zero (within 0.5*width of edges). When width is longer than the signal, this latter and the error are set to 0. The width of the median filter can be specified in wavelength (default), velocity units or sample domain. In the first 2 cases data may is unequally sampled. (default), velocity units or sample domain. In the first 2 cases data may is unequally sampled. For AAR, smooth over all detectors combined together (default) or separately on each detector when keyword /sep is set. The errors are propagated from the original data. Comment Does not treat sdir and scnt. Does not handle SPDs. It is too difficult to have this deal with SWS SPD offsets? How to apply to SPDs???? even after RESUM??? The program would have to know which SPD fluxes are the good ones (i.e. those with reset). Example -- Category ISAP Dependencies CALLS: chk_tag, is_struct, sap_error, sap_keyword_set, update_history CALLED FROM: IA, GUI Filename sm_median.pro Author Laurent Verstraete (IAS) (--> LV) Version 1.4 History Draft reqs DL/ES/CW 27.7.95 revision of requirements E. Sturm 8.8.95 1.0 - 04.03.96 LV creation 1.2 - 15.03.96 LV modified to handle combined or separate sets of band/det. Treat all AARs. Make wavelengths ascendent. 1.3 12.07.96 ES stat added 1.4 22.07.96 ES replaced erroneous "in1" with "aar" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;