45 |
|
{ARG_INT, "PERM", "1", "set to 0 for transient records, nonzero for permanent records"}, |
46 |
|
{ARG_INT, "VERB", "1", "option for level of verbosity: 0=only error and warning messages; >0=print messages outside of loop; >1=print messages inside loop; >2=debugging output", NULL}, |
47 |
|
{ARG_STRING, "TAG", kNOTSPECIFIED, "this parameter sets a keyword of the same name to the same value, usually used as an additional primekey"}, |
48 |
+ |
{ARG_STRING, "VERSION", kNOTSPECIFIED, "this parameter sets a keyword of the same name to the same value, useful for selecting obsolete records"}, |
49 |
|
|
50 |
|
{ARG_STRING, "LOGFILE", "stdout", ""}, |
51 |
|
{ARG_STRING, "GAPFILE", "", "record or file containing window function"}, |
228 |
|
|
229 |
|
char *tag = (char *)cmdparams_save_str(&cmdparams, "TAG", &newstat); |
230 |
|
int tagflag = strcmp(kNOTSPECIFIED, tag); |
231 |
+ |
char *version = (char *)cmdparams_save_str(&cmdparams, "VERSION", &newstat); |
232 |
+ |
int verflag = strcmp(kNOTSPECIFIED, version); |
233 |
|
|
234 |
|
char *tsseries = (char *)cmdparams_save_str(&cmdparams, "tsout", &newstat); |
235 |
|
tsout = strcmp(kNOTSPECIFIED, tsseries); |
598 |
|
|
599 |
|
/* Set sum to zero before starting */ |
600 |
|
if (mavgout) |
601 |
< |
msum = (float *)calloc(n_sampled_out/2,sizeof(float)); |
601 |
> |
msum = (float *)malloc((n_sampled_out/2)*sizeof(float)); |
602 |
|
|
603 |
|
if (fft1out || powout || mavgout || arpowout) |
604 |
|
{ |
789 |
|
|
790 |
|
} |
791 |
|
|
792 |
+ |
if (mavgout) |
793 |
+ |
for (i=0;i<n_sampled_out/2;i++) |
794 |
+ |
msum[i] = 0.0; |
795 |
+ |
|
796 |
|
/***** Main Loop over m: Detrend, gapfill and/or compute FFT/power spectrum *******/ |
797 |
|
for (m=0; m<=lmode; m++) |
798 |
|
{ |
1090 |
|
drms_setkey_int(outrec, "NDT", n_sampled_out); |
1091 |
|
if (tagflag) |
1092 |
|
drms_setkey_string(outrec, "TAG", tag); |
1093 |
< |
|
1093 |
> |
if (verflag) |
1094 |
> |
drms_setkey_string(outrec, "VERSION", version); |
1095 |
> |
|
1096 |
|
tnow = (double)time(NULL); |
1097 |
|
tnow += UNIX_epoch; |
1098 |
|
drms_setkey_time(outrec, "DATE", tnow); |