ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/proj/globalhs/apps/jtsfiddle.c
(Generate patch)

Comparing proj/globalhs/apps/jtsfiddle.c (file contents):
Revision 1.14 by tplarson, Sun Apr 28 08:05:21 2013 UTC vs.
Revision 1.15 by tplarson, Tue Jul 2 20:33:16 2013 UTC

# Line 45 | Line 45 | ModuleArgs_t module_args[] =
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"},
# Line 227 | Line 228 | int DoIt(void)
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);
# Line 595 | Line 598 | int DoIt(void)
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    {
# Line 786 | Line 789 | int DoIt(void)
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      {
# Line 1083 | Line 1090 | int DoIt(void)
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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines