OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
main_l1info.cpp File Reference
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <libgen.h>
#include <math.h>
#include "l12_proto.h"
#include <timeutils.h>
#include "version.h"
#include <stdbool.h>
#include "gringHelper.h"
#include "allocate2d.h"
#include <string>
Include dependency graph for main_l1info.cpp:

Go to the source code of this file.

Classes

struct  box_t
 
struct  day_node_t
 

Macros

#define NUM_SPACECRAFT_DIRECTION_MODES   3
 
#define DEFAULT_SPACECRAFT_DIRECTION   0 /* set to an invalid value */
 
#define ASCENDING_TRACK   1
 
#define DESCENDING_TRACK   2
 
#define NORTH   1
 
#define SOUTH   0
 
#define TRUE   1
 
#define FALSE   0
 
#define TMP_FILENAME_MAX   255
 
#define DEFAULT_COORD_VALUE   -999. /* set to an invalid value */
 
#define DEFAULT_DAYNIGHT_MODE   0
 
#define DAY_MODE   (1<<0)
 
#define NIGHT_MODE   (1<<1)
 
#define EARTH_RADIUS_EQUATORIAL   6378
 
#define MAX_ATTERR   1.0 /* degrees deviation considered as non-nominal attitude */
 
#define USAGESTR   "%s %d.%d.%d-%s (%s %s)\n\n\Usage: %s [-n number-of-boxes] [-s] L1-filename [met-file]\n\n\Where:\n\\t-d degree limits to set on boxes (use instead of -n)\n\\t-i set subsampling increment (default=1 gets all scan lines and pixels)\n\\t-n generates up to this number of lat/lon boxes per orbit-side\n\\t-s prints only data needed for database fields\n\\t-v verify number of pixels that match in boxed region\n\\t-o [output file]\n\n\Return status codes:\n\\t0 - good\n\\t1 - general error\n\\t100 - all pixels have NAVFAIL or NAVWARN flag set\n\\t101 - no 'good' navigation was found\n\\t102 - direction (ascending/descending) not set\n\\t103 - day night flag not set\n\\t104 - total box count = 0\n\\t105 - non-nominal pointing\n\(For multiple conditions, lowest value status code takes priority)\n\\n\"
 
#define PRINT_USAGE(x)   printf(USAGESTR,(x),VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,GITSHA,__DATE__,__TIME__,(x))
 

Enumerations

enum  {
  ALL_NAVFAIL = 100, NO_VALID_NAV = 101, DIRECTION_NOT_SET = 102, DAY_NIGHT_NOT_SET = 103,
  GEOBOX_NOT_FOUND = 104, NON_NADIR = 105
}
 

Functions

void set_north_south_boundaries (float32, float32 *, float32 *)
 
void set_west_east_boundaries (float32, float32 *, float32 *)
 
void set_west_east_boundaries2 (float32, float32 *, float32 *)
 
int check_if_in_west_east_boundaries (float32, float32, float32)
 
int check_if_in_box (float32, float32, float32, float32, float32, float32)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ ASCENDING_TRACK

#define ASCENDING_TRACK   1

Definition at line 42 of file main_l1info.cpp.

◆ DAY_MODE

#define DAY_MODE   (1<<0)

Definition at line 60 of file main_l1info.cpp.

◆ DEFAULT_COORD_VALUE

#define DEFAULT_COORD_VALUE   -999. /* set to an invalid value */

Definition at line 57 of file main_l1info.cpp.

◆ DEFAULT_DAYNIGHT_MODE

#define DEFAULT_DAYNIGHT_MODE   0

Definition at line 59 of file main_l1info.cpp.

◆ DEFAULT_SPACECRAFT_DIRECTION

#define DEFAULT_SPACECRAFT_DIRECTION   0 /* set to an invalid value */

Definition at line 41 of file main_l1info.cpp.

◆ DESCENDING_TRACK

#define DESCENDING_TRACK   2

Definition at line 43 of file main_l1info.cpp.

