Skip to content

Commit 0b6e73c

Browse files
committed
more debug messages when reading data
1 parent 2bae78e commit 0b6e73c

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/higher-level/read-ard-hl.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,18 @@ int nchar;
332332
if (nchar < 0 || nchar >= NPOW_10){
333333
printf("Buffer Overflow in assembling dirname\n"); return FAILURE;}
334334

335+
#ifdef FORCE_DEBUG
336+
printf("scanning %s for files\n", d.name);
337+
#endif
338+
335339
// directory listing
336340
if ((d.N = scandir(d.name, &d.LIST, 0, alphasort)) < 0){
337341
return FAILURE;}
338342

343+
#ifdef FORCE_DEBUG
344+
printf("found %d files, filtering now\n");
345+
#endif
346+
339347
// reflectance products
340348
alloc_2D((void***)&d.list, d.N, NPOW_10, sizeof(char));
341349

@@ -356,7 +364,11 @@ int nchar;
356364
// check against sensor list
357365
for (s=0, vs=false; s<sen->n; s++){
358366
if (strstr(d.LIST[t]->d_name, sen->sensor[s]) != NULL){
359-
vs = true; break;
367+
#ifdef FORCE_DEBUG
368+
printf("sensor is: %s\n", sen->sensor[s]);
369+
#endif
370+
vs = true;
371+
break;
360372
}
361373
}
362374

@@ -477,7 +489,7 @@ int n = 0;
477489
// get mask file listing, skip if tile is empty
478490
if (list_mask(tx, ty, phl, &dir) == FAILURE){
479491
#ifdef FORCE_DEBUG
480-
printf("No data in here. Skip.\n");
492+
printf("No data in here (no mask). Skip.\n");
481493
#endif
482494
*success = CANCEL;
483495
return NULL;
@@ -772,7 +784,7 @@ bool level3 = false;
772784
// get ARD file listing, skip if tile is empty
773785
if (list_ard(tx, ty, sen, phl, &dir) == FAILURE){
774786
#ifdef FORCE_DEBUG
775-
printf("No data in here. Skip.\n");
787+
printf("No data in here (datasets). Skip.\n");
776788
#endif
777789
*nt = 0;
778790
return NULL;

0 commit comments

Comments
 (0)