MIME-Version: 1.0 Date: Mon, 6 Feb 1995 16:25:17 -0700 To: igor@pica.army.mil From: "Michael Blanpied, USGS" Subject: Decimation procedure attached Fellow datacrunchers, Several people have emailed in response to my offer to post a routine for doing "intelligent" decimation on parametric data, so I am enclosing it as attachment to this message. (My apologies to the many of you who have no need for it or who have written superior versions yourselves.) The routine is useful for eliminating needless redundancy in your data while retaining all the interesting parts. The file contains a macro called PassDataThroughBox() and a function called QuikChop(). Further comments in the header. Contrary to my earlier statement, the function lacks the ability to average over the "skipped" points, though this feature could be easily added. To see how it works, open a new experiment, load and compile the procedure file, then issue the following set of commands: |Create a noisy sine wave: make/n=100 wave0=p make/n=100 wave1=sin(p/15)+gnoise(0.1) |Write points when X changes by 5 or Y changes by 0.25: PassDataThroughBox("wave0","wave1","wave0_b","wave1_b",5,0.25,2,1) |Display results: display wave1 vs wave0; append wave1_b vs wave0_b ModifyGraph mode=4,marker(wave1)=7,opaque(wave1)=1,rgb(wave1)=(3,52428,1);DelayUpdate ModifyGraph marker(wave1_b)=18,rgb(wave1_b)=(52428,1,1) |Then issue the following one-by-one and watch the graph change: |Write points when X changes by 5 or Y changes by 0.1: PassDataThroughBox("wave0","wave1","wave0_b","wave1_b",5,0.1,2,1) |Write points when Y changes by 0.35 (ignore X): PassDataThroughBox("wave0","wave1","wave0_b","wave1_b",1e9,0.35,2,1) |Write points when X changes by 5 (ignore Y): PassDataThroughBox("wave0","wave1","wave0_b","wave1_b",5,1e9,2,1) |Keep all points (Ybox = 0): PassDataThroughBox("wave0","wave1","wave0_b","wave1_b",5,0,2,1) I welcome feedback, suggestions for improvements, or improved versions. Cheers, Mike Blanpied Attachment converted: Apps:PassDataThroughBox Proc. (TEXT/IGR0) (00004E04) ------------------------------------------------------------------ Michael L. Blanpied _/ _/ _/_/_/ _/_/_/ _/_/_/ U. S. Geological Survey _/ _/ _/ _/ _/ 345 Middlefield Rd., MS-977 _/ _/ _/_/_/ _/ _/_/_/ _/_/_/ Menlo Park, CA 94025 _/ _/ _/ _/ _/ _/ 415-329-4969, fax -5163 _/_/_/ _/_/_/_/ _/_/_/_/ _/_/_/_/ [Views expressed here are mine, maybe not those of the Federal Govt.] -------------------------------------------------------------------