Manipulating a wave with cursors

I am looking for suggestions on a way to select a portion of a wave on a graph (eg the marquee or cursors) and then modify the values in that range. Somthing that might be a single command on the command line.

For example, I have a wave called ExternalTemperature that is plotted in a graph. It is a time-series of tempetarure data. I wish to shift the values between cursors A & B 5 degrees lower. I thought something like this would work:

ExternalTemperature[pcsr(A),pcsr(B)]  = ExternalTemperature[pcsr(A),pcsr(B)] - 5

Because this simpler case for the whole wave works as expected:

ExternalTemperature = ExternalTemperature  - 5

I fear this just illustrates my lack of understanding wave manipulation.

A better way or a correction to my attempt would be appreciated!

Thanks Forum Folks!

 

This will work just fine in the command line:

ExternalTemperature[pcsr(A),pcsr(B)]  -= 5

If you want to use this in a function regularly (or even send to somebody else for use), you should add a few checks, like that both cursors are set and in the right graph, and that the cursor position does not reach beyond the wave's limits.

If your goal is to have a region of interest to do some manipulation, then other approaches are possible as well: You can also read the ranges from a marquee drawn in the graph, you could edit the wave manually by dragging points around, or you read the mouse cursor for manipulating the points below (like editing landscapes in a game). This depends on what you want to achieve, though. If you want just a simple way to mass-edit a range of points then the cursor approach is not so bad, actually.

Chozo's statement is nicely concise.  I had to check the manual to find the correct syntax for the more verbose version:

ExternalTemperature[pcsr(A), pcsr(B)] = ExternalTemperature[p] - 5

On the right hand side, p will range from pcsr(A) through pcsr(B).

Yes, wave assignments can be a bit confusing but are invaluable in your daily life with Igor. :) I can only recommend MostlyHarmless to read the associated chapter in the manual (one of the most important chapters to read, I think):

DisplayHelpTopic "Waveform Arithmetic and Assignment"

 

THANK YOU chozo and jtigor!!!!

I really like Igor. The quality of the figures I can create are amazing and the speed that I can inspect data is fantastic. That said, I think it's time I ventured outside the GUI...

Cheers

MH