OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
printindx.c
Go to the documentation of this file.
1 /* -------------------------------------------------------------------- */
2 /* printindx - prints formatted report based on L0 info structure */
3 /* */
4 /* ---------------------------------------------------------------------*/
5 
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <fcntl.h>
9 #include <string.h>
10 #include <errno.h>
11 #include <unistd.h>
12 #include <time.h>
13 #include <math.h>
14 
15 #include <timeutils.h>
16 
17 #include "swl0_parms.h"
18 #include "swl0_types.h"
19 #include "swl0_struc.h"
20 #include "swl0_utils.h"
21 
22 char *format_time(double usec) {
23  static char tempstr[21];
24  time_t temp = (time_t) usec;
25  strftime(tempstr, 21, "%b %d %Y %T", gmtime((time_t *) & temp));
26  return (tempstr);
27 }
28 
29 void printindx(swl0indx *indx) {
30  printf("\nSeaWiFS Level-0 Format Report\n");
31  printf("File Name: %s\n", indx->l0file);
32 
33  if (indx->type == HRPT)
34  printf("Type: %s\n", "HRPT");
35  else
36  printf("Type: %s\n", "GAC/LAC");
37 
38  /*
39  printf("AOS Time: %24s",
40  asctime(gmtime((time_t *)&(indx->timeAOS))));
41  printf("LOS Time: %24s",
42  asctime(gmtime((time_t *)&(indx->timeLOS))));
43 
44  printf("Start_Time: %s\n",ydhmsf((double) indx->timeFirst,'G'));
45  printf("End_Time: %s\n",ydhmsf((double) indx->timeLast ,'G'));
46  */
47 
48  printf("AOS Time: %s\n", format_time(indx->timeAOS));
49  printf("LOS Time: %s\n", format_time(indx->timeLOS));
50 
51  printf("Start_Time: %s\n", format_time(indx->timeFirst));
52  printf("End_Time: %s\n", format_time(indx->timeLast));
53 
54  printf("Start_Zulu: %s\n", ydhmsf((double) indx->timeFirst, 'G'));
55 
56  printf("Number of Frames: %d\n", indx->nrecs);
57  printf("GAC Frames: %d\n", indx->ngac);
58  printf("LAC Frames: %d\n", indx->nlac);
59  printf("Lunar Cal Frames: %d\n", indx->nlun);
60  printf("Solar Cal Frames: %d\n", indx->nsol);
61  printf("Intergain Cal Frames: %d\n", indx->nigc);
62  printf("TDI Cal Frames: %d\n", indx->ntdi);
63  printf("Frame Timing Errors: %d\n", indx->timeError);
64  printf("SCID Errors: %d\n", indx->scidError);
65  printf("SOH Header Errors: %d\n", indx->sohError);
66  printf("Reported Bit Error Rate: %e\n", indx->bitRateRep);
67  printf("Computed Bit Error Rate: %e\n", indx->bitRateComp);
68 
69  return;
70 }
char * ydhmsf(double dtime, char zone)
Definition: ydhmsf.c:12
#define HRPT
Definition: l1stat.h:35
void printindx(swl0indx *indx)
Definition: printindx.c:29
char * format_time(double usec)
Definition: printindx.c:22