How get the creation time from multiple waves
alcarar
I'm trying to obtain the creation time from multiple waves
Do you know a procedure for that?
Thank you again
I'm trying to obtain the creation time from multiple waves
Do you know a procedure for that?
Thank you again
Hi,
CreationDate(waveName )
The CreationDate function returns creation date of wave as an Igor date/time value, which is the number of seconds from 1/1/1904.
The returned value is valid for waves created with Igor Pro 3.0 or later. For waves created in earlier versions, it returns 0.
Andy
July 15, 2022 at 07:17 am - Permalink
Thank you
How i can to implement this for multiple waves
Thanks!
July 15, 2022 at 07:33 am - Permalink
You must iterate over the set of wave names. This will require using a for-endfor loop or a do-while loop. Search for help on the functions WaveList and StringFromList as possible starting points to build and extract values from a wave list. An example in the help for StringFromList shows how to extract values one at a time in a for-endfor loop.
July 15, 2022 at 08:39 am - Permalink
You can also use wave reference waves to pass around lists of waves. A wave reference wave is a wave whose elements contain references to other waves. Here is an example:
WAVE/WAVE waves
int numWaves = numpnts(waves)
Make/FREE/D/N=(numWaves) modDates
int i
for(i=0; i<numWaves; i+=1)
WAVE w = waves[i]
double modDT = ModDate(w)
modDates[i] = modDT
endfor
return modDates
End
Function Demo()
Make/O jack, bob, sam
Make/FREE/WAVE/N=3 waves
waves[0] = jack
waves[1] = bob
waves[2] = sam
WAVE modDates = GetModDates(waves)
int numWaves = numpnts(waves)
int i
for(i=0; i<numWaves; i+=1)
WAVE w = waves[i]
String name = NameOfWave(w)
double modDT = modDates[i]
String dateTimeStr = Secs2Date(modDT,-2) + " " + Secs2Time(modDT,3)
Printf "Wave %s, modDate=%s\r", name, dateTimeStr
endfor
End
July 15, 2022 at 11:59 am - Permalink
thank you!
great
July 15, 2022 at 03:03 pm - Permalink