Adding intentionally NaN values to a Wave
Dolbash
I know this is a weird question but I am trying to format data in a very specific way. For the particular analysis, I need data grouped together in one wave, separated by a blank space. In a numerical wave, when adding a blank space, via insertpoints, it just fills the value with "0" by default. I intend to save it as .txt from igor and want those divisions of data to just show up as blank lines.
ex.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
.
.
.
thank you!
in Igor 8 you can use the /V flag to specify the value for inserted points:
InsertPoints /V=NaN beforeElement, numElements, waveName
August 29, 2019 at 09:12 am - Permalink
O, I supposed I should include that I am using v 6.3.7 (Last v6)
August 29, 2019 at 09:54 am - Permalink
In reply to O, I supposed I should… by Dolbash
Then you must set the value of your added point to NaN after insertion.
wave0[N]=NaN
To add a NaN to the end of a wave
wave0[numpnts(wave0)]={NaN}
August 29, 2019 at 10:26 am - Permalink
Wow, So it is that easy. I could have sworn that I tried that first. O well, Thank you!
August 29, 2019 at 03:41 pm - Permalink
@tony: Now that's a bummer I did not know what you can append to waves like that. For the curious ones this is explained in
DisplayHelpTopic "Indexing with an index wave"
but also requires you to realize that the indexing wave can also just be one index. And
wave0[inf] = {NaN}
works here as well even with rtGlobals=3.
August 29, 2019 at 04:33 pm - Permalink
@thomas_braun: This is an example of why AG can't change the behavior of WaveStats/RMD={inf, nan} :)
(For those wondering, this is a cryptic reference to a recent tech support incident)
August 30, 2019 at 09:24 am - Permalink
@johnweeks: I'm coding it like that because this is currently the way you do igor programming.
But I would like to see a move like from C++98 to C++11 in Igor as well. Or to rephrase that, once you offer rtGlobals=4 or an equivalent I'll use that and adapt my code.
August 31, 2019 at 01:17 pm - Permalink