Easy way to mask waves?
| amellnik | January 2, 2012 - 11:41 | ||
|---|---|---|---|
|
It seems like there should be a really easy way to mask waves, but I haven't been able to figure one out so far. For example, I might have to waves of the same length and I would like to delete all the points from the first wave where the corresponding point on the second wave is zero. The way I've been doing this so far is embarrassingly hackey:
This has the obvious problem that it gets rid of any NaNs and INFs that should be in targetwave. What's the proper way to do this? Thanks -Alex |
|||

Joined: 2007-09-04
Location: United States
Alex,
How about something like this?
My quick test shows that any point in wmask with a value of zero will cause the corresponding point in w to be deleted. There is no error checking, so watch out if it behaves unexpectedly. Hope this is what you have in mind.
Joined: 2007-09-19
Location: Germany
Extract/O targetwave, targetwave, maskwave!=0should also work. Be careful, targetwave is being overwritten! To avoid this, use a new name for destwave.A
Joined: 2011-08-16
Location: Netherlands
I'm trying something similar: I would like to use a piece of code that extracts a portion of a particular wave and use that portion to fill a new wave, rather than 'edit'-ing that wave and selecting the portion by mouse and ctrl+C&V. I would like to do something like the following:
however that does not work. What would be the proper code to do this?
Joined: 2007-03-01
Location: United States
however that does not work. What would be the proper code to do this?
Joined: 2011-08-16
Location: Netherlands
Perfect, thank you!
Joined: 2009-07-09
Location: United States
Sorry for the late reply -- thanks for all the suggestions!