# Copyright (c) 2002 Peter Guntert. All rights reserved. ## 7MACROS: reduceppm - reduce to a region defined by chemical shift values in ppm ## ## Usage: reduceppm {} ## ## reduceppm is a standard macro that reduces the data to a submatrix from ## the complete data matrix. reduceppm differs from the reduce command only ## in that the ranges are defined by chemical shift values (in ppm) rather ## than by data points. ## ## reduceppm can only be used for calibrated spectra, that is the system ## variables delta, ppmmax, and w0 must be defined. ## ## See also: delta, ppmmax, reduce, w0 var i j r d params params := do j 1 nparam r := $p$j; d = perm(j) if ('$r'.ne.'*') then i = index('$r','..') if (i.eq.0) then params := $params $pt(r,d) else if (i.eq.1) then params := $params $pt($r(3:),d).. else if (i.eq.len('$r')-1) then params := $params ..$pt($r(:i-1),d) else params := $params $pt($r(i+2:),d)..$pt($r(:i-1),d) end if else params := $params * end if end do reduce $params