OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
main_l0regen.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include "mfhdf.h"
#include "genutils.h"
Include dependency graph for main_l0regen.c:

Go to the source code of this file.

Macros

#define VERSION   "1.0"
 
#define USAGE   "Usage: %s SeaWiFS_level_1a_filename output_filename\n"
 
#define READ_GLBL_ATTR(nam, ptr)
 
#define READ_SDS(nam, ptr, s0, s1, s2, e0, e1, e2)
 
#define MALLOC(ptr, typ, num)
 
#define MINOR_FRAME_SIZE   21504
 
#define IS_LEAP_YEAR(y)   ( (!((y)%4) && (y)%100) || !((y)%400) )
 
#define EPOCH_YEAR   1970
 
#define SECONDS_PER_YEAR   31536000
 
#define SECONDS_PER_LEAP_YEAR   31622400
 

Functions

double doubleutime (int16, int16, int32)
 
void get_frame_data (int32, int32, int32, int16 *, int16 *, uint8 *, int16 *, int16 *, int16 *, int16 *, int16 *, int16 *)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ EPOCH_YEAR

#define EPOCH_YEAR   1970

Definition at line 395 of file main_l0regen.c.

◆ IS_LEAP_YEAR

#define IS_LEAP_YEAR (   y)    ( (!((y)%4) && (y)%100) || !((y)%400) )

Definition at line 394 of file main_l0regen.c.

◆ MALLOC

#define MALLOC (   ptr,
  typ,
  num 
)
Value:
{ \
(ptr) = (typ *)malloc((num) * sizeof(typ)); \
if((ptr) == NULL){ \
fprintf(stderr,"-E- %s line %d: Memory allocation failure.\n", \
__FILE__,__LINE__); \
exit(EXIT_FAILURE); \
} \
}

Definition at line 44 of file main_l0regen.c.

◆ MINOR_FRAME_SIZE

#define MINOR_FRAME_SIZE   21504

Definition at line 53 of file main_l0regen.c.

◆ READ_GLBL_ATTR

#define READ_GLBL_ATTR (   nam,
  ptr 
)
Value:
{ \
if(SDreadattr(sd_id,SDfindattr(sd_id,(nam)),(VOIDP)(ptr))){ \
fprintf(stderr, \
"-E- %s line %d: Could not get global attribute, %s, from file, %s.\n", \
__FILE__,__LINE__,(nam),argv[1]); \
exit(EXIT_FAILURE); \
} \
}

Definition at line 22 of file main_l0regen.c.

◆ READ_SDS

#define READ_SDS (   nam,
  ptr,
  s0,
  s1,
  s2,
  e0,
  e1,
  e2 
)
Value:
{ \
int32 start[3]; \
int32 edge[3]; \
edge[0]=(e0); edge[1]=(e1); edge[2]=(e2); \
start[0]=(s0); start[1]=(s1); start[2]=(s2); \
if(SDreaddata(SDselect(sd_id, SDnametoindex(sd_id, (nam))), \
start, NULL, edge, (VOIDP)(ptr)) == FAIL){ \
fprintf(stderr,"-E- %s line %d: Could not read SDS, %s.\n", \
__FILE__,__LINE__,(nam)); \
exit(EXIT_FAILURE); \
} \
}

Definition at line 31 of file main_l0regen.c.

◆ SECONDS_PER_LEAP_YEAR

#define SECONDS_PER_LEAP_YEAR   31622400

Definition at line 397 of file main_l0regen.c.

◆ SECONDS_PER_YEAR

#define SECONDS_PER_YEAR   31536000

Definition at line 396 of file main_l0regen.c.

◆ USAGE

#define USAGE   "Usage: %s SeaWiFS_level_1a_filename output_filename\n"

Definition at line 20 of file main_l0regen.c.

◆ VERSION

#define VERSION   "1.0"

Definition at line 19 of file main_l0regen.c.

Function Documentation

◆ doubleutime()

double doubleutime ( int16  year,
int16  day,
int32  msec 
)

Definition at line 399 of file main_l0regen.c.

◆ get_frame_data()

void get_frame_data ( int32  sd_id,
int32  npix,
int32  scan,
int16 *  sc_id,
int16 *  sc_ttag,
uint8 *  sc_soh,
int16 *  inst_tlm,
int16 *  l1a_data,
int16 *  start_syn,
int16 *  stop_syn,
int16 *  dark_rest,
int16 *  gain_tdi 
)

Definition at line 412 of file main_l0regen.c.

◆ main()

int main ( int  argc,
char *  argv[] 
)

An implementation of a Lon/Lat to UTM zone code written by Chuck Gantz chuck.nosp@m..gan.nosp@m.tz@gl.nosp@m.obal.nosp@m.star..nosp@m.com ...in 1998...found on http://www.gpsy.com/gpsinfo/geotoutm/, a site published by Karen Nakamura, last updated 22 June 2000.

Minor modifications to the code were made to eliminate deprecation warnings

Definition at line 59 of file main_l0regen.c.

#define FAIL
Definition: ObpgReadGrid.h:18
#define NULL
Definition: decode_rs.h:63