◆ EARTH_RADIUS_EQUATORIAL

#define EARTH_RADIUS_EQUATORIAL   6378

Definition at line 64 of file main_l1info.cpp.

◆ FALSE

#define FALSE   0

Definition at line 53 of file main_l1info.cpp.

◆ MAX_ATTERR

#define MAX_ATTERR   1.0 /* degrees deviation considered as non-nominal attitude */

Definition at line 66 of file main_l1info.cpp.

◆ NIGHT_MODE

#define NIGHT_MODE   (1<<1)

Definition at line 61 of file main_l1info.cpp.

◆ NORTH

#define NORTH   1

Definition at line 45 of file main_l1info.cpp.

◆ NUM_SPACECRAFT_DIRECTION_MODES

#define NUM_SPACECRAFT_DIRECTION_MODES   3

Definition at line 40 of file main_l1info.cpp.

◆ PRINT_USAGE

#define PRINT_USAGE (   x)    printf(USAGESTR,(x),VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,GITSHA,__DATE__,__TIME__,(x))

Definition at line 121 of file main_l1info.cpp.

◆ SOUTH

#define SOUTH   0

Definition at line 46 of file main_l1info.cpp.

◆ TMP_FILENAME_MAX

#define TMP_FILENAME_MAX   255

Definition at line 55 of file main_l1info.cpp.

◆ TRUE

#define TRUE   1

Definition at line 52 of file main_l1info.cpp.

◆ USAGESTR

#define USAGESTR   "%s %d.%d.%d-%s (%s %s)\n\n\Usage: %s [-n number-of-boxes] [-s] L1-filename [met-file]\n\n\Where:\n\\t-d degree limits to set on boxes (use instead of -n)\n\\t-i set subsampling increment (default=1 gets all scan lines and pixels)\n\\t-n generates up to this number of lat/lon boxes per orbit-side\n\\t-s prints only data needed for database fields\n\\t-v verify number of pixels that match in boxed region\n\\t-o [output file]\n\n\Return status codes:\n\\t0 - good\n\\t1 - general error\n\\t100 - all pixels have NAVFAIL or NAVWARN flag set\n\\t101 - no 'good' navigation was found\n\\t102 - direction (ascending/descending) not set\n\\t103 - day night flag not set\n\\t104 - total box count = 0\n\\t105 - non-nominal pointing\n\(For multiple conditions, lowest value status code takes priority)\n\\n\"

Definition at line 97 of file main_l1info.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ALL_NAVFAIL 
NO_VALID_NAV 
DIRECTION_NOT_SET 
DAY_NIGHT_NOT_SET 
GEOBOX_NOT_FOUND 
NON_NADIR 

Definition at line 68 of file main_l1info.cpp.

Function Documentation

◆ check_if_in_box()

int check_if_in_box ( float32  lat,
float32  lon,
float32  northern_boundary,
float32  southern_boundary,
float32  western_boundary,
float32  eastern_boundary 
)

Definition at line 1065 of file main_l1info.cpp.

◆ check_if_in_west_east_boundaries()

int check_if_in_west_east_boundaries ( float32  lon,
float32  western_boundary,
float32  eastern_boundary 
)

Definition at line 1089 of file main_l1info.cpp.

◆ 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 126 of file main_l1info.cpp.

◆ set_north_south_boundaries()

void set_north_south_boundaries ( float32  lat,
float32 *  northern_boundary,
float32 *  southern_boundary 
)

Definition at line 1041 of file main_l1info.cpp.

◆ set_west_east_boundaries()

void set_west_east_boundaries ( float32  lon,
float32 *  western_boundary,
float32 *  eastern_boundary 
)

Definition at line 1113 of file main_l1info.cpp.

◆ set_west_east_boundaries2()

void set_west_east_boundaries2 ( float32  lon,
float32 *  western_boundary,
float32 *  eastern_boundary 
)

Definition at line 1129 of file main_l1info.cpp.