Blockmean for time-series data


I am having data for every second for a year. Following is a file:

2019-01-01T01:01:01 14.600 0.000
2019-01-01T01:01:02 15.100 32.976
2019-01-01T01:01:03 15.700 45.372
2019-01-01T01:01:04 16.300 27.795
2019-01-01T01:01:05 16.800 25.586
2019-01-01T01:01:06 17.500 35.843
2019-01-01T01:01:07 18.100 55.230
2019-01-01T01:01:08 18.800 20.551
2019-01-01T01:01:09 19.500 28.891

I am trying to average out the data on a daily base using blockmean over these datasets. I am unable to get the expected output.

psbasemap $R -JX$j -Bpxa1Of1o --MAP_LABEL_OFFSET=20p -Bpya100f25+l"Diameter" -BWSne -K -X3 -Y12 > $out
makecpt -Cjet -T0/200000/1000 > map.cpt
cat $infile | blockmean $R -I10/10 -f0T -C -Sm >`

I got the following output using the above lines. It provides only maximum values of the second column in the second column of the output file instead of bins.

2019-01-01T01:00:00	982.2	16.52
2019-01-01T01:05:00	982.2	32.56
2019-01-01T01:10:00	982.2	235.25
2019-01-01T01:15:00	982.2	156.37
2019-01-01T01:20:00	982.2	29.87

Addition to the above issue, when I try to use the above code for my whole file, which is ~2GB in size. blockmean kills a task and provides me with the following error.

blockmean (GMT_blockmean): Error: Could not reallocate memory [91.83 Gb, 6162811815 items of 16 bytes]

Thank you in advance.

blockm* is meant for spatial (2-D) averaging while you have a 1-D time series. Yes, it can be used the way you describe but for very large files it is inefficient as it holds everything in memory. You would also have to specify -I so that there is only one “bin” per day.

I think what you want to do is user filter1d with a boxcar filter of width 1 day, probably -Fb86400 and then select output every day with -T.

Thank you Paul, but I have 2D datasets.
I tried filter1d but it is not working as I want to get mean of column 3 both for the bins of column 1 and column 2.
Also, I used -I in my above lines of code for blockmean as follow:

gmt blockmean $R -I86400/1 -f0T -do0 -C -Sm >

This provides me the values with 1day interval as well as the 1 bin size for the second column, but as my second column varies from 1 to 984 and I only got output bins from 11 to 461. Can you point out my mistake in above line?

OK, I see. Well, that blockmean command looks pretty good to me. Makes no sense to me that there are no output for the higher values. Please run gmt info on both your input file and the resulting blockmean’ed files. Do they show a loss of y-range?