version 1.2, 2012/08/21 22:14:34
|
version 1.3, 2012/09/18 16:03:27
|
Line 75 int jretile_manytofew(void) |
|
Line 75 int jretile_manytofew(void) |
|
sprint_time(tstartstr, tstart, "TAI", 0); | sprint_time(tstartstr, tstart, "TAI", 0); |
ttotal=(char *)cmdparams_save_str(&cmdparams, "TTOTAL", &newstat); | ttotal=(char *)cmdparams_save_str(&cmdparams, "TTOTAL", &newstat); |
status=drms_names_parseduration(&ttotal, &nseconds, 1); | status=drms_names_parseduration(&ttotal, &nseconds, 1); |
if (status) |
if (status != DRMS_SUCCESS) |
{ | { |
// newstat = newstat | CPSAVE_UNKNOWN_ERROR; | // newstat = newstat | CPSAVE_UNKNOWN_ERROR; |
fprintf(stderr, "ERROR: problem parsing TTOTAL, = %s\n", ttotal); | fprintf(stderr, "ERROR: problem parsing TTOTAL, = %s\n", ttotal); |
Line 85 int jretile_manytofew(void) |
|
Line 85 int jretile_manytofew(void) |
|
if (strcmp(kNOTSPECIFIED, tchunk)) | if (strcmp(kNOTSPECIFIED, tchunk)) |
{ | { |
status=drms_names_parseduration(&tchunk, &chunksecs, 1); | status=drms_names_parseduration(&tchunk, &chunksecs, 1); |
if (status) |
if (status != DRMS_SUCCESS) |
newstat = newstat | CPSAVE_UNKNOWN_ERROR; | newstat = newstat | CPSAVE_UNKNOWN_ERROR; |
} | } |
else | else |
Line 315 int jretile_manytofew(void) |
|
Line 315 int jretile_manytofew(void) |
|
} | } |
} | } |
*/ | */ |
|
long long calversout, calvers; |
|
int calversunset=1; |
| |
int firsttimethrough=1; | int firsttimethrough=1; |
int *nskiparr=(int *)calloc(nrecsout,sizeof(int)); | int *nskiparr=(int *)calloc(nrecsout,sizeof(int)); |
Line 343 int jretile_manytofew(void) |
|
Line 345 int jretile_manytofew(void) |
|
// continue; | // continue; |
} | } |
| |
|
if (calversunset) |
|
{ |
|
calversout=drms_getkey_longlong(inrec, "CALVER64", &status); |
|
if (status != DRMS_SUCCESS) |
|
calversout = 0; |
|
calversunset=0; |
|
} |
|
|
|
calvers=drms_getkey_longlong(inrec, "CALVER64", &status); |
|
if (status != DRMS_SUCCESS) |
|
calvers = 0; |
|
|
|
if (calvers != calversout) |
|
{ |
|
fprintf(stderr, "ERROR: input data has mixed CALVER64: %lld and %lld, recnum = %lld, histrecnum = %lld\n", calversout, calvers, inrec->recnum, histrecnum); |
|
return 0; |
|
} |
|
|
if (seginflag) | if (seginflag) |
segin = drms_segment_lookup(inrec, segnamein); | segin = drms_segment_lookup(inrec, segnamein); |
else | else |
segin = drms_segment_lookupnum(inrec, 0); | segin = drms_segment_lookupnum(inrec, 0); |
if (segin) |
if (segin != NULL) |
inarr = drms_segment_read(segin, usetype, &status); | inarr = drms_segment_read(segin, usetype, &status); |
// inarr = drms_segment_readslice(segin, usetype, startind, endind, &status); | // inarr = drms_segment_readslice(segin, usetype, startind, endind, &status); |
if (status != DRMS_SUCCESS || inarr == NULL || segin == NULL) | if (status != DRMS_SUCCESS || inarr == NULL || segin == NULL) |
Line 381 int jretile_manytofew(void) |
|
Line 401 int jretile_manytofew(void) |
|
| |
if (firsttimethrough) | if (firsttimethrough) |
{ | { |
if (histlink) |
if (histlink != NULL) |
drms_setlink_static(outrec, histlinkname, histrecnum); | drms_setlink_static(outrec, histlinkname, histrecnum); |
drms_copykeys(outrec, inrec, 0, kDRMS_KeyClass_Explicit); | drms_copykeys(outrec, inrec, 0, kDRMS_KeyClass_Explicit); |
|
// copykeys takes care of MAPMMAX, SINBDIVS, CALVER64, etc. that should be constant across the input |
drms_setkey_int(outrec, "LMIN", lminout); | drms_setkey_int(outrec, "LMIN", lminout); |
drms_setkey_int(outrec, "LMAX", lmaxout); | drms_setkey_int(outrec, "LMAX", lmaxout); |
drms_setkey_time(outrec, "T_START", tstartout); | drms_setkey_time(outrec, "T_START", tstartout); |
Line 451 int jretile_manytofew(void) |
|
Line 472 int jretile_manytofew(void) |
|
in_offset+=2*tstepin/cadence; | in_offset+=2*tstepin/cadence; |
} | } |
| |
|
outarr->bzero=segout->bzero; |
|
outarr->bscale=segout->bscale; |
status=drms_segment_writeslice_ext(segout, outarr, startind, endind, totallength, 0); | status=drms_segment_writeslice_ext(segout, outarr, startind, endind, totallength, 0); |
if (status != DRMS_SUCCESS) | if (status != DRMS_SUCCESS) |
{ | { |